RPatcher 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. rpatcher-2.0.1/ApkPatcher/ANSI_COLORS.py +56 -0
  2. rpatcher-2.0.1/ApkPatcher/APK_PATCHER.py +246 -0
  3. rpatcher-2.0.1/ApkPatcher/CLI.py +350 -0
  4. rpatcher-2.0.1/ApkPatcher/MODULES.py +34 -0
  5. rpatcher-2.0.1/ApkPatcher/Patch/AES.py +422 -0
  6. rpatcher-2.0.1/ApkPatcher/Patch/Ads_Patch.py +181 -0
  7. rpatcher-2.0.1/ApkPatcher/Patch/CERT_NSC.py +187 -0
  8. rpatcher-2.0.1/ApkPatcher/Patch/DeviceInfo.smali +459 -0
  9. rpatcher-2.0.1/ApkPatcher/Patch/Flutter_SSL_Patch.py +178 -0
  10. rpatcher-2.0.1/ApkPatcher/Patch/Manifest_Patch.py +172 -0
  11. rpatcher-2.0.1/ApkPatcher/Patch/Package.py +26 -0
  12. rpatcher-2.0.1/ApkPatcher/Patch/Pairip_CoreX.py +77 -0
  13. rpatcher-2.0.1/ApkPatcher/Patch/Pine_Hook.py +63 -0
  14. rpatcher-2.0.1/ApkPatcher/Patch/Random_INFO.py +3616 -0
  15. rpatcher-2.0.1/ApkPatcher/Patch/Smali_Patch.py +400 -0
  16. rpatcher-2.0.1/ApkPatcher/Patch/Spoof_Patch.py +150 -0
  17. rpatcher-2.0.1/ApkPatcher/Patch/TG_Patch.py +490 -0
  18. rpatcher-2.0.1/ApkPatcher/Patch/__init__.py +0 -0
  19. rpatcher-2.0.1/ApkPatcher/Utils/Anti_Splits.py +62 -0
  20. rpatcher-2.0.1/ApkPatcher/Utils/CRC.py +54 -0
  21. rpatcher-2.0.1/ApkPatcher/Utils/Credits.py +28 -0
  22. rpatcher-2.0.1/ApkPatcher/Utils/Decompile_Compile.py +180 -0
  23. rpatcher-2.0.1/ApkPatcher/Utils/Files/AES.smali +436 -0
  24. rpatcher-2.0.1/ApkPatcher/Utils/Files/Algorithm.dex +0 -0
  25. rpatcher-2.0.1/ApkPatcher/Utils/Files/Hook.smali +75 -0
  26. rpatcher-2.0.1/ApkPatcher/Utils/Files/__init__.py +0 -0
  27. rpatcher-2.0.1/ApkPatcher/Utils/Files/lib_Pairip_CoreX.so +0 -0
  28. rpatcher-2.0.1/ApkPatcher/Utils/Files_Check.py +206 -0
  29. rpatcher-2.0.1/ApkPatcher/Utils/Pine/__init__.py +0 -0
  30. rpatcher-2.0.1/ApkPatcher/Utils/Pine/config.json +84 -0
  31. rpatcher-2.0.1/ApkPatcher/Utils/Pine/libpine32 +0 -0
  32. rpatcher-2.0.1/ApkPatcher/Utils/Pine/libpine64 +0 -0
  33. rpatcher-2.0.1/ApkPatcher/Utils/Pine/loader.dex +0 -0
  34. rpatcher-2.0.1/ApkPatcher/Utils/Scan.py +120 -0
  35. rpatcher-2.0.1/ApkPatcher/Utils/__init__.py +0 -0
  36. rpatcher-2.0.1/ApkPatcher/__init__.py +0 -0
  37. rpatcher-2.0.1/LICENSE +22 -0
  38. rpatcher-2.0.1/PKG-INFO +266 -0
  39. rpatcher-2.0.1/README.md +244 -0
  40. rpatcher-2.0.1/RPatcher.egg-info/PKG-INFO +266 -0
  41. rpatcher-2.0.1/RPatcher.egg-info/SOURCES.txt +46 -0
  42. rpatcher-2.0.1/RPatcher.egg-info/dependency_links.txt +1 -0
  43. rpatcher-2.0.1/RPatcher.egg-info/entry_points.txt +3 -0
  44. rpatcher-2.0.1/RPatcher.egg-info/requires.txt +4 -0
  45. rpatcher-2.0.1/RPatcher.egg-info/top_level.txt +2 -0
  46. rpatcher-2.0.1/VERSION +1 -0
  47. rpatcher-2.0.1/pyproject.toml +64 -0
  48. rpatcher-2.0.1/setup.cfg +4 -0
