-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMasterBypassPatcher.java
More file actions
92 lines (84 loc) · 3.84 KB
/
Copy pathMasterBypassPatcher.java
File metadata and controls
92 lines (84 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import java.io.*;
import java.nio.file.*;
import java.util.*;
public class MasterBypassPatcher {
public static void main(String[] args) throws Exception {
String base = "D:/Ideas/Antigravity/Notes/standalone_source";
String[] securityClasses = {
"/smali/com/aheaditec/talsec_security/security/api/Natives.smali",
"/smali/com/aheaditec/talsec_security/security/Natives.smali",
"/smali/com/pairip/licensecheck/LicenseClient.smali",
"/smali/com/pairip/licensecheck/ResponseValidator.smali",
"/smali/com/google/android/play/core/integrity/IntegrityManagerFactory.smali",
"/smali/s6/t3.smali",
"/smali/s6/o3.smali",
"/smali/t8/h.smali"
};
for (String cls : securityClasses) {
neutralizeClass(base + cls);
}
patchRevenueCat(base + "/smali_classes2/com/revenuecat/purchases/EntitlementInfo.smali");
System.out.println("Surgical Master Bypass Applied.");
}
private static void neutralizeClass(String path) throws IOException {
File file = new File(path);
if (!file.exists()) {
System.out.println("Cls not found: " + path);
return;
}
List<String> lines = Files.readAllLines(file.toPath());
List<String> newLines = new ArrayList<>();
boolean inMethod = false;
for (String line : lines) {
String trimmed = line.trim();
if (trimmed.startsWith(".method ") && !trimmed.contains("abstract") && !trimmed.contains("native")) {
newLines.add(line);
// DO NOT touch constructors or initializers!
if (trimmed.contains("<init>") || trimmed.contains("<clinit>")) {
inMethod = false; // We want to keep the original body
} else {
String returnType = getReturnType(trimmed);
newLines.add(" .locals 1");
if (returnType.equals("Z")) newLines.add(" const/4 v0, 0x1\n return v0");
else if (returnType.equals("V")) newLines.add(" return-void");
else if (returnType.startsWith("L") || returnType.startsWith("[")) newLines.add(" const/4 v0, 0x0\n return-object v0");
else newLines.add(" const/4 v0, 0x0\n return v0");
inMethod = true;
}
} else if (inMethod && trimmed.equals(".end method")) {
newLines.add(line);
inMethod = false;
} else if (!inMethod) {
newLines.add(line);
}
}
Files.write(file.toPath(), newLines);
System.out.println("Neutralized: " + path);
}
private static void patchRevenueCat(String path) throws IOException {
File file = new File(path);
if (!file.exists()) return;
List<String> lines = Files.readAllLines(file.toPath());
List<String> newLines = new ArrayList<>();
boolean inIsActive = false;
for (String line : lines) {
if (line.trim().equals(".method public final isActive()Z")) {
newLines.add(line);
newLines.add(" .locals 1\n const/4 v0, 0x1\n return v0");
inIsActive = true;
} else if (inIsActive && line.trim().equals(".end method")) {
newLines.add(line);
inIsActive = false;
} else if (!inIsActive) {
newLines.add(line);
}
}
Files.write(file.toPath(), newLines);
System.out.println("Patched RevenueCat.");
}
private static String getReturnType(String methodHeader) {
int idx = methodHeader.lastIndexOf(")");
if (idx != -1) return methodHeader.substring(idx + 1).trim();
return "V";
}
}