mirror of
https://github.com/kdrag0n/safetynet-fix.git
synced 2024-11-19 11:11:22 +00:00
zygisk: Inject payload after specialization
This commit is contained in:
parent
cd84bf361f
commit
69e2aae3d8
@ -26,6 +26,15 @@ public:
|
||||
preSpecialize(process);
|
||||
}
|
||||
|
||||
void postAppSpecialize(const zygisk::AppSpecializeArgs *args) override {
|
||||
// Inject if module was loaded, otherwise this would've been unloaded by now (for non-GMS)
|
||||
if (!moduleDex.empty()) {
|
||||
LOGD("Injecting payload...");
|
||||
injectPayload();
|
||||
LOGI("Payload injected");
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
zygisk::Api *api;
|
||||
JNIEnv *env;
|
||||
@ -81,10 +90,12 @@ private:
|
||||
// caused by model detection and flag provisioning, such as broken weather with the new
|
||||
// smartspace on Android 12.
|
||||
if (process == "com.google.android.gms.unstable") {
|
||||
// This is post-fork, so just inject the payload now
|
||||
// Load the payload, but don't inject it yet until after specialization
|
||||
// Otherwise, specialization fails if any code from the payload still happens to be
|
||||
// running
|
||||
LOGD("Loading payload...");
|
||||
loadPayload();
|
||||
injectPayload();
|
||||
LOGI("Payload injected");
|
||||
LOGD("Payload loaded");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user