Huawei P9 doesn't show root folder in file explorer - Huawei P9 Questions & Answers

When I go to the "/" folder in any file explorer, there's nothing inside it. And when I type "sh /" or "ls" in Terminal Emulator it says "Permission denied". (Android 7, EMUI 5)
The phone is not rooted.
But my P8, even when it wasn't rooted, was able to show the root folder in file explorer and achieve the "sh /" or "ls" commands. Can I somehow check the root folder without rooting my phone?
Sorry for my bad English

Without root permissions you can only see few like ls storage, or sdcard, mnt
Or, you can see the root fron TWRP (half way to rooting the phone)

Related

[Q] What is terminal emulator?

Is this so i can push files through my phone, without having to do it on the computer? How does this work. Anyone have a link? I did a search and came up with nothing. Just wondering, thanks!
It's the same as a Terminal on a unix/linux box or for that matter, command line on a windows box.
Terminal emulator app will give you command line access to your (rooted) phone. You can then go into SU mode, as well.
Yes, you are correct, it will allow you to do things that an ADB shell would allow, from a computer.
You can download it from the market.
im sure that you might have known this already, but when you are using a terminal emulator, and you get root access (su), you really should follow the directions to the letter. if you make a mistake in the typing, it is possible that you could do some damage.
it is also recommended to not enter in terminal commands unless someone with more experience than you (based off their post number) reports success in completing the wanted task. so essentially, use the terminal at your own risk.
(all this is pulled from my previous post which you can find in my signature - "Terminal/adb shell commands")
Adb commands are completely different than terminal commands.
First enter "su" to get substitute user (the # sign)
Then enter "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system" to make the root r/w
to copy files use "cp" command
to move files use "mv" command
to remove files use "rm" command
to change file/dir permissions use "chmod"
to change directories use "cd" - "cd .." will bring you back one directory - "cd //" brings you back to root
to list files in the dir use "ls"
to read/mod/combine a file use "cat"
to edit a value use "echo"
to see running processes use "top"
to kill a process use "kill -9 PID#HERE"
ex) cp /sdcard/download/myapplication.apk /data/app/myapplication.apk
If you know any linux commands then you should know your way around terminal emulator. If you want i can give you more examples just let me know. Hope this helped
What does "cat" mean?
Oh my bad i didn't see it in there, all the times i lookedO sorry.
where could i get this app?
i couldnt find it on market using keyword "terminal", "terminal emulator" or even "adb terminal emulator"
bla.k.offee said:
where could i get this app?
i couldnt find it on market using keyword "terminal", "terminal emulator" or even "adb terminal emulator"
Click to expand...
Click to collapse
https://market.android.com/details?id=jackpal.androidterm&feature=search_result
Terminal Emulator Hell!!!!
I have wiped and restored more times tonight than I can count....HELP!!!! I have a very lean rom. So lean it that it has no file explorer and I don't want to install gapps. All I want to do is install Titanium Backup (the .apk file is on the root of my SD card) with the terminal emulator and I'll be all set. I have had all different error messages, and I'm more confused now then when I started this adventur, 6+ hours ago. Any help would be great.
hockeyfamily737 said:
I have wiped and restored more times tonight than I can count....HELP!!!! I have a very lean rom. So lean it that it has no file explorer and I don't want to install gapps. All I want to do is install Titanium Backup (the .apk file is on the root of my SD card) with the terminal emulator and I'll be all set. I have had all different error messages, and I'm more confused now then when I started this adventur, 6+ hours ago. Any help would be great.
Click to expand...
Click to collapse
I keep TB on the root of my sdcard named TB.apk. Then I go into terminal emulator (it is in most roms already).
su
cp /sdcard/TB.apk /data/app/TB.apk
Then I back out of TE and TB is installed. Any commands you type in TE are case sensitive. All file names are case sensitive and spaces do not work well. So if your TB apk is "Titanium Backup-1.3.3.apk", I would rename it to something without the spaces like Titanium_Backup-1.3.3.apk.
I rename it TB.apk because who wants to type all of that?
kyouko said:
(all this is pulled from my previous post which you can find in my signature - "Terminal/adb shell commands")
Adb commands are completely different than terminal commands.
First enter "su" to get substitute user (the # sign)
Then enter "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system" to make the root r/w
to copy files use "cp" command
to move files use "mv" command
to remove files use "rm" command
to change file/dir permissions use "chmod"
to change directories use "cd" - "cd .." will bring you back one directory - "cd //" brings you back to root
to list files in the dir use "ls"
to read/mod/combine a file use "cat"
to edit a value use "echo"
to see running processes use "top"
to kill a process use "kill -9 PID#HERE"
ex) cp /sdcard/download/myapplication.apk /data/app/myapplication.apk
If you know any linux commands then you should know your way around terminal emulator. If you want i can give you more examples just let me know. Hope this helped
Click to expand...
Click to collapse
Sent you a pm
#Root/Hack_Mod-Always®

Custom Recovery without Root?

I had previously unlocked my bootloader and was running CM6.1, but I had to go back to stock because my company's email app (Good for Enterprise) refuses access on rooted devices.
I would like to monkey around with different configurations to see if I can find a way to run Good on CM6.1. I don't want to do this if I have to reinstall everything if it doesn't work however.
So my question is this. I just want to get the Clockwork recovery on my N1 so I can back up the non-rooted OS and monkey around a little. Can this be done with ABD on a non-rooted device?
Gave it a shot, worked fine.
"fastboot flash recovery clockwork-image-name.img"
Good for Enterprise still runs, so it isn't looking at the recovery to determine rooted status.
Nevermind, clockwork didn't survive a reboot. Good news is I was able to get a backup first.
After installing recovery via fastboot, try removing the following files via adb:
/system/etc/install-recovery.sh
/system/recovery-from-boot.p
Sent from my Nexus One using XDA App
danger-rat said:
After installing recovery via fastboot, try removing the following files via adb:
/system/etc/install-recovery.sh
/system/recovery-from-boot.p
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
When I try to do this from the recovery, these files are not found, and adb can't see the device from the bootloader. If I boot into the OS, it will be too late - the recovery would be wiped by then and I am back to square one. I must be missing something.
Is there any way to pull the System partition and mount the .img file on my PC to do this? That sounds a little dangerous though
Just thought, you need root to delete the files.
You'd probably have to root, install recovery, then install a non-rooted ROM, but keep custom recovery...
Sent from my Nexus One using XDA App
This is what you need to do:
1) boot your device into the OS
2) download the rageagainstthecage binary and save it as rageagainstthecage in the /tools folder (in the android SDK)
3) plug your device to your computer
4) open a command prompt in the /tools directory
5) type adb devices to make sure your computer sees your device
6) push the rageagainstthecage binary to /data/local/tmp/ by typing adb push rageagainstthecage /data/local/tmp/rageagainstthecage
7) type adb shell to open a shell
8) change the permissions on the binary to allow it to run by typing chmod 700 /data/local/tmp/rageagainstthecage
9) navigate to the directory (cd /data/local/tmp) and execute the binary by typing ./rageagainstthecage
10) wait for it to run, and it will exit the shell
enter the following command at the prompt: adb kill-server
11) enter the following command at the prompt: adb start-server
12) open an adb shell again: adb shell
13) now you should have a temporary root shell. You should see a # instead of a $. if you still see the $, go back to step 9. You may have to do this a few times (I had to do it 3 times before I got root access)
14) now, mount the /system partition as r/w by typing mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
15) delete the two files: rm /system/etc/install-recovery.sh and rm /system/recovery-from-boot.p
16) mount the partition as r/o by typing mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
17) exit the shell
18) now flash your custom recovery
Awesome, thanks. I'll give it a shot later!
This worked flawlessly, thanks for the great writeup!
Santoro said:
This worked flawlessly, thanks for the great writeup!
Click to expand...
Click to collapse
Two things: First, don't forget that any update from Google always has those two files in it, so they will reappear after every update.
Second, I just reread your first post again. I think you should still be able to kepp root and have your company's email working. I think the problem was that you were using an AOSP-based ROM instead of a stock-based one. Follow the directions for rooting in my signature (the first part is essentially the same as what you just did to gain r/w access to the system partition via adb, the second part is copying su and Superuser.apk to the right directories). Root is essentially one additional file copied to your /system directory, so I believe your company's email will still work with root.
efrant said:
This is what you need to do:
1) boot your device into the OS
2) download the rageagainstthecage binary and save it as rageagainstthecage in the /tools folder (in the android SDK)
3) plug your device to your computer
4) open a command prompt in the /tools directory
5) type adb devices to make sure your computer sees your device
6) push the rageagainstthecage binary to /data/local/tmp/ by typing adb push rageagainstthecage /data/local/tmp/rageagainstthecage
7) type adb shell to open a shell
8) change the permissions on the binary to allow it to run by typing chmod 700 /data/local/tmp/rageagainstthecage
9) navigate to the directory (cd /data/local/tmp) and execute the binary by typing ./rageagainstthecage
10) wait for it to run, and it will exit the shell
enter the following command at the prompt: adb kill-server
11) enter the following command at the prompt: adb start-server
12) open an adb shell again: adb shell
13) now you should have a temporary root shell. You should see a # instead of a $. if you still see the $, go back to step 9. You may have to do this a few times (I had to do it 3 times before I got root access)
14) now, mount the /system partition as r/w by typing mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
15) delete the two files: rm /system/etc/install-recovery.sh and rm /system/recovery-from-boot.p
16) mount the partition as r/o by typing mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
17) exit the shell
18) now flash your custom recovery
Click to expand...
Click to collapse
Without unlock recovery i can install Amon RA?(‘fastboot oem unlock‘)In this way as u typed.
W3ber said:
Without unlock recovery i can install Amon RA?(‘fastboot oem unlock‘)In this way as u typed.
Click to expand...
Click to collapse
Not sure what you are asking.
If your bootloader is unlocked, you can use fastboot. Download the recovery image you want into the /tools directory of your SDK and rename it recovery.img. Open a command prompt in the same directory. Type fastboot devices to make sure fastboot sees you device. Then type fastboot flash recovery recovery.img and you are done.
If your bootloader is not unlocked, you can use flash_image, but you need root access. See attachments on how to get root if your bootloader is locked, and how to flash a custom recovery with a locked bootloader.
efrant said:
Two things: First, don't forget that any update from Google always has those two files in it, so they will reappear after every update.
Second, I just reread your first post again. I think you should still be able to kepp root and have your company's email working. I think the problem was that you were using an AOSP-based ROM instead of a stock-based one. Follow the directions for rooting in my signature (the first part is essentially the same as what you just did to gain r/w access to the system partition via adb, the second part is copying su and Superuser.apk to the right directories). Root is essentially one additional file copied to your /system directory, so I believe your company's email will still work with root.
Click to expand...
Click to collapse
I was using the Nexus One 2.2.1 stock image directly from Google. My problem is that the Good for Enterprise actively checks for root. Specifically if the Superuser.apk exists, it refuses to let me in and cites corporate policy.
Since getting my stock backup, I was free to experiment and I had some success getting Good running on CM 6.1. Taking clues from your earlier instructions, I used adb shell to rename su to su.bak and Superuser.apk to Superuserapk.bak on the phone, then rebooted. After the reboot, I don't have root anymore.
This is a compromise, but at least I don't have to give up that CM6 goodness just to use my corporate email. So far I have not seen any issues in CM6 resulting from not having root. In an emergency I can rename them the superuser files back using rageagainsthecage as you outlined but I probably won't do it often.
Thanks for the help!
Santoro said:
I was using the Nexus One 2.2.1 stock image directly from Google. My problem is that the Good for Enterprise actively checks for root. Specifically if the Superuser.apk exists, it refuses to let me in and cites corporate policy.
Since getting my stock backup, I was free to experiment and I had some success getting Good running on CM 6.1. Taking clues from your earlier instructions, I used adb shell to rename su to su.bak and Superuser.apk to Superuserapk.bak on the phone, then rebooted. After the reboot, I don't have root anymore.
This is a compromise, but at least I don't have to give up that CM6 goodness just to use my corporate email. So far I have not seen any issues in CM6 resulting from not having root. In an emergency I can rename them the superuser files back using rageagainsthecage as you outlined but I probably won't do it often.
Thanks for the help!
Click to expand...
Click to collapse
Just for your info, Superuser.apk does not give you root, it only manages the root permissions. If your corporate email application checks only for Superuser.apk, you could technically delete Superuser.apk and keep the su binary. Your would still have root, and your corporate email app would work. The su binary is what actually gives you root access. All that the Superuser.apk file does is manages the permissions for root access, i.e., it allows or denies applications from using the su binary. Everything would work fine (including all apps that require root) without Superuser.apk. HOWEVER, just as a warning, without Superuser.apk, you would have no control over which apps have root access...
I will have to put su back and see what happens. I may be recalling wrong, maybe it checks for su also...
I experimented a bit more and it looks for both files. Sorry for the confusion.

