Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
Fix AppComponentFactory not called
Browse files Browse the repository at this point in the history
  • Loading branch information
nonnonstop committed Aug 31, 2022
1 parent 0c5f890 commit 7367107
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,7 @@ private static Context createLoadedApkWithContext() {
} catch (Throwable ignored) {}
Log.i(TAG, "hooked app initialized: " + appLoadedApk);

var context = (Context) XposedHelpers.callStaticMethod(Class.forName("android.app.ContextImpl"), "createAppContext", activityThread, stubLoadedApk);
if (config.appComponentFactory != null) {
try {
context.getClassLoader().loadClass(config.appComponentFactory);
} catch (ClassNotFoundException e) { // This will happen on some strange shells like 360
Log.w(TAG, "Original AppComponentFactory not found: " + config.appComponentFactory);
appInfo.appComponentFactory = null;
}
}
return context;
return (Context) XposedHelpers.callStaticMethod(Class.forName("android.app.ContextImpl"), "createAppContext", activityThread, stubLoadedApk);
} catch (Throwable e) {
Log.e(TAG, "createLoadedApk", e);
return null;
Expand Down

0 comments on commit 7367107

Please sign in to comment.