Skip to content

Commit

Permalink
Fix unseal not working when proguard enabled.
Browse files Browse the repository at this point in the history
Signed-off-by: tiann <[email protected]>
  • Loading branch information
tiann committed Jul 24, 2021
1 parent 32d89f3 commit 9bc252d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/src/main/java/me/weishu/reflection/Reflection.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ private static boolean unsealByDexFile(Context context) {
}

DexFile dexFile = new DexFile(code);
Class<?> bootstrapClass = dexFile.loadClass(BootstrapClass.class.getCanonicalName(), null);
// This class is hardcoded in the dex, Don't use BootstrapClass.class to reference it
// it maybe obfuscated!!
Class<?> bootstrapClass = dexFile.loadClass("me.weishu.reflection.BootstrapClass", null);
Method exemptAll = bootstrapClass.getDeclaredMethod("exemptAll");
return (boolean) exemptAll.invoke(null);
} catch (Throwable e) {
Expand Down

0 comments on commit 9bc252d

Please sign in to comment.