I have a S-ON chacha. Software-Version 1.54.401.2. I tried to root the phone manually using zergRush and copying su to /system/bin but without success.
I connect to the phone via adb and I am able to successfully run the zergRush exploit on the phone and remount /system.
When I check for root and rw-access on /system this is what I get:
Code:
C:\zergRush\files>adb shell id
uid=0(root) gid=0(root)
C:\zergRush\files>adb shell df
...
/system: 266240K total, 255716K used, 10524K available (block size 4096)
...
C:\zergRush\files>adb shell mount
...
/dev/block/mtdblock3 /system yaffs2 rw,relatime 0 0
...
C:\zergRush\files>adb shell "ls -l /system"
...
drwxr-xr-x root shell 2011-11-01 06:55 bin
...
OK, I am root, have rw access to /system and there is some 10000K free, so lets copy su to /system/bin
Code:
C:\zergRush\files>adb push su /system/bin/su
failed to copy 'su' to '/system/bin/su': Out of memory
What's this? su is just 20K. But OK, I'll free up some more space and remove Maps.apk
Code:
C:\zergRush\files>adb shell ls -l /system/app/Maps.apk
-rw-r--r-- root root 7276623 2011-11-01 06:47 Maps.apk
C:\zergRush\files>adb shell rm /system/app/Maps.apk
rm failed for /system/app/Maps.apk, Directory not empty
Could somebody explain to me what is the case here? There is apparently enough space on /system and Maps.apk is not a directory. Where do these error messages come from?
I could not get a detailed description what S-ON means. But it seems to do things even a local root account cannot circumvent?
Could I solve these problems with an unlocked bootloader (which will not give me S-OFF)?
Thank you.
Afaik /system/bin/ has a restricted memory that you cannot free up by deleting anything from /system/apps/. Not sure about this though.
At the same time, unlocking the bootloader should probably work as zergRush is known to have issues with ChaCha.
Alex C. said:
At the same time, unlocking the bootloader should probably work as zergRush is known to have issues with ChaCha.
Click to expand...
Click to collapse
Thanks. After finally unlocking via htcdev.com it says "UNLOCKED" instead of "S-ON". zergRush works and writing to /system is possible.
Related
I have an Atrix on AT&T. Which means there's a bootloader encryption, and the carrier prevents non-market apk installations, which I have resolved since my phone is rooted and I have changed the boot animation already.
In order to do these things, I found Ghost Commander that would let me chmod my system directories...which is fine, but I feel kind of gimped that I can't do it on terminal.
Basically, what I want to be able to do is remount /system as rw using terminal.
This method doesn't work on both terminal and emulator on my phone. I have done:
Terminal:
Code:
sudo su
cd [sdk directory]
./adb devices
./adb shell
su
mount -o remount,rw -t ext3 /dev/block/mmcblk0p12 /system
and this is where I get stuck because I just get an Invalid argument error.
Here is some info about my sytem -
Usage: mount [-r] [-w] [-o options] [-t type] device directory
/dev/block/mmcblk0p12 /system ext3 ro,noatime,nodiratime, data=ordered 0 0
Been searching for the answers for a while now and tried all kinds of syntax, and now I'm here. What am I doing wrong? Thanks
Try:
mount -o remount,rw /system
The remount option automatically looks up the info for /system so you shouldn't have to bother with the details.
Hmm, I tried that thanks, and I still got 'Usage: mount [-r] [-w] [-o options] [-t type] device directory'
Hmm, I can't think of any reason that wouldn't work but it sounds like your phone is locked down pretty tight. Do you know if others have been able to remount /system?
What version of busybox do you have? Maybe you could try updating it. There are one or two free busybox updater apps on the market, if you can use them.
Have you tried just 'adb remount'?
Does the mount command require busybox? Do you have that properly installed?
That requires adbd itself to be run in root mode (this is different from being rooted on the phone) & you could do that only on insecure boot image. mount/unmount both happen to come from the busybox package. It would be hard to contemplate that Motorola actually changed that but nothing would stop them from. You could try updating the busybox utility onboard your phone. There is nothing with your usage of the command - it would work the same way on my Nexus S
I do have Busybox in /system/xbin. Thinking that maybe the xbin directory may need to have the rewrite permissions, I changed its permissions to 777 using the chmod command in phone Terminal. I did the remount command 'mount -o remount,rw -t ext3 /dev/block/mmcblk0p12 /system' in shell on the phone, and I THOUGHT I BRICKED! Haha, but it just turned off, and I rebooted to find that my button backlights were turned off...which I fixed with the brightness file.
Anyhow, I think I'll just use the chmod command because that seems to work. NeoA, I think you are right about the adbd to run in root mode, because I've seen discussions about that before.
Thanks for the feedback guys! At least I know I wasn't having syntax errors to say the least
So did it remount it as rw? The mount command was running before, just giving errors, but if it's running that should mean the permissions were ok.
try
Code:
busybox mount -o remount,rw /system
Fr4gg0r said:
try
busybox mount -o remount,rw /system
Click to expand...
Click to collapse
"mount: can't find /system/app in /proc/mounts"
but
Code:
busybox chmod 777 /system
is good enough for me, for now
marlasinger said:
Code:
busybox chmod 777 /system
is good enough for me, for now
Click to expand...
Click to collapse
Using chmod to change permissions won't actually give you rw access to the system partition since it won't change whether it's mounted as read-only or r/w. To be able to run the chmod command, the system must already have been mounted as r/w or you would have received a "Read-only file system" error. It must have gotten mounted as read/write when the remount command caused a reboot. You can see how /system is mounted by just typing "mount" in adb shell which will list all of the mounted partitions.
I have been googling far too long for an explanation of how to change the Read, Write, Execute options on individual system and data apps, when I remembed how fast someone usually answers my n00b questions here. It is not even clear to me what the differences are between the Write and Execute options. Can someone give me a link to a tutorial regarding this?
I did read the suggested threads, not helpful, and one I didn't understand about remounting the "entire /system partion to read-write".
thanks. d
To be more specific, I want to change the permission on certain system apps so I can uninstall them.
If your phone is rooted then you need a file manager that will remount the system partition as RW ( read write). Or you can use adb with your first command being adb remount.
Sent from my HTC Vision using XDA App
As ESKIMOn00b started to explain, the process of removing apps from the /system partition isn't a matter of individual file or folder permissions. Android secures the /system partition by preventing it from being written to under normal circumstances. If you have rooted your device then you have the ability to become the root user and run most if not all commands.
ADB provides a nice convenience command, 'adb remount', that will allow you to modify the /system partition. This command will only work if you have root user privileges but will unlock all of the apps for you to remove. Be careful though, you shouldn't just delete APK's directly out of /system/app as the package manager in Android might not keep up with your deletions. The best way to go about it (after remounting /system read/write) is to use the 'pm uninstall' command:
# pm uninstall com.myapp
To figure out the package names you can use 'pm list packages' and it will dump a huge list of all installed apps on the device. You'll need to hunt through and find the right ones. Most developers use obvious naming schemes such as Amazon's MP3 Store: com.amazon.mp3.
Hope this helps!
-ObsidianX
I have root and some recent experience w/the AndroidSDK. Using the SDK on my SonyEricsson phone:
c:\Users\dSpr> cd c:\AndroidSDK\tools
c:\AndroidSDK\tools>dir
{list}
c:\AndroidSDK\tools>adb devices
{0123456789ABCDEF device}
c:\AndroidSDK\tools>adb ls /system/app
{list}
c:\AndroidSDK\tools>adb shell
$ pm list packages
{list}
Note the shell command produces a $ instead of a #, but it still gives me a list.
But w/the $ and the command adb remount this:
$adb remount
adb remount
adb: permission denied.
If: tools>adb remount
This: remount failed; Operation not permitted
Same operation w/my QT7 and tools>adb shell produces a #. In fact, I don't even have to I don't have to use the adb remount command on my first uninstall, just
#rm /system/app/{app}.apk
#pm uninstall {package name}
I don't recall that I used the remount command between uninstalls-don't think I did or I would have noted it because I was keeping careful track of what I was doing. I can't test it because I have no apps on that device to uninstall.
Get the same result when using the terminal with the su command on the phone itself.
This is why I thought I had to change the Read/Write permissions.
What are you telling me that's not getting thru.
Thank you both very much.
d
to remount your system, you can try this
Code:
adb shell
Code:
su
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
hesperides said:
to remount your system, you can try this
Code:
adb shell
Code:
su
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
Click to expand...
Click to collapse
Nope. adb shell results in a $. su results in a su w/out the $ and after some (close to a minute) hesitation: Permission denied $
Debugging is on, as is mock locations. I am also having the exact same problem with my new enTourage Pocket eDGe, but it isn't that bothersome because it doesn't have a lot of garbage like the cell phone.
d
Figured out how to temp root my friends nextbook and get titanium backup working. Basically i followed this thread
http://forum.xda-developers.com/showthread.php?t=1173690
Download the htc flyer 16/32gb file and use that one. After you run the Run_ME_fre3vo_Root.bat File go to terminal and type su then hit enter.
You will get the notice that terminal has been granted superuser permission and you will be all set. Download titanium backup and install it .But remember everytime you reboot you will have to run the .bat again.
Thanks to Eugene373 for creating this tool. And thanks to #Teamwin
Htc Evo 4g rooted s-off cyanogenmod 7
Htc Flyer 16gb wifi rooted s-off Flyhigh rom
If i helped in anyway feel free to hit the thanks button
Or just use z4root. That's what I did on my Next6 while dumping the stock image.
By chance could I get a copy of the Next7's stock image?
temp root
tried z4root, i had no luck with gingerbread.
temp root
here is the system dump for nextbook7p
http://www.multiupload.com/6BY8BVS5BJ
Ok i followed the steps on there but im kinda confused on hoqw you managed to get it to work. The next book 7p always shows as a mountable disk when connected to my computer. On the link it says u need to change it to charge only. I tried ignoring that because the nexbook 7p cant charge via usb. But when i click run_me_fr3vo_root the terminal opens and it says wait-for-devices and thats all. So would u kind giving a more detailed explanation? Id aporeciate it alot cause ive been wanting to root this thing foreverrrrr (3 months lol)
krisf29 said:
Figured out how to temp root my friends nextbook and get titanium backup working. Basically i followed this thread
http://forum.xda-developers.com/showthread.php?t=1173690
Click to expand...
Click to collapse
This method did not work with my NextBook 7:
Code:
C:\RW_HTC_Flyer(1)>adb wait-for-device
C:\RW_HTC_Flyer(1)>adb push fre3vo /data/local/tmp
3188 KB/s (9796 bytes in 0.003s)
C:\RW_HTC_Flyer(1)>adb shell chmod 777 /data/local/tmp/fre3vo
C:\RW_HTC_Flyer(1)>adb shell /data/local/tmp/fre3vo
fre3vo by #teamwin
Please wait...
This device either does not support the fre3vo exploit, or this
account lacks permission to access the required devices.
An error has occured.
C:\RW_HTC_Flyer(1)>adb wait-for-device
C:\RW_HTC_Flyer(1)>adb shell /data/local/tmp/fre3vo
fre3vo by #teamwin
Please wait...
This device either does not support the fre3vo exploit, or this
account lacks permission to access the required devices.
An error has occured.
C:\RW_HTC_Flyer(1)>adb wait-for-device
C:\RW_HTC_Flyer(1)>adb shell sleep 5
C:\RW_HTC_Flyer(1)>adb remount
remount failed: Operation not permitted
C:\RW_HTC_Flyer(1)>adb shell mount -o rw,remount rootfs /
mount: Operation not permitted
C:\RW_HTC_Flyer(1)>adb shell mount -o remount,suid /dev/block/mmcblk0p29 /data
mount: Operation not permitted
C:\RW_HTC_Flyer(1)>adb shell rm -r /vendor
rm failed for /vendor, Read-only file system
C:\RW_HTC_Flyer(1)>adb shell mkdir /system/vendor
mkdir failed for /system/vendor, Read-only file system
C:\RW_HTC_Flyer(1)>adb shell mkdir /system/vendor/bin
mkdir failed for /system/vendor/bin, No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 777 /system/vendor
Unable to chmod /system/vendor: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 777 /system/vendor/bin
Unable to chmod /system/vendor/bin: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 4755 /system/bin/sh
Unable to chmod /system/bin/sh: Read-only file system
C:\RW_HTC_Flyer(1)>adb push sqlite3 /system/vendor/bin
failed to copy 'sqlite3' to '/system/vendor/bin': No such file or directory
C:\RW_HTC_Flyer(1)>adb push libext4_utils.so /system/lib
failed to copy 'libext4_utils.so' to '/system/lib/libext4_utils.so': Read-only f
ile system
C:\RW_HTC_Flyer(1)>adb push libfuse.so /system/lib
failed to copy 'libfuse.so' to '/system/lib/libfuse.so': Read-only file system
C:\RW_HTC_Flyer(1)>adb shell chmod 655 /system/lib/libext4_utils.so
Unable to chmod /system/lib/libext4_utils.so: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 000 /system/lib/libfuse.so
Unable to chmod /system/lib/libfuse.so: No such file or directory
C:\RW_HTC_Flyer(1)>adb push default.prop /default.prop
failed to copy 'default.prop' to '/default.prop': Read-only file system
C:\RW_HTC_Flyer(1)>adb push init.rc /init.rc
failed to copy 'init.rc' to '/init.rc': Read-only file system
C:\RW_HTC_Flyer(1)>adb push init.flyer.rc /init.flyer.rc
failed to copy 'init.flyer.rc' to '/init.flyer.rc': Read-only file system
C:\RW_HTC_Flyer(1)>adb shell chmod 755 /default.prop
Unable to chmod /default.prop: Read-only file system
C:\RW_HTC_Flyer(1)>adb shell chmod 755 /init.rc
Unable to chmod /init.rc: Read-only file system
C:\RW_HTC_Flyer(1)>adb shell chmod 755 /init.flyer.rc
Unable to chmod /init.flyer.rc: No such file or directory
C:\RW_HTC_Flyer(1)>adb push fixit /system/vendor/bin
failed to copy 'fixit' to '/system/vendor/bin': No such file or directory
C:\RW_HTC_Flyer(1)>adb push su /sbin
failed to copy 'su' to '/sbin/su': Permission denied
C:\RW_HTC_Flyer(1)>adb push su /system/vendor/bin
failed to copy 'su' to '/system/vendor/bin': No such file or directory
C:\RW_HTC_Flyer(1)>adb push busybox /system/vendor/bin
failed to copy 'busybox' to '/system/vendor/bin': No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 4755 /sbin
Unable to chmod /sbin: Read-only file system
C:\RW_HTC_Flyer(1)>adb shell chmod 4755 /sbin/su
Unable to chmod /sbin/su: Permission denied
C:\RW_HTC_Flyer(1)>adb shell chmod 4755 /system/vendor/bin/su
Unable to chmod /system/vendor/bin/su: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 4755 /system/vendor/bin/fixit
Unable to chmod /system/vendor/bin/fixit: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 4755 /system/vendor/bin/busybox
Unable to chmod /system/vendor/bin/busybox: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell chmod 755 /system/vendor/bin/sqlite3
Unable to chmod /system/vendor/bin/sqlite3: No such file or directory
C:\RW_HTC_Flyer(1)>adb shell /system/vendor/bin/busybox --install -s /system/ven
dor/bin
/system/vendor/bin/busybox: not found
C:\RW_HTC_Flyer(1)>adb shell rm -r /system/vendor/bin/ls
rm failed for /system/vendor/bin/ls, No such file or directory
C:\RW_HTC_Flyer(1)>adb shell rm -r /system/vendor/bin/reboot
rm failed for /system/vendor/bin/reboot, No such file or directory
C:\RW_HTC_Flyer(1)>adb shell rm -r /system/vendor/bin/chmod
rm failed for /system/vendor/bin/chmod, No such file or directory
C:\RW_HTC_Flyer(1)>adb shell rm -r /system/vendor/bin/chown
rm failed for /system/vendor/bin/chown, No such file or directory
C:\RW_HTC_Flyer(1)>adb install Superuser.apk
5818 KB/s (196640 bytes in 0.033s)
pkg: /data/local/tmp/Superuser.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\RW_HTC_Flyer(1)>adb install androidterm.apk
6039 KB/s (92780 bytes in 0.015s)
pkg: /data/local/tmp/androidterm.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\RW_HTC_Flyer(1)>adb shell ln -s /system/vendor /vendor
link failed File exists
C:\RW_HTC_Flyer(1)>adb wait-for-device
C:\RW_HTC_Flyer(1)>adb shell sync
C:\RW_HTC_Flyer(1)>pause
Press any key to continue . . .
Same here. I tried all of the methods that I could come across on the web with no luck. You would think that it would be a way to root the original factory rom and just flash the device with the rooted rom. That seems to be the only way.
pls help me to get it rooted
i tried Zroot and gingerbreak without sucess
after i tried superoneclick
without sucess
i have a bextbook next8P
pls help
I recently watched a video on YouTube on how to root the HTC Amaze. I followed the directions and unlocked the bootloader successfully but when I ran the ZergRushTempRoot.bat to root it, I got the following:
C:\Zerg rush root>adb wait-for-device
C:\Zerg rush root>adb push zergRush /data/local/
1328 KB/s (21215 bytes in 0.015s)
C:\Zerg rush root>adb shell chmod 777 /data/local/zergRush
C:\Zerg rush root>adb shell rm /data/local/tmp/*sh
C:\Zerg rush root>adb shell /data/local/zergRush
[**] Zerg rush - Android 2.2/2.3 local root
[**] (C) 2011 Revolutionary. All rights reserved.
[**] Parts of code from Gingerbreak, (C) 2010-2011 The Android Exploid Crew.
[+] Found a GingerBread ! 0x00017118
[*] Scooting ...
[*] Sending 149 zerglings ...
[*] Sending 189 zerglings ...
[-] Hellions with BLUE flames !
C:\Zerg rush root>adb wait-for-device
C:\Zerg rush root>adb shell sleep 1
C:\Zerg rush root>adb remount
remount failed: Operation not permitted
C:\Zerg rush root>adb shell mount -o rw,remount rootfs /
mount: Operation not permitted
C:\Zerg rush root>adb shell mount -o remount,suid /dev/block/mmcblk0p29 /system
mount: Operation not permitted
C:\Zerg rush root>adb shell chmod 4755 /system/bin/sh
Unable to chmod /system/bin/sh: Read-only file system
C:\Zerg rush root>adb push ./su /system/bin
failed to copy './su' to '/system/bin/su': Read-only file system
C:\Zerg rush root>adb push ./su /system/bin
failed to copy './su' to '/system/bin/su': Read-only file system
C:\Zerg rush root>adb push ./busybox /system/bin
failed to copy './busybox' to '/system/bin/busybox': Read-only file system
C:\Zerg rush root>adb shell chmod 4755 /system/bin
Unable to chmod /system/bin: Read-only file system
C:\Zerg rush root>adb shell chmod 4755 /system/bin/su
Unable to chmod /system/bin/su: No such file or directory
C:\Zerg rush root>adb shell chmod 4755 /system/bin/su
Unable to chmod /system/bin/su: No such file or directory
C:\Zerg rush root>adb push ./Superuser.apk /system/app
failed to copy './Superuser.apk' to '/system/app/Superuser.apk': Read-only file
system
C:\Zerg rush root>adb install ./androidterm.apk
2904 KB/s (92780 bytes in 0.031s)
pkg: /data/local/tmp/androidterm.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\Zerg rush root>adb wait-for-device
C:\Zerg rush root>adb shell sync
C:\Zerg rush root>pause
Press any key to continue . . .
If anyone can help me get this phone rooted, I would appreciate it.
Thanks,
George
[email protected]
root htc amaze 4g
i am in canada. useing mobilicity on this phone. i am also facing same problem. i am also waiting for root. after i readable my indian language. thanks
anybody plz help me.
Hello,
Thank you for this post. I also have the exact same issue.
Similar to kapil1878, I am also on Mobilicity in Canada.
Same issue here! Amaze t-mobile.
rooting
having the same problem about rooting. t-mobile usa
remount fails
So, one thing at a time.
First off remount fails. Why? Lets look at the script. I've numbered the lines for reference:
1 :cd %:h
2 adb wait-for-device
3 adb push zergRush /data/local/
4 adb shell chmod 777 /data/local/zergRush
5 adb shell /data/local/zergRush
6 adb wait-for-device
7 adb shell sleep 1
8 adb remount
9 adb shell mount -r -w -o remount rootfs /
10 adb shell mount -o remount,suid /dev/block/mmcblk0p29 /system
11 adb shell chmod 4755 /system/bin/sh
12 adb push ./su /system/bin
13 adb push ./su /system/bin
14 adb push ./busybox /system/bin
15 adb shell chmod 4755 /system/bin
16 adb shell chmod 4755 /system/bin/su
17 adb shell chmod 4755 /system/bin/su
18 adb push ./Superuser.apk /system/app
19 adb install ./androidterm.apk
20 adb wait-for-device
21 adb shell sync
22 pause
Line 8 is what fails first, probably causing a chain reaction of failures. This is because there's a critical spot on the device we need to write to that we can't write to for some reason.
I executed:
adb devices
The above command provides the serial numbers of all connected Android devices. I needed this for the next command which was:
adb -s [put serial number here] shell
This gave me access to the command line on the device. Then I executed:
mount
The above command tells you what file systems are active and usable, i.e. file systems that are mounted and ready for action. I think "file system" in this case may be synonymous with partition.
Now... looking up the remount command in the reference material shows that it is supposed to (and this is cut from the manual) :
adb remount - remounts the /system partition on the device read-write
However the result from our mount command a minute ago shows this for the /system mount. Note that there's a bunch of crap I've cut out but we are only interested in /system for now, anyway:
rootfs / rootfs ro,relatime 0 0
.
.
.
/dev/block/mmcblk0p29 /system ext4 ro,relatime,barrier=1,data=ordered 0 0
.
.
.
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
So... guessing based on my previous Unix experience, ro probably means that this partition is mounted read only. That means we have to find a way to remount it "rw". Problem is that I can't figure out what the command is. We already know remount doesn't work.
Here are some of my attempts:
$ mount -t ext4 -o rw,relatime,barrier=1,data=ordered /dev/block/mmcblk0p29 /system
mount -t ext4 -o rw,relatime,barrier=1,data=ordered /dev/block/mmcblk0p29 /system
mount: Operation not permitted
$ mount -t ext4 -o remount,rw,relatime,barrier=1,data=ordered /dev/block/mmcblk0p29 /system
mount -t ext4 -o remount,rw,relatime,barrier=1,data=ordered /dev/block/mmcblk0p29 /system
mount: Operation not permitted
Now, then. We don't have permissions require to execute remount and for mount we get the above. The only thing I can think of at this point is that I need to elevate the permissions of the user I am logged in as. Anybody know how to do that on Android? How do I know who I am logged in as? Is there more than one user even?
everyone should check out the thread below, Binary100100 does an excellent job in explaining how to root...
http://forum.xda-developers.com/showthread.php?t=1426179?referrerid=922386
Hi
I have a new Android device, it's not any of the ones that have their own forum.
More specifically it runs Android 11 on top of a 4.19.193 Rockchip BSP kernel.
I need to read one or two specific files but these files are only readable by root.
I have ADB shell access.
What I do want to acheive:-
Temporarily have an ability to copy a file that's readable only by root, this could be by some GUI app that copies files, as long as the copy is readable by normal user, running commands as root, copy a partition to an image file, export to a desktop machine and read it there. Any one of these would get me that file.
What I don't want to do:-
I don't want to permanently modify the device, unlock the bootloader, put su into /system or anything like that.
Does anyone know of a rooting app that can give me temporary root access but then doesn't actually change the system?
thanks
To get temporary super-user ( AKA root ) rights on an Android's device shell all you have to do is to find a suitable su binary and copy it onto Android's filesystem.
A: To run Android shell commands with super-user right from within the shell on desktop computer ( AKA Command Prompt ) you have to run within desktop computer shell
Code:
adb devices
adb push <LOCATION-OF-SUITABLE-SU-BINARY-ON-PC-HERE> /data/local/tmp/
what will 1. connect the Android device to your desktop computer and 2. upload the su binary in the Android device temporary directory always available for the user.
B: Then, in desktop computer shell type
Code:
adb shell "cd /data/local/tmp & chmod 776 su"
what makes the su binary executable: its ownership by default is set to shell.
C: Then in desktop computer shell type
Code:
adb shell "ls -l"
what will show you content and permissions on recently uploaded files.
D:
To apply a series of Android shell commands what require super-user rights you now would run
Code:
adb shell
export PATH=/data/local/tmp:$PATH"
su -c "<SHELL-CMD-HERE>"
....
su -c "<SHELL-CMD-HERE">
exit
BTW:
When in an Android shell another process like su gets started then this spawned process runs as a child process means it inherits most of the parent process attributes.
adb push allowed me to send the file
Code:
adb push su /data/local/tmp/
su: 1 file pushed. 1.2 MB/s (11640 bytes in 0.009s)
but the adb shell command is failing
Code:
adb shell "cd /data/local/tmp & chmod 776 su"
chmod: su: No such file or directory
if I then log in over adb I don't seem to have permissions to do anything in data
Code:
adb shell
ls -al
drwxrwx--x 47 system system 4096 2022-09-02 16:31 data
cd data
ls -al
ls: .: Permission denied
additionally, I thought that su would need the suid bit set
Does chmod 766 acheive that?
oh this works
Code:
adb shell
cd /data/local/tmp
ls -al
total 18
drwxrwx--x 2 shell shell 3452 2022-09-02 16:32 .
drwxr-x--x 4 root root 3452 2022-07-27 03:04 ..
-rw-rw-rw- 1 shell shell 11640 2022-09-02 16:29 su
Code:
chmod 776 su
ls -al
total 18
drwxrwx--x 2 shell shell 3452 2022-09-02 16:32 .
drwxr-x--x 4 root root 3452 2022-07-27 03:04 ..
-rwxrwxrw- 1 shell shell 11640 2022-09-02 16:29 su
Code:
adb shell
export PATH=$PATH:/data/local/tmp
su
su: setgid failed: Operation not permitted
The device has separate boot_a, boot_b, dtbo_a, dtbo_b partitions.
If I could be reasonably sure that booting a boot partition from a similar device (I have one) would pick up the dtb from this device then I think I could be reasonably confident of not frying anything, I might try and boot it from fastboot.