[ROOT] Disable charging LED - Xiaomi Mi A1 Themes, Apps, and Mods

If anyone wants to disable charging LED, here's an easy way via Tasker.
Note: notifications will not cause LED to blink while charging
State, power, power any
Enter task:
1. run shell as root, "chmod 644 /sys/class/leds/red/brightness"
2. run shell as root, "echo 0 > /sys/class/leds/red/brightness"
3. run shell as root, "chmod 444 /sys/class/leds/red/brightness"
Exit task:
1. run shell as root, "chmod 644 /sys/class/leds/red/brightness"
2. run shell as root, "echo 0 > /sys/class/leds/red/brightness"

Hi! Thanks for sharing. I am getting the following error:
23.21.58/E Run Shell: ->
23.21.58/E Run Shell: ->
23.21.58/E Run Shell: ->
23.21.58/Shell runBackground "chmod 644 /sys/class/leds/red/brigthness" root: true timeout: -1
23.21.58/Shell start process-thread ID 725
23.21.58/E add wait type Shell1 time 2147483647
23.21.58/E add wait type Shell1 done
23.21.58/E add wait task
23.21.58/E Error: 127
Am I doing something wrong?
Thanks!

Dj Telo said:
Hi! Thanks for sharing. I am getting the following error:
23.21.58/E Run Shell: ->
23.21.58/E Run Shell: ->
23.21.58/E Run Shell: ->
23.21.58/Shell runBackground "chmod 644 /sys/class/leds/red/brigthness" root: true timeout: -1
23.21.58/Shell start process-thread ID 725
23.21.58/E add wait type Shell1 time 2147483647
23.21.58/E add wait type Shell1 done
23.21.58/E add wait task
23.21.58/E Error: 127
Am I doing something wrong?
Thanks!
Click to expand...
Click to collapse
Does Tasker have root access? Check it in Magisk/superuser section.

_mysiak_ said:
Does Tasker have root access? Check it in Magisk/superuser section.
Click to expand...
Click to collapse
Yes it does. I can even execute other shell commands with root without problem. Is the command you are giving maybe only valid with Nougat and not Oreo?
Thanks!

Dj Telo said:
Yes it does. I can even execute other shell commands with root without problem. Is the command you are giving maybe only valid with Nougat and not Oreo?
Thanks!
Click to expand...
Click to collapse
Oups, my bad, sorry for the typo in the instructions. It has to be brigHTness, not brigTHness.

Will this work on the Mi A3 too?
And will the notification led still blink when not charging the phone?
Thank you

DBuffon said:
Will this work on the Mi A3 too?
And will the notification led still blink when not charging the phone?
Thank you
Click to expand...
Click to collapse
I don't have rooted A3 at hand, so can't try it. It might work, there is no harm in sending those commands over adb shell as root user. You will see the result immediately.
Sent from my Mi A1 using Tapatalk

_mysiak_ said:
I don't have rooted A3 at hand, so can't try it. It might work, there is no harm in sending those commands over adb shell as root user. You will see the result immediately.
Click to expand...
Click to collapse
Ok, I'll try but I don't understand the following:
_mysiak_ said:
State, power, power any
Enter task:
1. run shell as root, "chmod 644 /sys/class/leds/red/brightness"
2. run shell as root, "echo 0 > /sys/class/leds/red/brightness"
3. run shell as root, "chmod 444 /sys/class/leds/red/brightness"
Exit task:
1. run shell as root, "chmod 644 /sys/class/leds/red/brightness"
2. run shell as root, "echo 0 > /sys/class/leds/red/brightness"
Click to expand...
Click to collapse
Are the "Enter task" the code that should be run when the charging cable connects to the phone and the "Exit task" the one that runs when unplugging the cable?
I don't understand what this code does, and I don't want to mess up the led (that is: before I proceed, I want to know how to revert if things don't go as they should). Thank you.

DBuffon said:
Ok, I'll try but I don't understand the following:
Are the "Enter task" the code that should be run when the charging cable connects to the phone and the "Exit task" the one that runs when unplugging the cable?
I don't understand what this code does, and I don't want to mess up the led (that is: before I proceed, I want to know how to revert if things don't go as they should). Thank you.
Click to expand...
Click to collapse
Enter and exit tasks are for Tasker. If you want to try the commands from adb shell, enter those mentioned in "entry task" first and check if LED stopped glowing. To restore the original state enter commands from "exit task" (or just reboot the phone). Changes are not permanent.
Commands do the following - enable RW access to LED control, set intensity to 0%, disable RW access.

_mysiak_ said:
Enter and exit tasks are for Tasker. If you want to try the commands from adb shell, enter those mentioned in "entry task" first and check if LED stopped glowing. To restore the original state enter commands from "exit task" (or just reboot the phone). Changes are not permanent.
Commands do the following - enable RW access to LED control, set intensity to 0%, disable RW access.
Click to expand...
Click to collapse
Great, thanks for the information.
Unfortunately I can't issue the commands (sorry, I'm new to the adb shell):
Code:
[email protected]:~$ adb shell chmod 644 /sys/class/leds/red/brightness
chmod: /sys/class/leds/red/brightness: Permission denied
[email protected]:~$ adb root
adbd cannot run as root in production builds

DBuffon said:
Great, thanks for the information.
Unfortunately I can't issue the commands (sorry, I'm new to the adb shell):
Code:
[email protected]:~$ adb shell chmod 644 /sys/class/leds/red/brightness
chmod: /sys/class/leds/red/brightness: Permission denied
[email protected]:~$ adb root
adbd cannot run as root in production builds
Click to expand...
Click to collapse
adb shell
su
chmod ....

It works on the A3 too. Thanks!

In my mi A1, revengeos android 9, in enter task, 2th step go in error

d_borghi said:
In my mi A1, revengeos android 9, in enter task, 2th step go in error
Click to expand...
Click to collapse
What kind of error..?

_mysiak_ said:
What kind of error..?
Click to expand...
Click to collapse
Allego

d_borghi said:
Allego
Click to expand...
Click to collapse
Try to run that command from terminal on the phone (or via ADB) as root. Alternatively, store the error message in some variable in Tasker and display it, so we know why exactly does it fail. On my phone it still works fine (Mi A3 now).

how can i try by an emulator terminal app in my phone directly?

d_borghi said:
how can i try by an emulator terminal app in my phone directly?
Click to expand...
Click to collapse
Install and run for example this app https://play.google.com/store/apps/details?id=yarolegovich.materialterminal&hl=en

_mysiak_ said:
Install and run for example this app https://play.google.com/store/apps/details?id=yarolegovich.materialterminal&hl=en
Click to expand...
Click to collapse
Finally, I try the app.
By this terminal I receive no error, look at the screenshot.
Why tasker goes in error?

d_borghi said:
Finally, I try the app.
By this terminal I receive no error, look at the screenshot.
Why tasker goes in error?
Click to expand...
Click to collapse
Could you take a screenshot of the details in Tasker for that one task which gives you an error? Maybe you have a typo there.

Related

Regaws Root Method???

Is there something additional I need to do to actually gain "root"? I can't install the clear lock screen from smurf, can't wireless tether.... Don't know what's going on, all of this used to work fine on my Hero - what am I missing?
I don't think you have given enough info for people to even know what the problem is that you are having. Maybe you could be a bit more specific. Do you have superuser installed?
Sorry about that.... basically im on stock 2.2 with supposed "root" using regaws method - problem is, I can't use anything though; adb, wireless tether, I can't flash a lock screen (just sits at boot screen).
Download superuser app from the market place or google it if it is not on your phone already. Install it then launch an app that requires root. You will know real fast if you are rooted.
DomSim said:
Download superuser app from the market place or google it if it is not on your phone already. Install it then launch an app that requires root. You will know real fast if you are rooted.
Click to expand...
Click to collapse
I do have SU... that's the thing but when I try ADB Remount it says device not permitted or something like that, can't remember exactly
You could try full wipe / reflash.
Maybe try a diff ROM too.
You need to flash the engineering bootloader (0.76.2000). Go to Toast's method part 2 and follow the steps to unlock nand. You need the engineering bootloader in order to access /system.
Sent from my PC36100 using XDA App
sombdy said:
You need to flash the engineering bootloader (0.76.2000). Go to Toast's method part 2 and follow the steps to unlock nand. You need the engineering bootloader in order to access /system.
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
Nand root... I was looking for more info on this, I thought it was the culprit, thanks - ill post results, hopefully good
Edit: Won't work "Permission denied" .... this is really starting to piss me off grrr
DirtyShroomz said:
Nand root... I was looking for more info on this, I thought it was the culprit, thanks - ill post results, hopefully good
Edit: Won't work "Permission denied" .... this is really starting to piss me off grrr
Click to expand...
Click to collapse
Have you run Unrevoked Forever? This will turn off security permissions and should then allow you to flash anything.
Sent from my PC36100 using XDA App
Ok, the reason
Code:
adb remount
doesn't work is because the boot.img isn't patched to allow that, because I forgot to at the time of posting. You still have root (as long as you actually completed the guide successfully), that's just an all time access root through adb
To acheive the same results, type
Code:
adb shell
type
Code:
su
you will then see #. thats root.
Then remount your /system partition using
Code:
mount -o rw,remount / /system
there you go.
regaw_leinad said:
Ok, the reason
Code:
adb remount
doesn't work is because the boot.img isn't patched to allow that, because I forgot to at the time of posting. You still have root (as long as you actually completed the guide successfully), that's just an all time access root through adb
To acheive the same results, type
Code:
adb shell
type
Code:
su
you will then see #. thats root.
Then remount your /system partition using
Code:
mount -o rw,remount / /system
there you go.
Click to expand...
Click to collapse
When I try to type "su" it says "Permission denied"
DirtyShroomz said:
When I try to type "su" it says "Permission denied"
Click to expand...
Click to collapse
Do you have usb debugging on?
Try the new 1 click root in the dev forum. Unrevoked 3.2. See if that doesn't do the trick.
Sent from my PC36100 using XDA App
My guess is you didn't flash the 2.2-root.zip at the end then.. That's the best I can do w/ the info you've given.
one was already asked once but i had two questions
1. Is USB Debugging turned on or off? Settings > Applications > Development
2. you are using a stock rooted rom. are you trying to use sprint's wireless tether app? Sprint's app wont work you need to download wireless tether from the market.
joebags said:
one was already asked once but i had two questions
1. Is USB Debugging turned on or off? Settings > Applications > Development
2. you are using a stock rooted rom. are you trying to use sprint's wireless tether app? Sprint's app wont work you need to download wireless tether from the market.
Click to expand...
Click to collapse
Running stock 2.2. Regaw I did flash 2.2-root at the end and I am trying to use wireless tether not Sprints hotspot
I do have superuser in my apps list and I was able to install SNeoid, Swype, Setcpu, juicedefender and a few others that may require root but it wont let me do anything via adb or install any themes/mods that come in .zips
DirtyShroomz said:
Running stock 2.2. Regaw I did flash 2.2-root at the end and I am trying to use wireless tether not Sprints hotspot
I do have superuser in my apps list and I was able to install SNeoid, Swype, Setcpu, juicedefender and a few others that may require root but it wont let me do anything via adb or install any themes/mods that come in .zips
Click to expand...
Click to collapse
ok do this in command prompt and paste the results in code tags (to save space)
Code:
adb shell ls /system/bin/
regaw_leinad said:
ok do this in command prompt and paste the results in code tags (to save space)
Code:
adb shell ls /system/bin/
Click to expand...
Click to collapse
Code:
setconsole
dumplayer
svc
e2fsck_recvy
chownto
apph
ps
id
chownThp
notify
dhcpcd
pand
renice
bugreport
snd8k
hciattach
iqfd
top
lsmod
setprop
ionice
ifconfig
iptables
kthp_proxy
logwrapper
getevent
htcipcd
su
start
iqd
wipe
ip
smd
sleep
getWiMAXPropDaemond
newfs_msdos
vdc
sync
udhcpd
pppd
rmmod
fsck_msdos
netstat
route
sound8k
rm
radiooptions
pm
logcat
setWiMAXPropDaemond
resize2fs_recvy
htc_inittest
vmstat
dvz
mmcamera_test
keystore
dmesg
system_server
linker
fbtool
reboot
sdptool
busybox
hd
iftop
insmod
bootcomplete
rild
schedtop
debuggerd
wpa_supplicant
schedtest
bluetoothd
ping
btld
ime
omx_tests
tc
sendevent
racoon
toolbox
date
bma150_usr
bootanimation
wimaxDhcpRenew
log
installd
wimax_uart
applypatch
wimaxAddRoute
dexopt
monkey
ln
getprop
album_hdmiexe
stop
surfaceflinger
uevent
akmd
monitorMTD
wimax_mtd
mv
debug_tool
servicemanager
wimaxDumpKmsg
dumpstate
ipd
DmWrapperTest
nandread
kill
gzip
chmod
rmdir
lsc_camera
dbus-daemon
run-as
netcfg
cat
htclogkernel
sh
mount
printenv
mkdir
bmgr
wimaxDhcpRelease
umount
mke2fs_recvy
dnsmasq
input
df
ioctl
am
wimaxDumpLogcat
app_process
chown
htc_timezonetest
service
netd
ls
netsharing
cam_ins_spmo
mm-venc-omx-test
dalvikvm
ser2net
dmagent
shutdown
ndc
dumpsys
mediaserver
vold
sequansd
awb_camera
dd
keypress
cmp
mscompress
wimaxDumpLastKmsg
mtpd
watchprops
ok, so "su" is in there... you should be able to
Code:
adb shell
su
and it give you a #
try opening SuperUser.apk on your phone, THEN doing the above commands. a pop up should come up on your phone saying to allow root to su
regaw_leinad said:
ok, so "su" is in there... you should be able to
Code:
adb shell
su
and it give you a #
try opening SuperUser.apk on your phone, THEN doing the above commands. a pop up should come up on your phone saying to allow root to su
Click to expand...
Click to collapse
that worked, now to get remount do i have to always use that previous command you wrote?

[ROOT] Navigation keys back light control

I've been looking for a way how to have navigation keys back light always on while screen on (I was distracted by blinking caused by short timeout value) and at the same time always off for ebook reading and video watching and the solution should be simple and future proof (working on Nougat and Oreo as well). It is partially possible with Xposed and Gravitybox, but I am preparing myself for Oreo update, so I want to replace as many of its functions as possible. Long story short, use Tasker with following:
1. Event, display on, task:
run shell command as root, "chmod 644 /sys/class/leds/button-backlight/brightness"
run shell command as root, "echo 10 > /sys/class/leds/button-backlight/brightness"
run shell command as root, "chmod 444 /sys/class/leds/button-backlight/brightness"
2. Event, display off, task:
run shell command as root, "chmod 644 /sys/class/leds/button-backlight/brightness"
run shell command as root, "echo 0 > /sys/class/leds/button-backlight/brightness"
run shell command as root, "chmod 444 /sys/class/leds/button-backlight/brightness"
3. Application, ebook reader, youtube,..
Enter task
run shell command as root, "chmod 644 /sys/class/leds/button-backlight/brightness"
run shell command as root, "echo 0 > /sys/class/leds/button-backlight/brightness"
run shell command as root, "chmod 444 /sys/class/leds/button-backlight/brightness"
Exit task
run shell command as root, "chmod 644 /sys/class/leds/button-backlight/brightness"
run shell command as root, "echo 10 > /sys/class/leds/button-backlight/brightness"
run shell command as root, "chmod 444 /sys/class/leds/button-backlight/brightness"
Hi.
Is this working?
I really hate buttons light and would like to shut them off for good.
I guess that running this script after booting should work (if yours is working)
echo 0 > /sys/class/leds/button-backlight/brightness
What do you think?
Thanks in advance.
pantezuma said:
Hi.
Is this working?
I really hate buttons light and would like to shut them off for good.
I guess that running this script after booting should work (if yours is working)
echo 0 > /sys/class/leds/button-backlight/brightness
What do you think?
Thanks in advance.
Click to expand...
Click to collapse
I am still using this method without any issues. I even enhanced it with lowering the keys back light intensity during night, quite handy in total darkness
To disable back light permanently after boot use this:
1. run shell command as root, "chmod 644 /sys/class/leds/button-backlight/brightness"
2. run shell command as root, "echo 0 > /sys/class/leds/button-backlight/brightness"
3. run shell command as root, "chmod 444 /sys/class/leds/button-backlight/brightness"
Explanation:
1. make sure that we have RW configuration rights (I would say that this is optional in your case, but it won't hurt anything)
2. disable brightness
3. remove RW configuration rights (otherwise system apps can and will enable the back light again when you turn screen off and on)
Thanks for you fast reply.
I'm still trying to understand how magisk works with scripting (and the permissions you mention that I didn't know were required).
I come from an old S2 running custom Jelly Bean and all this systemless stuff is new to me as previously I used to put scripts in init.d and that was all I needed, but now I don't want to modify system partition.
I am using Magisk for root and few build.prop tweaks, not sure how init.d works with it. In the past I had luck with Script manager - it was enough to create a script file, open it with Script manager and set it as "run as root and at boot time". Or you can still use an automation app which can run shell commands (Tasker has this feature for sure).
_mysiak_ said:
I am using Magisk for root and few build.prop tweaks, not sure how init.d works with it. In the past I had luck with Script manager - it was enough to create a script file, open it with Script manager and set it as "run as root and at boot time". Or you can still use an automation app which can run shell commands (Tasker has this feature for sure).
Click to expand...
Click to collapse
As far as I know, anything you put under /magisk/.core/post-fs-data.d would be ran as a script after boot.
But as I said before, just starting with this and may be talking nonsense.
I really wouldn't like to install tasker or anything else as I just want them off for the rest of my life!
Thanks!
PD: Sorry for my english.
_mysiak_ said:
I am using Magisk for root and few build.prop tweaks, not sure how init.d works with it. In the past I had luck with Script manager - it was enough to create a script file, open it with Script manager and set it as "run as root and at boot time". Or you can still use an automation app which can run shell commands (Tasker has this feature for sure).
Click to expand...
Click to collapse
Hey!
I was able to run your commands via ADB and everything is working perfect (I don't know why but they didn't work via terminal emulator)
Only issue is that whenever I reboot my phone everything is lost.
My problem is that I'm unable to make a script that runs at boot time (I'm pretty ignorant in scripting and where to put that script).
Any help or suggestions will be highly appreciated!
pantezuma said:
Hey!
I was able to run your commands via ADB and everything is working perfect (I don't know why but they didn't work via terminal emulator)
Only issue is that whenever I reboot my phone everything is lost.
My problem is that I'm unable to make a script that runs at boot time (I'm pretty ignorant in scripting and where to put that script).
Any help or suggestions will be highly appreciated!
Click to expand...
Click to collapse
Don't forget to add "su" as a first command if you are running it from terminal emulator. Try Script manager mentioned before, it can do what you want quite easily - just put all commands in a file, save it somewhere on the internal SD, open it from SM, set as run at boot and run as root and that's it. You can run your scripts on demand as well, so you can check quickly if it's working fine.
I remembered that had bought Tasker a few years ago (but never really used it) so I created a task to perform the above mentioned commands at boot.
Anyway, I'm still unable to make a script and run it via terminal emulator, and that's really annoying!
I'll keep investigating.
Thanks a lot!
pantezuma said:
Anyway, I'm still unable to make a script and run it via terminal emulator, and that's really annoying!
Click to expand...
Click to collapse
What is the exact content of the script file, what are the file permissions and how do you try to run it?
_mysiak_ said:
What is the exact content of the script file, what are the file permissions and how do you try to run it?
Click to expand...
Click to collapse
Hi!
This script is something like this:
#!/bin/sh
su
chmod 644 /sys/class/leds/button-backlight/brightness
echo 0 > /sys/class/leds/button-backlight/brightness
chmod 444 /sys/class/leds/button-backlight/brightness
Named it "lights sh" and put in on my internal SD card,
Then, with terminal emulator browsed to its location and tried to run it via "./lights sh"
I got "Permission denied" and also some errors like "backlight not found".
Couldn't find the way to change permissions (Reading a little more found that internal SD card is mounted as non executable. Is that correct?
Later I moved the file to DATA and changed permissions to 755 obtaining the same results.
As you may notice I'm a complete noob regarding scripting and permissions and I apologize for that!
Thanks in advance!
pantezuma said:
Hi!
This script is something like this:
#!/bin/sh
su
chmod 644 /sys/class/leds/button-backlight/brightness
echo 0 > /sys/class/leds/button-backlight/brightness
chmod 444 /sys/class/leds/button-backlight/brightness
Named it "lights sh" and put in on my internal SD card,
Then, with terminal emulator browsed to its location and tried to run it via "./lights sh"
I got "Permission denied" and also some errors like "backlight not found".
Couldn't find the way to change permissions (Reading a little more found that internal SD card is mounted as non executable. Is that correct?
Later I moved the file to DATA and changed permissions to 755 obtaining the same results.
As you may notice I'm a complete noob regarding scripting and permissions and I apologize for that!
Thanks in advance!
Click to expand...
Click to collapse
I've just made a very simple script:
1.
#!/bin/sh
echo hello world!
2. saved it to the internal sd card as "script.sh"
3. chmod 755 script.sh
4. running it as "./script.sh" gives the permission denied error, but "sh script.sh" works fine
In your case, remove "su" command from the script file itself, but run it in terminal before calling the script instead. Or just use script manager
Thanks, working great Tasker profiles...
how to lower the brightness of thw buttons? on night the light is so bright and on the white variant looks horrible xD
deewfrank said:
how to lower the brightness of thw buttons? on night the light is so bright and on the white variant looks horrible xD
Click to expand...
Click to collapse
If you have tasker:
Code:
run shell command as root, "chmod 644 /sys/class/leds/button-backlight/brightness"
if %LIGHT > 3
run shell command as root, "echo 10 > /sys/class/leds/button-backlight/brightness"
else
run shell command as root, "echo 1 > /sys/class/leds/button-backlight/brightness"
end if
run shell command as root, "chmod 444 /sys/class/leds/button-backlight/brightness"
It will set brightness based on the surrounding light level.

Disable heads up OOS Oreo

I hope someone can help me here. I am looking to disable the annoying ugly heads up notifications that come on my phone.
I am rooted with magisk using OB4 8.1 Oreo. I also tried this on OB3 and it didn't work but I thought OB4 might work.
I have tried the terminal bmehtod and the dB method but both don't work for me. Is there a reason why or does anyone know a way to disable heads up. Thanks
Gravitybox allows you to disable them on a per-app basis or as a global setting.
Enable gaming mode
i use the same command as yours in adb, it works on OB4.
just add "adb shell" before the command.
Code:
adb shell settings put global heads_up_notifications_enabled 0
hassan_1000 said:
I hope someone can help me here. I am looking to disable the annoying ugly heads up notifications that come on my phone.
I am rooted with magisk using OB4 8.1 Oreo. I also tried this on OB3 and it didn't work but I thought OB4 might work.
I have tried the terminal bmehtod and the dB method but both don't work for me. Is there a reason why or does anyone know a way to disable heads up. Thanks
Click to expand...
Click to collapse
Need to do su command twice, so "su"-> enter then again "su" - enter.
lockmunk said:
i use the same command as yours in adb, it works on OB4.
just add "adb shell" before the command.
Code:
adb shell settings put global heads_up_notifications_enabled 0
Click to expand...
Click to collapse
i i want enable again what is the command
MsuatafaKhatab said:
i use the same command as yours in adb, it works on OB4.
just add "adb shell" before the command.
i i want enable again what is the command
Click to expand...
Click to collapse
Change 0 to 1
vkass said:
Need to do su command twice, so "su"-> enter then again "su" - enter.
Click to expand...
Click to collapse
This worked for me. Thanks so much!
lockmunk said:
i use the same command as yours in adb, it works on OB4.
just add "adb shell" before the command.
Code:
adb shell settings put global heads_up_notifications_enabled 0
Click to expand...
Click to collapse
it does not work with Terminal Emulator. I tried with Terminal Emulator and can see the result as sh: adb: not found.
I haven't tried it with my PC.
I found an alternative methods to do this.
Application Method:
2- HeadsOff app method [FREE]
a) Install "HeadsOff - TickerOn" - https://play.google.com/store/apps/d...oheadsup&hl=en
b) Open the application.
c) Disable the Heads-Up notifications clicking on Settings.
d) Select "Start the App" button.
e) If a "Notification access" screen appears, allow the app to control your notifications by ticking it.
f) Reboot your phone.
g) Done!
Terminal Emulator Method:
3- Terminal method (directly from your phone) [FREE]
a) Install "Terminal Emulator for Android" - https://play.google.com/store/apps/d...roidterm&hl=en
b) Open the application. Use the following command:
Code:
su
c) The indicator should change from "$" to "#". Do the following command now:
Code:
settings put global heads_up_notifications_enabled 0
d) Reboot your phone.
e) Done!
Thanks to @1edson
Posting link: https://forum.xda-developers.com/android/general/howto-4-to-disable-heads-notifications-t3197660

