Freedom OS - "adb root" returns "cannot run as root in production build" - OnePlus 3T Questions & Answers

Freedom OS - "adb root" returns "cannot run as root in production build"
Hi! How can I run ADB as root? I'm on FreedomOS. I've tried flashing ElementalX Kernel, but it didn't fix this.
Apparently I need ro.secure = 0 and ro.debuggable = 1. How can I set this? Could someone upload a modified boot.img with those set?
Or, the main problem, could someone run the pull_library.sh script on their 3T that can be downloaded from here: https://github.com/OnePlusOSS/android/blob/oneplus3/6.0.1/pull_library.sh
It won't pull some of the files.
Thanks!

Is "adb root" different from typing:
adb shell
su
You also need to have adb root access enabled in Magisk Manager or SuperSU app.

redpoint73 said:
Is "adb root" different from typing:
adb shell
su
You also need to have adb root access enabled in Magisk Manager or SuperSU app.
Click to expand...
Click to collapse
That's the thing, I can do adb shell and su properly, I get a su prompt and I'm good. But even with that I can't pull certain system files, remount system rw, or edit certain system files.
I need ADB to run as root for that, and there is a difference. ADB shell and su just allows me to run device commands and stuff as root (like terminal app on Android) but ADB root lets me use ADB commands as root like what I mentioned above.
There's apparently two solutions. One, a modified adbd binary that doesn't check for ro.debuggable (which I can't find) or have a kernel that sets ro.debuggable to 1 in default.prop. Or I need a userdebug or engineering build of Freedom OS based off of OxygenOS.
I can't find any of those, and my decompiled stock kernels don't boot the phone properly.
Or, I could get around all this if someone would be able to upload the files I don't have from their device.
Also, where do I set ADB root access in Magisk?
Sorry for the wall of text haha,.just lots going on

NateDev said:
Also, where do I set ADB root access in Magisk?
Click to expand...
Click to collapse
In Magisk Manager, open the 3-line menu icon (top left corner), go to Settings, and you will see under the Superuser heading, the toggle for "Superuser Access" (Apps only, Apps and ADB, etc.).
NateDev said:
Sorry for the wall of text haha,.just lots going on
Click to expand...
Click to collapse
No apology needed. Thanks for the clarification. I don't use adb often. On this device, not even once, I don't think.

redpoint73 said:
In Magisk Manager, open the 3-line menu icon (top left corner), go to Settings, and you will see under the Superuser heading, the toggle for "Superuser Access" (Apps only, Apps and ADB, etc.).
No apology needed. Thanks for the clarification. I don't use adb often. On this device, not even once, I don't think.
Click to expand...
Click to collapse
Ok, thanks, I'll try that when I get home and see if it works

NateDev said:
Hi! How can I run ADB as root? I'm on FreedomOS. I've tried flashing ElementalX Kernel, but it didn't fix this.
Apparently I need ro.secure = 0 and ro.debuggable = 1. How can I set this? Could someone upload a modified boot.img with those set?
Or, the main problem, could someone run the pull_library.sh script on their 3T that can be downloaded from here: https://github.com/OnePlusOSS/android/blob/oneplus3/6.0.1/pull_library.sh
It won't pull some of the files.
Thanks!
Click to expand...
Click to collapse
If all you need to do is set ro.debuggable and ro.secure you might be able to use Magisk's resetprop tool to set them on the fly.
Code:
resetprop ro.debuggable 1
resetprop ro.secure 0

Didgeridoohan said:
If all you need to do is set ro.debuggable and ro.secure you might be able to use Magisk's resetprop tool to set them on the fly.
Code:
resetprop ro.debuggable 1
resetprop ro.secure 0
Click to expand...
Click to collapse
Thanks, so I opened up ADB, and ran
Code:
adb shell resetprop ro.debuggable 1
but it tells me "resetprop: Initialize error". I've just assumed tho that resetprop is included when you install Magisk. If it's not, how can I install it? I also tried running "resetprop" in Termux on my phone, but it says resetprop can't be found.
Thanks

NateDev said:
Thanks, so I opened up ADB, and ran
Code:
adb shell resetprop ro.debuggable 1
but it tells me "resetprop: Initialize error". I've just assumed tho that resetprop is included when you install Magisk. If it's not, how can I install it?
Thanks
Click to expand...
Click to collapse
It needs su...

Didgeridoohan said:
If all you need to do is set ro.debuggable and ro.secure you might be able to use Magisk's resetprop tool to set them on the fly.
Code:
resetprop ro.debuggable 1
resetprop ro.secure 0
Click to expand...
Click to collapse
Didgeridoohan said:
It needs su...
Click to expand...
Click to collapse
Sorry, forgot to mention, I tried it with su in adb shell as well, changed to #, but still gives same error...
Nevermind, a reboot of the phone fixed it. Unfortunatly I still get cannot run in production builds, even when the 2 items are set to the proper values. This guide: https://forum.xda-developers.com/showthread.php?t=1794203 says it should work with those 2 set, but for some reason it doesn't. Time to find a new solution...

NateDev said:
Sorry, forgot to mention, I tried it with su in adb shell as well, changed to #, but still gives same error...
Click to expand...
Click to collapse
Hm... Works fine running it in a terminal emulator (I just tested).

Related

[Q] busybox and nandroid issues

I have been experimenting with my new droid/milestone the past couple of days, odd problems which I am past now but still curious about.
Firstly after flashing the 2.1 sbf with rsd it will autoboot and screen slider will be there, then when I reboot, screen slider will be missing. This only happend when I flashed an sbf from the sbf site(2.1 uk version, not service), doing a factory reset didn't have any problem -could reboot as many times and slider would be there.... then suddenly after factory boot it would dissapear after first boot. Anyway solved this problem by installing screen mode widget after first boot after flash, solved problem, but still weird. Fixed this now but still curious about it.
Next, nandroid backup is missing from recovery menu, I have rooted and can execute root commands after typing "su" via Android Terminal emulator, so pretty sure is rooted. So why no nandroid? I thought I could do nandroid backup after rooting.
Next busybox won't install, tried the app, did the "searching system" for over an hour(not exagerrating), eventually gave up and uninstalled.
Trying to do a "manual busybox install" now, using this guide:
Busybox How-to? - Android Forums
Can't execute commands via usb/adb in recovery mode as the other guy suggested so been trying these commands both with terminal emulator on phone, and usb-debugging mode with windows shell. Using these I can go "su" and type "ls" to see files on my droid phone....but when I try to "mount /system" or /sdcard from windows I just get a print about mount options, when I try to "cat /sdcard/busybox > /system/xbin/busybox" I get a "file is read only" error.
I would like advice on how to install busybox, I would like to do it manually(because the app seems to not work for me, remember I waited over an hour while it "searched") and I want to learn to manually do stuff anyway. I tried to chmod /system/xbin too, but that didn't seem to change it from read only.
Also any thoughts on why nandroid backup is missing from my recovery menu even though my droid is rooted. I thought it was meant to appear.
I am still learning and researching, and appreciate any links or tips.
droidtech1 said:
Next, nandroid backup is missing from recovery menu, I have rooted and can execute root commands after typing "su" via Android Terminal emulator, so pretty sure is rooted. So why no nandroid? I thought I could do nandroid backup after rooting.
Click to expand...
Click to collapse
This is odd. Which OpenRecovery did you install? Androidiani? GOT? Or the "original" OpenRecovery? Are you aware, that you come into OpenRecovery by starting Recovery Mode and apply update.zip?
droidtech1 said:
Next busybox won't install, tried the app, did the "searching system" for over an hour(not exagerrating), eventually gave up and uninstalled.
Trying to do a "manual busybox install" now, using this guide:
Busybox How-to? - Android Forums
Click to expand...
Click to collapse
Using the app from the market worked like a charm for me. No idea, what might have gone wrong for you...
droidtech1 said:
Can't execute commands via usb/adb in recovery mode as the other guy suggested so been trying these commands both with terminal emulator on phone, and usb-debugging mode with windows shell. Using these I can go "su" and type "ls" to see files on my droid phone....but when I try to "mount /system" or /sdcard from windows I just get a print about mount options, when I try to "cat /sdcard/busybox > /system/xbin/busybox" I get a "file is read only" error.
Click to expand...
Click to collapse
For remounting, try "mount -o rw,remount /dev/block/mtdblock6 /system" and for undoing this, use "ro" instead of "rw".
droidtech1 said:
I would like advice on how to install busybox, I would like to do it manually(because the app seems to not work for me, remember I waited over an hour while it "searched") and I want to learn to manually do stuff anyway. I tried to chmod /system/xbin too, but that didn't seem to change it from read only.
Click to expand...
Click to collapse
You should download busybox and put the "busybox"-file in the directory /sdcard. After that do:
Code:
# su
# mount -o rw,remount /dev/block/mtdblock6 /system
# cp /sdcard/busybox /system/xbin
# cd /system/xbin
# chmod 755 busybox
# ./busybox --install
# mount -o ro,remount /dev/block/mtdblock6 /system
One thought at the end: How did you root?
I rooted by flashing "vunerable recovery" using RSD lite, copied milestone-root.zip to sd card, renamed it update.zip, rebooted into recovery mode, flashed update.zip from there.
I didn't realise I had to install something like open recovery, think because I remember not having to do that on my pulse? Anyway will try and install one of those now.
Thanks those commands at the end helped, actually managed to copy busybox to /system/xbin, however the 2nd last one "./busybox --install" gave me a load of errors -all being no such file or directory, for example "/usr/bin/wc: no such file"
about 30 of those path errors. Maybe the command path "./busybox" needs to be something else?
ah, okay. sorry, I thought you already installed an openrecovery. for many cool features you will need it (e.g. nandroid, for overclocking it's not a must but a nice-to-have). please don't use GOT, it's rather old already. androidiani is okay, I think.
I think your previous attempts to install busybox via the app etc. mixed up some internal links in the device. please reboot and try again (the above steps except the "cp ..."). seems like the app tried to install busybox to /usr/bin but failed... I hope this failed attempt will be fixed by a simple reboot. otherwise it would be great to have the output of:
Code:
# su
# ls /usr/bin
No I re-flashed my main sbf and also did a factory reset to do a clean start, only thing since that full wipe I have done is rooting in the method I described, installed the screenmode widget, textedit, and android terminal emulator.
I have no such file /usr, are you sure I should have this in droid/milestone?
Here is my full output of my root system using ls:
tmp
pds
cdrom
sqlite_stmt_journals
config
cache
sdcard
d
etc
system
sys
sbin
proc
init_prep_keypad.sh
init.rc
init.mapphone_umts.rc
init.mapphone_cdma.rc
init.goldfish.rc
init
default.prop
data
root
dev
perhaps "/usr" is a sub inside one of the above folders? I tried using "find" to find it but that command dosn't seem to work since it won't even find the ones I can see with ls
I found it, /usr is inside /system... so if busybox was moved to /system/xbin, I'm guessing the ./ means install it to the parent directory which was /system which /usr is also in.
The errors I got said no such file "/usr" so It seems like it is trying to install to the wrong directory.... perhaps the command should be "busybox --install" or "/busybox --install" I don't want to experiment and mess things up before your opinion on this.
*edit almost forgot, output of /system/usr is
keychars
bin
srec
keylayout
share
output of /system/usr/bin is
panic_daemon
gki_pd_notifier
nvm_daemon
clean_dex.sh
brcm_guci_drv
bplogd_daemon
This is really strange. Maybe your busybox-file is corrupt.
Where did you download the busybox-file?
Which sbf did you flash?
So for explanation-purposes: When you put an executable or script file in any directory, you can execute it by first making it executable ("chmod 755 /system/xbin/busybox"), changing to that directory ("cd /system/xbin") and then executing it by adding "./" in front of it. The dot slash always stands for the _current_ directory. The _parent_directory has two dots "../".
If you want, you may try:
# /system/xbin/busybox --install
instead of
# ./busybox --install
Or maybe try this one:
# /system/xbin/busybox --install -s /system/xbin
Last time, I installed busybox into the directory /data/busybox, which worked brilliantly, but this path turned out to be unpractical. So I wanted to reinstall it in a different directory. I removed everything from /data/busybox including the directory itself and tried to start the whole procedure with /system/xbin. But that time it protested, that there were no files in "/data/busybox/...". Conclusion: The last busybox-install affected the second one. When I remember correctly I rebooted after that and used the app from the market *g*
My main sbf I flashed was android 2.1(uk version).
I downloaded busybox 1.17.2(won't let me post url here), was from droidforums dot net.
I don't remember if I tried all of his commands, but the last one on that forum seems to have worked.. I think......... it was:
"busybox --install /system/xbin/"
After remounting with your commands and typing the above command, I didn't get any errors, I synced and rebooted and now when I "ls /system/xbin" it shows a bunch of files/names which look like busybox commands. When I type "busybox" it outputs a bunch of commands too... so I am guessing this means it has succesfully installed? I can't say I tried these before attempting install so I have no comparison but I assume I would have a different output if busybox wasn't installed.
So assuming it worked, why would
"busybox --install /system/xbin/" work, and
"/system/xbin/busybox --install" not?
I also managed to install open recovery and do a nandroid backup succesfully
I have another short question, not specific to android but happens in all terminals I use, windows and linux alike. Sometimes I cannot execute commands anymore and it just becomes text in the terminal(just re-echo'ing my text output, without executing any functions)... can't remember specifically when it happened on my windows or linux pc shells, but on my android it happens whenever I have to give "SU" permission to the terminal, I have to quickly close the terminal and reload it again to get su access. I'm sure there is a name for this "state" where you are locked out of using commands in the shell and just typing text but I can't find a way to get out of it(without closing and re-opening terminal), there must be some key combination to be able to execute commands again in the current terminal session. If you have any idea what I am talking about?
Thanks for all your help so far.
droidtech1 said:
My main sbf I flashed was android 2.1(uk version).
Click to expand...
Click to collapse
Don't want to try one of the 2.2?
droidtech1 said:
I downloaded busybox 1.17.2(won't let me post url here), was from droidforums dot net.
I don't remember if I tried all of his commands, but the last one on that forum seems to have worked.. I think......... it was:
"busybox --install /system/xbin/"
After remounting with your commands and typing the above command, I didn't get any errors, I synced and rebooted and now when I "ls /system/xbin" it shows a bunch of files/names which look like busybox commands. When I type "busybox" it outputs a bunch of commands too... so I am guessing this means it has succesfully installed? I can't say I tried these before attempting install so I have no comparison but I assume I would have a different output if busybox wasn't installed.
Click to expand...
Click to collapse
Yes, this sounds very much like installation was successful.
droidtech1 said:
So assuming it worked, why would
"busybox --install /system/xbin/" work, and
"/system/xbin/busybox --install" not?
Click to expand...
Click to collapse
typing "busybox" without the path in front of it worked, because busybox is in the directory /system/xbin, which is already in your $PATH-variable (try "echo $PATH"). So the command interpreter (shell) will automatically look up "busybox" in /system/xbin.
I had a look at the busybox syntax and it's actually
Code:
busybox --install [-s] [INSTALLDIR]
So you have to put the directory you want to install in at the end. That's what your last command makes use of
droidtech1 said:
I have another short question, not specific to android but happens in all terminals I use, windows and linux alike. Sometimes I cannot execute commands anymore and it just becomes text in the terminal(just re-echo'ing my text output, without executing any functions)... can't remember specifically when it happened on my windows or linux pc shells, but on my android it happens whenever I have to give "SU" permission to the terminal, I have to quickly close the terminal and reload it again to get su access. I'm sure there is a name for this "state" where you are locked out of using commands in the shell and just typing text but I can't find a way to get out of it(without closing and re-opening terminal), there must be some key combination to be able to execute commands again in the current terminal session. If you have any idea what I am talking about?
Click to expand...
Click to collapse
Sounds like this is just the state, when shell is busy, i.e. when the last process you started is still running and no prompt ($ or #) is displayed. You may kill the last process in linux using CTRL+C, which will hopefully bring back the shell prompt. No idea which shortcut replaces this on the milestone/droid. I never use any android terminals, but only the ADB-Shell: http://developer.android.com/guide/developing/tools/adb.html
I'm learning to build apps for android so I thought having 2.1 on my droid would be better for testing (instead of 2.2). I also have a Nexus-S with 2.3 and a tmobile-pulse with 1.5. So I want to keep the most native version on each phone since most consumers won't install custom roms, although some will get updates anyway.
I use my droid a lot when I am out and use the terminal a lot so having busybox too has given me more to play around with. I actually find my droid much better working on than the nexus s, love the keyboard and dpad.

Temp root for apps required root access (for s-on IS)

Psneuter exploit is working on IS, but because /system is locked on s-on phones, we can't copy su and superuser.apk into /system, apps required root access can't work.
The following procedure uses psenuter exploit to gain adb shell root, and then copy su (without privilege control ) and busybox into /sbin (which is on rootfs and in the global PATH list) to gain root access for apps.
The procedure:
1. Unzip the attached .zip into a directory (like c:\adb)
2. Open a command prompt and cd to the directory where you extracted the .zip (like cd \adb)
3. run pushroot.bat (simply type pushroot)
4. adb shell /data/local/tmp/getroot
5. adb shell
6. you are now in # prompt. Type /data/local/tmp/pushroot
You have to redo steps 4,5,6 once you reboot your phone.
The procedure will have all apps gaining root access.
!!USE ON YOUR OWN RISK!!
Known working programs: Root explorer, Titanium backup, gscript lite, trasproxy 2.04, ...
Some apps check existence of su in /system/xbin , and reject to proceed if the su binary is not exist (like transproxy 3.08). For this kind of apps, this procedure won't help.
Nice but old news mate...
Sent from my HTC Incredible S using XDA Premium App
Good job...thanks
Thanks for writing this up, might quell the thirst for S-OFF a little longer
/system/ is writeable btw, if you remount it, but after reboot everything u done will be changed to the way it were before.
so a temp root in xbin is possible also, only it will be gone afterwards (atleast i never tried this, but should work also...)
Yes. /system could be remount in rw with root. However, the files you wrote will be gone after you remount ro, and then you won't be able to copy the same filename into the same location again before next reboot ( I don't know why, actually!!). This is why I put su in sbin instead of /system/xbin.
thanks to your files 非常感谢你的工作。
Does anyone know whether steps 4, 5 and 6 can be run from the device itself?
Can I put these commands into some sort of script and run it everytime I need temp root or would I need to do this from a computer every time?
faf said:
Does anyone know whether steps 4, 5 and 6 can be run from the device itself?
Can I put these commands into some sort of script and run it everytime I need temp root or would I need to do this from a computer every time?
Click to expand...
Click to collapse
I believe you can do it from a terminal emulator but haven't got the chance to try it myself though.
Sent from my HTC Incredible S using Tapatalk
pushroot error
c:/adb>adb shell ln /data/local/tem/busybox /data/local/tmp/cp
Link failed File exists
and
c:/adb>adb shell /data/local/tmp/getroot
mmap<> failed. operation not permitted
Why??THX....
itandy said:
I believe you can do it from a terminal emulator but haven't got the chance to try it myself though.
Sent from my HTC Incredible S using Tapatalk
Click to expand...
Click to collapse
Definitely, this is the way to go.
Unfortunately, the root exploit I know could run on device itself, including
rageagainstthecage (ratc) and local root exploit (hotplug) both failed on IS.
The solution will be nearly perfect if we can get temp root on IS without a computer link.
Any input will be welcome.
sky1212 said:
pushroot error
c:/adb>adb shell ln /data/local/tem/busybox /data/local/tmp/cp
Link failed File exists
and
c:/adb>adb shell /data/local/tmp/getroot
mmap<> failed. operation not permitted
Why??THX....
Click to expand...
Click to collapse
Please then type adb shell.
If you see # but not $, do
cd /data/local/tmp
rm ./cp
ln busybox cp
./pushroot
Then you finished the install.
If you see $, please do all over again.
You can also add ShootMe (screen capture app) and SetCPU to the list of working apps. SetCPU will only allow you underclock for now due to the kernel, but it is a nice touch if you are worried about battery life. Adfree doesn't appear to work
l0st.prophet said:
You can also add ShootMe (screen capture app) and SetCPU to the list of working apps. SetCPU will only allow you underclock for now due to the kernel, but it is a nice touch if you are worried about battery life. Adfree doesn't appear to work
Click to expand...
Click to collapse
Adfree is working for me. Are you getting some type of error message?
MetaMorph, screenshot and MyBackup Root are also working.
I had to mount system, then push su to /system/xbin. Then install BusyBox Installer from Market.
No erro, still got the ads. I've tried rebooting & rerooting, still no luck
l0st.prophet said:
No erro, still got the ads. I've tried rebooting & rerooting, still no luck
Click to expand...
Click to collapse
What site/app are you going to so I can see if I get the ads.
the anti-ads actually tries to modify the current host file... which is not allowed in your state as far as i know
what you can do is replace it by pushin it to the right spot
but after reboot gone,but sure u know
Adfee is working for me, you can also add Droidwall.
@eddycyf, did you test adfree with apps? Since it aint working for prophet...
Sent from my HTC Incredible S using XDA Premium App
Mhm AdFree isnt working for me. The App states that everything is okay, and that my hosts file is up to date, but I see ads everywhere.
But I am kinda happy now, because i can use Titanium Backup

Possible New Rooting Method!

Well, this is interesting.
On my Revo4g, all I did was enable USB debugging in internet only mode, and i'm faced with this:
Code:
c:\tools\android\android-sdk-windows\platform-tools>adb shell
# busybox whoami
busybox whoami
whoami: unknown uid 0
#
Looks like there's no need for rageagainstthecage, or any exploits. ADB is run as superuser already! (although for some reason ro.secure is set, and it seems to be ignored, so it possibly may be a bug)
EDIT: Nope, verified. Toggle ADB debugging on and off, and you're root!
This is most definitely not what LG intended, but hey- it works!
Still no signs of fastboot without accidentally erasing recovery or something. Looks like it's left in as emergency-only.
If you're not rooted, try this:
Open ADB shell
Your command prompt should be "$"
Run
Code:
kill `busybox pidof adbd`
Re-run ADB shell, your command prompt should change to "#"
Congrats! You're root.. now you can push "su" and whatnot.
That was strangely easy...
thecubed said:
Well, this is interesting.
On my Revo4g, all I did was enable USB debugging in internet only mode, and i'm faced with this:
Code:
c:\tools\android\android-sdk-windows\platform-tools>adb shell
# busybox whoami
busybox whoami
whoami: unknown uid 0
#
Looks like there's no need for rageagainstthecage, or any exploits. ADB is run as superuser already! (although for some reason ro.secure is set, and it seems to be ignored, so it possibly may be a bug)
EDIT: Nope, verified. Toggle ADB debugging on and off, and you're root!
This is most definitely not what LG intended, but hey- it works!
Still no signs of fastboot without accidentally erasing recovery or something. Looks like it's left in as emergency-only.
If you're not rooted, try this:
Open ADB shell
Your command prompt should be "$"
Run
Code:
kill `busybox pidof adbd`
Re-run ADB shell, your command prompt should change to "#"
Congrats! You're root.. now you can push "su" and whatnot.
That was strangely easy...
Click to expand...
Click to collapse
OKAY... So, I don't need to do superoneclick? And I don't need to go through the painful process of downloading 3-4 programs?
markapowell said:
OKAY... So, I don't need to do superoneclick? And I don't need to go through the painful process of downloading 3-4 programs?
Click to expand...
Click to collapse
Well, if you've got ADB installed, then no you don't need superoneclick, but it's main claim to fame is that it's got all of the tools bundled together.
Stick with superoneclick until I get an easy method put together...
LOL... That's sweet!
Like I mentioned elsewhere... LG wants Verizon to think all is locked down and such but secretly behind its back it is giving us free candy. Like when grandpa and grandma hide money in your room before leaving...
They left in everything needed, we only had to put the pieces together.
Bravo LG bravo... now can we have the source code for this device for 2.2 and 2.3..
Now i'm for sure rooting today, as i already have adb installed. Epic.
So i ran ADB Shell and it automatically gave me "#". I then proceeded to "kill 'busybox pidof adbd' " and it said it did it. Still had "#". I don't seem to have root though. I can't delete bingsearch.apk, can't do anything in setcpu.
When i installed super user from the market, it did say there was an update, so it asked if i wanted to install it. I said yes, and it said an error occurred but it put a zip on my sd card to update the binary and that i need to reboot into recovery and install it.
Any ideas? I don't have cwm yet so i can't exactly do that. Here's how the whole thing went down:
Code:
C:\AndroidSDK\platform-tools>adb shell
*daemon not running. starting it now on port 5037 *
*daemon started successfully *
# kill 'busybox pidof adbd'
kill 'busybox pidof adbd'
[1] Terminated kill "busybox pidof adbd"
#
Nevermind, i just went with super one click and i have root now.
powder007 said:
I then proceeded to "kill 'busybox pidof adbd' " and it said it did it.
Click to expand...
Click to collapse
Those were back-ticks, like this: `` not single quotes: ' '
powder007 said:
I don't seem to have root though. I can't delete bingsearch.apk, can't do anything in setcpu.
Click to expand...
Click to collapse
setCPU will require superuser.apk and a working su. Did you mount the system partition r/w by hand before trying to delete bing? Using this method, you'd have to mount r/w, then push su, etc.
Ah, my bad. I'm semi new to adb. Thanks for pointing that out.
I had the super user app from the market. On root explorer it didn't give me a Mount r/w button, so i knew i wasn't rooted.
The problem with this rooting method is that it's incomplete.
My method gives you entry to a root shell-- it does not "root" your device.
A "rooted" device requires a file in /system/bin/ called "su", which allows normal Android apps to access root functionality on the device.
The method I detail allows you to manually remount /system as r/w and push the required file to the proper location without requiring an exploit.
Once I have some time free from working on the deodex'd rom, and porting CM7, I will make a super-super easy one click root application for windows/linux.
Until then, this thread is mostly for technical reference for devs, and something interesting that I found

[SOLVED][Q] 4.4.3 after restart restores previous values

Hi!
I have problem with my HTC One m7 (ViperOne 7.0.1).
While I changed something in /system/app folder (eg. deleted a "DriveActivator.apk" - successfully accomplished) and restart phone, I see again that deleted app!!!
Do you know why? I'm using RootExplorer, I have root and granted permissions to r/w.
It seems like system restores some kind of backup - I don't know why, and I don't know how to fix it (I mean do some permanent changes in /system/app).
dry3333 said:
Hi!
I have problem with my HTC One m7 (ViperOne 7.0.1).
While I changed something in /system/app folder (eg. deleted a "DriveActivator.apk" - successfully accomplished) and restart phone, I see again that deleted app!!!
Do you know why? I'm using RootExplorer, I have root and granted permissions to r/w.
It seems like system restores some kind of backup - I don't know why, and I don't know how to fix it (I mean do some permanent changes in /system/app).
Click to expand...
Click to collapse
It appears that the System isn't booted with RW capabilities
There's a nice long command that I'll give you later that will fix it
If you wanna get it sooner and aren't afraid of adb shell (make sure you have root access enabled for adb AND apps, not just apps) you can Google remount Linux system read/write and you should find it
You'll need to modify that command to reflect the One, but the name of the partition should be something like by-name-system or something
I'll get it later if you need it when I wake up
ajbiz11 said:
It appears that the System isn't booted with RW capabilities
There's a nice long command that I'll give you later that will fix it
If you wanna get it sooner and aren't afraid of adb shell (make sure you have root access enabled for adb AND apps, not just apps) you can Google remount Linux system read/write and you should find it
You'll need to modify that command to reflect the One, but the name of the partition should be something like by-name-system or something
I'll get it later if you need it when I wake up
Click to expand...
Click to collapse
Thanks mate!
Stupid question - how I can check whether I have root access enabled for adb and apps? I have superuser app, and in settings I can see: "Superuser Access: Apps and ADB" - is this what you are wrote about?
dry3333 said:
Thanks mate!
Stupid question - how I can check whether I have root access enabled for adb and apps? I have superuser app, and in settings I can see: "Superuser Access: Apps and ADB" - is this what you are wrote about?
Click to expand...
Click to collapse
That's exactly what I'm referring to (The settings thing)
Lemme go find that command for you
---------- Post added at 06:00 AM ---------- Previous post was at 05:56 AM ----------
Wish I knew this existed when I was working on the L port
There's an app to do exactly what you need without looking up partitions
https://play.google.com/store/apps/details?id=com.beansoft.mount_system
Although if you want to go through terminal, here's a tutorial
http://ckirbach.wordpress.com/2012/11/27/how-to-remount-system-as-read-write-in-android/
Basically, you use grep to find the name of the system partition, then run the mount command to remount the partition you found in that precious step
I have this app: Mount /system (rw / ro), also I have this option in superuser and it works fine - I mean that I can change /system/app or for eg. edit /etc/hosts (I get message that ES explorer granted superuser access), but after restart I see previous files (before changes)... I have no idea how make this work - maybe I need custom kernel or something? I want to make permanent changes in system files...
I have reinstalled system (clean option with wipe all data), but still no results...
dry3333 said:
I have this app: Mount /system (rw / ro), also I have this option in superuser and it works fine - I mean that I can change /system/app or for eg. edit /etc/hosts (I get message that ES explorer granted superuser access), but after restart I see previous files (before changes)... I have no idea how make this work - maybe I need custom kernel or something? I want to make permanent changes in system files...
I have reinstalled system (clean option with wipe all data), but still no results...
Click to expand...
Click to collapse
The remount app should do exactly that
Try the command option and make your changes then reboot
ajbiz11 said:
The remount app should do exactly that
Try the command option and make your changes then reboot
Click to expand...
Click to collapse
I have tried - still no results. My system already has RW permissions. Problem is that after restart my files are "restored".
Analogously like in Cisco IOS - commit but without write memory.
Maybe I should go to recovery and do something (but I don't know what)?
dry3333 said:
I have tried - still no results. My system already has RW permissions. Problem is that after restart my files are "restored".
Analogously like in Cisco IOS - commit but without write memory.
Maybe I should go to recovery and do something (but I don't know what)?
Click to expand...
Click to collapse
Check the Viper forum and maybe post there
I only run CM-base so I'm not too experienced with Sense issues
ajbiz11 said:
Check the Viper forum and maybe post there
I only run CM-base so I'm not too experienced with Sense issues
Click to expand...
Click to collapse
Thanks - they said they don't know, but it affects S-ON users....
Can You tell me one thing - I execute this script:
echo off
adb reboot
cd /d %~dp0
echo .
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb -d shell su -c "mount -o remount rw /system"
adb -d shell rm /system/app/DriveActivator.apk
adb reboot
This should remove DriveActivator (while script is ongoing I see no errors), but after reboot DriveActivator.apk is still in /system/app...
Is there any other way to permanently remove/change files in /system/app?
dry3333 said:
Thanks - they said they don't know, but it affects S-ON users....
Can You tell me one thing - I execute this script:
echo off
adb reboot
cd /d %~dp0
echo .
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb -d shell su -c "mount -o remount rw /system"
adb -d shell rm /system/app/DriveActivator.apk
adb reboot
This should remove DriveActivator (while script is ongoing I see no errors), but after reboot DriveActivator.apk is still in /system/app...
Is there any other way to permanently remove/change files in /system/app?
Click to expand...
Click to collapse
You can remove it from the ViperROM zip and format ONLY system and reflash
That SHOULD work
That's like...the be all end all
dry3333 said:
Thanks - they said they don't know, but it affects S-ON users....
Can You tell me one thing - I execute this script:
echo off
adb reboot
cd /d %~dp0
echo .
echo Waiting for device...
adb wait-for-device
echo.
adb -d shell stop
adb -d shell su -c "mount -o remount rw /system"
adb -d shell rm /system/app/DriveActivator.apk
adb reboot
This should remove DriveActivator (while script is ongoing I see no errors), but after reboot DriveActivator.apk is still in /system/app...
Is there any other way to permanently remove/change files in /system/app?
Click to expand...
Click to collapse
Make life simple: erase the apk while in custom recovery, TWRP has a file manager, or you can use Aroma File Manager
even adb commands while booted in custom recovery are better than booted up ROM.
nkk71 said:
Make life simple: erase the apk while in custom recovery, TWRP has a file manager, or you can use Aroma File Manager
even adb commands while booted in custom recovery are better than booted up ROM.
Click to expand...
Click to collapse
Thanks for advice. Is it possible via TWRP not only remove file, but also replace it? Where shoul I place new file for replace original one?
dry3333 said:
Thanks for advice. Is it possible via TWRP not only remove file, but also replace it? Where shoul I place new file for replace original one?
Click to expand...
Click to collapse
I would recommend using the Aroma File Manager instead of TWRP's, just place all the files you'll need on your internal storage (including Aroma File Manager), then reboot to select "Install" to run the Aroma File Manager and remove/replace whatever you need to.
You may need to also check if the permissions are right, I can't remember if Aroma File Manager has that built in.
remember that once you are in recovery to mount /system (in the Mount menu)
and you can even use adb shell, and adb push commands to replace the .apk.... i'm just guessing it's easier with a GUI interface.
nkk71 said:
I would recommend using the Aroma File Manager instead of TWRP's, just place all the files you'll need on your internal storage (including Aroma File Manager), then reboot to select "Install" to run the Aroma File Manager and remove/replace whatever you need to.
You may need to also check if the permissions are right, I can't remember if Aroma File Manager has that built in.
remember that once you are in recovery to mount /system (in the Mount menu)
and you can even use adb shell, and adb push commands to replace the .apk.... i'm just guessing it's easier with a GUI interface.
Click to expand...
Click to collapse
The windows drivers don't work with recovery mode (usually)
ajbiz11 said:
The windows drivers don't work with recovery mode (usually)
Click to expand...
Click to collapse
they do for me, but sometimes (after flashing a new/different version) i have to manually select the drivers, check FAQ#2 here: http://forum.xda-developers.com/showpost.php?p=52135024&postcount=2
I would like to thank you for advice. I did this via TWRP (after I had mounted /system). It works fine for me
dry3333 said:
I would like to thank you for advice. I did this via TWRP (after I had mounted /system). It works fine for me
Click to expand...
Click to collapse
sure, no problem :good: :good:
if all is good now, can you also edit main thread title to include [SOLVED], thanks
edit the first post -> at the bottom of the edit window, click Go Advanced, and then you can edit main title

Execute a script at boot

Hello, I'd like to execute a easy script at every boot of the phone so basically I've placed the script in the folder
/sbin/.magisk/img/.core/service.d/doze.disable.sh
I've tried also putting it in
/sbin/.magisk/img/.core/post-fs-data.d/doze.disable.sh
but even if the magisk log reports the script was executed... it isn't executed.
The script has the purpose to completely disable the doze and it has root/root and all r/w/x permissions
The content is
#!/system/bin/sh
su -c 'dumpsys deviceidle disable'
The magisk log is attached
Where am I wrong??
Or, how I can execute the script every boot?
Samsung S7 with The Galaxy Project OREO
Thanks
A couple of things:
You don't need to call su in the boot script. It's being executed by Magisk, which always has superuser access...
post-fs-data.d might be too early. Try moving it to service.d instead. Depending on when that's being set during boot, you might also have to add a delay as to when the command is being run.
Didgeridoohan said:
A couple of things:
You don't need to call su in the boot script. It's being executed by Magisk, which always has superuser access...
post-fs-data.d might be too early. Try moving it to service.d instead. Depending on when that's being set during boot, you might also have to add a delay as to when the command is being run.
Click to expand...
Click to collapse
Thanks,
1) I've tried also without calling the su option but without success. So I tried also calling it
2) after checking the script in the service.d didn't work I tried puttin it also in post-fs-data.d
... yes, I've tried different ways.
So something like this (considering 10 seconds)?
#!/system/bin/sh
sleep 10
dumpsys deviceidle disable
Something like that might work, yes. Have you made sure that the command works at all on your device? If it does it's likely a matter of finding the correct delay...
Didgeridoohan said:
Something like that might work, yes. Have you made sure that the command works at all on your device? If it does it's likely a matter of finding the correct delay...
Click to expand...
Click to collapse
Yes, sending it manually it works
I will try
Thanks again
It seems it is working now, thanks for the tip "delay"
sverza said:
It seems it is working now, thanks for the delay tip
Click to expand...
Click to collapse
No worries. Been there, done that, pulled my hair out in frustration... :laugh:
I'm running into this same problem, Magisk is saying it was executed but the process is not running. Here is my script in
/sbin/.magisk/img/.core/service.d/customboot.sh
The script runs fine when i run it via ssh but it never works on boot?
Code:
#!/system/bin/sh
sleep 30
/data/data/com.termux/files/usr/bin/rclone mount gDRIVE: /data/media/0/Movies \
--config=/storage/sda1/tools/rclone/rclone.conf \
--allow-non-empty \
--allow-other \
--dir-cache-time 72h \
--cache-workers 6 \
--debug-fuse \
-v \
--daemon
Any ideas?
[email protected] said:
Any ideas?
Click to expand...
Click to collapse
Have you tried running it on device (not trough ssh)? How about putting the command on one line?
Didgeridoohan said:
Have you tried running it on device (not trough ssh)? How about putting the command on one line?
Click to expand...
Click to collapse
hmm you found something interesting, when I launch termux and try to launch it from there directly off the device it doesn't work:
su
sh /sbin/.magisk/img/.core/service.d/customboot.sh
however there are no errors or anything like that. the command is not running in the processes I see via top (when i run the command thru ssh the process shows) and the log I designed only shows the sleep command and rclone command no other errors:
exec > /sbin/.magisk/img/.core/service.d/test.log 2>&1
set -x
I'm stuck at this point any ideas
edit--i figured it out it was a problem within rclone itself strangely enough it hda a dependency that didn't load till later
So now that I figured out I'm missing an environmental variable does anyone know how I can add a custom program as an environmental variable to Android or Magisk so that when my bootscript runs it calls the right programs and fix "executable file not found in $PATH"
figured it out:
#!/system/bin/sh
PATH=$PATH:<directory you want to add>
<rest of script>
So, with regards to the Doze script, how do you tell if it worked?
nijohnson said:
So, with regards to the Doze script, how do you tell if it worked?
Click to expand...
Click to collapse
In console write
su
dumpsys deviceidle
and search for
mlightnenable=false and mdeepenable=false
If they are = true it means the doxe is still active
Cool! Thanks
curious why do you want to disable doze?
virtyx said:
curious why do you want to disable doze?
Click to expand...
Click to collapse
It is causing delayed notification on some apps.
Oreo
what is the command to disable doze please? Thanks
Deleted
sverza said:
It is causing delayed notification on some apps.
Oreo
Click to expand...
Click to collapse
Credit @return_of_0ctobot
while [ "$(getprop sys.boot_completed)" != 1 ];
do sleep 1;
done
Much more universal ... And does not require trial and error to find boot completed

Categories

Resources