ale5000-git / tingle

Tingle - Android patcher
http://forum.xda-developers.com/showthread.php?t=3438764
GNU General Public License v3.0
160 stars 11 forks source link

Support for system-as-root devices in recovery mode #47

Open valpackett opened 5 years ago

valpackett commented 5 years ago

Modern devices use system-as-root, so the framework can be in /system/systemwhile in the recovery at least. I've been doing this:

diff --git i/main.py w/main.py
index bfa95c9..01850e4 100755
--- i/main.py
+++ w/main.py
@@ -428,7 +428,7 @@ def brew_input_file(mode, files_list, chosen_one):
         safe_copy(os.path.join(SCRIPT_DIR, "input", "framework.jar"), os.path.join(TMP_DIR, "framework.jar"))
         safe_copy(os.path.join(SCRIPT_DIR, "input", "build.prop"), os.path.join(TMP_DIR, "build.prop"))
     else:
-        safe_copy("/system/framework/framework.jar", os.path.join(TMP_DIR, "framework.jar"))
+        safe_copy("/system/system/framework/framework.jar", os.path.join(TMP_DIR, "framework.jar"))

 def decompress(file, out_dir):
@@ -590,7 +590,7 @@ if mode == 1:
 import patches.sig_spoof
 patch_instance = patches.sig_spoof.Patch()
 files_list = patch_instance.get_files_list()
-files_list.append(["/system", "build.prop"])
+files_list.append(["/system/system", "build.prop"])

 brew_input_file(mode, files_list, SELECTED_DEVICE)

@@ -737,7 +737,7 @@ if mode == 1:
     print_(" *** Pushing changes to the device...")
     try:
         if not DEBUG_PROCESS:
-            output = safe_subprocess_run([DEPS_PATH["adb"], "-s", SELECTED_DEVICE, "push", "framework.jar", "/system/framework/framework.jar"])
+            output = safe_subprocess_run([DEPS_PATH["adb"], "-s", SELECTED_DEVICE, "push", "framework.jar", "/system/system/framework/framework.jar"])
             debug(safe_output_decode(output).rstrip())
     except subprocess.CalledProcessError:
         e = sys.exc_info()[1]
@@ -748,7 +748,7 @@ if mode == 1:
             subprocess.check_call([DEPS_PATH["adb"], "-s", SELECTED_DEVICE, "reboot", "recovery"])
             subprocess.check_call([DEPS_PATH["adb"], "-s", SELECTED_DEVICE, "wait-for-device"])
             enable_device_writing(SELECTED_DEVICE)
-            subprocess.check_output([DEPS_PATH["adb"], "-s", SELECTED_DEVICE, "push", "framework.jar", "/system/framework/framework.jar"])
+            subprocess.check_output([DEPS_PATH["adb"], "-s", SELECTED_DEVICE, "push", "framework.jar", "/system/system/framework/framework.jar"])
         else:
             raise
         del e
@@ -759,6 +759,6 @@ print_(" *** All done! :)")

 print_(os.linesep + "Your original file is present at "+BACKUP_FILE)
 if mode != 3:
-    print_(os.linesep + "If your device bootloop, please run this command on the pc when the connected device is inside recovery:" + os.linesep + "adb push \""+BACKUP_FILE+"\" /system/framework/framework.jar")
+    print_(os.linesep + "If your device bootloop, please run this command on the pc when the connected device is inside recovery:" + os.linesep + "adb push \""+BACKUP_FILE+"\" /system/system/framework/framework.jar")
 else:
     print_(os.linesep + "Now you should replace the file on your system with the patched file in the output folder.")
diff --git i/patches/sig_spoof.py w/patches/sig_spoof.py
index 3b91333..47c41e4 100755
--- i/patches/sig_spoof.py
+++ w/patches/sig_spoof.py
@@ -20,4 +20,4 @@ class Patch(sys.BasePatch):
         pass

     def _set_files_list(self):
-        self.files.append(["/system/framework", "framework.jar"])
+        self.files.append(["/system/system/framework", "framework.jar"])

but proper auto-detection would be better of course :)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/73344509-support-for-system-as-root-devices-in-recovery-mode?utm_campaign=plugin&utm_content=tracker%2F43052892&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F43052892&utm_medium=issues&utm_source=github).
lgommans commented 2 years ago

Want to back this issue? Post a bounty on it!

Would this make it work on the Samsung S10e? That uses system-as-root with magisk in recovery if I understand what I did to root my phone correctly. I don't know what kind of bounty value would be appropriate but I can definitely post something if this would allow me to add sig spoofing and thus get rid of google services in favor of µG.

It seems that this repository is currently broken since like Android 9, not sure if we also need to change a ton of other stuff and this is futile, or if this would be one of just a handful of things to be done to make it work again for Android 11. In the latter case I would think it's worth it trying to get there.