Windows 10 Powershell root permissions - Google Pixel 3 XL Questions & Answers

I'm coming from a long time being on Windows 7 and regular shell. I'm trying to transition to powershell but cannot find a way to get root permission to android /system via ADB script. This worked formally:
adb shell su -c "mount -o rw,remount /system"
This no longer works. When trying to set chmod or copy systemui.apk to system in bash script I get "Read Only file system".
Any help with this would be extremely helpful and I would be grateful. I've googled and googled and nothing seems to work.

Well, kind of cheating but you could put. cmd.exe /c in front of it. May need to quote the rest.

I am assuming you right clicked and ran power shell as administrator then input your commands?

I always just type cmd before doing anything to switch back over to traditional command prompt for the rest of the session.

Tulsadiver said:
I'm coming from a long time being on Windows 7 and regular shell. I'm trying to transition to powershell but cannot find a way to get root permission to android /system via ADB script. This worked formally:
adb shell su -c "mount -o rw,remount /system"
This no longer works. When trying to set chmod or copy systemui.apk to system in bash script I get "Read Only file system".
Any help with this would be extremely helpful and I would be grateful. I've googled and googled and nothing seems to work.
Click to expand...
Click to collapse
You may already know that in Windows settings you can revert to the old CMD window instead of PS if you like, and also add a right-click context menu item to "open a new command window here" which is handy. You can easily find both these tips online. BUT I'm not sure if Windows has anything to do with your issue... I think this is due to Android security and the kernel. I ran into this earlier trying to modify contents in the Program folder. Terminal with su, nor root file explorers can change permissions either. There are a couple of threads discussing this this on XDA. The jist of it was that the kernel would have to be modified and I don't know of any custom kernels that have been (or whether it is possible). I know it was requested for EX Kernel but I never saw a follow up.

I appreciate all the responses. I've tried so many things I'm just a little worn out. I believe I'll just abandon my ADB mod Installer for now. My Zip method is better anyway (in my opinion) but it would be nice to still have the ADB Installer method working in those cases where TWRP isn't working.

Related

help changing boot screen

