Skip to content

Instantly share code, notes, and snippets.

@nrafter
Last active August 14, 2019 01:26
Show Gist options
  • Save nrafter/14f73fd2580895e49e04a0596ed3239b to your computer and use it in GitHub Desktop.
Save nrafter/14f73fd2580895e49e04a0596ed3239b to your computer and use it in GitHub Desktop.
The class file version is 52.0 (only 45.3, 46.0 and 47.0 are supported)
The class file version is 52.0 (only 45.3, 46.0 and 47.0 are supported)
The class file version is 52.0 (only 45.3, 46.0 and 47.0 are supported)
The class file version is 52.0 (only 45.3, 46.0 and 47.0 are supported)
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3)
package com.waybots.blackbox;
import android.content.Context;
import java.io.*;
import java.net.*;
// Referenced classes of package com.waybots.blackbox:
// j, c, g, d,
// v
public class e
{
private static final class a extends Enum
{
public static a valueOf(String s)
{
return (a)Enum.valueOf(com/waybots/blackbox/e$a, s);
}
public static a[] values()
{
return (a[])e.clone();
}
public static final a a;
public static final a b;
public static final a c;
public static final a d;
private static final a e[];
static
{
a = new a("INITIALIZED", 0);
b = new a("IN_PROGRESS", 1);
c = new a("SUCCESS", 2);
d = new a("FAILURE", 3);
e = (new a[] {
a, b, c, d
});
}
private a(String s, int i)
{
super(s, i);
}
}
public e(Context context, v v1, j j1)
{
b = v1;
c = j1;
d = context;
h = a.a;
c.a("Initialize bootload");
}
static j a(e e1)
{
return e1.c;
}
static Context b(e e1)
{
return e1.d;
}
private static byte[] c(String s)
{
int i = s.length();
byte abyte0[] = new byte[i / 2 + 1];
abyte0[0] = (byte)58;
for(int k = 1; k < i; k += 2)
abyte0[k / 2 + 1] = (byte)((Character.digit(s.charAt(k), 16) << 4) + Character.digit(s.charAt(k + 1), 16));
return abyte0;
}
public String a()
{
return h.name();
}
Couldn't fully decompile method a
Couldn't resolve all exception handlers in method a
public void a(c c1)
{
if(h == a.b) goto _L2; else goto _L1
_L1:
c.a("Drop bootload message. Not in progress");
_L10:
return;
_L2:
Couldn't fully decompile method <clinit>
Couldn't resolve all exception handlers in method <clinit>
static class _cls2
{
static final int a[];
static
{
a = new int[com.waybots.blackbox.d.values().length];
NoSuchFieldError nosuchfielderror;
try
{
a[d.x.ordinal()] = 1;
}
catch(NoSuchFieldError nosuchfielderror4) { }
try
{
a[d.y.ordinal()] = 2;
}
catch(NoSuchFieldError nosuchfielderror3) { }
try
{
a[d.z.ordinal()] = 3;
}
catch(NoSuchFieldError nosuchfielderror2) { }
try
{
a[d.A.ordinal()] = 4;
}
catch(NoSuchFieldError nosuchfielderror1) { }
a[d.B.ordinal()] = 5;
_L2:
return;
nosuchfielderror;
if(true) goto _L2; else goto _L1
_L1:
}
}
_cls2.a[c1.a.a.ordinal()];
JVM INSTR tableswitch 1 5: default 72
// 1 75
// 2 120
// 3 201
// 4 215
// 5 344;
goto _L3 _L4 _L5 _L6 _L7 _L8
_L3:
continue; /* Loop/switch isn't completed */
_L4:
if(!c1.b())
{
c.a("Ready to start bootloading");
b.a(d.y, new byte[0]);
} else
{
a("Failed to start bootloading");
}
continue; /* Loop/switch isn't completed */
_L5:
c1 = a.readLine();
if(c1 != null)
{
try
{
j j1 = c;
StringBuilder stringbuilder1 = JVM INSTR new #131 <Class StringBuilder>;
stringbuilder1.StringBuilder();
j1.a(stringbuilder1.append("First line of the hex: ").append(c1).toString());
b.a(d.A, c(c1));
}
// Misplaced declaration of an exception variable
catch(c c1)
{
a(((Exception) (c1)));
}
continue; /* Loop/switch isn't completed */
}
a("Hex file to bootload is empty");
continue; /* Loop/switch isn't completed */
_L6:
c.a("Got a ping from the erase progress");
continue; /* Loop/switch isn't completed */
_L7:
if(c1.b())
{
a((new StringBuilder()).append("Error when programming data: ").append(c1.d()).toString());
continue; /* Loop/switch isn't completed */
}
String s = a.readLine();
if(s != null)
{
try
{
c1 = c;
StringBuilder stringbuilder = JVM INSTR new #131 <Class StringBuilder>;
stringbuilder.StringBuilder();
c1.a(stringbuilder.append("Next line: ").append(s).toString());
b.a(d.A, c(s));
}
// Misplaced declaration of an exception variable
catch(c c1)
{
a(((Exception) (c1)));
}
continue; /* Loop/switch isn't completed */
}
c.a("Reached the end of the file");
h = a.c;
continue; /* Loop/switch isn't completed */
_L8:
a.close();
c.a("COMPLETE");
h = a.c;
continue; /* Loop/switch isn't completed */
c1;
a(((Exception) (c1)));
if(true) goto _L10; else goto _L9
_L9:
}
public void a(BufferedReader bufferedreader)
{
c.a("Call startHex");
h = a.b;
a = bufferedreader;
b.a(d.x, new byte[0]);
}
public void a(Exception exception)
{
h = a.d;
c.a(exception);
}
public void a(String s)
{
h = a.d;
c.c(s);
}
Couldn't fully decompile method b
Couldn't resolve all exception handlers in method b
public void b()
{
c.a("Bootload from file");
java.io.FileInputStream fileinputstream = d.openFileInput("image.hex");
BufferedReader bufferedreader = JVM INSTR new #126 <Class BufferedReader>;
InputStreamReader inputstreamreader = JVM INSTR new #191 <Class InputStreamReader>;
inputstreamreader.InputStreamReader(fileinputstream);
bufferedreader.BufferedReader(inputstreamreader);
a(bufferedreader);
_L1:
return;
FileNotFoundException filenotfoundexception;
filenotfoundexception;
a(filenotfoundexception);
goto _L1
}
Couldn't fully decompile method b
Couldn't resolve all exception handlers in method b
public void b(String s)
{
c.a((new StringBuilder()).append("bootloadFromUrl: ").append(s).toString());
URL url;
url = JVM INSTR new #205 <Class URL>;
url.URL(s);
(new Thread(new Runnable(url) Overlapped try statements detected. Not all exception handlers will be resolved in the method run
Couldn't fully decompile method run
Couldn't resolve all exception handlers in method run
{
public void run()
{
Object obj;
int i;
obj = a.openConnection();
((URLConnection) (obj)).connect();
i = ((URLConnection) (obj)).getContentLength();
j j1 = e.a(b);
StringBuilder stringbuilder1 = JVM INSTR new #47 <Class StringBuilder>;
stringbuilder1.StringBuilder();
j1.a(stringbuilder1.append("Length of hex is ").append(i).toString());
if(i <= 0x1e8480 && i >= 50000) goto _L2; else goto _L1
_L1:
obj = b;
StringBuilder stringbuilder = JVM INSTR new #47 <Class StringBuilder>;
stringbuilder.StringBuilder();
((e) (obj)).a(stringbuilder.append("File size is not in a valid range: ").append(i).toString());
_L4:
return;
_L2:
byte abyte0[];
BufferedInputStream bufferedinputstream;
FileOutputStream fileoutputstream;
bufferedinputstream = JVM INSTR new #72 <Class BufferedInputStream>;
bufferedinputstream.BufferedInputStream(((URLConnection) (obj)).getInputStream());
fileoutputstream = e.b(b).openFileOutput("image.hex", 0);
abyte0 = new byte[1024];
_L3:
i = bufferedinputstream.read(abyte0);
if(i == -1)
break MISSING_BLOCK_LABEL_174;
fileoutputstream.write(abyte0, 0, i);
goto _L3
IOException ioexception;
ioexception;
b.a("Failed to download file");
b.a(ioexception);
goto _L4
fileoutputstream.close();
bufferedinputstream.close();
e.a(b).a("done writing");
b.b();
goto _L4
}
final URL a;
final e b;
{
b = e.this;
a = url;
super();
}
})).start();
_L2:
return;
s;
a("Bad url format");
h = a.d;
if(true) goto _L2; else goto _L1
_L1:
}
private BufferedReader a;
private v b;
private j c;
private Context d;
private final String e = "image.hex";
private final int f = 0x1e8480;
private final int g = 50000;
private a h;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment