-
-
Save yous/43bc6f60d41d0197cf18 to your computer and use it in GitHub Desktop.
libdroid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ctf.stratumauhhur.libdroid; | |
import android.content.res.AssetManager; | |
import android.os.Bundle; | |
import android.support.design.widget.Snackbar; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Base64; | |
import android.view.View; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
public class a | |
extends AppCompatActivity | |
{ | |
static String a; | |
static String b; | |
static String c; | |
static String d; | |
static Object f; | |
static String flag = a(getFlag(), 1); | |
static String g; | |
String e; | |
static | |
{ | |
System.loadLibrary("libdroid"); | |
a = a(getOperatingSystem(), 1); | |
b = a(getPhoneNumber(), 1); | |
c = a(installRootkit(), 1); | |
d = a(generateConfusion(), 1); | |
f = a(obtainWorldDomination(), 1); | |
g = a(installiOS(), 1); | |
} | |
static String a(String paramString, int paramInt) | |
{ | |
Object localObject1 = new Exception().getStackTrace()[paramInt]; | |
Object localObject2 = new StringBuilder(); | |
((StringBuilder)localObject2).append(((StackTraceElement)localObject1).getClassName()).insert(paramInt, ((StackTraceElement)localObject1).getMethodName()); | |
localObject1 = localObject2.toString(); | |
localObject2 = new char[paramString.length()]; | |
int i = 0; | |
paramInt = (char)((String)localObject1).length(); | |
for (;;) | |
{ | |
if (i < paramString.length()) | |
{ | |
j = paramString.charAt(i); | |
localObject2[i] = ((char)(((String)localObject1).charAt(paramInt - 1) ^ j ^ 0x12)); | |
i = (char)(i + 1); | |
if (i < paramString.length()) {} | |
} | |
else | |
{ | |
return String.valueOf((char[])localObject2); | |
} | |
int j = paramString.charAt(i); | |
localObject2[i] = ((char)(((String)localObject1).charAt(paramInt - 1) ^ j ^ 0xFA)); | |
j = (char)(i + 1); | |
int k = (char)(paramInt - 1); | |
paramInt = k; | |
i = j; | |
if (k <= 0) | |
{ | |
paramInt = (char)((String)localObject1).length(); | |
i = j; | |
} | |
} | |
} | |
public static native String generateConfusion(); | |
public static native String getFlag(); | |
public static native String getOperatingSystem(); | |
public static native String getPhoneNumber(); | |
public static native String installRootkit(); | |
public static native String installiOS(); | |
public static native String obtainWorldDomination(); | |
private static native void phoneHome(byte[] paramArrayOfByte1, byte[] paramArrayOfByte2); | |
public void a(View paramView) | |
{ | |
if (paramView.getId() == 2131492969) { | |
this.e += d.charAt(1); | |
} | |
if (paramView.getId() == 2131492970) { | |
this.e += d.charAt(2); | |
} | |
if (paramView.getId() == 2131492971) { | |
this.e += d.charAt(3); | |
} | |
if (paramView.getId() == 2131492972) { | |
this.e += d.charAt(4); | |
} | |
if (paramView.getId() == 2131492973) { | |
this.e += d.charAt(5); | |
} | |
if (paramView.getId() == 2131492974) { | |
this.e += d.charAt(6); | |
} | |
if (paramView.getId() == 2131492975) { | |
this.e += d.charAt(7); | |
} | |
if (paramView.getId() == 2131492977) { | |
this.e += d.charAt(8); | |
} | |
if (paramView.getId() == 2131492978) { | |
this.e += d.charAt(9); | |
} | |
if (paramView.getId() == 2131492976) { | |
this.e += d.charAt(0); | |
} | |
String str; | |
Object localObject2; | |
Object localObject1; | |
if ((this.e.length() == 6) || (paramView.getId() == 2131492979)) | |
{ | |
str = flag; | |
try | |
{ | |
InputStream localInputStream = getAssets().open(g); | |
localObject2 = new ByteArrayOutputStream(); | |
byte[] arrayOfByte = new byte['?']; | |
for (;;) | |
{ | |
int i = localInputStream.read(arrayOfByte, 0, arrayOfByte.length); | |
if (i == -1) { | |
break; | |
} | |
((ByteArrayOutputStream)localObject2).write(arrayOfByte, 0, i); | |
} | |
Snackbar.make(paramView, (CharSequence)localObject1, 0).setAction("Action", null).show(); | |
} | |
catch (Exception localException) | |
{ | |
localException.printStackTrace(); | |
localObject1 = str; | |
} | |
} | |
for (;;) | |
{ | |
this.e = ""; | |
return; | |
((ByteArrayOutputStream)localObject2).flush(); | |
localObject2 = ((ByteArrayOutputStream)localObject2).toByteArray(); | |
localObject1 = new byte[16]; | |
System.arraycopy((byte[])f, 0, localObject1, 0, ((byte[])f).length); | |
System.arraycopy(this.e.getBytes(), 0, localObject1, 10, this.e.getBytes().length); | |
phoneHome((byte[])localObject2, (byte[])localObject1); | |
localObject1 = str; | |
if (new String((byte[])localObject2).startsWith(c)) { | |
localObject1 = new String((byte[])localObject2); | |
} | |
} | |
} | |
void a(String paramString) | |
throws Exception | |
{ | |
paramString = getAssets().open(paramString); | |
Object localObject = new ByteArrayOutputStream(); | |
byte[] arrayOfByte = new byte['?']; | |
for (;;) | |
{ | |
int i = paramString.read(arrayOfByte, 0, arrayOfByte.length); | |
if (i == -1) { | |
break; | |
} | |
((ByteArrayOutputStream)localObject).write(arrayOfByte, 0, i); | |
} | |
((ByteArrayOutputStream)localObject).flush(); | |
paramString = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(a(((ByteArrayOutputStream)localObject).toByteArray(), b)))); | |
for (;;) | |
{ | |
localObject = paramString.readLine(); | |
if (localObject == null) { | |
break; | |
} | |
if (((String)localObject).startsWith(g)) { | |
g = ((String)localObject).substring(g.length()); | |
} | |
if (((String)localObject).startsWith((String)f)) { | |
f = (byte[])Base64.decode(((String)localObject).substring(((String)f).length()), 0); | |
} | |
} | |
} | |
byte[] a(byte[] paramArrayOfByte, String paramString) | |
{ | |
byte[] arrayOfByte = new byte[paramArrayOfByte.length]; | |
for (int i = 0; i < arrayOfByte.length; i = (char)(i + 1)) { | |
arrayOfByte[i] = ((byte)(paramArrayOfByte[i] ^ paramString.charAt(i % paramString.length()))); | |
} | |
return arrayOfByte; | |
} | |
protected void onCreate(Bundle paramBundle) | |
{ | |
super.onCreate(paramBundle); | |
setContentView(2130968601); | |
try | |
{ | |
a(a); | |
this.e = ""; | |
return; | |
} | |
catch (Exception paramBundle) | |
{ | |
for (;;) {} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment