import java.io.*; import javax.microedition.lcdui.*; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; import javax.microedition.rms.RecordStore; public class BookReaderMidlet extends MIDlet { public BookReaderMidlet() { a = this; try { for(int i1 = 0; i1 < 256; i1++) b.d[i1] = (char)i1; char ac[]; if((ac = a("/encoding.txt", false)) != null) System.arraycopy(ac, 0, b.d, 128, 128); c.a(a("/locenum.txt", false)); InputStream inputstream = getClass().getResourceAsStream("/menu.pck"); DataInputStream datainputstream; a.y = (datainputstream = new DataInputStream(inputstream)).readShort() != 0; a.z = new short[datainputstream.readShort()]; for(int j1 = 0; j1 < a.z.length; j1++) a.z[j1] = datainputstream.readShort(); a.A = new short[datainputstream.readShort()]; for(int k1 = 0; k1 < a.A.length; k1++) a.A[k1] = datainputstream.readShort(); a.B = new byte[datainputstream.readShort()]; datainputstream.read(a.B); inputstream.close(); (inputstream = getClass().getResourceAsStream("/caseconv")).read(s); inputstream.close(); c = new Command(c.a, 4, 0); new Command(c.b, 3, 1); d = new Command(c.c, 4, 0); e = new Command(c.d, 7, 0); new Command(c.e, 8, 1); f = new Command(c.f, 2, -1); new Command(c.g, 5, 0); g = new Command(c.h, 8, 5); h = new Command(c.i, 8, 5); return; } catch(Throwable _ex) { return; } } public final void startApp() throws MIDletStateChangeException { if(i != null) return; b = Display.getDisplay(this); o = e("/b0.png"); n = e("/b1.png"); m = e("/b2.png"); p = e("/hourglass.png"); if(r == null) { try { if(q == null) q = RecordStore.openRecordStore("strprops", true); byte abyte0[]; DataInputStream datainputstream; if(q.getNextRecordID() != 1 && (abyte0 = q.getRecord(1)) != null) r = (datainputstream = new DataInputStream(new ByteArrayInputStream(abyte0))).readUTF(); } catch(Exception _ex) { q = null; r = null; } if(r == null) { r = "\nas_verb.3=item.77\nas_verb.9=item.76\n"; char ac[]; try { if((ac = a("/props.ini", true)) != null) r = r + new String(ac) + "\n"; } catch(Exception _ex) { } if(d("web_engine") == null) a("web_engine", "http://answers.com/%s"); } } l = new a(); b.setCurrent(l); i = new List("", 3); i.addCommand(d); i.addCommand(e); i.addCommand(f); i.setCommandListener(l); if(d("pwd") == null) { a(); return; } else { l.a(); return; } } public final void a() { String s1; if((s1 = d("lasttext")) == null && d("1.0") == null) s1 = "0."; if(s1 != null) { if(l.a(s1) != null) { b.setCurrent(l); a.b(); return; } } else { b(null); a(0); } } public static String a(String s1) { String s2 = "\n" + s1; int i1; int j1; if((i1 = r.indexOf(s2)) >= 0 && (j1 = r.indexOf('=', i1)) > -1) return r.substring(i1 + 1, j1); else return null; } public static void a(int i1) { b.setCurrent(i); j = i1; k = 0; if(i1 == 2) { i.addCommand(h); i.addCommand(g); return; } else { i.removeCommand(h); i.removeCommand(g); return; } } public final void pauseApp() { if(r == null) return; if(l != null && l.e != null) a(l.e + "pos", l.c); if(d("noreset") != null) { a(false); return; } i = null; if(l != null) { l.o = null; l = null; b.setCurrent(i); System.gc(); } a(false); m = null; o = null; p = null; n = null; b = null; } public static void b() { try { a.destroyApp(true); a.notifyDestroyed(); return; } catch(Exception exception) { Alert alert; (alert = new Alert("error saving props", exception.toString(), null, AlertType.ERROR)).setTimeout(-2); b.setCurrent(alert); return; } } public final void destroyApp(boolean flag) { if(r != null && l != null && l.e != null) a(l.e + "pos", l.c); a(true); } public static void a(int i1, String s1, Image image) { if(i1 >= i.size()) { i.append(s1, image); return; } else { i.set(i1, s1, image); return; } } private static int f(String s1) { if(d(s1 + ".complete") != null) return 2; return d(s1 + ".pos") != null ? 1 : 0; } public final void b(String s1) { int i1 = 0; i.setTitle(l.a(14)); String s2; for(int j1 = 0; (s2 = d(Integer.toString(j1) + ".label")) != null; j1++) { int k1; Image image = (k1 = f(Integer.toString(j1))) != 0 ? k1 != 1 ? m : n : o; a(i1, s2, image); if(s1 != null && s1.equals(Integer.toString(j1) + ".")) i.setSelectedIndex(i1, true); i1++; } for(; i1 < i.size(); i.delete(i1)); } public final void c(String s1) { i.setTitle(l.a(13)); int i1; String s2; for(i1 = 0; (s2 = d(s1 + i1)) != null; i1++) { int j1 = s2.indexOf(":"); a(i1, s2.substring(j1 + 1), o); } for(; i1 < i.size(); i.delete(i1)); } public static void a(String s1, int i1) { a(s1, Integer.toString(i1)); } public static void a(String s1, String s2) { String s3 = "\n" + s1 + '='; int i1; if((i1 = r.indexOf(s3)) == -1) { if(s2 != null) { r = r + s3.substring(1) + s2 + '\n'; return; } } else { if(s2 == "t") s2 = null; int j1 = r.indexOf("\n", i1 + 1); if(s2 == null) { r = r.substring(0, i1) + r.substring(j1); return; } r = r.substring(0, i1 + s3.length()) + s2 + r.substring(j1); } } public static int b(String s1, int i1) { return c(d(s1), i1); } private static int c(String s1, int i1) { if(s1 != null && !"".equals(s1)) try { i1 = Integer.parseInt(s1); } catch(Exception _ex) { } return i1; } public static String d(String s1) { String s2 = "\n" + s1 + "="; String s3 = null; int i1; if((i1 = r.indexOf(s2)) != -1) { i1 += s2.length(); int j1 = r.indexOf("\n", i1); s3 = r.substring(i1, j1); } return s3; } public static void a(boolean flag) { if(q == null) break MISSING_BLOCK_LABEL_132; if(r != null) break MISSING_BLOCK_LABEL_40; q.closeRecordStore(); q = null; break MISSING_BLOCK_LABEL_32; Exception exception; exception; q = null; throw exception; RecordStore.deleteRecordStore("strprops"); break MISSING_BLOCK_LABEL_132; ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); DataOutputStream dataoutputstream; (dataoutputstream = new DataOutputStream(bytearrayoutputstream)).writeUTF(r.toString()); byte abyte0[] = bytearrayoutputstream.toByteArray(); if(q.getNumRecords() == 0) q.addRecord(abyte0, 0, abyte0.length); else q.setRecord(1, abyte0, 0, abyte0.length); if(!flag) break MISSING_BLOCK_LABEL_132; q.closeRecordStore(); q = null; break MISSING_BLOCK_LABEL_132; Exception exception1; exception1; q = null; throw exception1; return; JVM INSTR pop ; } private char[] a(String s1, boolean flag) throws IOException { StringBuffer stringbuffer = new StringBuffer(); InputStream inputstream; (inputstream = getClass().getResourceAsStream(s1)).read(); inputstream.read(); do { int i1; if((i1 = inputstream.read()) < 0) break; char c1 = (char)(i1 << 8 | inputstream.read()); if(!flag || c1 != '\r') stringbuffer.append(c1); } while(true); inputstream.close(); return stringbuffer.toString().toCharArray(); } public static Image e(String s1) { return g(s1); } private static Image g(String s1) { return Image.createImage(s1); JVM INSTR pop ; return null; } static BookReaderMidlet a = null; public static Display b; static Command c; static Command d; static Command e; static Command f; static Command g; static Command h; public static List i = null; public static int j; public static int k; a l; static Image m; static Image n; static Image o; static Image p; static RecordStore q = null; public static String r = null; public static byte s[] = new byte[256]; }