Last active
April 10, 2025 10:17
-
-
Save ghoulgy/6c2ae9a1e5aaa55f22d0b343c59454fd to your computer and use it in GitHub Desktop.
arm/StubApp c951e7c322530cbd470cc1ba0c103d93fcf3fd3120af53de3dae128d70adfb38
This file contains hidden or 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 arm; | |
... | |
public class StubApp extends Application { | |
public static final String MAIN_APPLICATION = "com.e4a.runtime.android.E4Aapplication"; | |
static { | |
System.loadLibrary("arm_protect"); | |
} | |
static void loadDex(List list, Context context) { | |
try { | |
long currentThreadTimeMillis = SystemClock.currentThreadTimeMillis(); | |
Field declaredField = ((Class) Objects.requireNonNull(context.getClassLoader().getClass().getSuperclass())).getDeclaredField("pathList"); | |
if (!declaredField.isAccessible()) { | |
declaredField.setAccessible(true); | |
} | |
Object obj = declaredField.get(context.getClassLoader()); | |
Field declaredField2 = Objects.requireNonNull(obj).getClass().getDeclaredField("dexElements"); | |
if (!declaredField2.isAccessible()) { | |
declaredField2.setAccessible(true); | |
} | |
Object[] objArr = (Object[]) declaredField2.get(obj); | |
Method declaredMethod = obj.getClass().getDeclaredMethod("makePathElements", new Class[]{List.class, File.class, List.class}); | |
if (!declaredMethod.isAccessible()) { | |
declaredMethod.setAccessible(true); | |
} | |
Object[] objArr2 = (Object[]) declaredMethod.invoke(obj, new Object[]{list, context.getDir("arm", 0), new ArrayList()}); | |
Object[] objArr3 = (Object[]) Array.newInstance((Class) Objects.requireNonNull(((Object[]) Objects.requireNonNull(objArr)).getClass().getComponentType()), ((Object[]) Objects.requireNonNull(objArr2)).length + objArr.length); | |
System.arraycopy(objArr, 0, objArr3, 0, objArr.length); | |
System.arraycopy(objArr2, 0, objArr3, objArr.length, objArr2.length); | |
declaredField2.set(obj, objArr3); | |
System.out.println("耗时:" + (SystemClock.currentThreadTimeMillis() - currentThreadTimeMillis) + " ms"); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
/* access modifiers changed from: protected */ | |
public native void attachBaseContext(Context context); | |
public native Context createPackageContext(String str, int i); | |
public native String getPackageName(); | |
public native void onCreate(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment