Skip to content

Instantly share code, notes, and snippets.

@ferbivore
Created February 7, 2016 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferbivore/2800ea63d749f043d2a7 to your computer and use it in GitHub Desktop.
Save ferbivore/2800ea63d749f043d2a7 to your computer and use it in GitHub Desktop.
Kindle settings booklet and viewRequest properties
//
// Decompiled by Procyon v0.5.30
//
package com.amazon.kindle.settings;
import com.amazon.kindle.settings.view.readingtime.H;
import com.amazon.kindle.settings.view.readingtime.lA;
import com.amazon.kindle.device.G;
import javax.swing.SwingUtilities;
import com.amazon.kindle.settings.view.readingtime.FreeTimePasswordProtectedController;
import com.amazon.kindle.control.PasswordProtectedController;
import com.amazon.kindle.settings.view.l.F;
import com.amazon.kindle.settings.view.s.K;
import com.amazon.kindle.settings.view.o.b;
import com.amazon.kindle.settings.view.p.k;
import com.amazon.kindle.profile.Profile;
import com.amazon.kindle.settings.e.q;
import com.amazon.kindle.profile.AdultProfile;
import com.amazon.kindle.settings.view.e.W;
import com.amazon.kindle.settings.e.gA;
import com.amazon.kindle.settings.b.g;
import com.amazon.kindle.settings.view.e.t;
import com.amazon.kindle.settings.view.readingtime.u;
import com.amazon.kindle.settings.view.readingtime.cA;
import com.amazon.kindle.profile.ChildProfile;
import com.amazon.kindle.profile.household.HouseholdService;
import com.amazon.kindle.settings.view.n.I;
import com.amazon.kindle.settings.view.readingtime.dA;
import com.amazon.kindle.settings.view.readingtime.GA;
import com.amazon.kindle.settings.view.f.M;
import com.amazon.kindle.settings.e.i;
import com.amazon.kindle.settings.b.f;
import com.amazon.kindle.restricted.webservices.social.L;
import com.amazon.kindle.settings.view.d.E;
import com.amazon.kindle.settings.view.registration.A;
import com.amazon.kindle.booklet.Booklet;
import com.amazon.kindle.apps.util.bA;
import java.util.Map;
import java.net.URI;
import com.amazon.kindle.settings.view.b.D;
import com.amazon.kindle.control.DisplayController;
import com.amazon.kindle.util.lipc.LipcEvent;
import com.amazon.kindle.device.UserStoreListener;
import com.amazon.kindle.device.UserStoreService;
import com.amazon.kindle.util.lipc.LipcException;
import com.amazon.kindle.util.lipc.LipcEventListener;
import com.amazon.kindle.util.lipc.helper.PowerTarget;
import com.amazon.kindle.settings.b.B;
import com.amazon.kindle.booklet.BookletContext;
import com.amazon.ebook.util.log.e;
import com.amazon.kindle.control.DCBooklet;
public class SettingsBooklet extends DCBooklet
{
private static final e K;
private static final String G = "diagnosticMode";
private volatile boolean f;
private static final int I = 30000;
private static final String i = "dest";
public static final String g = "profileId";
private B M;
private f J;
static /* synthetic */ Class A;
static /* synthetic */ Class b;
public void create(final BookletContext a) {
super.create(a);
com.amazon.kindle.settings.b.B.klb(this);
this.RMb();
this.mPb();
}
public void destroy() {
SettingsBooklet settingsBooklet;
try {
new PowerTarget().removeLipcEventListener((LipcEventListener)this.M);
settingsBooklet = this;
}
catch (LipcException a) {
SettingsBooklet.K.ycb("Error removing Power Target listener", (Throwable)a);
settingsBooklet = this;
}
final UserStoreService b;
SettingsBooklet settingsBooklet2;
if ((b = (UserStoreService)settingsBooklet.l.getService((SettingsBooklet.A == null) ? (SettingsBooklet.A = UeA("com.amazon.kindle.device.UserStoreService")) : SettingsBooklet.A)) == null) {
SettingsBooklet.K.UNd(e.L, new String[] { "UserStoreService" }, (String)null);
settingsBooklet2 = this;
}
else {
b.Rk((UserStoreListener)this.J);
settingsBooklet2 = this;
}
settingsBooklet2.destroy();
}
private void mPb() {
this.M = new LipcEventListener() {
private final /* synthetic */ SettingsBooklet H = null;
public void onLipcEvent(final LipcEvent a) {
if ("goingToScreenSaver".equals(a.getEventName()) || "userShutdown".equals(a.getEventName())) {
this.H.HPb();
}
}
};
SettingsBooklet settingsBooklet;
try {
new PowerTarget().addLipcEventListener((LipcEventListener)this.M);
settingsBooklet = this;
}
catch (LipcException a) {
SettingsBooklet.K.J("Error removing Power Target listener");
settingsBooklet = this;
}
final UserStoreService b;
if ((b = (UserStoreService)settingsBooklet.getBookletContext().getService((SettingsBooklet.A == null) ? (SettingsBooklet.A = UeA("com.amazon.kindle.device.UserStoreService")) : SettingsBooklet.A)) == null) {
SettingsBooklet.K.UNd(e.L, new String[] { "UserStoreService" }, (String)null);
return;
}
b.Jk((UserStoreListener)(this.J = new UserStoreListener() {
private final /* synthetic */ SettingsBooklet H = null;
public void HC(final com.amazon.kindle.device.B a) {
if (a.raB() == com.amazon.kindle.device.B.f.e) {
this.H.HPb();
}
}
}));
}
public DisplayController RMb() {
return (DisplayController)D.ZBb(this);
}
public void start(final URI a) {
this.f = this.isActive();
super.start(a);
}
protected void vQb(final Map f) {
final DisplayController e;
SettingsBooklet settingsBooklet;
if ((e = this.BRb(f)) != null) {
settingsBooklet = this;
e.qD(f);
this.PPb(e, (Object)null, false);
}
else {
if (f != null && f.containsKey("diagnosticMode")) {
final Object c;
if ((c = f.get("diagnosticMode")) instanceof String) {
this.hqb((String)c);
}
else {
this.Pqb("Diagnostic Request ID type expected: String");
}
}
else if (f != null && f.containsKey("viewRequest")) {
final Object d;
if ((d = f.get("viewRequest")) instanceof String) {
final int b = (this.D != null && this.D.bD()) ? 1 : 0;
final DisplayController a;
if (b == 0 && this.eRb(this.D) && (a = this.D.Tb()) != null && a.bD()) {
this.QMb(a);
}
this.wRb((String)d, f);
}
else {
this.Pqb("View Request ID type expected: String");
}
}
else {
this.YQb();
}
settingsBooklet = this;
}
settingsBooklet.Eob();
}
public void wRb(final String l, final Map k) {
if ("VIEW_REQUEST_ID_REGISTRATION".equals(l) && !this.f && !bA.DZC((Booklet)this)) {
com.amazon.kindle.settings.view.registration.A.ZBb(this).Abb((Object)k);
return;
}
if ("VIEW_REQUEST_ID_SOCIAL_NETWORKS".equals(l)) {
E.ZBb(this).Sdb();
return;
}
if ("VIEW_REQUEST_ID_FACEBOOK_LOGIN".equals(l)) {
this.Rpb(L.B.e);
return;
}
if ("VIEW_REQUEST_ID_GROK_FACEBOOK_LOGIN".equals(l)) {
this.jqb(L.B.l);
return;
}
if ("VIEW_REQUEST_ID_TWITTER_LOGIN".equals(l)) {
this.Rpb(L.B.c);
return;
}
if ("VIEW_REQUEST_ID_WEIBO_LOGIN".equals(l)) {
if (com.amazon.kindle.settings.b.f.OJb()) {
this.Rpb(L.B.B);
return;
}
com.amazon.kindle.settings.b.f.LJb((Booklet)this);
}
else if ("VIEW_REQUEST_FREETIME_LANDING_PAGE".equals(l)) {
final String g = k.get("dest");
if ("HOUSEHOLD_PROFILE_DISPLAY".equals(g)) {
com.amazon.kindle.settings.e.i.ZBb(this).Sdb();
return;
}
com.amazon.kindle.settings.view.readingtime.E.ZBb(this).Sdb();
}
else {
if ("VIEW_REQUEST_ID_FRONT_LIGHT".equals(l)) {
com.amazon.kindle.settings.view.q.f.ZBb(this).Sdb();
return;
}
if ("VIEW_REQUEST_ID_LANGUAGE_LEARNING".equals(l)) {
com.amazon.kindle.settings.view.m.f.ZBb(this).Sdb();
return;
}
if ("VIEW_REQUEST_ID_READING_OPTIONS".equals(l)) {
com.amazon.kindle.settings.view.f.M.ZBb(this).Sdb();
return;
}
if ("VIEW_REQUEST_FREETIME_STARTUP_PAGE".equals(l)) {
GA.ZBb(this).Sdb();
return;
}
if ("VIEW_REQUEST_FREETIME_UNLIMITED_PAGE".equals(l)) {
dA.FGb(this, k.get("dest")).yCb((Object)null, true);
return;
}
if ("VIEW_REQUEST_ID_LANGUAGE".equals(l)) {
com.amazon.kindle.settings.view.n.I.ZBb(this).Sdb();
return;
}
if (l != null && l.startsWith("VIEW_REQUEST_FREETIME_EDIT_PAGE_")) {
final String h = l.substring("VIEW_REQUEST_FREETIME_EDIT_PAGE_".length());
final HouseholdService d;
final ChildProfile c;
if ((d = (HouseholdService)this.getBookletContext().getService((SettingsBooklet.b == null) ? (SettingsBooklet.b = UeA("com.amazon.kindle.profile.household.HouseholdService")) : SettingsBooklet.b)) != null && (c = (ChildProfile)d.SF(h)) != null) {
cA.ffb(this, c, "READING_TIME").Sdb();
}
}
else if (l != null && l.startsWith("VIEW_REQUEST_FREETIME_EDIT_CATALOG_PAGE_")) {
final String i;
if (com.amazon.ebook.util.text.I.rAc(i = l.substring("VIEW_REQUEST_FREETIME_EDIT_CATALOG_PAGE_".length()))) {
this.Pqb("Error handling profile catalog view, invalid profile id");
return;
}
final HouseholdService f;
if ((f = (HouseholdService)this.getBookletContext().getService((SettingsBooklet.b == null) ? (SettingsBooklet.b = UeA("com.amazon.kindle.profile.household.HouseholdService")) : SettingsBooklet.b)) == null) {
this.Pqb("Unable to load Household Service");
return;
}
final ChildProfile b;
if ((b = (ChildProfile)f.SF(i)) == null) {
this.Pqb("Unable to load profile during profile catalog load view request");
return;
}
u.yfb(this, b, false, true, k.get("dest")).Abb((Object)b);
}
else {
if ("ASR_SETTINGS".equalsIgnoreCase(l)) {
t.ZBb(this).Abb((Object)k);
return;
}
if ("VIEW_REQUEST_FREETIME_OPEN_PAGE".equals(l)) {
com.amazon.kindle.settings.b.g.cLb(this);
return;
}
if ("VIEW_REQUEST_LAUNCH_FREETIME_ON_SCREENSAVER".equals(l)) {
com.amazon.kindle.settings.b.g.dlb(this, "ViewRequest", k.get("dest"));
return;
}
if ("VIEW_REQUEST_ID_NOTES_AND_ABOUT_BOOK".equals(l)) {
com.amazon.kindle.settings.view.k.f.ZBb(this).Sdb();
return;
}
if ("VIEW_REQUEST_ID_ADD_PROFILE_TO_HOUSEHOLD_PAGE".equalsIgnoreCase(l)) {
gA.ZBb(this).Abb((Object)k);
return;
}
if ("VIEW_REQUEST_ID_HOUSEHOLD_PROFILES_PAGE".equalsIgnoreCase(l)) {
com.amazon.kindle.settings.e.i.ZBb(this).Abb((Object)k);
return;
}
if ("VIEW_REQUEST_ID_ASR_TUTORIAL".equalsIgnoreCase(l)) {
W.ZBb(this).Abb((Object)k);
return;
}
if ("VIEW_REQUEST_ID_JOIN_HOUSEHOLD_PAGE".equalsIgnoreCase(l)) {
com.amazon.kindle.settings.e.A.ZBb(this).Abb((Object)k);
return;
}
if ("VIEW_REQUEST_ID_EDIT_ADULT_PROFILE_PAGE".equals(l)) {
final String j;
if (com.amazon.ebook.util.text.I.rAc(j = k.get("profileId"))) {
this.Pqb("loginId empty.");
return;
}
final HouseholdService e;
if ((e = (HouseholdService)this.getBookletContext().getService((SettingsBooklet.b == null) ? (SettingsBooklet.b = UeA("com.amazon.kindle.profile.household.HouseholdService")) : SettingsBooklet.b)) == null) {
this.Pqb("Unable to load Household Service");
return;
}
final Profile a;
if ((a = e.SF(j)) == null) {
this.Pqb("Profile with given login id not found");
return;
}
q.pLb(this, (AdultProfile)a).Abb((Object)k);
}
else {
if ("VIEW_REQUEST_ID_CONTENT_SHARING_PAGE".equalsIgnoreCase(l)) {
com.amazon.kindle.settings.e.GA.ZBb(this).Abb((Object)k);
return;
}
this.Pqb("Invalid View Request");
}
}
}
}
protected DisplayController cOb(final String a) {
if ("DEVICE_OPTIONS".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.t.A.ZBb(this);
}
if ("READING_OPTIONS".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.f.M.ZBb(this);
}
if ("ADVANCED_OPTIONS".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.u.m.ZBb(this);
}
if ("SPECIAL_OFFERS".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.c.B.ZBb(this);
}
if ("REGISTRATION".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.registration.A.ZBb(this);
}
if ("INTERNATIONAL".equals(a)) {
return (DisplayController)k.ZBb(this);
}
if ("SELECT_DICTIONARY".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.r.k.ZBb(this);
}
if ("PASSCODE".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.h.L.ZBb(this);
}
if ("KEYBOARD".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.o.b.ZBb(this);
}
if ("LANGUAGE".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.n.I.ZBb(this);
}
if ("PERSONALIZE".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.g.b.ZBb(this);
}
if ("DEFAULT_PARENTAL_CONTROLS".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.i.b.ZBb(this);
}
if ("DICTIONARY_LANGUAGES".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.r.I.ZBb(this);
}
if ("711".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.s.D.ZBb(this);
}
if ("411".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.s.K.ZBb(this);
}
if ("311".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.s.b.ZBb(this);
}
if ("611".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.s.A.ZBb(this);
}
if ("LEGAL".equals(a)) {
return (DisplayController)F.ZBb(this);
}
if ("SOCIAL_NETWORKS".equals(a)) {
return (DisplayController)E.ZBb(this);
}
if ("CONNECT_SOCIAL_NETWORK".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.d.e.ZBb(this);
}
if ("FRONT_LIGHT".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.q.f.ZBb(this);
}
if ("READING_TIME".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.readingtime.E.ZBb(this);
}
if ("PARENTAL_CONTROLS_RESTRICTIONS".equals(a)) {
return (DisplayController)com.amazon.kindle.settings.view.i.L.ZBb(this);
}
if ("PROFILE_CONTENT_CONTROLLER".equals(a)) {
return (DisplayController)dA.ZBb(this);
}
if ("ASR_SETTINGS".equals(a)) {
return (DisplayController)t.ZBb(this);
}
SettingsBooklet.K.UNd(SettingsBooklet.E, new String[] { a }, "Use: Default Controller");
return this.RMb();
}
private void Rpb(final L.B c) {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 0: new Ljavax/swing/Timer;
// 3: dup
// 4: sipush 30000
// 7: new Lcom/amazon/kindle/settings/m;
// 10: dup
// 11: aload_0 /* d */
// 12: aload_1 /* c */
// 13: invokespecial com/amazon/kindle/settings/m.<init>:(Lcom/amazon/kindle/settings/SettingsBooklet;Lcom/amazon/kindle/restricted/webservices/social/B;)V
// 16: invokespecial javax/swing/Timer.<init>:(ILjava/awt/event/ActionListener;)V
// 19: astore_2
// 20: aload_0 /* d */
// 21: aload_1 /* c */
// 22: aload_2 /* b */
// 23: dup_x2
// 24: aload_2 /* b */
// 25: iconst_0
// 26: invokevirtual javax/swing/Timer.setRepeats:(Z)V
// 29: invokevirtual javax/swing/Timer.start:()V
// 32: iconst_0
// 33: invokespecial com/amazon/kindle/settings/SettingsBooklet.xqb:(Lcom/amazon/kindle/restricted/webservices/social/B;Z)Lcom/amazon/kindle/restricted/webservices/social/L;
// 36: astore_3 /* a */
// 37: invokevirtual javax/swing/Timer.isRunning:()Z
// 40: ifeq 95
// 43: aload_3 /* a */
// 44: aload_2 /* b */
// 45: invokevirtual javax/swing/Timer.stop:()V
// 48: ifnull 68
// 51: aload_3 /* a */
// 52: invokevirtual com/amazon/kindle/restricted/webservices/social/L.qP:()Z
// 55: ifne 68
// 58: aload_0 /* d */
// 59: invokestatic com/amazon/kindle/settings/view/d/e.ZBb:(Lcom/amazon/kindle/settings/SettingsBooklet;)Lcom/amazon/kindle/control/social/B;
// 62: aload_3 /* a */
// 63: invokevirtual com/amazon/kindle/control/social/B.Abb:(Ljava/lang/Object;)V
// 66: return
// 67: pop
// 68: aload_0 /* d */
// 69: new Ljava/lang/StringBuffer;
// 72: dup
// 73: invokespecial java/lang/StringBuffer.<init>:()V
// 76: iconst_0
// 77: ldc "Couldn't switch to "
// 79: invokevirtual java/lang/StringBuffer.insert:(ILjava/lang/String;)Ljava/lang/StringBuffer;
// 82: aload_1 /* c */
// 83: invokevirtual com/amazon/kindle/restricted/webservices/social/B.name:()Ljava/lang/String;
// 86: invokevirtual java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
// 89: invokevirtual java/lang/StringBuffer.toString:()Ljava/lang/String;
// 92: invokespecial com/amazon/kindle/settings/SettingsBooklet.Pqb:(Ljava/lang/String;)V
// 95: return
// LocalVariableTable:
// Start Length Slot Name Signature
// ----- ------ ---- ---- ---------------------------------------------------
// 0 96 0 d Lcom/amazon/kindle/settings/SettingsBooklet;
// 0 96 1 c Lcom/amazon/kindle/restricted/webservices/social/B;
// 22 74 2 b Ljavax/swing/Timer;
// 24 72 3 a Lcom/amazon/kindle/restricted/webservices/social/L;
//
// The error that occurred was:
//
// java.lang.NullPointerException
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
private void jqb(final L.B e) {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 0: aload_0 /* f */
// 1: invokevirtual com/amazon/kindle/settings/SettingsBooklet.getBookletContext:()Lcom/amazon/kindle/booklet/BookletContext;
// 4: getstatic com/amazon/kindle/settings/SettingsBooklet.c:Ljava/lang/Class;
// 7: ifnonnull 23
// 10: ldc "com.amazon.kindle.restricted.webservices.grok.GrokService"
// 12: invokestatic com/amazon/kindle/settings/SettingsBooklet.UeA:(Ljava/lang/String;)Ljava/lang/Class;
// 15: dup
// 16: putstatic com/amazon/kindle/settings/SettingsBooklet.c:Ljava/lang/Class;
// 19: goto 26
// 22: pop
// 23: getstatic com/amazon/kindle/settings/SettingsBooklet.c:Ljava/lang/Class;
// 26: invokeinterface com/amazon/kindle/booklet/BookletContext.getService:(Ljava/lang/Class;)Ljava/lang/Object;
// 31: checkcast Lcom/amazon/kindle/restricted/webservices/grok/GrokService;
// 34: dup
// 35: astore_2 /* d */
// 36: ifnonnull 61
// 39: getstatic com/amazon/kindle/settings/SettingsBooklet.K:Lcom/amazon/ebook/util/log/e;
// 42: getstatic com/amazon/ebook/util/log/e.L:Lcom/amazon/ebook/util/log/H;
// 45: iconst_1
// 46: anewarray Ljava/lang/String;
// 49: iconst_1
// 50: dup
// 51: pop2
// 52: dup
// 53: iconst_0
// 54: ldc "GrokService"
// 56: aastore
// 57: aconst_null
// 58: invokevirtual com/amazon/ebook/util/log/e.UNd:(Lcom/amazon/ebook/util/log/H;[Ljava/lang/String;Ljava/lang/String;)V
// 61: new Ljavax/swing/Timer;
// 64: dup
// 65: sipush 30000
// 68: new Lcom/amazon/kindle/settings/k;
// 71: dup
// 72: aload_0 /* f */
// 73: aload_1 /* e */
// 74: invokespecial com/amazon/kindle/settings/k.<init>:(Lcom/amazon/kindle/settings/SettingsBooklet;Lcom/amazon/kindle/restricted/webservices/social/B;)V
// 77: invokespecial javax/swing/Timer.<init>:(ILjava/awt/event/ActionListener;)V
// 80: astore_3
// 81: aload_0 /* f */
// 82: aload_1 /* e */
// 83: aload_3 /* c */
// 84: dup_x2
// 85: aload_3 /* c */
// 86: iconst_0
// 87: invokevirtual javax/swing/Timer.setRepeats:(Z)V
// 90: invokevirtual javax/swing/Timer.start:()V
// 93: iconst_1
// 94: invokespecial com/amazon/kindle/settings/SettingsBooklet.xqb:(Lcom/amazon/kindle/restricted/webservices/social/B;Z)Lcom/amazon/kindle/restricted/webservices/social/L;
// 97: astore b
// 99: invokevirtual javax/swing/Timer.isRunning:()Z
// 102: ifeq 206
// 105: aload b
// 107: aload_3 /* c */
// 108: invokevirtual javax/swing/Timer.stop:()V
// 111: ifnull 179
// 114: aload b
// 116: invokevirtual com/amazon/kindle/restricted/webservices/social/L.qP:()Z
// 119: ifne 179
// 122: aload_2 /* d */
// 123: invokeinterface com/amazon/kindle/restricted/webservices/grok/GrokService.dG:()Z
// 128: ifeq 206
// 131: getstatic com/amazon/kindle/restricted/webservices/social/B.l:Lcom/amazon/kindle/restricted/webservices/social/B;
// 134: invokevirtual com/amazon/kindle/restricted/webservices/social/B.name:()Ljava/lang/String;
// 137: aload b
// 139: invokevirtual com/amazon/kindle/restricted/webservices/social/L.zRb:()Ljava/lang/String;
// 142: invokevirtual java/lang/String.equals:(Ljava/lang/Object;)Z
// 145: ifeq 206
// 148: new Ljava/util/HashMap;
// 151: dup
// 152: invokespecial java/util/HashMap.<init>:()V
// 155: dup
// 156: astore a
// 158: ldc "VIEW_MODE"
// 160: ldc "FACEBOOK_LOGIN_MODE"
// 162: invokeinterface java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
// 167: aload_0 /* f */
// 168: invokestatic com/amazon/kindle/settings/view/d/g.ZBb:(Lcom/amazon/kindle/settings/SettingsBooklet;)Lcom/amazon/kindle/settings/view/d/g;
// 171: aload a
// 173: invokevirtual com/amazon/kindle/settings/view/d/g.Abb:(Ljava/lang/Object;)V
// 176: pop
// 177: return
// 178: iconst_0
// 179: aload_0 /* f */
// 180: new Ljava/lang/StringBuffer;
// 183: dup
// 184: invokespecial java/lang/StringBuffer.<init>:()V
// 187: iconst_0
// 188: ldc "Couldn't switch to "
// 190: invokevirtual java/lang/StringBuffer.insert:(ILjava/lang/String;)Ljava/lang/StringBuffer;
// 193: aload_1 /* e */
// 194: invokevirtual com/amazon/kindle/restricted/webservices/social/B.name:()Ljava/lang/String;
// 197: invokevirtual java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
// 200: invokevirtual java/lang/StringBuffer.toString:()Ljava/lang/String;
// 203: invokespecial com/amazon/kindle/settings/SettingsBooklet.Pqb:(Ljava/lang/String;)V
// 206: return
// LocalVariableTable:
// Start Length Slot Name Signature
// ----- ------ ---- ---- -----------------------------------------------------------
// 0 207 0 f Lcom/amazon/kindle/settings/SettingsBooklet;
// 0 207 1 e Lcom/amazon/kindle/restricted/webservices/social/B;
// 35 172 2 d Lcom/amazon/kindle/restricted/webservices/grok/GrokService;
// 83 124 3 c Ljavax/swing/Timer;
// 85 122 4 b Lcom/amazon/kindle/restricted/webservices/social/L;
// 156 28 5 a Ljava/util/Map;
//
// The error that occurred was:
//
// java.lang.NullPointerException
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
private L xqb(final L.B d, final boolean c) {
//
// This method could not be decompiled.
//
// Original Bytecode:
//
// 0: iload_2 /* c */
// 1: ifeq 12
// 4: aload_0 /* e */
// 5: invokestatic com/amazon/kindle/control/util/k.pQC:(Lcom/amazon/kindle/control/DCBooklet;)Ljava/util/Map;
// 8: goto 16
// 11: pop
// 12: aload_0 /* e */
// 13: invokestatic com/amazon/kindle/control/util/k.WQC:(Lcom/amazon/kindle/control/DCBooklet;)Ljava/util/Map;
// 16: astore_3
// 17: aload_3
// 18: goto 31
// 21: iconst_0
// 22: astore 4
// 24: aconst_null
// 25: aload_0 /* e */
// 26: invokestatic com/amazon/kindle/control/util/k.qpC:(Lcom/amazon/kindle/booklet/Booklet;)V
// 29: areturn
// 30: aload_3 /* b */
// 31: ifnull 48
// 34: aload_3 /* b */
// 35: aload_1 /* d */
// 36: invokevirtual com/amazon/kindle/restricted/webservices/social/B.name:()Ljava/lang/String;
// 39: invokeinterface java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
// 44: checkcast Lcom/amazon/kindle/restricted/webservices/social/L;
// 47: areturn
// 48: aconst_null
// 49: areturn
// LocalVariableTable:
// Start Length Slot Name Signature
// ----- ------ ---- ---- ---------------------------------------------------
// 0 50 0 e Lcom/amazon/kindle/settings/SettingsBooklet;
// 0 50 1 d Lcom/amazon/kindle/restricted/webservices/social/B;
// 0 50 2 c I
// 18 32 3 b Ljava/util/Map;
// 25 11 4 a Lcom/amazon/kindle/net/g;
// Exceptions:
// Try Handler
// Start End Start End Type
// ----- ----- ----- ----- -------------------------
// 0 17 22 30 Lcom/amazon/kindle/net/g;
//
// The error that occurred was:
//
// java.lang.NullPointerException
//
throw new IllegalStateException("An error occurred while decompiling this method.");
}
private void hqb(final String b) {
final DisplayController a;
if (!((a = this.pRb()) instanceof com.amazon.kindle.settings.view.s.b) && b.equalsIgnoreCase(";311")) {
this.Pqb(null);
com.amazon.kindle.settings.view.s.b.ZBb(this).yCb(null, this.f);
return;
}
if (!(a instanceof K) && b.equalsIgnoreCase(";411")) {
com.amazon.kindle.settings.view.s.K.ZBb(this).Sdb();
return;
}
if (!(a instanceof com.amazon.kindle.settings.view.s.A) && b.equalsIgnoreCase(";611")) {
com.amazon.kindle.settings.view.s.A.ZBb(this).Sdb();
return;
}
if (!(a instanceof com.amazon.kindle.settings.view.s.D) && b.equalsIgnoreCase(";711")) {
com.amazon.kindle.settings.view.s.D.ZBb(this).Sdb();
return;
}
this.Pqb(new StringBuffer().insert(0, "Failed to load diagnostic view: ").append(b).toString());
}
public void Erb(final DisplayController f, final Object e, final boolean d, final int c, final boolean b) {
final DisplayController a = this.D;
super.Erb(f, e, d, c, b);
if (a != null && f != null) {
com.amazon.kindle.control.util.F.vqC(new StringBuffer().insert(0, "Settings:").append(a.Lc()).toString(), new StringBuffer().insert(0, "Settings:").append(f.Lc()).toString());
}
}
private void Pqb(final String a) {
String s;
if (!this.f) {
s = a;
this.YQb();
}
else {
this.D.Zb().repaint();
s = a;
}
if (s != null) {
SettingsBooklet.K.J(a);
}
}
private void YQb() {
this.PPb(this.RMb(), (Object)null, false);
}
private void hpb(final PasswordProtectedController a) {
if (a instanceof FreeTimePasswordProtectedController) {
SwingUtilities.invokeLater(new com.amazon.kindle.settings.L(this, a));
final String s = "KFT";
final String s2 = "Settings";
final String s3 = "PasswordInvalidated";
final int n = 1;
final Map map = null;
final int n2 = 0;
com.amazon.kindle.device.G.qmC(s, s2, s3, n, map, n2, n2);
}
}
private boolean eRb(final DisplayController a) {
return a instanceof cA || a instanceof u || a instanceof lA || a instanceof H || a instanceof dA;
}
private void HPb() {
final DisplayController a;
if ((a = this.pRb()) == null) {
return;
}
if (a instanceof PasswordProtectedController) {
this.hpb((PasswordProtectedController)a);
}
}
static /* synthetic */ Class UeA(final String b) {
try {
return Class.forName(b);
}
catch (ClassNotFoundException a) {
throw new NoClassDefFoundError().initCause(a);
}
}
static {
K = e.bvA("SettingsBooklet");
}
}

The interesting function is wRb in SettingsBooklet.java. Parts of the settings app can be launched with the following command:

lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.settings?viewRequest=<ID>

Replacing <ID> with one of the strings in the wRb function. Here are the outcomes on my device (unregistered KT2 5.7.2):

  • VIEW_REQUEST_ID_REGISTRATION opens the Registration page
  • VIEW_REQUEST_FREETIME_LANDING_PAGE opens the FreeTime (parental controls) setup page, suggesting that FreeTime might actually work with unregistered Kindles (though I haven't tried actually setting it up)
  • VIEW_REQUEST_ID_FRONT_LIGHT opens the Night Light settings (yes, even on the KT2)
  • VIEW_REQUEST_ID_LANGUAGE_LEARNING lets you enable Word Wise, apparently
  • VIEW_REQUEST_ID_READING_OPTIONS opens the Reading Options page
  • VIEW_REQUEST_FREETIME_STARTUP_PAGE opens the FreeTime setup page
  • VIEW_REQUEST_FREETIME_UNLIMITED_PAGE opens a "Subscribe to FreeTime Unlimited" page, though both options pop up an "Unexpected Error" message on my device
  • VIEW_REQUEST_ID_LANGUAGE opens the language selector
  • VIEW_REQUEST_FREETIME_EDIT_CATALOG_PAGE_ is probably meant to be used with a postfix or a dest= parameter, no idea what it does
  • ASR_SETTINGS opens the VoiceView settings page (yes, even on the KT2, though you can't enable it)
  • VIEW_REQUEST_FREETIME_OPEN_PAGE is the FreeTime setup page, again
  • VIEW_REQUEST_LAUNCH_FREETIME_ON_SCREENSAVER opens a different FreeTime-related page with an "Add New Profile" option
  • VIEW_REQUEST_ID_ADD_PROFILE_TO_HOUSEHOLD_PAGE opens an "Add a New Person" page, though clicking on anything seems to freeze the settings app
  • VIEW_REQUEST_ID_ASR_TUTORIAL is the VoiceView tutorial, ruined slightly by the fact that VoiceView doesn't work
  • VIEW_REQUEST_ID_EDIT_ADULT_PROFILE_PAGE seems to expect a profileId= parameter
  • VIEW_REQUEST_ID_CONTENT_SHARING_PAGE is a weird, mostly blank page

The settings app can sometimes "freeze", which means you can navigate using the Home/Back buttons but it will only give you blank pages if you try and open anything. Using restartFramework.sh should clear that right up - in about half a minute, that is.

These are blank pages, at least on my device:

  • VIEW_REQUEST_FREETIME_LANDING_PAGE\&dest=HOUSEHOLD_PROFILE_DISPLAY
  • VIEW_REQUEST_FREETIME_EDIT_PAGE_READING_TIME
  • VIEW_REQUEST_ID_HOUSEHOLD_PROFILES_PAGE

These are blank pages that may or may not freeze the settings app:

  • VIEW_REQUEST_ID_NOTES_AND_ABOUT_BOOK

These (should) open up a blank page that tries and fails to load, then continue to the main settings menu. After running them a couple of times, they started skipping past the blank page for some reason.

  • VIEW_REQUEST_ID_SOCIAL_NETWORKS
  • VIEW_REQUEST_ID_FACEBOOK_LOGIN
  • VIEW_REQUEST_ID_GROK_FACEBOOK_LOGIN
  • VIEW_REQUEST_ID_WEIBO_LOGIN

The function cOb is even more interesting, but I have no idea where it's called from - or indeed if it's ever called from somewhere. Poking at the com.lab126.booklet.settings using LIPC only crashed the app repeatedly, grepping the decompiled source tree didn't turn up anything and I can barely read Java, much less write patches for the settings booklet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment