mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-02 22:21:51 +00:00
Relaunch process without second process
This commit is contained in:
@@ -8,19 +8,13 @@ import java.io.File;
|
||||
// mapping when loading from platform (via LoadedApk.mClassLoader)
|
||||
class InjectedClassLoader extends ClassLoader {
|
||||
|
||||
private static final String PKEY = "PHOENIX";
|
||||
static final String PHOENIX = Mapping.inverseMap.get(PKEY);
|
||||
|
||||
InjectedClassLoader(File apk) {
|
||||
super(new DynamicClassLoader(apk));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
|
||||
String n = Mapping.get(name);
|
||||
if (n.equals(PKEY))
|
||||
return PhoenixActivity.class;
|
||||
return super.loadClass(n, resolve);
|
||||
return super.loadClass(Mapping.get(name), resolve);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ public class DownloadActivity extends Activity {
|
||||
dialog = ProgressDialog.show(themed, getString(dling), getString(dling) + " " + APP_NAME, true);
|
||||
Runnable onSuccess = () -> {
|
||||
dialog.dismiss();
|
||||
PhoenixActivity.rebirth(this, InjectedClassLoader.PHOENIX);
|
||||
StubApk.restartProcess(this);
|
||||
finish();
|
||||
};
|
||||
// Download and upgrade the app
|
||||
|
||||
Reference in New Issue
Block a user