Bootstrap hookings should only be done once

This commit is contained in:
solohsu 2019-01-22 17:09:12 +08:00
parent af4feada27
commit 12667f5bd2
1 changed files with 4 additions and 0 deletions

View File

@ -47,11 +47,15 @@ public final class XposedInit {
private XposedInit() { private XposedInit() {
} }
private static volatile AtomicBoolean bootstrapHooked = new AtomicBoolean(false);
/** /**
* Hook some methods which we want to create an easier interface for developers. * Hook some methods which we want to create an easier interface for developers.
*/ */
/*package*/ /*package*/
public static void initForZygote(boolean isSystem) throws Throwable { public static void initForZygote(boolean isSystem) throws Throwable {
if (!bootstrapHooked.compareAndSet(false, true)) {
return;
}
startsSystemServer = isSystem; startsSystemServer = isSystem;
Router.startBootstrapHook(isSystem); Router.startBootstrapHook(isSystem);
// MIUI // MIUI