JB OTA Forgot to Update Superuser binaries but ES File Explorer has Root

I followed the steps here
http://forum.xda-developers.com/showthread.php?p=33774480
But I forgot to update the binaries... actually I did not know I had to click where I need to click in order to update the binaries. I opened SuperUser up and it never said I needed to update binaries like Supersu does. ES File Explorer and Voodoo OTA still has root. Anyway I can fix this issue?
I tried "RestoreRoot.zip" that was posted and it says:
"Have drivers installed, phone connected, and USB Debugging enabled in Develope
r Options."
4371 KB/s (380532 bytes in 0.085s)
failed to copy 'Superuser.apk' to '/system/app//Superuser.apk': Permission denie
d
/system/bin/sh: su: can't execute: Permission denied
"Rebooting..."
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),1009
(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt)
,3003(inet),3006(net_bw_stats)
If the above id shows 0 then you are rooted. Press any key to exit.
I have the same problem, either upgrade to 3.1.1 binaries and only has the voodoo root and titanium, we can do?
"Have drivers installed, phone connected, and USB Debugging enabled in Develope
r Options."
failed to copy 'su' to '/system/bin//su': Permission denied
failed to copy 'Superuser.apk' to '/system/app//Superuser.apk': Permission denie
d
Unable to chmod /system/bin/su: Operation not permitted
"Rebooting..."
Click to expand...
Click to collapse
ok, well then, i dont think its going to work, but here what ive done... it might help
Restored with vodoo OTA rootkeeper, saying that root is back ! but not really lol
I've had es file explorer already rooted, so, i just copied the binary files and reboot ... nada ! was having root permission but was denied everytime automaticaly, so i reeponned the es file explorer, and cannont be granted for root acces
i oppened up the super user app, and unavailable to acces root doing the update ......
superuser status was : rwxr-xr-x : conflict (showed in red) -binary : ok (showed in green) - path : ok (showed in green aswell)....
So, that is probably why it wont allow me root acces to succesfully re-update the su binary trough the native way of the superuser.apk
so here what i've done....
Re-used vodoo to reset the root to the old binairies (wich is actually enough for adb to work as root), i've then changed superuser.apk permissions that was actually resseted to :rw-r-x-r-- .... <--- WTF ????
So changed that to : rwxr-xr-x and then, i copied the su binary to the corect place, and boom, voila, was able to set binary permission and use it as usual .....
So my guess is if you guys wont have root on an explorer, adb will have with the old binairies restored from vodoo, so you should be able to change permissions to the /system/app/superuser.apk to : rwxr-xr-x and see if something magic occured that will let you update via superuser.apk in a native way so you wont need to copy/paste the binary manually !
But what i find odd is that you have a permissions denied !
did you tried it with the OLD binairies in place from voodoo directly inside adb shell
if you just type adb shell : ittl go in $ and if u type su (hit enter) you should now see the lasp part of command line protocol changing to : #
Right ?
then you should be able to change permissions of the superuser app ? right ?
or am i completely lost in the dust !?
Edit : well, if you want to keep root on an old leaked, its your thing, but i would recomand THIS tutorial instead cause you have a real ROM through OTA now.... dont know if it will change anything, but i followed this one !
Partial Root Restore
I was able to restore root to my phone after the 4.1.1 update using the information in this thread...
http://forum.xda-developers.com/showthread.php?t=1911261
Basically, if you had a root backup before the update, you may still have partial root on your phone.
To verify...
adb shell
su
If you find yourself at the # prompt, not all hope is lost!
:fingers-crossed:
Regained root on my Atrix using this instructions
http://forum.xda-developers.com/showthread.php?p=35905543#post35905543

