Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
valpackett opened this issue Apr 25, 2019 · 1 comment
Open

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

valpackett opened this issue Apr 25, 2019 · 1 comment

Comments

@valpackett
Copy link

valpackett commented Apr 25, 2019

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! We accept bounties via Bountysource.

@lgommans
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants