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
Related
This will NOT work in CM5.0b4 as JIT has been disabled entirely
It seems like a lot of people are constantly pulling/editing/pushing build.conf in order to turn JIT on and off, so I threw together a short script to toggle it on and off.
It's nothing elaborate, but it gets the job done. This is meant to work with the build.prop that comes stock with cyanogenmod 5.0b2 but will most likely work with other build.props that have JIT.
Steps to run the script:
1) Download jit.txt, rename it jit.sh
2) If you downloaded from your computer, run "adb push jit.sh /sdcard" or mount your device and copy to your sdcard.
3) In terminal on Nexus One:
$ su
# sh /sdcard/jit.sh
JIT toggled ON
JIT enabled upon reboot
#
You can also set it up in GScript or GScript Lite so you can add an icon on your homescreen to toggle JIT more easily:
1) From command line: mv /sdcard/jit.sh /sdcard/gscript/jit.sh
2) Open GScript
3) Go to Menu->Add Script
4) Go to "Load file"
5) Select jit.sh
Then to make an icon on your homescreen:
1) Long press homescreen
2) Select Shortcuts
3) Select GScript(Lite)
4) Select jit
You must reboot for the changes to take effect after running the script. If you prefer, simply put "reboot" (without quotes) on it's own line at the end of the script and it will reboot automatically. Only do this after you have confirmed that the script works for you.
If you are using Windows, make sure you use the attached jit.txt rather than copying the code from this post. Copying/pasting the code will not work because of Windows CR/LF line breaks.
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
if grep -q fast /system/build.prop ; then
sed -i s/=int:fast/=int:jit/ /system/build.prop
echo "JIT toggled ON"
echo "JIT enabled upon reboot"
else
sed -i s/=int:jit/=int:fast/ /system/build.prop
echo "JIT toggled OFF"
echo "JIT disabled upon reboot"
fi
exit
mhaedo said:
It seems like a lot of people are constantly pulling/editing/pushing build.conf in order to turn JIT on and off, so I threw together a short script to toggle it on and off.
It's nothing elaborate, but it gets the job done. This is meant to work with the build.prop that comes stock with cyanogenmod 5.0b2.
Simply push the script to your phone (sdcard, or wherever you please) and run it. For example, put the quoted text into a file called jit.sh, push it to the root of your sdcard, and run "sh /sdcard/jit.sh" from a terminal. You can also set it up in GScript or GScript Lite so you can add an icon on your homescreen to toggle JIT more easily.
You must reboot for the changes to take effect.
Click to expand...
Click to collapse
Nice - been looking for just this, thanks. As a bit of a n00b, any idea why this doesn't seem to run in GScript Lite? I get the SU request OK, but then nothing - don't see the echo'd text at all, nowt. Running CM5b2 .29 kernel.
Ive installed pauls modaco patch wil this turn jlt off? its annoying me
Thanks for this script !
I just pull, nano, and push it back.
I don't think It's 100% stable.
push/pull? Shoot, I just use vi on build.prop from betterterminal. Don't have to mess with adb at all
Since you need to reboot anyway, couldn't we just put "reboot" in place of "exit"? I'm assuming that's not part of the script to save, since you have "fi" at the end of it. Personally, what I did is save 2 versions of build.prop to my sdcard and then built gscripts to swap 'em out. lol A little more crude, but just as effective.
when i try to run the jit.sh file in terminal i get:
failed: no such file or directoryk3 on /system : not found
sdcard/jit.sh : 13: syntax error: end of file unexpected (expecting 'then")
am i completely retarded?
trisl said:
Nice - been looking for just this, thanks. As a bit of a n00b, any idea why this doesn't seem to run in GScript Lite? I get the SU request OK, but then nothing - don't see the echo'd text at all, nowt. Running CM5b2 .29 kernel.
Click to expand...
Click to collapse
Yeah, I had the same problem. Remove the su request from superuser.apk. Then, run any script that requires root. Click remember, and allow. It will not work at this point. Back out to the homescreen with the back button, then go back into GScript Lite and run it again. It should work this time.
Guitarfreak26 said:
Ive installed pauls modaco patch wil this turn jlt off? its annoying me
Click to expand...
Click to collapse
Not sure. I would assume so, never seen the build.prop that's used but I don't see why it would be any different.
Mi|enko said:
Since you need to reboot anyway, couldn't we just put "reboot" in place of "exit"? I'm assuming that's not part of the script to save, since you have "fi" at the end of it. Personally, what I did is save 2 versions of build.prop to my sdcard and then built gscripts to swap 'em out. lol A little more crude, but just as effective.
Click to expand...
Click to collapse
That would be more efficient, but I just enjoy clicking my icon a few times and toggling it on and off Don't ask me why.
[email protected] said:
push/pull? Shoot, I just use vi on build.prop from betterterminal. Don't have to mess with adb at all
Click to expand...
Click to collapse
How would I do that? I have betterterminal emulator pro..
Four Fourty Four said:
How would I do that? I have betterterminal emulator pro..
Click to expand...
Click to collapse
$ su
# vi /system/build.prop
Proceed to edit (man vi, google vi). Bit of a pain in the ass though if you switch back and forth frequently.
mhaedo said:
$ su
# vi /system/build.prop
Proceed to edit (man vi, google vi). Bit of a pain in the ass though if you switch back and forth frequently.
Click to expand...
Click to collapse
Don't forget, you need to remount /system as rw also. it is a tiny bit of a pain, but I don't see much of a reason to switch back and forth all the time. Thus far I have yet to have any problems with JIT.
[email protected] said:
Don't forget, you need to remount /system as rw also. it is a tiny bit of a pain, but I don't see much of a reason to switch back and forth all the time. Thus far I have yet to have any problems with JIT.
Click to expand...
Click to collapse
The only time I consistently have problems with JIT is when tethering. Otherwise, I have yet to have any issues. I tether frequently, hence the script.
BTW, thanks for Apps2SD(2) and OpenOverclocker. They were very helpful to me at one point.
blakestimac said:
when i try to run the jit.sh file in terminal i get:
failed: no such file or directoryk3 on /system : not found
sdcard/jit.sh : 13: syntax error: end of file unexpected (expecting 'then")
am i completely retarded?
Click to expand...
Click to collapse
+1
I'm getting this message also.
blakestimac said:
when i try to run the jit.sh file in terminal i get:
failed: no such file or directoryk3 on /system : not found
sdcard/jit.sh : 13: syntax error: end of file unexpected (expecting 'then")
am i completely retarded?
Click to expand...
Click to collapse
Hm, strange. I can't duplicate this error. The steps I take are as follows:
1) Cut/paste the quoted code in the original post and save it in a document called jit.sh
2) On computer, adb push jit.sh /sdcard
3) In terminal on Nexus One:
$ cd sdcard
$ su
# sh jit.sh
JIT toggled ON
JIT enabled upon reboot
#
I'm sorry I can't be more help, but I'm not sure why you'd see that error.
mhaedo said:
Hm, strange. I can't duplicate this error. The steps I take are as follows:
1) Cut/paste the quoted code in the original post and save it in a document called jit.sh
2) On computer, adb push jit.sh /sdcard
3) In terminal on Nexus One:
$ cd sdcard
$ su
# sh jit.sh
JIT toggled ON
JIT enabled upon reboot
#
I'm sorry I can't be more help, but I'm not sure why you'd see that error.
Click to expand...
Click to collapse
Ok, I didn't do the whole adb push thing, I just copied it to my SDcard root from windows. Is that the problem?
BoostedSR20 said:
Ok, I didn't do the whole adb push thing, I just copied it to my SDcard root from windows. Is that the problem?
Click to expand...
Click to collapse
Ah, it's the line breaks. Windows uses a pair of CR and LF characters to terminate lines. Unix based system use an LF character only.
You can get a utility to convert the line breaks to unix style line breaks. I'm sure it will come in handy. I'll also upload the jit.sh with proper line breaks to the original post.
BoostedSR20 said:
Ok, I didn't do the whole adb push thing, I just copied it to my SDcard root from windows. Is that the problem?
Click to expand...
Click to collapse
Just tried pushing it to the sdcard, that went thru ok.
Still cant get it to run, same error. I've tried your command in the OP, and the what you wrote out a couple posts up. Same error on each one.
mhaedo said:
Ah, it's the line breaks. Windows uses a pair of CR and LF characters to terminate lines. Unix based system use an LF character only.
You can get a utility to convert the line breaks to unix style line breaks. I'm sure it will come in handy. I'll also upload the jit.sh with proper line breaks to the original post.
Click to expand...
Click to collapse
Ahhh, so it had to do with me making the file in the Windows Notepad. Got it..
Don't know if this has been mentioned anywhere, but I'll post it anyway...
This utility will come in handy for those who use terminal emulators. "Bash" features command completion (by holding the center button on the directional pad) and can execute previous commands from history (by pressing Up on the direction pad).
Simply unzip the attachment to anywhere on your SD card, and, using a terminal emulator like ConnectBot do the following:
Code:
cd sdcard/[I]<folder where bash was saved>[/I]
su
sh bash.sh
Or, if you want to run from OpenRecovery, then unzip the files under /sdcard/OpenRecovery/scripts, then edit "bash.sh" so that the "cp bash/bash /system/bin" line is changed to "cp /sdcard/OpenRecovery/scripts/bash/bash /system/bin". To install it, use the "Miscellaneous->Run Script" option from OpenRecovery.
It will automatically take effect as your default shell the next time you start a terminal session or reboot. Or just type 'bash'
Thanks for the script , I havent had a chance to use it just yet but it would be extremely useful
~PsyCl0ne
PsyCl0ne said:
Thanks for the script , I havent had a chance to use it just yet but it would be extremely useful
~PsyCl0ne
Click to expand...
Click to collapse
No problem! It's a time saver for me... no more need to re-type commands or type out the long folder names.
Isnt busybox sh acting the same way ? whats advantage over busybox sh ?
http://www.faqs.org/faqs/unix-faq/shell/shell-differences/
Scroll down till you see a table...
zewelor1 said:
Isnt busybox sh acting the same way ? whats advantage over busybox sh ?
Click to expand...
Click to collapse
I think the most visible is the permanent history.
Busybox has the permanent history as compile option but nobody cares to enable it.
For the rest the busybox's shell is more than enough for the limited usage on a cellphone.
oh this is awesome.
Gonna come in real handy for ro/rw mounting. I'd been cheating by throwing a bunch of common commands into the 'first command' line and saving different connection profiles in ConnectBot
-----
*edit*
bummer, couldn't get Terminal Emulator to initialize the session. Attached is a zip with sh.sh to restore your shell to sh - actually, it just redirects the sym. link from bash to sh (sh0 binary), so you could use it to swap back and forth if you want - bash is left on the system.
In case anybody cares, here's a pure C reimplementation of 'cuber.py'
(my own earlier reimplementation of @vortox's signature.py).
This is what I'm using in my '1-Click' bootloader unlock VM...
See 'grep ^gcc' for "build instructions".
Hack, you can probably build this for ARM and run it right on your very HDX tablet... (-;
UPDATE (JanuaryFebruary 2017):
OK; so, @zivimo had built this for ARM, but people still haven't noticed.
I repacked his binary from a .tar.gz to a .zip archive and decided to spell out the instructions for use.
Perhaps, this helps... With the right bootloader in place, and adb/fastboot installed (and working),
the unlock is as easy as follows...
Download and extract unlock.zip (SHA256: e40e3010f8eccfa9cbd1e73eecac30cf799099d183de23b2d256fc3407f143f6e5db0b8d82c8fd2a25a22b0a598014d22a2ec33cef27a8d4b65a36acde08f27a)
to the same directory that holds the adb and fastboot executables (unless you have added them to your PATH)
Click on get_code.bat in the extracted folder
-- optional (but commonly required) step(s) --
fix root (roll back, if you need to), flash vulnerable bootloader
[you'll definitely need to perform at least some of these if the last step fails]
Click on unlock.bat in the extracted folder
The archive also includes .sh variants of the .bat files for convenience.
You could also just click to show the hidden section and cut&paste... (-;
Code:
[STRIKE]unzip cuber.zip[/STRIKE]
adb push cuber /data/local/tmp/
adb shell chmod 0755 /data/local/tmp/cuber
adb shell 'id=$(cat /sys/class/block/mmcblk0/device/{manfid,serial}); echo "$id"; echo 0x${id:6:2}${id:11:8} | /data/local/tmp/cuber > /sdcard/unlock.code'
adb pull /sdcard/unlock.code
adb shell rm /sdcard/unlock.code /data/local/tmp/cuber
adb reboot-bootloader
fastboot -i 0x1949 flash unlock unlock.code
NOTE: download and extract the attached 'cuberunlock.zip' and run the above commands
in the directory where 'cuber' got extracted to.
Nice job! Originally I wanted to use OpenSSL BigNum too, but I hadn't enough time and Python was easier to use
hey,
made a static compile with an arm debian (jessie). seemed the easiest solution to me. compile command:
Code:
# gcc -fPIE -static cuber.c -o cuber -lssl -lcrypto
# strip cuber
# ldd cuber
not a dynamic executable
# ./cuber
Usage: cuber [RSA-bytes] < data > sig
seems to work. arm(!) binary attached.
ok draxie, you pointed me here but something seems to be missing. i downloaded unlock.zip, put the files in my adb directory. when i run get_code.bat, it pushes cuber to the kindle in the right directory, changes permissions (dont see any errors there) but then stops saying the system can't find the specified path. Whats funny is i used es file explorer to check the paths in the script, and they are there so not sure where the hang up is.
chin_bone said:
ok draxie, you pointed me here but something seems to be missing. i downloaded unlock.zip, put the files in my adb directory. when i run get_code.bat, it pushes cuber to the kindle in the right directory, changes permissions (dont see any errors there) but then stops saying the system can't find the specified path. Whats funny is i used es file explorer to check the paths in the script, and they are there so not sure where the hang up is.
Click to expand...
Click to collapse
Did you check all three paths?
/data/local/tmp
/sdcard
/sys/class/block/mmcblk0
The 2nd one _may_ be problematic if you're on SafeStrap.
I don't know why. I'm yet to install that on one of my test
devices to investigate. (Or, was that the 1st... )
The 0 in the 3rd one may actually be a 1 on some systems.
I have a few extra lines in my VM script to work around
that, I can easily add that here as well, if that turns out
to be the issue.
BUT, to try and troubleshoot: how far does the script get?
If it didn't complain with the permissions, the 1st path is probably OK.
Does it print your manfid/serial?
If so, mmcblkX would be right as well.
Any chance that you're on SafeStrap?
Can you push/pull to/from /sdcard?
- - - - -
On a second thought: I've only ever tested this on Linux.
String quoting on Windows may work differently, and could *royally* mess up how that more complex command is interpreted.
I'll test tomorrow; it's like 20 past 1am here. I need to get some sleep.
In the meantime, as a workaround, you could just hard-code your manfid/serial, and replace this line:
Code:
adb shell 'id=$(cat /sys/class/block/mmcblk0/device/{manfid,serial}); echo "$id"; echo 0x${id:6:2}${id:11:8} | /data/local/tmp/cuber > /sdcard/unlock.code'
by the decidedly much simpler:
Code:
adb shell 'echo 0xmmssssssss | /data/local/tmp/cuber > /sdcard/unlock.code'
draxie said:
Did you check all three paths?
/data/local/tmp
/sdcard
/sys/class/block/mmcblk0
The 2nd one _may_ be problematic if you're on SafeStrap.
I don't know why. I'm yet to install that on one of my test
devices to investigate. (Or, was that the 1st... )
The 0 in the 3rd one may actually be a 1 on some systems.
I have a few extra lines in my VM script to work around
that, I can easily add that here as well, if that turns out
to be the issue.
BUT, to try and troubleshoot: how far does the script get?
If it didn't complain with the permissions, the 1st path is probably OK.
Does it print your manfid/serial?
If so, mmcblkX would be right as well.
Any chance that you're on SafeStrap?
Can you push/pull to/from /sdcard?
- - - - -
On a second thought: I've only ever tested this on Linux.
String quoting on Windows may work differently, and could *royally* mess up how that more complex command is interpreted.
I'll test tomorrow; it's like 20 past 1am here. I need to get some sleep.
Click to expand...
Click to collapse
It's all good draxie, i figured out what i was doing wrong with the other procedure, that damn STEP 2, once i did it, everything fell into place. Bootloader unlocked and now just trying to figure out which rom to try first. Thanks again, you guys are great and i know how valuable everyones time is. :good:
I keep hitting road blocks, I am rooted and on Fire OS 4.5.5.2 I click get code a screen flashes up then I click Unlock and my Kindle boots to the Grey Kindle screen with Fastboot underneath and nothing else happens. Same happens when I copy and past the code into ADB. What step am I failing at? Thanks for the help!
pdanforth said:
I keep hitting road blocks, I am rooted and on Fire OS 4.5.5.2 I click get code a screen flashes up then I click Unlock and my Kindle boots to the Grey Kindle screen with Fastboot underneath and nothing else happens. Same happens when I copy and past the code into ADB. What step am I failing at? Thanks for the help!
Click to expand...
Click to collapse
@draxie - I have no experience with this tool; python/gmpy2 works reliably for me. Sorry to pull you in ...
Davey126 said:
@draxie - I have no experience with this tool; python/gmpy2 works reliably for me. Sorry to pull you in ...
Click to expand...
Click to collapse
I am up and running now, unlocked and running kk-fire-nexus-rom-thor-20161017. Play store is also up and running.
pdanforth said:
I am up and running now, unlocked and running kk-fire-nexus-rom-thor-20161017. Play store is also up and running.
Click to expand...
Click to collapse
Did you end up using some other method, or did these scripts work for you in the end?
Either way, others may find useful if you could share whatever worked for you. (-;
Unfortunately, I still haven't had a chance to test these scripts in Windows;
so, I couldn't answer your first call for help in a good way. If there's something
wrong and there's enough interest, I'll be happy to fix it as soon as I can.
draxie said:
Did you end up using some other method, or did these scripts work for you in the end?
Either way, others may find useful if you could share whatever worked for you. (-;
Unfortunately, I still haven't had a chance to test these scripts in Windows;
so, I couldn't answer your first call for help in a good way. If there's something
wrong and there's enough interest, I'll be happy to fix it as soon as I can.
Click to expand...
Click to collapse
@stangri did my unlock file and I used this thread to unlock https://forum.xda-developers.com/kindle-fire-hdx/general/thor-unlocking-bootloader-firmware-t3463982
I had trouble making the Unlock file, once that was done and some help from other users I am now up and running!
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).
In AOSP based android Q roms, there is a force dark option in developer settings whoich makes almost all apps to be appreaded in dark mode.
This option gets unselected after reboot.
One has to enable it after every reboot.
However it's possible to enable it by default after reboot.
For rooted phone.
Just add the following line in your build.prop file
debug.hwui.force_dark=true
Thats all.
It's working in my phone. Tested.
For unrooted Phone
execute the following line after reboot
setprop debug.hwui.force_dark true
To make it auto after reboot use tasker or script manager app or smthing similer.
Check the space after setprop and dark.
Hit a thanks to me if you are benifited.
Screenshots.??
Screenshot
Hmmmm.
Screenshot for many apps.?
Thanks
LoveFootJob said:
Hmmmm.
Screenshot for many apps.?
Thanks
Click to expand...
Click to collapse
look at your back....its there already
[email protected] said:
For unrooted Phone
execute the following line after reboot
setprop debug.hwui.force_dark true
To make it auto after reboot use tasker or script manager app or smthing similer.
Check the space after setprop and dark.
Click to expand...
Click to collapse
Hi
How did you manage that?
As far as I know, setprop needs root or it won't work unless it's done via adb on a computer
Sent from my SM-N976B using XDA Labs
paolo200 said:
Hi
How did you manage that?
As far as I know, setprop needs root or it won't work unless it's done via adb on a computer
Click to expand...
Click to collapse
No...it will work...
Just auto execute it after every reboot thru tasker
[email protected] said:
No...it will work...
Just auto execute it after every reboot thru tasker
Click to expand...
Click to collapse
Ok. Thanks.
May I ask what is the action to use within tasker?
Sent from my SM-N976B using XDA Labs
davidking2893 said:
First, turn off regular dark mode (if enabled) and reboot your cell phone. Then, toggle the override-dark-mode option in developer settings and restart the settings app. This will force all apps into the override-dark-mode color scheme. Thats' it.
Click to expand...
Click to collapse
Question is how to do it auto after reboot
[email protected] said:
For unrooted Phone
execute the following line after reboot
setprop debug.hwui.force_dark true
To make it auto after reboot use tasker or script manager app or smthing similer.
Check the space after setprop and dark.
Hit a thanks to me if you are benifited.
Click to expand...
Click to collapse
I don't get you. Can you give a detailed tutorial?
Not working
Im on a non-rooted Galaxy S10e [Android 10, OneUI 2.0]. If I run the command with tasker, it gives me the following message ("Ausführen" is german and means "execute", "Fehler" means "error"):
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/Shell runBackground setprop debug.hwui.force_dark true root: false timeout: -1
05.06.39/Shell start process-thread ID 672
05.06.39/E add wait type Shell1 time 2147483647
05.06.39/E add wait type Shell1 done
05.06.39/E add wait task
05.06.39/E Fehler: 1
If I do it with the app "Android Terminal Emulator" it gives me the following error:
:/ $ setprop debug.hwui.force_dark true
setprop: failed to set property 'debug.hwui.force_dark' to 'true'
Either way, it doesnt work for me. Does anybody know what could be the issue here? Ive also tried setting it to "1" instead of "true", same result. Setting the real setting to enabled or disabled doesnt matter either.
RnKn98 said:
Im on a non-rooted Galaxy S10e [Android 10, OneUI 2.0]. If I run the command with tasker, it gives me the following message ("Ausführen" is german and means "execute", "Fehler" means "error"):
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/E Shell Ausführen: ->
05.06.39/Shell runBackground setprop debug.hwui.force_dark true root: false timeout: -1
05.06.39/Shell start process-thread ID 672
05.06.39/E add wait type Shell1 time 2147483647
05.06.39/E add wait type Shell1 done
05.06.39/E add wait task
05.06.39/E Fehler: 1
If I do it with the app "Android Terminal Emulator" it gives me the following error:
:/ $ setprop debug.hwui.force_dark true
setprop: failed to set property 'debug.hwui.force_dark' to 'true'
Either way, it doesnt work for me. Does anybody know what could be the issue here? Ive also tried setting it to "1" instead of "true", same result. Setting the real setting to enabled or disabled doesnt matter either.
Click to expand...
Click to collapse
In Samsung phone setprop command is diff i guess... Google it for command.
[email protected] said:
In Samsung phone setprop command is diff i guess... Google it for command.
Click to expand...
Click to collapse
Do you have proof it's working for non root??
[email protected] said:
In Samsung phone setprop command is diff i guess... Google it for command.
Click to expand...
Click to collapse
First thanks for the answer , but...
I dont think its different. The getprop command (getprop debug.hwui.force_dark) works fine, gives me true if its turned on.
If i do the setprop command over adb (adb shell setprop debug.hwui.force_dark true) it also works fine.
The only thing not working is the setprop command executed directly on my device. Which lets me conclude that i probably need root?
RnKn98 said:
First thanks for the answer , but...
I dont think its different. The getprop command (getprop debug.hwui.force_dark) works fine, gives me true if its turned on.
If i do the setprop command over adb (adb shell setprop debug.hwui.force_dark true) it also works fine.
The only thing not working is the setprop command executed directly on my device. Which lets me conclude that i probably need root?
Click to expand...
Click to collapse
No... Its working in non rooted device... Tested.
There may be one more thing... Shell need to have write secure settings permission. Its permission issue.
[email protected] said:
In AOSP based android Q roms, there is a force dark option in developer settings whoich makes almost all apps to be appreaded in dark mode.
This option gets unselected after reboot.
One has to enable it after every reboot.
However it's possible to enable it by default after reboot.
For rooted phone.
Just add the following line in your build.prop file
debug.hwui.force_dark=1
Thats all.
It's working in my phone. Tested.
Hit a thanks to me if you are benifited.
Click to expand...
Click to collapse
Hello,
Thank you so much for your solution that works very well on my rooted phone :good:
1) I would like to know how to totally disable this feature if I no longer want the override force-dark someday please ?
2) Actually, how to force the rest of the remaining white applications to become black please ?
Thank you in advance for your help.
Cordially
MobAndro said:
Hello,
Thank you so much for your solution that works very well on my rooted phone :good:
1) I would like to know how to totally disable this feature if I no longer want the override force-dark someday please ?
2) Actually, how to force the rest of the remaining white applications to become black please ?
Thank you in advance for your help.
Cordially
Click to expand...
Click to collapse
Just switch off dark theme... Force dark need not to be changed. Add dark theme icon in qs header
[email protected] said:
Just switch off dark theme... Force dark need not to be changed. Add dark theme icon in qs header
Click to expand...
Click to collapse
Hello,
I've been using the dark mode since I bought my S10.
I discovered the override force-dark a few days ago then I realized that after the reboot this option was disabled on its own and every time.
I did some research to have it automatically and I came across your tuto that worked very well for me. Only some applications had problems with the override force-dark.
Since yesterday, I don't know why now the override force-dark disables itself. When I turn it on, it immediately turns off itself without even restarting.
I don't understand what's going on because this option was automatically activated after each reboot.
I didn't again even touch the build.prop either...
MobAndro said:
Hello,
I've been using the dark mode since I bought my S10.
I discovered the override force-dark a few days ago then I realized that after the reboot this option was disabled on its own and every time.
I did some research to have it automatically and I came across your tuto that worked very well for me. Only some applications had problems with the override force-dark.
Since yesterday, I don't know why now the override force-dark disables itself. When I turn it on, it immediately turns off itself without even restarting.
I don't understand what's going on because this option was automatically activated after each reboot.
I didn't again even touch the build.prop either...
Click to expand...
Click to collapse
It's tough to tell the problem from here. U hv to find it.
[email protected] said:
It's tough to tell the problem from here. U hv to find it.
Click to expand...
Click to collapse
Do you think that I can delete this line "debug.hwui.force_dark=1" and put it back in the build.prop again after reboot please ?
Because it's the first time that I've modified this system file so I'm not used to manipulating it...
Thank you in advance for your answer.