Hey all, ive been trying to change my boot screen to the haters gonna hate one for a few days now but cant seem to get it to work at all, i have full root and tried to the fastboot method and recovery/adb method. no matter what it stays the same as the one i had originally, i never get errors when trying to push the files if someone can give me instructions for dummies haha or another method id really appreciate it sorry for being a noob at all this.
I had the same problem
First of all, what rom are you using? Different rooms pull from different places. I might be able to help you out. If you are running cyan6, try this:
Adb reboot recovery
Adb remount (make sure it remounts. Maybe also do adb root to make sure.)
Adb push blahblah.zip /system/customize/resource/bootanimation.zip
Adb push blahblah.zip /system/media/bootanimation.zip
Adb push blahblah.zip /data/local/bootanimation.zip
If you want sound, push that to the same locations. Make sure there is only one of each file in each folder. Then, to check,
Adb reboot
Hope this helps
oh yeah sorry i should have included that i am on evios 1.2 beta 2 rom
I'm not familiar on where to place boot on this rom. Try all three locations I suggested. System customize resource. System media. Data local. Tell me if it works out.
I had this animation on EViO. I just pushed it from my desktop to system/media. Worked fine for me.
how do you push it from the desktop? i tried all 3 methods posted above and none worked. i had the file in the android sdk tools folder though...also whenever i try to do adb remount i get "remount failed:invalid argument" and adb root gives me "error:closed" i tried killing adb and restarting but no luck
This might be an obvious question, but do you have USB debugging enabled on your phone? Under Setting>Applications>Development
You arent going to be able to push anything if you can't get ADB running first.
yeah debugging has been enabled the whole time
ok have you been in recovery mode?
try typing
adb shell
su (make sure #comes up.)
exit (retype until you get back to the tools directory)
then do the push commands to system media, system customize resource, and data local.
Just use this program. Its as easy as it gets.
http://forum.xda-developers.com/showthread.php?t=701295
dkdude36 said:
First of all, what rom are you using? Different rooms pull from different places. I might be able to help you out. If you are running cyan6, try this:
Adb reboot recovery
Adb remount (make sure it remounts. Maybe also do adb root to make sure.)
Adb push blahblah.zip /system/customize/resource/bootanimation.zip
Adb push blahblah.zip /system/media/bootanimation.zip
Adb push blahblah.zip /data/local/bootanimation.zip
If you want sound, push that to the same locations. Make sure there is only one of each file in each folder. Then, to check,
Adb reboot
Hope this helps
Click to expand...
Click to collapse
Putting sound in boot animation doesn't work with cm6. Just to clarify. No one has been able to get it to work unless you found something out to make it work please share as I have hates going to hate also and want to use haters everywhere mp3 and is perfect for it.
Sent from my PC36100 using XDA App
yeah i have also been in recovery mode every time i tried to run a command prompt for adb...i tried that when i hit adb shell i get # but when i type su after the # it says "/sbin/sh: su: not found"
mount: mounting /dev/block/mtdblock4 on /system failed: Device or resource busy
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
thats what i get when in command prompt when i try to use the program you just posted above
Want a easier way? Use root explorer and copy and paste. Works for my every time. It's in the market. And root explore you can manually turn writeable on and off to move it into system. It's on the top right of screen in root explorer when you go into system folder.
Edit: the command you are tying to put in enables you to push and pull in the system folder. Root explore you can just click a button.
Sent from my PC36100 using XDA App
Good idea
Root explorer works most of the time. If you have the cash, go ahead. You should make site out posted though.
/sbin/sh: reboot: not found
been trying to use adb and i keep on getting that....any of you know a fix?

Rooting with Gfree HELP!

Okay, I'm a complete noob and I'm following these instructions (http://forum.xda-developers.com/wiki/index.php?title=HTC_Vision#Rooting_the_G2) using Gfree I believe.
I finished downloading the SDK File Manager and all the .zip folders that were mentioned on the site. However, I am stuck at the first temp root step. It says I can either enter in the command via cmd window or a different terminal. I chose a cmd window because I already have that and know how to use.
I run Windows 7, so I simply type cmd in the search bar to pull up a cmd window. I then "cd desktop" and then "cd gfree_temp-root" because it says to navigate to that folder. However, when I enter in the first command, my cmd window tells me this "adb is not recognized as an internal or external command, operable program or batch file". Does anyone know what I have to do?
Also, do I have to install Eclipse and an ADT plug-in to root my phone? And is anyone available right now to chat and walk this complete noob through this????
You're fine, just make sure your android sdk with adb is in your system path, in Win7 find it in ctrl panel/sys and security/system -> advanced system settings on the left, then advanced tab, environment variables at the bottom. In there in the bottom text window, find Path, edit it, go to the end of the path line and if there isnt already add a ; to the end of the line then paste in the full path to your android sdk where adb is - for me someandroidsdkpath\platform-tools
Alright, bumping into a new problem. I found an alternative way to run adb through another guide on the forum. Downloaded adb.exe and this is what I do.
Pull up a cmd window and then cd to the folder that contains the adb.exe, and then I copied all the files that needed to be push on the wiki page that needed to be push into that same folder. Howeverr, I am getting permission denied.
I got adb to recognize my device and all, but don't understand why permission is being denied.
EDIT: While I am waiting for a reply, I went ahead and did what the previous user told me to do. Now I can use adb through my cmd window. I navigate to the window of the file but I still get permission denied. What's going on?
LGS1231 said:
Alright, bumping into a new problem. I found an alternative way to run adb through another guide on the forum. Downloaded adb.exe and this is what I do.
Pull up a cmd window and then cd to the folder that contains the adb.exe, and then I copied all the files that needed to be push on the wiki page that needed to be push into that same folder. Howeverr, I am getting permission denied.
I got adb to recognize my device and all, but don't understand why permission is being denied.
EDIT: While I am waiting for a reply, I went ahead and did what the previous user told me to do. Now I can use adb through my cmd window. I navigate to the window of the file but I still get permission denied. What's going on?
Click to expand...
Click to collapse
Hmmm, are you in adb shell running the commands? ie a $ prompt?
the prompt at the point you send the push command would look like (for Windows): c:\myrootfileshere> adb push somefiles /sdcard/wherever
No, I am in a cmd window.
This what is looks like:
C:\User\XXXX\Desktop\gfree_temp-root> adb push su /sdcard/su ... I would then get "failed to copy 'su' to '/sdcard/su': Permission denied
Even if I wanted to use adb shell, I would get this:
C:\User\XXXX\Desktop\gfree_temp-root>adb shell
$ adb push su /sdcard/su
adb: permission denied
LGS1231 said:
No, I am in a cmd window.
This what is looks like:
C:\User\XXXX\Desktop\gfree_temp-root> adb push su /sdcard/su ... I would then get "failed to copy 'su' to '/sdcard/su': Permission denied
Even if I wanted to use adb shell, I would get this:
C:\User\XXXX\Desktop\gfree_temp-root>adb shell
$ adb push su /sdcard/su
adb: permission denied
Click to expand...
Click to collapse
Alrighty then try adb devices (not in the shell) and just verify it actually shows your phone, it won't show 'PHONE' but it's either going to show something or not.
Next, make sure the sdcard is mounted for the phone and not usb disk mode for the pc
Another thought, make sure there isnt a loose 'adb.exe' in the folder, we want to use the one ref'd from androidsdk\platform-tools
All of that failing, mount the SD card.. copy/paste the file(s) to to SD card.. unmount SD card.. continue as if you pushed it to the SD card
WHOOHOOO! I am rooted! I had to turn off the USB transfer thing and it all worked!!!! THANKS SO MUCH!
Nice bro! If I helped at all and if you wouldn't mind, hit the thanks
No problem!
thanks and happy flashing!

can not mount system in read-write mode using adb without recovery mode

I wanted to change my device model, so I copied build.prop from another mobile to my mobile. I am already rooted. But unfortunately I did not change the o.s. from gingerbread to froyo in build.prop ( I have android 2.2 FROYO) When I rebooted, there were many errors. It is now showing no sim card. Mobile network search gives error. Effectively, I can not use the mobile. Terminal emulator, X-plore etc. stopped working. Only Rom toolkit free version works and astro file manager works. Other programs are forcefully closed. Needles to say, I must replace new build.prop with new one.
Using adb I can only pull files but can not write as it is in read only mode.
adb root and adb remount works only if you are in recovery mode ? Y mobile does not have any custom recovery so when I boot in recovery mode it hangs.
Superuser has installed su in system\bin directory. But from adb shell I can use su also. It gives permission denied error. Hence I can not remount the system.
I have read similar threads and found that on some mobiles adb root or adb shell su works but on some not.
I am using Vista 32 bit with admin rights, still can not use root in adb.
Please tell me, how can I mount system read-write. I can not install root explore as google play and even internet is not working.
Please help.
maheshchavan said:
Using adb I can only pull files but can not write as it is in read only mode.
Click to expand...
Click to collapse
activate USB debugging then in console
Code:
adb shell
su
mount -o rw,remount /dev/block/mmcblk0p1 /system
adb push build.prop /system/build.prop
check where is your build.prop
ruscan.calin said:
activate USB debugging then in console
Code:
adb shell
su
mount -o rw,remount /dev/block/mmcblk0p1 /system
adb push build.prop /system/build.prop
check where is your build.prop
Click to expand...
Click to collapse
OMG ruscan.calin i COULD KISS YOU! I had tried to change my OG EVO 4G's buildprop file to another phone so that I could purchase & download an incompatible Google Play app. However after I restarted the phone wouldn't start! It would boot into my rooted HTC EVO 4G Android 2.3.3 and HTC Sense 2.1 but it would get stuck on the wallpaper with just the notification bar at the top and all buttons would be frozen. However I noticed when I plugged in my phone to my computer via usb the computer recognized it. I always keep my phone with USB debugging enabled so I thought I should be good right? I have spent the last 4 hours trying to install and setup adb with no real previous experience with it. I am familiar with dos from years ago and that helped me as it's basic procedure, commands, etc. Then I found out how to install the HTC drivers which I needed and then download the Android SDK with adb that's included which many guides show easily. I started the command prompt (cmd), typed my adb devices command and hurray it showed my phone! I connected and quickly navigated to the build.prop system folder! Luckily when I changed the file I made a bak backup and left it in the same folder. Now the main issue was figuring out how to change the naming of the files which I did via usual adb commands (mv build.prop.bak build.prop). But then to no avail I couldn't get it to write due to it being a system read only folder! Arg! Then I found your post on here, above, and typed it in simply leaving out the adb push portion and replacing that with the mv file command instead and first changing the name of the bad file and then replacing the bak file as the good copy! I exited back to the adb main and unplugged my phone. Moment of truth and man was everything flashing through my head at once! I booted up and YESSSSSSSSSSSSSS, it worked! I went back into root explorer and got rid of the offending leftovers and I've learned my lesson! I just don't want to think about what would have happened if I hadn't found this post. Thank you and if anyone else makes this hug mistake let me know and maybe I can help. Moral of the story don't mess with the build.prop or any system folder unless you know what you're doing! Thanks again!
Quick Guide to Fix Android "build.prop" Issues:
1. Find and download USB drivers for your phone by model or type (HTC EVO 4G's HTC Fastboot drivers): http://downloads.unrevoked.com/HTCDriver3.0.0.007.exe
2. Download and install Android SDK and choose adb: http://developer.android.com/sdk/index.html
Guide: http://htcevohacks.com/htc-evo-hacks/how-to-install-android-sdk-and-adb-drivers-for-htc-evo-4g/
3. Run a command prompt from the "c:/program files/android/android-sdk/platform-tools/" directory. I had to copy the command prompt to get it to open there but sometimes a right-click action will do it. The guide below will help just navigate down to "Using ADB" and skip the rest.
Guide: http://www.howtogeek.com/114667/how...y-default-move-almost-any-app-to-the-sd-card/
4. Once you open the command prompt and you're in the "c:/program files/android/android-sdk/platform-tools/" foler type "adb devices" and your device should appear. If it does move on to next step.
5. Then type adb shell and use the ls command to see directories. Then you'll need to navigate to the system folder by typing "cd system" and then type "ls" to look around in the directory (similar to "dir" in DOS). You should now see the bad build.prop file.
6. You'll need to rename the file or push a correct version. First you need to use the "adb shell" command again and then "su" and finally "mount -o rw,remount /dev/block/mmcblk0p1 /system" to make the directory writable (see ruscan.calin post above for additional info).
Note: I only had to rename my build.prop as I already had my old one in the same system folder. You may have to copy the bad build.prop to your computer, edit it and then push it back to the same system directory. These directions are only for renaming files in the same folder. For the info on how to copy the file to your computer and push it back to your phone go to step *10 below or use the guide below it.
7. I already had the bad build.prop in the system directory with my old one which I had named build.prop.bak. If you have this too simply rename by changing the name first of the bad file to anything by typing "mv build.prop build.prop.bad" or similar.
8. Next rename the build.prop.bak to build.prop by typing "mv build.prop.bak build.prop". Everything should go smoothly and move onto the next step.
9. Finally, If no error messages are found, simply type "adb reboot" or "adb shell reboot" (Depending which version of ADB you have). You should be done, your phone will reboot like normal (working, lol) and everything should be working again! YAY!
*10. To copy the build.prop to your phone type "adb pull /system/build.prop c:\" and the file should be placed in the main c:/ directory on your computer. Navigate to the root (c:/) directory and then right click and "open with" the "build.prop" file using a notepad or other file editor. Then use the text editor (Notepad, etc) to change back what you originally changed to mess everything up. There is tons of stuff on the net to let you know what to fill back in depending on your phone model/type. Or it's possible to get a previous version from an old Nandroid backup or similar. Save the changed text file and make sure its named the same "build.prop" and make sure it's still in the root directory (If you're having issues on this step or just want more insight check out the guides and threads below for more help).
Guide 1: http://androidforums.com/admire-all...p-computer-not-phone-using-root-explorer.html
Guide 2: http://www.modaco.com/topic/328943-quick-guide-to-modifying-buildprop-with-adb/
Guide 3: http://forums.androidcentral.com/sp...-replaced-build-prop-phone-wont-start-up.html
*11. We've already made the directory writable in step 6 so we simply need to push the file back to the phone. If any error message appear re-do step 6 to make writable again. Otherwise push the modified file back to the phone by typing "adb push c:\build.prop /system/". Back to step 9 above! Yay!
If anyone wants to help cleanup this quick guide or make any changes feel free. I just wanted something so that if anyone else has this issue they won't have to worry or search forever to find a solution. OMG it's 2:30AM, to bed... I ride! LOL
Enjoy,
5th :highfive:
THANK YOU!!! Totally saved me today.
One thing that I noticed. After pushing the correct build.prop, I had to fully power down, then turn back on my Razr for it to load up the fixed build.prop.
error message,Help please
Hello, when i am going to mount and change the permission i am getting constant error od device not found or sh:not found.
What to do?Help me please?
jigarpattani said:
Hello, when i am going to mount and change the permission i am getting constant error od device not found or sh:not found.
What to do?Help me please?
Click to expand...
Click to collapse
What step are you on? What phone do you have? More info please?
i am have problem whit my pantech flex i need to use the build.prop.bak but when i type the su it stay in blank do nothing any ideas pls help
ehy there hope someone can help me...i have an archos 97b platinum, messed up with build.prop. So i pulled out and restored but can't push in any way. I have a cwm installed, tablet rooted but i alwais got "permission denied" at push command. Other error is operation not permitted" if i try remount command from adb. i can do mount -o rw,remount /dev/block/mtdblock7 /system but after that push still give me permission denied.
any suggestion?
http://imgur.com/FDLp4fl
i open a 2nd cmd, give the mount -o rw,remount /dev/block/mtdblock7 /system , and system is now rw, but from the first cmd when i give "push build.prop /system (or /system/build.prop) it will always return me permission denied
help
dev.block
i want to view to dev/block using adb shell #
eg . what block is boot.img
what block is recovery.img
what block is system.img
what block is cache.ing
adb shell getprop mtd is not work . Pls Help Me & sent to mail [email protected]

KFHD 8.9 Help, Please

I rooted my KFHD 8.9, installed the Play Market, Go Launcher HD, and a few other things. Everything went smoothly...until I decided to install TSF Shell 3d. I moved it to system/app, changed permissions, and rebooted. Now, TSF is stuck in a loop and I can't access ES File Explorer long enough to delete it from the device. When I try using Android Commander, it shows "No Root" and I'm not very experienced at ADB. Is there some way to get this off my device so it's usable again?
When I boot up, it boots normally, then before I can unlock the lockscreen, I get "TSF Shell has Stopped" with a button below it to ok the message. When I tap it, it goes away for a split second, then comes right back...over and over.
Any tips or advice would be greatly appreciated. Thanks.
(I posted this here because I did not see a Q and A or Help section that was KFHD 8.9 specific. If it needs to be moved, feel free and I apologize.)
couple of things to try. if you can access the pull down menu go to more settings, applications then find tsf shell and clear defaults. reboot.
if that doesn't work reboot to recovery and do a factory reset.
adb reboot recovery.
I will try the adb reboot recovery option. I can't get into anything on the device itself long enough to do anything. Also, I didn't even set TSF as default home. I'm thinking (the way adb is acting), that I don't have full root privileges. When I try to delete the file using adb, I get a permission denied error.
slim6596 said:
I will try the adb reboot recovery option. I can't get into anything on the device itself long enough to do anything. Also, I didn't even set TSF as default home. I'm thinking (the way adb is acting), that I don't have full root privileges. When I try to delete the file using adb, I get a permission denied error.
Click to expand...
Click to collapse
Have you tried:
Code:
adb shell su -c "rm /path/to/TSF.apk"
...replacing "/path/to/TSF.apk" with the actual path to the actual name of the TSF app you want deleted? Just be sure to leave the quotes around the command or it may not work.
soupmagnet said:
Have you tried:
Code:
adb shell su -c "rm /path/to/TSF.apk"
...replacing "/path/to/TSF.apk" with the actual path to the actual name of the TSF app you want deleted? Just be sure to leave the quotes around the command or it may not work.
Click to expand...
Click to collapse
I tried adb shell su -c rm/system/app/TSF Shell 3D
"permission denied" and then "device not found" when I tried editing the pathname. What am I missing? The path to the Kindle?
slim6596 said:
I tried adb shell su -c rm/system/app/TSF Shell 3D
"permission denied" and then "device not found" when I tried editing the pathname. What am I missing? The path to the Kindle?
Click to expand...
Click to collapse
There is a space between the 'rm' command and the path. Also you need to get the exact name of the file you want removed...
Code:
adb shell su -c "ls /system/app"
And again, don't forget the quotes...meaning leave them there.
"Is" or "rm"?
........and thanks for trying to help me out. I really appreciate it.
slim6596 said:
"Is" or "rm"?
........and thanks for trying to help me out. I really appreciate it.
Click to expand...
Click to collapse
'ls' is the list command. Use it to list the contents of either the '/system/app' directory or the '/data/app' directory to find the exact name of the 'apk' that is causing problems, then use the 'rm' (remove) command to get rid of it.
I got it to work. TSF is gone (yahoo!). So now I get to start over. What I finally did was to do a total restore using KFFirstAide. Thanks you guys for pitching in and helping a newb. I appreciate it to no end.

[Q&A][Help] So you want to be a dev?

This is a thread that will allow you to ask specific questions and get some help with any dev work you may be attempting.
This will be a community effort between enewman17, loserskater, stratatak7, and myself. It would be great if other devs want to join in.
Acceptable questions
"I am trying to recompile X using APK Tool and I get this error. What am I doing wrong?".
"I am trying to flash the ROM I just built and I keep getting a status 0 error. Any thoughts?".
Unacceptable questions
"How do I compile/decompile apks?"
"How do I mod a kernel"
Theming questions go here.
Thread Rules
Do not post unless you have searched the thread.
Only post specific questions.
Only post long sections of code using the code or hide tags.
Your question may not be answered immediately. Be patient.
Use the thanks button (even if you don't get the answer you want).
Many thanks to kennyglass123 for the sticky!
Re: So you want to be a dev?
Just wanted to comment about questions.
The more info the better!
Bad comment: "I can't get X mod to work."
Better: "I'm trying to get X mod to work, and settings keeps FCing. Here's my modified files and a logcat."
Sent from my SAMSUNG-SGH-I747
Anyone feel free to PM me and I'll help you get the ball rolling if you feel your question does not meet thread criteria and you're looking to start development. I realize everyone has to start somewhere. Just be prepared for work.
mine
Now that we have thoroughly thanked each other, maybe someone will stop by with some questions. :silly:
upndwn4par said:
Now that we have thoroughly thanked each other, maybe someone will stop by with some questions. :silly:
Click to expand...
Click to collapse
LOL. I sure hope so.
For those of you reading this, feel free to ask any questions you have about Android development-related modification. I'm sure between the four of us and anyone else who wants to help out that knows what they are doing will know. I'm happy to help out with anything I can.
How do you double the hours in a day so you have enough time to actually do this stuff
Seriously though, this is a great thread and nice to see 4 of the top devs working together and willing to help.
If I ever do find the time I'm sure I'll be back.
Sent from my SGH-I747 using xda premium
jde984 said:
How do you double the hours in a day so you have enough time to actually do this stuff
Click to expand...
Click to collapse
A (somewhat) valid question: For me, it requires a very understanding wife and sleep deprivation.
______________
OK, now let's keep this thread clean and on topic. Thanks!
See in my sig a guide how to decompile apks, edit, and recompile apks! link: http://forum.xda-developers.com/showthread.php?t=2147425
My question: I'm attempting to edit smali for the first time. However, it's pretty foreign. Any guides or tutorials out there? I've searched, but nothing substantive (just some pages on the nomenclature for the dalvik bytecode). My issue is that the instructions for the mod have different registers than me and I can't figure out how to adjust the changes.
It's difficult to answer generic questions like that.
Post up what you are trying to do and maybe we can all work it our together.
headsest control for AOSP
Ok... Team LiquidSmooth is stumped as am I, and I've spent about 8-10 hours searching all in all, through Google, CM threads, Android General/q&a and githubs... I'm still looking but wondering if I could get some help before their team or I pull any more hair out. Basically just what my title says, need the code for controlling music and phone calls from headset controls. The capacitive keys light up when the buttons are pressed but no actions are performed. It's as if the rom is just missing the path for them or something. Any help on where to search or anything, I'm game. Thanks guys.
SOLVED, thanks anyways guys :good:
upndwn4par said:
It's difficult to answer generic questions like that.
Post up what you are trying to do and maybe we can all work it our together.
Click to expand...
Click to collapse
Got it. I'll write up my issues...but, I've been having some trouble with adb and think that might be a bigger issue, haha:
I'm trying to allow adb to run as root. I decompiled boot.img, changed ro.secure to 0, recompiled boot.img, and pushed. Default.prop now shows ro.secure=0. But, I tried running adb remount and I still get permission denied? Someone said there may be other edits required, but I can't seem to find any.
Here's what I changed it to:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Here's what ADB is telling me:
Code:
[email protected]:/ $ getprop ro.secure
getprop ro.secure
0
[email protected]:/ $ exit
exit
adb remount
[B]remount failed: Operation not permitted[/B]
ikjadoon said:
Got it. I'll write up my issues...but, I've been having some trouble with adb and think that might be a bigger issue, haha:
I'm trying to allow adb to run as root. I decompiled boot.img, changed ro.secure to 0, recompiled boot.img, and pushed. Default.prop now shows ro.secure=0. But, I tried running adb remount and I still get permission denied? Someone said there may be other edits required, but I can't seem to find any.
Here's what I changed it to:
Here's what ADB is telling me:
Code:
[email protected]:/ $ getprop ro.secure
getprop ro.secure
0
[email protected]:/ $ exit
exit
adb remount
[B]remount failed: Operation not permitted[/B]
Click to expand...
Click to collapse
Try this in terminal...
adb root
Then
adb remount
That should do it for ya.
task650 said:
Try this in terminal...
adb root
Then
adb remount
That should do it for ya.
Click to expand...
Click to collapse
Thanks for the reply! Right: I should probably be root before I try that command. Unfortunately, I tried "adb root" and it said: "adbd cannot run as root in production builds." I did some Google'ing and a few threads said that I should have changed ro.debuggable to 1 as well in default.prop.
So, I changed ro.debuggable=1 and, right, ro.secure=0 still. Then the oddest thing happened: I typed "adb root" into terminal and it went to a new line, no message. And then it disconnected my phone from ADB (I heard the little "ding ding" noise of disconnection). Unfettered, I typed in "adb remount," but of course then it complained that no devices were attached! I thought it was a fluke, so I tried it a few more times. It happened again and again.
In an ostensibly unrelated problem, I couldn't get SecSettings.apk to push back (even though android.policy.jar pushed fine), so I tried a Nandroid. TWRP seemingly did not like my changes to default.prop, as it went crazy (froze a few times) saying "cannot unmount /system" every time I tried a restore and then "Restore failed." Hmm...I pushed back my backed up boot.img and it restored fine.
I'm messing up somehow. So, I'm using VTS to unpack and repack the image. I saw that the output boot.img's are about 6MB, while the default ones I pulled are 10.1MB. Dev said it was probably just compression? Also, I'm pulling the boot.img via adb dd if=/dev/mnt/mmcblk0p7 of=/sdcard/boot.img. Are either of these too weird/wrong?
ikjadoon said:
Thanks for the reply! Right: I should probably be root before I try that command. Unfortunately, I tried "adb root" and it said: "adbd cannot run as root in production builds." I did some Google'ing and a few threads said that I should have changed ro.debuggable to 1 as well in default.prop.
So, I changed ro.debuggable=1 and, right, ro.secure=0 still. Then the oddest thing happened: I typed "adb root" into terminal and it went to a new line, no message. And then it disconnected my phone from ADB (I heard the little "ding ding" noise of disconnection). Unfettered, I typed in "adb remount," but of course then it complained that no devices were attached! I thought it was a fluke, so I tried it a few more times. It happened again and again.
In an ostensibly unrelated problem, I couldn't get SecSettings.apk to push back (even though android.policy.jar pushed fine), so I tried a Nandroid. TWRP seemingly did not like my changes to default.prop, as it went crazy (froze a few times) saying "cannot unmount /system" every time I tried a restore and then "Restore failed." Hmm...I pushed back my backed up boot.img and it restored fine.
I'm messing up somehow. So, I'm using VTS to unpack and repack the image. I saw that the output boot.img's are about 6MB, while the default ones I pulled are 10.1MB. Dev said it was probably just compression? Also, I'm pulling the boot.img via adb dd if=/dev/mnt/mmcblk0p7 of=/sdcard/boot.img. Are either of these too weird/wrong?
Click to expand...
Click to collapse
Are you running adb shell as superuser?
Try:
adb shell
su
adb remount
After typing su you will need to grant superuser permission on your device.
Things to check when pushing with adb:
System, app, and framework folders are mounted r/w in root explorer.
USB debugging is enabled.
I am lazy so I use Eclipse for pushing and pulling files.
Repacked boot images are almost always smaller than the original (sometimes a lot smaller).
upndwn4par said:
Are you running adb shell as superuser?
Try:
adb shell
su
adb remount
After typing su you will need to grant superuser permission on your device.
Things to check when pushing with adb:
System, app, and framework folders are mounted r/w in root explorer.
USB debugging is enabled.
I am lazy so I use Eclipse for pushing and pulling files.
Repacked boot images are almost always smaller than the original (sometimes a lot smaller).
Click to expand...
Click to collapse
EDIT: I gave up, haha. Thank you guys, though. I just copied and pasted both files onto /sdcard and then used the good 'ole adb shell mount -o remount,rw /system and then busybox cp of the files over. Copy worked. And the mod worked. And, honestly, I don't flash enough to make adb root worth it. It's a few extra seconds of my life to type the extra commands instead of taking 2 days to figure out this boot.img....
----
I re-did the ro.secure=0 edit in the boot.img through dsixda's kitchen, just to be sure it wasn't VTS. I also "flashed" it via adb dd in recovery this time instead of in Android. I also left ro.debuggable=0 as that does not seem pertinent to allowing adb to run as root, but simply to debug system apps, etc. Does anyone know any actual information on whether ro.debuggable=0 is required to allow adbd to run as root?
1) ADB shell as superuser: um, I didn't think about that! I thought adb root and adb remount were ADB commands, not shell commands? But, I tried it anyways, but it simply said "error: device not found". See http://prntscr.com/wvjmq
2) Right, ADB shell has SU rights as "always grant" per the SuperSU app.
3) Pushing with ADB: oh, huh! So, adb remount or mount -o remount,rw /system are not recursive? Meaning they only apply to the top-level directory? I think that's what you're saying, but that has never been a problem in the past...I think. And, technically, that doesn't explain why when I didn't mount /system/framework specifically android.policy.jar pushed fine. Pushing SecSettings.apk to /system/app causes a "Permission denied" error. Can Android reject apks? I did a few minor edits to SecSettings.apk, from this mod: http://forum.xda-developers.com/showthread.php?t=2002620
4) Thanks for the boot.img size clarification; got a little worried after having "lost" 40% of the image, haha!
tl;dr:
1) Using either VTS or dsixda's kitchen to modify boot.img to ro.secure=0 and running "adb root" = "adbd cannot run as root in production builds." Pulled and flashed boot.img via adb dd.
2) Unrelated to issue 1 (I think): after mounting system via adb shell (mount -o remount,rw /system), I cannot push SecSettings.apk into /system/app ("Permission denied"), while android.policy.jar pushes just fine /system/framework.
I appreciate everyone's help here. I think it's something really little that I've missed and I just can't figure it out.
ikjadoon said:
EDIT: I gave up, haha. Thank you guys, though. I just copied and pasted both files onto /sdcard and then used the good 'ole adb shell mount -o remount,rw /system and then busybox cp of the files over. Copy worked. And the mod worked. And, honestly, I don't flash enough to make adb root worth it. It's a few extra seconds of my life to type the extra commands instead of taking 2 days to figure out this boot.img....
----
I re-did the ro.secure=0 edit in the boot.img through dsixda's kitchen, just to be sure it wasn't VTS. I also "flashed" it via adb dd in recovery this time instead of in Android. I also left ro.debuggable=0 as that does not seem pertinent to allowing adb to run as root, but simply to debug system apps, etc. Does anyone know any actual information on whether ro.debuggable=0 is required to allow adbd to run as root?
1) ADB shell as superuser: um, I didn't think about that! I thought adb root and adb remount were ADB commands, not shell commands? But, I tried it anyways, but it simply said "error: device not found". See http://prntscr.com/wvjmq
2) Right, ADB shell has SU rights as "always grant" per the SuperSU app.
3) Pushing with ADB: oh, huh! So, adb remount or mount -o remount,rw /system are not recursive? Meaning they only apply to the top-level directory? I think that's what you're saying, but that has never been a problem in the past...I think. And, technically, that doesn't explain why when I didn't mount /system/framework specifically android.policy.jar pushed fine. Pushing SecSettings.apk to /system/app causes a "Permission denied" error. Can Android reject apks? I did a few minor edits to SecSettings.apk, from this mod: http://forum.xda-developers.com/showthread.php?t=2002620
4) Thanks for the boot.img size clarification; got a little worried after having "lost" 40% of the image, haha!
tl;dr:
1) Using either VTS or dsixda's kitchen to modify boot.img to ro.secure=0 and running "adb root" = "adbd cannot run as root in production builds." Pulled and flashed boot.img via adb dd.
2) Unrelated to issue 1 (I think): after mounting system via adb shell (mount -o remount,rw /system), I cannot push SecSettings.apk into /system/app ("Permission denied"), while android.policy.jar pushes just fine /system/framework.
I appreciate everyone's help here. I think it's something really little that I've missed and I just can't figure it out.
Click to expand...
Click to collapse
If you post the kernel (untouched) for me. I will go through the process myself. That when when/if it works I can tell you my exact steps so that you can try it out for yourself. Let me know exactly what you are trying to accomplish also.
task650 said:
If you post the kernel (untouched) for me. I will go through the process myself. That when when/if it works I can tell you my exact steps so that you can try it out for yourself. Let me know exactly what you are trying to accomplish also.
Click to expand...
Click to collapse
You guys are too kind. I feel like you have more important things to do than help a sucker like me. If you're very bored, go ahead.
Attached is my stock, unadulterated boot.img inside a zip. What I am trying to accomplish: push system files from ADB (without going into the shell). I think you need adbd to run as root to do that, right? So, an "insecure" kernel. Thus, I should be able to type "adb root" and then "adb remount" to make /system rw instead of ro and then type "adb push SystemUI.apk /system/app/SystemUI.apk" and it work. I thought I just needed to make ro.secure=0 in the boot.img's default.prop, but it looks like that is not enough.
But, honestly, if it looks like it takes too much time (I'm serious; I honestly think Samsung sent me a borked phone), it's all good. ADB shell and Busybox cp will suffice. I'm just more curious of what I am doing wrong here.
~Ibrahim~
Interesting. I am getting the same error (yes, ro.secure=0 and ro.debuggable=1).
As soon as I am finished with the update I am working on I will look in to this - unless Task figures it out first. If for no other reason, just because I want to know.
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Me>cd c:\android
c:\Android>adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
041b9c2b device
c:\Android>adb shell
[email protected]:/ $ adb root
adb root
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
1|[email protected]:/ $ su
su
[email protected]:/ # adb remount
adb remount
error: device not found
1|[email protected]:/ # adb root
adb root
error: device not found
1|[email protected]:/ #WTF?
upndwn4par said:
Interesting. I am getting the same error (yes, ro.secure=0 and ro.debuggable=1).
As soon as I am finished with the update I am working on I will look in to this - unless Task figures it out first. If for no other reason, just because I want to know.
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Me>cd c:\android
c:\Android>adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
041b9c2b device
c:\Android>adb shell
[email protected]:/ $ adb root
adb root
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
1|[email protected]:/ $ su
su
[email protected]:/ # adb remount
adb remount
error: device not found
1|[email protected]:/ # adb root
adb root
error: device not found
1|[email protected]:/ #WTF?
Click to expand...
Click to collapse
You shouldn't be running adb root inside of a shell. You're running two instances of adb and only need the first connection. The reason you're getting device not found is because you're running an instance of adb on the device and it's looking for other devices. Try it again without running adb shell.
Sent from my SAMSUNG-SGH-I747

Categories

Resources