[GUIDE] Access color-filter through command shell

I'm running on the 10.5.10.IN11BA build.
Just get a command shell to your OnePlus 8 Pro through adb, no need for the device to be rooted or anything.
Once you get there, just type:
Code:
am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
It will launch the FactoryMode app and get you directly to the manual camera test view.
Just press the bottom right icon until you get to the color filter.
I have no doubt there is easier and quicker ways to get the same result, maybe through an apk.
Edit:
As far as I know, this workaround could work on any OnePlus 8 Pro model.
Also, as pointed out by ster88, you also can take videos with the filter, which was not possible with the camera app.
I tried not working. I used th terminal app from google playstore.
Can u specifically provide which app and where.
And anything to enable on developer mode.
sajjadhussaini said:
I tried not working. I used th terminal app from google playstore.
Can u specifically provide which app and where.
And anything to enable on developer mode.
Click to expand...
Click to collapse
Sure !
To enable developper mode, go to "Settings > About phone" and tap the "Build number" until they tell you have developper mode enabled.
Then go to "Settings > System > Developper options" and under "Debugging" enable "USB Debugging" and "Wireless ADB Debugging".
Once that is done, on your computer, download the platform-tools, containing adb here :
Code:
https://developer.android.com/studio/releases/platform-tools
Once it is downloaded, go inside it with your command line.
If you are doing this wirelessly, get your phone IP address and type:
Code:
adb connect <your-phone-ip-address>
Then if it worked, to know what the transport id of our device is, type :
Code:
adb devices -l
Once you have the transport id, type this to get a shell to your phone:
Code:
adb -t <transport-id> shell
You can get more details on how adb works here:
Code:
https://developer.android.com/studio/command-line/adb
Then when you have access to the shell, just type:
Code:
am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
If everything went fine, you should get access to the camera !
I could not use a terminal app to run the command, usually because the terminal app doesn't want to let the camera application to take over the view, or something like that, not sure.
The ideal would be to have a dedicated apk to run the command, at least for the time being.
Tried to launch using an app called Activity launcher and it didn't work.
play.google.com/store/apps/details?id=de.szalkowski.activitylauncher
imgur.com/a/BS9Wqzc
I'm not rooted, are you sure this works for non rooted devices? I'll try later with adb to see what happens.
Here is the error from Termux. Hope it can be loaded via apk, not sure if it suffers same restrictions:
$ am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Warning: Activity not started because the current activity is being kept for the user.
From what I understood, you need to run the command from an adb shell. You cannot run it from within the phone as far as I know.
You can still run it from adb and "lock" the application so it stays in the background.
And I tried with multiple Terminal apps, the command works with none of them (Termux, Terminal Emulator, Material Terminal, etc...)
Apparently, you have some rights on the adb command shell that you don't get as a simple user on the phone.
You man are genius. I found easy way also to keep it running if needed. After getting the camera test to run, you can lock the app so phone will not close it and always return to it. Thanks, finally I can enjoy my camera
Launched it without a computer by using ADB from temux
--no root required
https://github.com/MasterDevX/Termux-ADB
*Enable wireless debugging (wireless doesn't actually need to be on)
Note wireless debugging --takes some time to take effect, sometimes up to 3-5 minutes for me.
*Run the installer above in termux,
*Type adb devices
*Type adb connect 127.0.0.1
*Accept the trusted key
*type adb shell
Troubleshooting:
*If you get an error about multiple devices type adb kill-server
*type adb devices
*type adb shell
*Accept the trusted key
*then paste in: am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
lllsondowlll said:
Here is the error from Termux. Hope it can be loaded via apk, not sure if it suffers same restrictions:
$ am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Warning: Activity not started because the current activity is being kept for the user.
Click to expand...
Click to collapse
Did you get any solution for this ?
aishkumar said:
Did you get any solution for this ?
Click to expand...
Click to collapse
...
lllsondowlll said:
Launched it without a computer by using ADB from temux
--no root required
https://github.com/MasterDevX/Termux-ADB
*Enable wireless debugging (wireless doesn't actually need to be on)
Note wireless debugging --takes some time to take effect, sometimes up to 3-5 minutes for me.
*Run the installer above in termux,
*Type adb devices
*Type adb connect 127.0.0.1
*Accept the trusted key
*type adb shell
Troubleshooting:
*If you get an error about multiple devices type adb kill-server
*type adb devices
*type adb shell
*Accept the trusted key
*then paste in: am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Click to expand...
Click to collapse
I've made a script that allows you to launch the Camera from your phone by just typing ./camera in Termux. No root needed. It can be found here: https://github.com/lllsondowlll/OP8_Camera/blob/master/README.md
can u make a video on this how u used termux and what to do whole process screen recording will be helpful coz i am new to this and i dnt wanna mess up with my phone if i lost some files or smthing please make a video i really want to play with IR camera
It works but not really required
It's working, but have few questions to myself.
1. Does it really needed?
Ans: No, you won't keep clicking pics of plastic material to see inside.
2. Is it handy?
Ans: yes, once opened you can pin/lock it in recent app and open whenever required.
It is just a IR camera and nothing wrong in it, I believe OP will enable it in future, because it really doesn't show through the clothes and even if you want to see for some black thin clothes, you need to go near.
So if you are thinking to click the nude people and go closure you will be slapped.
Few images I have taken.
babsvsphudi said:
can u make a video on this how u used termux and what to do whole process screen recording will be helpful coz i am new to this and i dnt wanna mess up with my phone if i lost some files or smthing please make a video i really want to play with IR camera
Click to expand...
Click to collapse
https://youtu.be/iVQYu-CeN24
You can't hurt anything. Just follow the instructions.
lllsondowlll said:
You can't hurt anything. Just follow the instructions.
Click to expand...
Click to collapse
thanks man you are awesome love n respect for u brother
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Error type 3
Error: Activity class {com.oneplus.factorymode/com.oneplus.factorymode.camera.manualtest.CameraManualTest} does not exist.
connected to localhost:5555
error: more than one device/emulator
I ran it as the video shows. But I got an error like above.
Is there any way to solve this problem or is it not possible with IN2020? Please forgive me for using a translator.
pcningen said:
Starting: Intent { cmp=com.oneplus.factorymode/.camera.manualtest.CameraManualTest }
Error type 3
Error: Activity class {com.oneplus.factorymode/com.oneplus.factorymode.camera.manualtest.CameraManualTest} does not exist.
connected to localhost:5555
error: more than one device/emulator
I ran it as the video shows. But I got an error like above.
Is there any way to solve this problem or is it not possible with IN2020? Please forgive me for using a translator.
Click to expand...
Click to collapse
I was able to resolve this issue by reinstalling factory mode. I apologize to you for a fuss over. Many thanks to the developers of this method.
Since I can't get termux to work for now, another idea if you want to have it accessible all the time(*), is to run this (beautiful) command with an adb shell from a computer and then lock the app so you can't accidentally close it.
After that you can always go back to it whenever you want it!
*App won't remain locked after reboot, obviously.
lllsondowlll said:
Launched it without a computer by using ADB from temux
--no root required
https://github.com/MasterDevX/Termux-ADB
*Enable wireless debugging (wireless doesn't actually need to be on)
Note wireless debugging --takes some time to take effect, sometimes up to 3-5 minutes for me.
*Run the installer above in termux,
*Type adb devices
*Type adb connect 127.0.0.1
*Accept the trusted key
*type adb shell
Troubleshooting:
*If you get an error about multiple devices type adb kill-server
*type adb devices
*type adb shell
*Accept the trusted key
*then paste in: am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
Click to expand...
Click to collapse
I wanna piggyback on this some, since this is similar to the process I just did.
So while this works for nonroot users (I didn't actually test the nonroot version myself), if you are rooted, AND using magisk, I personally install ADB and fastboot binaries from the repo from zackptg5(?) And then just told termux to run an elevated shell (su) and then pasted in the command linked in OP:
Code:
am start -n com.oneplus.factorymode/.camera.manualtest.CameraManualTest
It then loaded the testmode camera app, and (xXx caused it to crash, I had to disable it but I don't know if it's a setting with my config) voila. It worked! Thank you.
Edit: I wanna say just running termux in root would solve the issue either way still, but, my point still is there.

ADB debugging not working on reboot

I am running lineageOS on a rooted firestick. I am using ADB on the Firestick to control it via Homeassistant. The problem is that the adb debugging does not automatically work on reboot. Everytime i reboot i have to manually go to the menu turn off the ADB debugging and then turn in back on. After doing this i am able to reconnect adb via network (i.e, on homeassistant).
I want to ask is there any way i can use a script to automatically do this on restart of firestick. I have tried creating a script in init.d with the following contents but it doesn't seem to work.
adb tcpip 5555
I have added the following line to build.prop but this doesn't seem to work too
service.adb.tcp.port=5555
On restart the adb debugging is on in the developer tools but somehow it doesn't connect (either to Homeassistant or to my laptop), what seems to make it work is toggling it off and then back on.
Have you tried persist, so that the setting sticks between reboots?
Code:
ADB shell setprop persist.adb.tcp.port 5555
Just tried it. Still not working after reboot.
I there any command i can use to toggle the adb debugging via a startup script or crontab?
symbiansucks said:
Just tried it. Still not working after reboot.
I there any command i can use to toggle the adb debugging via a startup script or crontab?
Click to expand...
Click to collapse
Be sure you are running the above command as root user. Type su at the shell prompt, then type whoami to confirm you are root.
I guess you could make a script to run the following on each boot if the above doesn't work:
Code:
settings put global adb_enabled 1
setprop service.adb.tcp.port 5555
stop adbd
start adbd
exit 0
But I don't think this should be necessary.
Finnzz said:
Be sure you are running the above command as root user. Type su at the shell prompt, then type whoami to confirm you are root.
I guess you could make a script to run the following on each boot if the above doesn't work:
Code:
settings put global adb_enabled 1
setprop service.adb.tcp.port 5555
stop adbd
start adbd
exit 0
But I don't think this should be necessary.
Click to expand...
Click to collapse
Thanks. yes the command was run as root. Can i ask you one more thing, whats the best place to put the startup scripts in? I have tried init.d/ directory but the scripts don't get loaded from there i believe?
I have set permissions to chmod 755 for the script.
You can follow this guide,
Android (LineageOS 16) Execute Script on Start Up | sqall's blog
but it seems like there should be a much easier way to make ADB tcpip persist between reboots. I don't want to steer you wrong. @Sus_i would know better, he uses your build of LineageOS, and may have a cleaner solution.

Categories

Resources