You've already forked PlayIntegrityFork
mirror of
https://github.com/osm0sis/PlayIntegrityFork.git
synced 2025-09-06 06:37:06 +00:00
Fix errant Windows line endings
This commit is contained in:
@@ -1,62 +1,62 @@
|
|||||||
package es.chiteroman.playintegrityfix;
|
package es.chiteroman.playintegrityfix;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public final class EntryPointVending {
|
public final class EntryPointVending {
|
||||||
|
|
||||||
private static void LOG(String msg) {
|
private static void LOG(String msg) {
|
||||||
Log.d("PIF/Java:PS", msg);
|
Log.d("PIF/Java:PS", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
@SuppressLint("DefaultLocale")
|
||||||
public static void init(int verboseLogs, int spoofVendingFinger, int spoofVendingSdk, String vendingFingerprintValue) {
|
public static void init(int verboseLogs, int spoofVendingFinger, int spoofVendingSdk, String vendingFingerprintValue) {
|
||||||
// Only spoof FINGERPRINT to Play Store if not forcing Android <13 Play Integrity verdict
|
// Only spoof FINGERPRINT to Play Store if not forcing Android <13 Play Integrity verdict
|
||||||
if (spoofVendingSdk < 1) {
|
if (spoofVendingSdk < 1) {
|
||||||
if (spoofVendingFinger < 1) return;
|
if (spoofVendingFinger < 1) return;
|
||||||
String oldValue;
|
String oldValue;
|
||||||
try {
|
try {
|
||||||
Field field = Build.class.getDeclaredField("FINGERPRINT");
|
Field field = Build.class.getDeclaredField("FINGERPRINT");
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
oldValue = String.valueOf(field.get(null));
|
oldValue = String.valueOf(field.get(null));
|
||||||
if (oldValue.equals(vendingFingerprintValue)) {
|
if (oldValue.equals(vendingFingerprintValue)) {
|
||||||
if (verboseLogs > 2) LOG(String.format("[FINGERPRINT]: %s (unchanged)", oldValue));
|
if (verboseLogs > 2) LOG(String.format("[FINGERPRINT]: %s (unchanged)", oldValue));
|
||||||
field.setAccessible(false);
|
field.setAccessible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
field.set(null, vendingFingerprintValue);
|
field.set(null, vendingFingerprintValue);
|
||||||
field.setAccessible(false);
|
field.setAccessible(false);
|
||||||
LOG(String.format("[FINGERPRINT]: %s -> %s", oldValue, vendingFingerprintValue));
|
LOG(String.format("[FINGERPRINT]: %s -> %s", oldValue, vendingFingerprintValue));
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
LOG("FINGERPRINT field not found: " + e);
|
LOG("FINGERPRINT field not found: " + e);
|
||||||
} catch (SecurityException | IllegalAccessException | IllegalArgumentException |
|
} catch (SecurityException | IllegalAccessException | IllegalArgumentException |
|
||||||
NullPointerException | ExceptionInInitializerError e) {
|
NullPointerException | ExceptionInInitializerError e) {
|
||||||
LOG("FINGERPRINT field not accessible: " + e);
|
LOG("FINGERPRINT field not accessible: " + e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int requestSdk = spoofVendingSdk == 1 ? 32 : spoofVendingSdk;
|
int requestSdk = spoofVendingSdk == 1 ? 32 : spoofVendingSdk;
|
||||||
int targetSdk = Math.min(Build.VERSION.SDK_INT, requestSdk);
|
int targetSdk = Math.min(Build.VERSION.SDK_INT, requestSdk);
|
||||||
int oldValue;
|
int oldValue;
|
||||||
try {
|
try {
|
||||||
Field field = Build.VERSION.class.getDeclaredField("SDK_INT");
|
Field field = Build.VERSION.class.getDeclaredField("SDK_INT");
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
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);
|
field.setAccessible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
field.set(null, targetSdk);
|
field.set(null, targetSdk);
|
||||||
field.setAccessible(false);
|
field.setAccessible(false);
|
||||||
LOG(String.format("[SDK_INT]: %d -> %d", oldValue, targetSdk));
|
LOG(String.format("[SDK_INT]: %d -> %d", oldValue, targetSdk));
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
LOG("SDK_INT field not found: " + e);
|
LOG("SDK_INT field not found: " + e);
|
||||||
} catch (SecurityException | IllegalAccessException | IllegalArgumentException |
|
} catch (SecurityException | IllegalAccessException | IllegalArgumentException |
|
||||||
NullPointerException | ExceptionInInitializerError e) {
|
NullPointerException | ExceptionInInitializerError e) {
|
||||||
LOG("SDK_INT field not accessible: " + e);
|
LOG("SDK_INT field not accessible: " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user