No class loading if Java features disabled

- No longer loads custom classes if not needed for respective packages
- Renames isGmsUnstable to isDroidGuardOrVending
- Removes spoofVendingSdk from migrate/autopif scripts (don't document yet)
- Adds missing setAccessible() call for early return in EntryPointVending.init()
- Adds missing set of spoofSignature -> 0 for vending
This commit is contained in:
Nicholas Bissell
2025-02-05 18:36:28 +00:00
committed by Chris Renshaw
parent 4740d2048d
commit a52cc16b43
4 changed files with 11 additions and 8 deletions

View File

@@ -13,6 +13,7 @@
#define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json"
#define CUSTOM_JSON_FILE_PATH "/data/adb/modules/playintegrityfix/custom.pif.json"
#define VENDING_PACKAGE "com.android.vending"
#define DROIDGUARD_PACKAGE "com.google.android.gms.unstable"
static int verboseLogs = 0;
static int spoofBuild = 1;
@@ -85,7 +86,7 @@ public:
}
void preAppSpecialize(zygisk::AppSpecializeArgs *args) override {
bool isGms = false, isGmsUnstable = false;
bool isGms = false, isDroidGuardOrVending = false;
auto rawProcess = env->GetStringUTFChars(args->nice_name, nullptr);
auto rawDir = env->GetStringUTFChars(args->app_data_dir, nullptr);
@@ -101,7 +102,7 @@ public:
std::string_view dir(rawDir);
isGms = dir.ends_with("/com.google.android.gms") || dir.ends_with("/com.android.vending");
isGmsUnstable = pkgName == "com.google.android.gms.unstable" || pkgName == VENDING_PACKAGE;
isDroidGuardOrVending = pkgName == DROIDGUARD_PACKAGE || pkgName == VENDING_PACKAGE;
env->ReleaseStringUTFChars(args->nice_name, rawProcess);
env->ReleaseStringUTFChars(args->app_data_dir, rawDir);
@@ -114,7 +115,7 @@ public:
// We are in GMS now, force unmount
api->setOption(zygisk::FORCE_DENYLIST_UNMOUNT);
if (!isGmsUnstable) {
if (!isDroidGuardOrVending) {
api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
return;
}
@@ -164,11 +165,13 @@ public:
readJson();
if (pkgName == VENDING_PACKAGE) spoofProps = spoofBuild = spoofProvider = 0;
if (pkgName == VENDING_PACKAGE) spoofProps = spoofBuild = spoofProvider = spoofSignature = 0;
else spoofVendingSdk = 0;
if (spoofProps > 0) doHook();
inject();
if (spoofBuild + spoofProvider + spoofSignature + spoofVendingSdk > 0 ||
pkgName == DROIDGUARD_PACKAGE && verboseLogs > 99)
inject();
dexVector.clear();
json.clear();

View File

@@ -23,6 +23,7 @@ public final class EntryPointVending {
oldValue = field.getInt(null);
if (oldValue == targetSdk) {
if (verboseLogs > 2) LOG(String.format("[SDK_INT]: %d (unchanged)", oldValue));
field.setAccessible(false);
return;
}
field.set(null, targetSdk);

View File

@@ -158,7 +158,7 @@ if [ -f "$MIGRATE" ]; then
if [ -n "$ARGS" ]; then
grep_json() { [ -f "$2" ] && grep -m1 "$1" $2 | cut -d\" -f4; }
verboseLogs=$(grep_json "VERBOSE_LOGS" $OLDJSON);
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature spoofVendingSdk verboseLogs";
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature verboseLogs";
for SETTING in $ADVSETTINGS; do
eval [ -z \"\$$SETTING\" ] \&\& $SETTING=$(grep_json "$SETTING" $OLDJSON);
eval TMPVAL=\$$SETTING;

View File

@@ -114,13 +114,12 @@ if [ -z "$DEVICE_INITIAL_SDK_INT" -o "$DEVICE_INITIAL_SDK_INT" = "null" ]; then
DEVICE_INITIAL_SDK_INT=25;
fi;
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature spoofVendingSdk verboseLogs";
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature verboseLogs";
spoofBuild=1;
spoofProps=1;
spoofProvider=1;
spoofSignature=0;
spoofVendingSdk=0;
verboseLogs=0;
if [ -f "$OUT" ]; then