Skip to content

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

@valpackett

Description

@valpackett

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions