Open ecanja opened 7 years ago
It is possibly a bug in the ROM.
Can you please try what happen if you run these commands from terminal?
adb root
adb remount
It is possibly a bug in the ROM.
Definitely possible.
I'm still in the state of the hanging script and any adb commands don't do anything but hanging as well.
EDIT: Strg + C
in the Terminal gives:
Traceback (most recent call last):
File "main.py", line 531, in <module>
enable_device_writing(chosen_one)
File "main.py", line 219, in enable_device_writing
remount_check = subprocess.check_output([DEPS_PATH["adb"], "-s", chosen_device, "remount", "/system"]).decode("utf-8")
File "/usr/lib/python2.7/subprocess.py", line 567, in check_output
output, unused_err = process.communicate()
File "/usr/lib/python2.7/subprocess.py", line 791, in communicate
stdout = _eintr_retry_call(self.stdout.read)
File "/usr/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
return func(*args)
And now, adb root
(already ran as root) and adb remount
(successful) go through without failure.
Don't know if that is of any help...
@ecanja: Please try to reboot the phone, run the 2 commands (without running Tingle) to see what happens and post the ouput.
Ok, did that:
$ adb logcat
# lot of output, worked as usual
$ adb shell
shell@golden:/ $ exit
~$ adb root
restarting adbd as root
~$ adb remount
^C
~$ adb logcat
^C
~$ adb shell
^C
~$
The first command adb root
was ok, but adb remount
hang up. Moreover, the usual adb commands adb logcat
and adb shell
were fine before this, but got stuck afterwards.
Does this mean that adb remount
is not working on my phone and somehow crashes adb?
@ecanja: It is possible.
adb remount
remount the system partition as read-write.
Try this:
mount -o remount,rw /system
in Terminal (with root access) inside the phone.adb remount
(in this case it shouldn't do anything since it is already read-write).And see if it stuck.
I have no terminal installed, but I did this and it stuck:
$ adb shell
shell@golden:/ $ su
root@golden:/ # mount -o rw,remount,rw /system
root@golden:/ # exit
shell@golden:/ $ exit
$ adb root
restarting adbd as root
~$ adb remount
^C
~$
@ecanja: Try to update adb on your pc, just in case there is a problem in it, there should be version 1.0.36 if I'm not wrong.
I updated adb, but the problem remains. I guess, it's an issue with the ROM. Seems as if I need to go with XPosed for signature spoofing.
Nevertheless, thanks a lot for your help!
@ecanja: Probably I cannot fix it in the script if it is a ROM issue, but just for patching you can also do it from recovery. You just need to enter in recovery, mount the system partition, and then run Tingle on the pc.
Some ROMs / devices just don't let you remount /system in read-write mode via adb. I'm on a OnePlus X and no ROM I've put on it has allowed this to work.
Here is a workaround. Start in the tingle repo. You'll also need an su binary on your phone.
adb pull /system/framework/framework.jar ./input
python main.py # (then select item 2 to work with a local file)
adb push ./output/framework.jar /data
Then, either via adb shell or in a terminal on the device:
su
mount -o remount,rw /system
cp /data/framework.jar /system/framework/framework.jar
reboot
@georgedorn: The main problem isn't remounting, but it is the fact that the adb remount command freeze adb indefinitely and never return.
So, the only thing would be probably kill adb and re-try with a workaround. I will see what I can do.
@ecanja: Could you please post a bug report about adb remount to the ROM author and post a link of the bug report here?
Did so: https://github.com/NovaFusion/android_device_samsung_golden/issues/83.
Unfortunately, the issue tracker doesn't look like being very actively maintained.
@ecanja @georgedorn
Could you please try the latest version of Tingle, tell me if there is any improvement and post the log? When the command hang it should go on after 6 seconds, I would like to know if it works.
I don't know if my issue is the same.. But for me it crashes after "Remounting /system..."
MENU
1 - Patch file from a device (adb)
2 - Patch file from the input folder
> 1
*** OS: Linux 4.14.9-1-ARCH (linux)
*** Python: 3.6.4 (64 bit)
*** Mode: 1
*** Working dir: /tmp/Tingle-x2vr8_to
*** Selected device: 43f8c4790903
*** Automounting /system...
DEBUG: Already mounted
*** Pulling framework from device...
*** Device SDK: 25
*** Decompressing framework...
DEBUG: Decompressing framework.jar
*** Disassembling classes...
DEBUG: Disassembling framework/classes.dex
*** Patching...
*** Detected: Android 8.x / 7.x / 6.x (or LOS/CM 13-15)
*** Patching succeeded.
*** Reassembling classes...
DEBUG: Assembling out/classes.dex
WARNING: The reassembling has failed (probably we have exceeded the 64K methods limit)
but do NOT worry, we will retry.
*** Moving methods...
WARNING: Experimental code.
DEBUG: Disassembling framework/classes2.dex
*** Reassembling classes...
DEBUG: Assembling out/classes.dex
DEBUG: Assembling out/classes2.dex
*** Recompressing framework...
DEBUG: Compressing framework.jar
*** Copying the patched file to the output folder...
*** Rooting adbd...
DEBUG: adbd cannot run as root in production builds
*** Unlocked ADB: False
*** Remounting /system...
ERROR INFO
==========
Type: <class 'subprocess.CalledProcessError'>
Cmd: ['/usr/bin/adb', '-s', '43f8c4790903', 'shell', "su -c 'mount -o remount,rw /system /system && mount' | grep ' /system '"]
Return code: 1
Output: mount: '/system' not in /proc/mounts
Traceback (most recent call last):
File "./main.py", line 720, in <module>
enable_device_writing(SELECTED_DEVICE)
File "./main.py", line 365, in enable_device_writing
remount_check = safe_output_decode(safe_subprocess_run([DEPS_PATH["adb"], "-s", chosen_device, "shell", "su -c 'mount -o remount,rw /system /system && mount' | grep ' /system '"])) # Untested
File "./main.py", line 203, in safe_subprocess_run
return subprocess.check_output(command, stderr=subprocess.STDOUT)
File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/adb', '-s', '43f8c4790903', 'shell', "su -c 'mount -o remount,rw /system /system && mount' | grep ' /system '"]' returned non-zero exit status 1.
Any advice?
@Ociramma: It isn't the same problem, could you please open a separate issue (to avoid confusion)?
Ok, no problem.
I want to patch my phone (Samsung Galaxy S3 Mini with unofficial CM12.1) with Tingle and it seemed to work, but it didn't finish the process. This is how far I got in the (Linux) Terminal:
At this point, it stops going further, but it didn't crash. I'm not able to get a logcat (
adb logcat
in a different Terminal seems to hang as well and doesn't produce any output).Any idea what could cause this? And what to do to get around?