[Q] Cannot access certain roms on my rooted htc one

Hello guys, i have a bit of a problem here.
Earlier last August I had a family friend root my HTC One for me, load up a few roms, and told me to test some out. Months and months later, I have some knowledge of ADB, test out tons of roms, and love my phone.
The issue is I STILL have these 3 roms on my phone, and I cannot for the life of me get rid of them!
now it's hard to explain exactly whats up, but I will do my best!
In recovery, which is currently CWM v 6.0.4.6, I hit -> install zip, choose zip from /sdcard and at the very bottom of the list I have
ARHD 12, Trickdroid, and ViperOne
I can NEVER find these with any explorer, cannot search for them, or find them anywhere on my device. Does anyone have any idea what I can do?
Also to help clarify, if I download a rom in say google chrome, I need to hit /0/ after I hit "choose zip from /sdcard" in order to find it under downloads.
Any help would be awesome. Sorry if this is in the wrong area, I don't post often.
katsock said:
In recovery, which is currently CWM v 6.0.4.6, I hit -> install zip, choose zip from /sdcard and at the very bottom of the list I have
ARHD 12, Trickdroid, and ViperOne
I can NEVER find these with any explorer, cannot search for them, or find them anywhere on my device. Does anyone have any idea what I can do?
Click to expand...
Click to collapse
I think the files are located in /data/media. You can find them with a root explorer (if not running as root, /data will just appear empty). Or you can use ADB (not a terminal emulator on your phone, that won't work). To see these files, you type:
Code:
adb shell ls /mnt/shell/emulated
To delete a file, you type:
Code:
adb shell rm "/mnt/shell/emulated/Some-Rom.zip"
FYI, /sdcard another directory, which links to another directory, etc., with the final location being /data/media/0. Most file-type data is stored in /data/media, but the files outside "0" aren't meant to be accessed directly. But since we still need access at times for various reasons, if you're using the ADB shell, you can see the contents of this folder by using the "magic" path "/mnt/shell/emulated".
fenstre said:
I think the files are located in /data/media. You can find them with a root explorer (if not running as root, /data will just appear empty). Or you can use ADB (not a terminal emulator on your phone, that won't work). To see these files, you type:
Code:
adb shell ls /mnt/shell/emulated
To delete a file, you type:
Code:
adb shell rm "/mnt/shell/emulated/Some-Rom.zip"
FYI, /sdcard another directory, which links to another directory, etc., with the final location being /data/media/0. Most file-type data is stored in /data/media, but the files outside "0" aren't meant to be accessed directly. But since we still need access at times for various reasons, if you're using the ADB shell, you can see the contents of this folder by using the "magic" path "/mnt/shell/emulated".
Click to expand...
Click to collapse
Thanks so much! it was in data/media! thank god I could stop going through each and every folder. I just got about 3 gigs back that I thought were filled up forever!

How can i mount a folder in sdcard?

Hi,
I want to backup my phone to my pc. Due to insufficient storage space, I decide to mount a sshfs folder to sdcard directory, and then, select the mounted folder as backup target.
The sshfs utility works good, and I can access the mounted directory with "adb shell".
But all apps can not detect the newly mounted directory. They just works on the old directory.
It seems like there are two folders bind on same path. The old one is on the original internal storage, and the new one is on the ssh remote server.
For example, if I mount the sshfs to `/sdcard/backup`, the "ES File Explorer" will just see the old folder in `/sdcard/backup`. If i create a file using "ES File Explorer", then it is done successful. The "ES File Explorer" can read and edit it, and other apps works too. But I can not see the newly created file using "adb shell". And the file does not shown in the remote server. If I umount /sdcard/backup, then the newly created file can be listed using "ls" in "adb shell".
And when the sshfs mounted, if I create the file using "touch" command in "adb shell", then the file appears on the remote server.
I have noticed that there are a lot of "sdcard" paths, so I may mount the sshfs to a wrong path. But I have tried these paths, none of them works:
```
/storage/emulated/0/backup
/data/media/0/backup
/sdcard/backup
```
Then, I uninstalled magisk, and try mount sshfs to `/storage/emulated/0/backup`. This time, all apps can detect the sshfs, all created files can be sent to remote server.
I have compared the mountpoint before and after enable magisk, it seems that magisk introduce a lot of mountpoint from `/dev/.d***/`. So am i mount the sshfs to a wrong path when magisk enabled?
And how can i mount to a right path?
OS: Android 11
Magisk: 23.0
Thank you!

Categories

Resources