@@ -0,0 +1,56 @@
1
+ # ————— 𝐀𝐍𝐒𝐈 𝐂𝐎𝐋𝐎𝐑𝐒 —————
2
+
3
+ class ANSI:
4
+ def __init__(self):
5
+
6
+ # =====🔸𝐀𝐍𝐒𝐈 𝐂𝐎𝐋𝐎𝐑𝐒🔸=====
7
+
8
+ self.ESC = '\033' # ( Octal )
9
+
10
+ # 𝐀𝐍𝐒𝐈 𝐂𝐎𝐋𝐎𝐑 ( 𝐁𝐎𝐋𝐃 = 𝟏𝐦 | 𝐃𝐀𝐑𝐊 = 𝟐𝐦 )
11
+
12
+ self.R = self.ESC + '[31;1m' # RED
13
+ self.G = self.ESC + '[32;1m' # GREEN
14
+ self.Y = self.ESC + '[33;1m' # YELLOW
15
+ self.B = self.ESC + '[34;1m' # BLUE
16
+ self.P = self.ESC + '[35;1m' # PURPLE
17
+ self.C = self.ESC + '[36;1m' # CYAN
18
+ self.W = self.ESC + '[37;1m' # WHITE
19
+
20
+ # 𝐁𝐑𝐈𝐆𝐇𝐓 𝐂𝐎𝐋𝐎𝐑
21
+
22
+ self.BR = self.ESC + '[91;1m' # BRIGHT RED
23
+ self.BG = self.ESC + '[92;1m' # BRIGHT GREEN
24
+ self.BY = self.ESC + '[93;1m' # BRIGHT YELLOW
25
+ self.BB = self.ESC + '[94;1m' # BRIGHT BLUE
26
+ self.BP = self.ESC + '[95;1m' # BRIGHT PURPLE
27
+ self.BC = self.ESC + '[96;1m' # BRIGHT CYAN
28
+ self.BW = self.ESC + '[97;1m' # BRIGHT WHITE
29
+
30
+ # 𝐎𝐓𝐇𝐄𝐑 𝐂𝐎𝐋𝐎𝐑
31
+
32
+ self.DG = self.ESC + '[32;2m' # DARK GREEN
33
+ self.GR = self.ESC + '[90;1m' # GRAY
34
+
35
+ # 𝟐𝟓𝟔 𝐂𝐨𝐥𝐨𝐫𝐬 ( 𝐄𝐒𝐂 + '[𝟑𝟖;𝟓;{𝐈𝐃}𝐦' ) [ 𝐈𝐃 - https://user-images.githubusercontent.com/995050/47952855-ecb12480-df75-11e8-89d4-ac26c50e80b9.png ]
36
+
37
+ self.PN = self.ESC + '[38;5;213;1m' # PINK
38
+ self.OG = self.ESC + '[38;5;202;1m' # ORANGE
39
+
40
+ # 𝐂𝐋𝐄𝐀𝐑 𝐂𝐎𝐃𝐄𝐒
41
+
42
+ self.CL = self.ESC + '[2K' # CLEAR LINE
43
+ self.CC = self.ESC + '[0m' # CLEAR COLOR
44
+
45
+ # 𝐌𝐎𝐑𝐄 𝐈𝐍𝐅𝐎 [ 𝐋𝐈𝐍𝐊 - https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 ]
46
+
47
+ # =====🔹𝐓𝐀𝐆🔹=====
48
+
49
+ self.S = f'{self.B}[{self.C}'
50
+ self.E = f'{self.B}]'
51
+ self.X = f'{self.B}[ {self.P}* {self.B}]'
52
+ self.FYI = f'{self.B}[ {self.P}FYI {self.B}]'
53
+ self.INFO = f'{self.B}[ {self.Y}INFO {self.B}]{self.C}'
54
+ self.WARN = f'{self.B}[ {self.Y}WARN {self.B}]{self.B}'
55
+ self.ERROR = f'{self.B}[ {self.R}ERROR {self.B}]{self.R}'
56
+ self.SUGGEST = f'{self.B}[ {self.Y}SUGGEST {self.B}]{self.C}'
@@ -0,0 +1,246 @@
1
+ from .CLI import parse_arguments
2
+ from .ANSI_COLORS import ANSI; C = ANSI()
3
+ from .MODULES import IMPORT; M = IMPORT()
4
+
5
+ from ApkPatcher.Utils.CRC import CRC_Fix
6
+ from ApkPatcher.Utils.Credits import Credits
7
+ from ApkPatcher.Utils.Scan import Scan_Apk
8
+ from ApkPatcher.Utils.Anti_Splits import Anti_Split
9
+ from ApkPatcher.Utils.Files_Check import FileCheck, __version__
10
+ from ApkPatcher.Utils.Decompile_Compile import Decompile_Apk, Recompile_Apk, FixSigBlock, Sign_APK
11
+
12
+ from ApkPatcher.Patch.CERT_NSC import Write_NSC
13
+ from ApkPatcher.Patch.Smali_Patch import Smali_Patch
14
+ from ApkPatcher.Patch.TG_Patch import TG_Smali_Patch
15
+ from ApkPatcher.Patch.Ads_Patch import Ads_Smali_Patch
16
+ from ApkPatcher.Patch.Pine_Hook import Pine_Hook_Patch
17
+ from ApkPatcher.Patch.Spoof_Patch import Patch_Random_Info
18
+ from ApkPatcher.Patch.Flutter_SSL_Patch import Patch_Flutter_SSL
19
+ from ApkPatcher.Patch.AES import Copy_AES_Smali, Patch_Algorithm
20
+ from ApkPatcher.Patch.Pairip_CoreX import Check_CoreX, Hook_Core
21
+ from ApkPatcher.Patch.Manifest_Patch import Fix_Manifest, Patch_Manifest, Permission_Manifest
22
+
23
+
24
+ def Clear():
25
+ M.os.system('cls' if M.os.name == 'nt' else 'clear')
26
+ Clear()
27
+
28
+
29
+ # ---------------- Install Require Module ---------------
30
+ required_modules = ['requests', 'r2pipe', 'asn1crypto', 'multiprocess']
31
+ for module in required_modules:
32
+ try:
33
+ __import__(module)
34
+ except ImportError:
35
+ print(f"{C.S} Installing {C.E} {C.OG}➸❥ {C.G}{module}...\n")
36
+ try:
37
+ M.subprocess.check_call([M.sys.executable, "-m", "pip", "install", module])
38
+ Clear()
39
+ except (M.subprocess.CalledProcessError, Exception):
40
+ exit(
41
+ f"\n{C.ERROR} No Internet Connection. ✘\n"
42
+ f"\n{C.INFO} Internet Connection is Required to Install {C.G} pip install {module}\n"
43
+ )
44
+
45
+
46
+ # ---------------- Check Dependencies ---------------
47
+ def check_dependencies():
48
+ try:
49
+ M.subprocess.run(['java', '-version'], stdout=M.subprocess.PIPE, stderr=M.subprocess.PIPE, check=True, text=True)
50
+ except (M.subprocess.CalledProcessError, FileNotFoundError):
51
+ if M.os.name == 'posix':
52
+ install_package('openjdk-17')
53
+ else:
54
+ exit(
55
+ f'\n\n{C.ERROR} Java is not installed on Your System. ✘\n'
56
+ f'\n{C.INFO} Install Java & Run Script Again in New CMD. ✘\n'
57
+ f'\n{C.INFO} Verify Java Installation {C.G} java --version\n'
58
+ )
59
+
60
+ if M.os.name == 'posix': install_package('aapt2')
61
+
62
+
63
+ # ---------------- Install Package ---------------
64
+ def install_package(pkg):
65
+ try:
66
+ result = M.subprocess.run(['pkg', 'list-installed'], stdout=M.subprocess.PIPE, stderr=M.subprocess.PIPE, text=True)
67
+ if pkg not in result.stdout:
68
+ print(f"{C.S} Installing {C.E} {C.OG}➸❥ {C.G}{pkg}...\n")
69
+ M.subprocess.check_call(['pkg', 'install', '-y', pkg])
70
+ Clear()
71
+ except (M.subprocess.CalledProcessError, Exception):
72
+ exit(
73
+ f"\n\n{C.ERROR} No Internet Connection. ✘\n"
74
+ f"\n{C.INFO} Internet Connection is Required to Installation {C.G}pkg install {pkg}\n"
75
+ )
76
+
77
+ check_dependencies()
78
+
79
+ F = FileCheck(); F.Set_Path(); F.F_D()
80
+
81
+ Date = M.datetime.now().strftime('%d/%m/%y')
82
+ print(f"{C.OG}{f'v{__version__}':>22}")
83
+
84
+ # Logo ( 🙏 )
85
+ b64 = """eJzVlc9LAkEUx8/Ov9DlMXgNzLAfeMlUSAQLETx4ELGlJEehnEPgQSrqUlFYdIroHNShixDRP1DQn1DaqUv+Cc3MzszOrFtUt96u+2O+n/fmvTe7LoCwsdIEGStNzsRj8WgkSoYXe9fsdwtFp15tEsfSp8n8phyYjZKCU11tNCHTWK5V2GhE+yIUCgF1DYFplIY9s0RLGdG56EsU5PTjRgLcyfIJMk1IQNcDiaUsLCUKyYV0XoUL4H8QErNLbJxNBCtA4FSOikGdOufBj/DYAQS1L72WYreH7CB5ak+iUzPTtHSvZH32LWcYGxsX2Yp7KdIwyI2KJNx1ZpgIZ5TCURqm3qAAkNKona5qn3pkkP1QCZSbnM5QkXDG2MQpWA+fq7IuyAA8lh2e3TPNbASfBHxRkVwZI7QPkpqqUs2OjcAWLqbERv0j5uIqt685UM9bKFjUb8Swu7MFr4eX71fn/Z1jGHZ3j+CjdzfY3uufHr31OvDycAbPN4/3T90sP/B7/uKgfuckcG9/JXy//8XtFz4WiqweTJFchTi8Jtmbtq0WnLqzsl4hmmj73BeLuXTe56/FVKXl/Pt++f6XB51988Mw6ByI6tvqQxIjc+trLUHUONDYGNHz2XIhnVzILZYzuVQmITr0CawgFWQ="""
86
+ logo = 'REVERSE | Telegram: @reverse_xk'
87
+ print(f"{logo} | {C.B}{Date}{C.CC}")
88
+ print("————————|——————————————————|—————————————————|——————————————|————")
89
+
90
+
91
+ # ---------------- Target All Classes Folder ---------------
92
+ def Find_Smali_Folders(decompile_dir, isAPKEditor, isPine_Hook):
93
+
94
+ dex_path = M.os.path.join(decompile_dir, "dex") if isAPKEditor else decompile_dir
95
+
96
+ smali_path = M.os.path.join(decompile_dir, "smali") if isAPKEditor else decompile_dir
97
+
98
+ if isPine_Hook:
99
+
100
+ classes_files = [file for file in M.os.listdir(dex_path) if file.startswith("classes") and file.endswith(".dex")]
101
+
102
+ return f"classes{len(classes_files) + 1}.dex"
103
+
104
+ else:
105
+
106
+ prefix = "classes" if isAPKEditor else "smali_classes"
107
+
108
+ folders = sorted([folder for folder in M.os.listdir(smali_path) if folder == "smali" or folder.startswith(prefix)], key=lambda x: int(x.split(prefix)[-1]) if x.split(prefix)[-1].isdigit() else 0)
109
+
110
+ return [M.os.path.join(smali_path, folder) for folder in folders]
111
+
112
+
113
+ # ---------------- Execute Main Function ---------------
114
+ def main():
115
+ args = parse_arguments()
116
+ isCoreX = args.Hook_CoreX
117
+ isFlutter = args.Flutter; isPairip = args.Pairip
118
+ Skip_Patch = args.Skip_Patch if args.Skip_Patch else []
119
+ isAPKEditor = args.APKEditor; isEmulator = args.For_Emulator
120
+
121
+ if isEmulator:
122
+ F.isEmulator()
123
+ F.F_D_A()
124
+
125
+ if args.Credits:
126
+ Credits()
127
+
128
+ apk_path = args.input or args.Merge
129
+
130
+ if not M.os.path.isfile(apk_path):
131
+ exit(
132
+ f"\n{C.ERROR} APK file '{apk_path}' not found. ✘\n\n"
133
+ f"\n{C.FYI}{C.G} Make Sure There Is 'No Extra Space' In The Folder/Apk Name In The Input Text. If Yes, Then Remove Extra Space & Correct It By Renaming It.\n"
134
+ )
135
+
136
+ if args.CA_Certificate:
137
+ isCert = [Cert for Cert in args.CA_Certificate if not M.os.path.isfile(Cert)]
138
+
139
+ if isCert:
140
+ exit(f"\n{C.ERROR} Not exist: {', '.join(isCert)}\n")
141
+
142
+ apk_path = Anti_Split(apk_path, args.Merge, isCoreX)
143
+
144
+ # ---------------- Set All Paths Directory ----------------
145
+ decompile_dir = M.os.path.join(M.os.path.expanduser("~"), f"{M.os.path.splitext(M.os.path.basename(apk_path))[0]}_decompiled")
146
+
147
+ build_dir = M.os.path.abspath(M.os.path.join(M.os.path.dirname(apk_path), f"{M.os.path.splitext(M.os.path.basename(apk_path))[0]}_Patched.apk"))
148
+
149
+ rebuild_dir = build_dir.replace('_Patched.apk', '_Patch.apk')
150
+
151
+ manifest_path = M.os.path.join(decompile_dir, 'AndroidManifest.xml')
152
+
153
+ if M.os.name == 'posix':
154
+ M.subprocess.run(['termux-wake-lock'])
155
+ print(f"\n{C.X}{C.C} Acquiring Wake Lock...\r")
156
+
157
+ start_time = M.time.time()
158
+
159
+ # ---------------- Scan & Decompile APK ---------------
160
+ Package_Name, isFlutter_lib, isPairip_lib = Scan_Apk(apk_path, isFlutter, isPairip)
161
+
162
+ Decompile_Apk(apk_path, decompile_dir, isEmulator, isAPKEditor, args.AES_Logs, args.Algorithm, args.Pine_Hook, Package_Name)
163
+
164
+ smali_folders = Find_Smali_Folders(decompile_dir, isAPKEditor, args.Pine_Hook)
165
+
166
+ # ---------------- Pine Hook ----------------
167
+ if args.Pine_Hook:
168
+ Pine_Hook_Patch(decompile_dir, isAPKEditor, args.Load_Modules, smali_folders)
169
+ else:
170
+ # ---------------- AES Logs Inject ----------------
171
+ if args.AES_Logs or args.Algorithm:
172
+ Copy_AES_Smali(decompile_dir, smali_folders, manifest_path, args.AES_S, args.Algorithm, isAPKEditor)
173
+
174
+ Permission_Manifest(decompile_dir, manifest_path, isAPKEditor)
175
+
176
+ # ---------------- Remove Ads ----------------
177
+ if args.Remove_Ads:
178
+ Ads_Smali_Patch(smali_folders)
179
+
180
+ # ---------------- Fake / Spoof Device Info ----------------
181
+ if args.Random_Info:
182
+ Patch_Random_Info(smali_folders, args.Android_ID)
183
+
184
+ # ---------------- TG Patch ----------------
185
+ if args.TG_Patch:
186
+ TG_Smali_Patch(decompile_dir, smali_folders, isAPKEditor)
187
+
188
+
189
+ # ---------------- Other Patch ----------------
190
+ if args.AES_Logs or args.Algorithm or args.Remove_Ads or args.Random_Info or args.Pine_Hook or args.TG_Patch:
191
+ Fix_Manifest(manifest_path, args.Spoof_PKG, args.Pine_Hook, Package_Name)
192
+ else:
193
+ if isFlutter and isFlutter_lib:
194
+ Patch_Flutter_SSL(decompile_dir, isAPKEditor)
195
+
196
+ # ---------------- Smali Patching / Hook CoreX ----------------
197
+ if isCoreX and isPairip and isPairip_lib and Check_CoreX(decompile_dir, isAPKEditor):
198
+ M.shutil.rmtree(decompile_dir)
199
+ exit(1)
200
+
201
+ Smali_Patch(decompile_dir, smali_folders, isAPKEditor, args.CA_Certificate, args.Android_ID, isPairip, isPairip_lib, args.Spoof_PKG, args.Purchase, args.Remove_SS, Skip_Patch, args.Remove_USB, isCoreX)
202
+
203
+ if isCoreX and isPairip and isPairip_lib:
204
+ Hook_Core(args.input, decompile_dir, isAPKEditor, Package_Name)
205
+
206
+ # ---------------- Patch Manifest & Write Network Config ----------------
207
+ Fix_Manifest(manifest_path, args.Spoof_PKG, args.Pine_Hook, Package_Name)
208
+
209
+ Patch_Manifest(decompile_dir, manifest_path)
210
+
211
+ Write_NSC(decompile_dir, isAPKEditor, args.CA_Certificate)
212
+
213
+ # ---------------- Recompile APK ----------------
214
+ Recompile_Apk(decompile_dir, apk_path, build_dir, isEmulator, isAPKEditor, Package_Name)
215
+
216
+ # ---------------- Fix CRC / Sign APK ----------------
217
+ if not isCoreX and isPairip and isPairip_lib or args.unsigned_apk:
218
+
219
+ if not isAPKEditor:
220
+ FixSigBlock(decompile_dir, apk_path, build_dir, rebuild_dir);
221
+
222
+ CRC_Fix(apk_path, build_dir, ["AndroidManifest.xml", ".dex"])
223
+
224
+ else:
225
+ Sign_APK(build_dir)
226
+
227
+ if M.os.path.exists(build_dir):
228
+ print(f'{C.S} Final APK {C.E} {C.G}︻デ═一 {C.Y}{build_dir} {C.G} ✔')
229
+
230
+ print(f"\n{C.CC}{'_' * 61}\n")
231
+
232
+ if not isCoreX and isPairip and isPairip_lib:
233
+ print(f'\n{C.FYI}{C.C} This is Pairip Apk So U Install {C.G}( Keep Apk Without Sign ) {C.C}in VM / Multi_App\n')
234
+
235
+ print(f'\n{C.S} Time Spent {C.E} {C.G}︻デ═一 {C.PN}{M.time.time() - start_time:.2f} {C.CC}Seconds {C.G} ✔\n')
236
+
237
+ print(f'\n{C.S} REVERSE {C.E}{C.P} @reverse_xk {C.G} ✔\n')
238
+
239
+ if M.os.name == 'posix':
240
+ M.subprocess.run(['termux-wake-unlock'])
241
+ exit(f"\n{C.X}{C.C} Releasing Wake Lock...\n")
242
+ exit(0)
243
+
244
+
245
+ if __name__ == '__main__':
246
+ main()
@@ -0,0 +1,350 @@
1
+ from .ANSI_COLORS import ANSI; C = ANSI()
2
+ from .MODULES import IMPORT; M = IMPORT()
3
+
4
+ from ApkPatcher.Utils.Files_Check import __version__
5
+
6
+
7
+ Tag = f"\n{C.CC}————|———————|————{C.G}•❀ {C.OG}Tag {C.G}❀•{C.CC}————|———————|————\n"
8
+
9
+ FE = f"{C.P}\n |\n ╰{C.CC}┈{C.OG}➢ {C.G}RPatcher"
10
+
11
+ EX = f"{FE} -i Your_Apk_Path.apk {C.OG}"
12
+
13
+
14
+ class CustomArgumentParser(M.argparse.ArgumentParser):
15
+ # ---------------- Error Handling ----------------
16
+ def error(self, message):
17
+ suggestion = ""
18
+ for action in self._actions:
19
+ if action.option_strings and any(option in message for option in action.option_strings):
20
+ if action.dest == 'input':
21
+ suggestion = (
22
+ f'\n{C.FYI}{C.G} Make Sure There Is "No Extra Space" In The Folder / APK Name In The Input Text. If Yes, Then Remove Extra Space & Correct It By Renaming It.\n\n'
23
+ f'\n{C.INFO} With Your Certificate Flag: {C.OG}-c {C.P}( Input Your pem/crt/cert Path ){EX}-c {C.Y}certificate.cert\n\n'
24
+ f'\n{C.INFO} If you are using an Emulator in PC Then Use Flag: {C.OG}-e{EX}-c {C.Y}certificate.cert {C.OG}-e\n'
25
+ )
26
+
27
+ elif action.dest == 'Merge':
28
+ suggestion = (
29
+ f'\n{C.INFO} Only Merge APK\n\n'
30
+ f'\n{C.INFO} Merge Extension {C.Y}( .apks/.xapk/.apkm )'
31
+ f'\n{FE}{C.OG} -m {C.G}Your_Apk_Path.apks\n'
32
+ )
33
+
34
+ break
35
+
36
+ exit(
37
+ f'\n{C.ERROR} {message}\n'
38
+ f'\n{suggestion}'
39
+ )
40
+
41
+ # ---------------- Print Help ----------------
42
+ def print_help(self):
43
+
44
+ super().print_help()
45
+
46
+ print(f"\n{C.INFO} RPatcher by REVERSE. Default patch is VPN & SSL Bypass. Other flags: {C.G}RPatcher -O{C.C}\n")
47
+
48
+ # ---------------- Other Patch ----------------
49
+ def Other_Patch(self):
50
+ print(
51
+ f"""\n{C.X}{C.C} Other Patch Flags Help ( Keep Sequence in Mind )
52
+
53
+ <Flags> {C.G}─•❀•❀ {C.C}Info Patch {C.G}❀•❀•─ {C.OG}
54
+
55
+ -A, {C.C}--AES_Logs {C.Y} ➸ {C.G}AES Logs Inject {C.OG}
56
+ -A2, {C.C}--Algorithm {C.Y} ➸ {C.G}Algorithm Logs Inject {C.OG}
57
+ -D, {C.C}--Android_ID {C.Y} ➸ {C.G}Hook Android ID for One Device Login Bypass {C.OG}
58
+ -f, {C.C}--Flutter {C.Y} ➸ {C.G}Flutter SSL Bypass {C.OG}
59
+ -l, {C.C}--Load_Modules {C.Y} ➸ {C.G}Path of Xposed & LSP Module {C.P}( Currently Not Supported XSharedPreferences Module ) {C.OG}
60
+ -p, {C.C}--Pairip {C.Y} ➸ {C.G}Pairip CERT SSL Bypass {C.OG}
61
+ -P, {C.C}--Purchase {C.Y} ➸ {C.G}Purchase / Paid / Price {C.OG}
62
+ -r, {C.C}--Random_Info {C.Y} ➸ {C.G}Per-install fake device profile (12 real models, 2023+) {C.OG}
63
+ -rmads, {C.C}--Remove_Ads {C.Y} ➸ {C.G}Bypass Ads {C.OG}
64
+ -rmss, {C.C}--Remove_SS {C.Y} ➸ {C.G}Bypass Screenshot Restriction {C.OG}
65
+ -rmusb, {C.C}--Remove_USB {C.Y} ➸ {C.G}Bypass USB Debugging {C.OG}
66
+ -pkg, {C.C}--Spoof_PKG {C.Y} ➸ {C.G}Spoof Package Detection {C.OG}
67
+ -pine, {C.C}--Pine_Hook {C.Y} ➸ {C.G}Pine Hook {C.OG}
68
+ -skip {C.C}[Skip_Patch ...]{C.Y} ➸ {C.G}Skip Specific Patches {C.P}( e.g. getAcceptedIssuers ) {C.OG}
69
+ -s, {C.C}--AES_S {C.Y} ➸ {C.G}Do U Want Separate AES.smali Dex {C.OG}
70
+ -t, {C.C}--TG_Patch {C.Y} ➸ {C.G}Telegram / Plus Patcher {C.OG}
71
+ -x, {C.C}--Hook_CoreX {C.Y} ➸ {C.G}Hook CoreX Flag: {C.OG}-p -x {C.P}( Only For [ arm64 ] )"""
72
+ )
73
+
74
+ user_input = input(f"\n\n{C.B}[ {C.P}* {C.B}] {C.C} Do See Example\n{C.G} |\n └──── {C.CC}~ y / Exit to Enter {C.G}$ : {C.Y}")
75
+
76
+ if user_input.lower() == "y":
77
+ print(
78
+ f"""\n{Tag.replace("Tag", "AES Logs Inject")}
79
+
80
+ {C.INFO} AES MT Logs Inject Flag: {C.OG}-A{EX}-A
81
+
82
+
83
+ {C.INFO} Do U Want Separate AES.smali Dex Use Flag: {C.OG}-A -s{EX}-A -s
84
+
85
+
86
+ {C.INFO} Algorithm Logs Inject Flag: {C.OG}-A2{EX}-A2
87
+
88
+ {Tag.replace("Tag", "Hook Android ID")}
89
+
90
+ {C.INFO} Hook Android ID For One Device Login Bypass Use Flag: {C.OG}-D {C.P}( Input Your Original 16 Digit Android ID ){EX}-D {C.Y}7e9f51f096bd5c83
91
+
92
+ {Tag.replace("Tag", "isFlutter / isPairip")}
93
+
94
+ {C.INFO} If APK is Flutter Then Use Additional Flag: {C.OG}-f{EX}-f
95
+
96
+
97
+ {C.INFO} If APK is Pairip Then Use Additional Flag: {C.OG}-p {C.P}( Without Sign APK Use Only in VM / Multi_App ){EX}-p
98
+
99
+
100
+ {C.INFO} If APK is Pairip Then Hook CoreX Use Additional Flag: {C.OG}-p -x {C.P}( Install Directly Only For [ arm64 ] ){EX}-p -x
101
+
102
+ {Tag.replace("Tag", "Spoof PKG / Device Info")}
103
+
104
+ {C.INFO} Spoof Package Detection Flag: {C.OG}-pkg {C.P}( Dex / Manifest / Res ){EX}-pkg
105
+
106
+ {C.INFO} Per-install Device Info Flag: {C.OG}-r{EX}-r
107
+
108
+ {C.INFO} Profile is created at first app launch and stays stable until uninstall or Clear data. {C.OG}
109
+
110
+
111
+ {C.INFO} Custom Android ID Flag: {C.OG}-r -D {C.P}( Overrides random Android ID ){EX}-r -D {C.Y}7e9f51f096bd5c83
112
+
113
+ {Tag.replace("Tag", "Pine Hook")}
114
+
115
+ {C.INFO} Pine Hook Flag: {C.OG}-pine -l {C.P}( Input Path of Xposed & LSP Module ){EX}-pine -l {C.Y}NoVPNDetect.apk just.trust.me.apk
116
+
117
+ {Tag.replace("Tag", "Bypass Ads / SS / USB")}
118
+
119
+ {C.INFO} Bypass Ads Flag: {C.OG}-rmads{EX}-rmads
120
+
121
+
122
+ {C.INFO} Bypass Screenshot Restriction Flag: {C.OG}-rmss{EX}-rmss
123
+
124
+
125
+ {C.INFO} Bypass USB Debugging Flag: {C.OG}-rmusb{EX}-rmusb
126
+
127
+ {Tag.replace("Tag", "isPurchase / Skip Patch")}
128
+
129
+ {C.INFO} Purchase / Paid / Price Flag: {C.OG}-P{EX}-P
130
+
131
+
132
+ {C.INFO} Skip Patch Flag: {C.OG}-skip{EX}-skip {C.Y}getAcceptedIssuers
133
+
134
+ {Tag.replace("Tag", "Telegram / Plus Patch")}
135
+
136
+ {C.INFO} Telegram / Plus Patch Flag: {C.OG}-t{EX}-t\n"""
137
+ )
138
+
139
+ else:
140
+ return
141
+
142
+
143
+ # ---------------- Parse Arguments ----------------
144
+ def parse_arguments():
145
+
146
+ args = M.sys.argv[1:]
147
+
148
+ if '-O' in args:
149
+ exit(CustomArgumentParser().Other_Patch())
150
+
151
+ if any(arg.startswith('-') for arg in args):
152
+ parser = CustomArgumentParser(description=f'{C.C}RPatcher v{__version__}')
153
+ else:
154
+ parser = M.argparse.ArgumentParser()
155
+
156
+ group = parser.add_mutually_exclusive_group(required=True)
157
+
158
+ group.add_argument(
159
+ '-i',
160
+ dest='input',
161
+ help=f'{C.Y}➸{C.G} Input APK Path...{C.C}'
162
+ )
163
+
164
+ group.add_argument(
165
+ '-m',
166
+ dest='Merge',
167
+ help=f'{C.Y}➸{C.G} Anti-Split ( Only Merge APK ){C.C}'
168
+ )
169
+
170
+ group.add_argument(
171
+ '-C',
172
+ dest='Credits',
173
+ action='store_true',
174
+ help=f'{C.Y}➸{C.G} Show Credits{C.C}'
175
+ )
176
+
177
+ additional = parser.add_argument_group(f'{C.OG}[ * ] Additional Flags{C.C}')
178
+
179
+ additional.add_argument(
180
+ '-a',
181
+ '--APKEditor',
182
+ action='store_true',
183
+ help=f'{C.Y}➸ {C.G}APKEditor ( Default APKTool ){C.C}'
184
+ )
185
+
186
+ additional.add_argument(
187
+ '-e',
188
+ '--For_Emulator',
189
+ action='store_true',
190
+ help=f'{C.Y}➸{C.G} If using emulator on PC then use -e flag{C.C}'
191
+ )
192
+
193
+ additional.add_argument(
194
+ '-c',
195
+ dest='CA_Certificate',
196
+ type=str,
197
+ nargs='*',
198
+ help=f"{C.Y}➸{C.G} Input Your HttpCanary / Reqable / ProxyPin etc. Capture APK's CA-Certificate{C.C}"
199
+ )
200
+
201
+ additional.add_argument(
202
+ '-u',
203
+ dest='unsigned_apk',
204
+ action='store_true',
205
+ help=f"{C.Y}➸{C.G} Keep Unsigned APK{C.C}"
206
+ )
207
+
208
+
209
+ # ---------------- Other Patch Flags ----------------
210
+ parser.add_argument(
211
+ '-A',
212
+ '--AES_Logs',
213
+ action='store_true',
214
+ help=M.argparse.SUPPRESS
215
+ )
216
+
217
+ parser.add_argument(
218
+ '-A2',
219
+ '--Algorithm',
220
+ action='store_true',
221
+ help=M.argparse.SUPPRESS
222
+ )
223
+
224
+ parser.add_argument(
225
+ '-D',
226
+ '--Android_ID',
227
+ type=str,
228
+ help=M.argparse.SUPPRESS
229
+ )
230
+
231
+ parser.add_argument(
232
+ '-f',
233
+ '--Flutter',
234
+ action='store_true',
235
+ help=M.argparse.SUPPRESS
236
+ )
237
+
238
+ parser.add_argument(
239
+ '-l',
240
+ '--Load_Modules',
241
+ type=str,
242
+ nargs='*',
243
+ help=M.argparse.SUPPRESS
244
+ )
245
+
246
+ parser.add_argument(
247
+ '-p',
248
+ '--Pairip',
249
+ action='store_true',
250
+ help=M.argparse.SUPPRESS
251
+ )
252
+
253
+ parser.add_argument(
254
+ '-P',
255
+ '--Purchase',
256
+ action='store_true',
257
+ help=M.argparse.SUPPRESS
258
+ )
259
+
260
+ parser.add_argument(
261
+ '-r',
262
+ '--Random_Info',
263
+ action='store_true',
264
+ help=M.argparse.SUPPRESS
265
+ )
266
+
267
+ parser.add_argument(
268
+ '-rmads',
269
+ '--Remove_Ads',
270
+ action='store_true',
271
+ help=M.argparse.SUPPRESS
272
+ )
273
+
274
+ parser.add_argument(
275
+ '-rmss',
276
+ '--Remove_SS',
277
+ action='store_true',
278
+ help=M.argparse.SUPPRESS
279
+ )
280
+
281
+ parser.add_argument(
282
+ '-rmusb',
283
+ '--Remove_USB',
284
+ action='store_true',
285
+ help=M.argparse.SUPPRESS
286
+ )
287
+
288
+ parser.add_argument(
289
+ '-pkg',
290
+ '--Spoof_PKG',
291
+ action='store_true',
292
+ help=M.argparse.SUPPRESS
293
+ )
294
+
295
+ parser.add_argument(
296
+ '-pine',
297
+ '--Pine_Hook',
298
+ action='store_true',
299
+ help=M.argparse.SUPPRESS
300
+ )
301
+
302
+ parser.add_argument(
303
+ '-skip',
304
+ dest='Skip_Patch',
305
+ nargs='*',
306
+ help=M.argparse.SUPPRESS
307
+ )
308
+
309
+ parser.add_argument(
310
+ '-s',
311
+ '--AES_S',
312
+ action='store_true',
313
+ help=M.argparse.SUPPRESS
314
+ )
315
+
316
+ parser.add_argument(
317
+ '-t',
318
+ '--TG_Patch',
319
+ action='store_true',
320
+ help=M.argparse.SUPPRESS
321
+ )
322
+
323
+ parser.add_argument(
324
+ '-x',
325
+ '--Hook_CoreX',
326
+ action='store_true',
327
+ help=M.argparse.SUPPRESS
328
+ )
329
+
330
+
331
+ Ext = ('.apk', '.apks', '.apkm', '.xapk')
332
+
333
+ fixed = []; start = None; Valid_Ext = False
334
+
335
+ for index, option in enumerate(args):
336
+ if option in ['-i', '-m', '-C']:
337
+ start, fixed = index + 1, fixed + [option]
338
+ elif start and (option.endswith(Ext) or M.os.path.isdir(option)):
339
+ fixed, start = fixed + [' '.join(args[start:index+1])], None
340
+ Valid_Ext = True
341
+ elif not start:
342
+ fixed.append(option)
343
+
344
+
345
+ if not Valid_Ext and M.sys.argv[1:2] != ['-C']:
346
+ print(f"\n{C.X}{C.C} Only Supported Extensions {C.G}{Ext}\n")
347
+
348
+ print(f"\n{C.S} Input Path {C.E} {C.OG}➸❥{C.Y}", *fixed, f"{C.CC}\n")
349
+
350
+ return parser.parse_args(fixed)
@@ -0,0 +1,34 @@
1
+ # ————— 𝐈𝐌𝐏𝐎𝐑𝐓 𝐌𝐎𝐃𝐔𝐋𝐄𝐒 —————
2
+
3
+ class IMPORT:
4
+ def __init__(self):
5
+
6
+ # ---------------- 𝐌𝐮𝐥𝐭𝐢𝐏𝐫𝐨𝐜𝐞𝐬𝐬 / 𝐌𝐮𝐥𝐭𝐢𝐏𝐫𝐨𝐜𝐞𝐬𝐬𝐢𝐧𝐠 ----------------
7
+ try:
8
+ mp = __import__('multiprocess')
9
+ except ImportError:
10
+ mp = __import__('multiprocessing')
11
+
12
+ # ————— 𝐋𝐢𝐛𝐫𝐚𝐫𝐢𝐞𝐬 𝐈𝐦𝐩𝐨𝐫𝐭 —————
13
+ self.re = __import__('re')
14
+ self.os = __import__('os')
15
+ self.sys = __import__('sys')
16
+ self.zlib = __import__('zlib')
17
+ self.json = __import__('json')
18
+ self.time = __import__('time')
19
+ self.shutil = __import__('shutil')
20
+ self.string = __import__('string')
21
+ self.zipfile = __import__('zipfile')
22
+ self.hashlib = __import__('hashlib')
23
+ self.base64 = __import__('base64')
24
+ self.binascii = __import__('binascii')
25
+ self.random = __import__('random')
26
+ self.argparse = __import__('argparse')
27
+ self.subprocess = __import__('subprocess')
28
+
29
+ # ————— 𝐄𝐱𝐭𝐫𝐚 𝐋𝐢𝐛𝐫𝐚𝐫𝐢𝐞𝐬 —————
30
+ self.Pool = mp.Pool
31
+ self.Manager = mp.Manager
32
+ self.cpu_count = mp.cpu_count
33
+ self.datetime = __import__('datetime').datetime
34
+