Add granular advanced spoofing options

This commit is contained in:
osm0sis
2024-08-02 14:56:32 -03:00
parent a5d9980ea7
commit a7c2f348ea
5 changed files with 65 additions and 11 deletions
@@ -38,4 +38,4 @@ public class CustomPackageInfoCreator implements Parcelable.Creator<PackageInfo>
public PackageInfo[] newArray(int size) {
return originalCreator.newArray(size);
}
}
}
@@ -13,7 +13,9 @@ public final class CustomProvider extends Provider {
@Override
public synchronized Service getService(String type, String algorithm) {
if (EntryPoint.getVerboseLogs() > 2) EntryPoint.LOG(String.format("Service: Caller type '%s' with algorithm '%s'", type, algorithm));
if (type.equals("KeyStore")) EntryPoint.spoofDevice();
if (EntryPoint.getSpoofBuildEnabled() > 0) {
if (type.equals("KeyStore")) EntryPoint.spoofDevice();
}
return super.getService(type, algorithm);
}
}
@@ -26,6 +26,7 @@ import java.util.Map;
public final class EntryPoint {
private static Integer verboseLogs = 0;
private static Integer spoofBuildEnabled = 1;
private static final String signatureData = "MIIFyTCCA7GgAwIBAgIVALyxxl+zDS9SL68SzOr48309eAZyMA0GCSqGSIb3DQEBCwUAMHQxCzAJ\n" +
"BgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQw\n" +
@@ -61,12 +62,17 @@ public final class EntryPoint {
return verboseLogs;
}
public static void init(int level) {
verboseLogs = level;
public static Integer getSpoofBuildEnabled() {
return spoofBuildEnabled;
}
public static void init(int logLevel, int spoofBuildVal, int spoofProviderVal, int spoofSignatureVal) {
verboseLogs = logLevel;
spoofBuildEnabled = spoofBuildVal;
if (verboseLogs > 99) logFields();
spoofProvider();
spoofPackageManager();
spoofDevice();
if (spoofProviderVal > 0) spoofProvider();
if (spoofBuildVal > 0) spoofDevice();
if (spoofSignatureVal > 0) spoofPackageManager();
}
public static void receiveJson(String data) {