You've already forked PlayIntegrityFork
mirror of
https://github.com/osm0sis/PlayIntegrityFork.git
synced 2025-09-06 06:37:06 +00:00
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:
committed by
Chris Renshaw
parent
4740d2048d
commit
a52cc16b43
@@ -13,6 +13,7 @@
|
|||||||
#define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json"
|
#define JSON_FILE_PATH "/data/adb/modules/playintegrityfix/pif.json"
|
||||||
#define CUSTOM_JSON_FILE_PATH "/data/adb/modules/playintegrityfix/custom.pif.json"
|
#define CUSTOM_JSON_FILE_PATH "/data/adb/modules/playintegrityfix/custom.pif.json"
|
||||||
#define VENDING_PACKAGE "com.android.vending"
|
#define VENDING_PACKAGE "com.android.vending"
|
||||||
|
#define DROIDGUARD_PACKAGE "com.google.android.gms.unstable"
|
||||||
|
|
||||||
static int verboseLogs = 0;
|
static int verboseLogs = 0;
|
||||||
static int spoofBuild = 1;
|
static int spoofBuild = 1;
|
||||||
@@ -85,7 +86,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void preAppSpecialize(zygisk::AppSpecializeArgs *args) override {
|
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 rawProcess = env->GetStringUTFChars(args->nice_name, nullptr);
|
||||||
auto rawDir = env->GetStringUTFChars(args->app_data_dir, nullptr);
|
auto rawDir = env->GetStringUTFChars(args->app_data_dir, nullptr);
|
||||||
@@ -101,7 +102,7 @@ public:
|
|||||||
std::string_view dir(rawDir);
|
std::string_view dir(rawDir);
|
||||||
|
|
||||||
isGms = dir.ends_with("/com.google.android.gms") || dir.ends_with("/com.android.vending");
|
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->nice_name, rawProcess);
|
||||||
env->ReleaseStringUTFChars(args->app_data_dir, rawDir);
|
env->ReleaseStringUTFChars(args->app_data_dir, rawDir);
|
||||||
@@ -114,7 +115,7 @@ public:
|
|||||||
// We are in GMS now, force unmount
|
// We are in GMS now, force unmount
|
||||||
api->setOption(zygisk::FORCE_DENYLIST_UNMOUNT);
|
api->setOption(zygisk::FORCE_DENYLIST_UNMOUNT);
|
||||||
|
|
||||||
if (!isGmsUnstable) {
|
if (!isDroidGuardOrVending) {
|
||||||
api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
|
api->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -164,11 +165,13 @@ public:
|
|||||||
|
|
||||||
readJson();
|
readJson();
|
||||||
|
|
||||||
if (pkgName == VENDING_PACKAGE) spoofProps = spoofBuild = spoofProvider = 0;
|
if (pkgName == VENDING_PACKAGE) spoofProps = spoofBuild = spoofProvider = spoofSignature = 0;
|
||||||
else spoofVendingSdk = 0;
|
else spoofVendingSdk = 0;
|
||||||
|
|
||||||
if (spoofProps > 0) doHook();
|
if (spoofProps > 0) doHook();
|
||||||
inject();
|
if (spoofBuild + spoofProvider + spoofSignature + spoofVendingSdk > 0 ||
|
||||||
|
pkgName == DROIDGUARD_PACKAGE && verboseLogs > 99)
|
||||||
|
inject();
|
||||||
|
|
||||||
dexVector.clear();
|
dexVector.clear();
|
||||||
json.clear();
|
json.clear();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public final class EntryPointVending {
|
|||||||
oldValue = field.getInt(null);
|
oldValue = field.getInt(null);
|
||||||
if (oldValue == targetSdk) {
|
if (oldValue == targetSdk) {
|
||||||
if (verboseLogs > 2) LOG(String.format("[SDK_INT]: %d (unchanged)", oldValue));
|
if (verboseLogs > 2) LOG(String.format("[SDK_INT]: %d (unchanged)", oldValue));
|
||||||
|
field.setAccessible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
field.set(null, targetSdk);
|
field.set(null, targetSdk);
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ if [ -f "$MIGRATE" ]; then
|
|||||||
if [ -n "$ARGS" ]; then
|
if [ -n "$ARGS" ]; then
|
||||||
grep_json() { [ -f "$2" ] && grep -m1 "$1" $2 | cut -d\" -f4; }
|
grep_json() { [ -f "$2" ] && grep -m1 "$1" $2 | cut -d\" -f4; }
|
||||||
verboseLogs=$(grep_json "VERBOSE_LOGS" $OLDJSON);
|
verboseLogs=$(grep_json "VERBOSE_LOGS" $OLDJSON);
|
||||||
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature spoofVendingSdk verboseLogs";
|
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature verboseLogs";
|
||||||
for SETTING in $ADVSETTINGS; do
|
for SETTING in $ADVSETTINGS; do
|
||||||
eval [ -z \"\$$SETTING\" ] \&\& $SETTING=$(grep_json "$SETTING" $OLDJSON);
|
eval [ -z \"\$$SETTING\" ] \&\& $SETTING=$(grep_json "$SETTING" $OLDJSON);
|
||||||
eval TMPVAL=\$$SETTING;
|
eval TMPVAL=\$$SETTING;
|
||||||
|
|||||||
@@ -114,13 +114,12 @@ if [ -z "$DEVICE_INITIAL_SDK_INT" -o "$DEVICE_INITIAL_SDK_INT" = "null" ]; then
|
|||||||
DEVICE_INITIAL_SDK_INT=25;
|
DEVICE_INITIAL_SDK_INT=25;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature spoofVendingSdk verboseLogs";
|
ADVSETTINGS="spoofBuild spoofProps spoofProvider spoofSignature verboseLogs";
|
||||||
|
|
||||||
spoofBuild=1;
|
spoofBuild=1;
|
||||||
spoofProps=1;
|
spoofProps=1;
|
||||||
spoofProvider=1;
|
spoofProvider=1;
|
||||||
spoofSignature=0;
|
spoofSignature=0;
|
||||||
spoofVendingSdk=0;
|
|
||||||
verboseLogs=0;
|
verboseLogs=0;
|
||||||
|
|
||||||
if [ -f "$OUT" ]; then
|
if [ -f "$OUT" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user