[Q] How can I disable the LED while charging? - Huawei Ascend P7

Hello XDA-developers
How can I disable the LED while charging?
I have root access on my Huawei ascend P7.
Lightflow (lite) doesn't help, and Settings > Display > LED and disable it there doesn't help too.
Thanks for your help.

heyhou95 said:
Hello XDA-developers
How can I disable the LED while charging?
I have root access on my Huawei ascend P7.
Lightflow (lite) doesn't help, and Settings > Display > LED and disable it there doesn't help too.
Thanks for your help.
Click to expand...
Click to collapse
Hello !
Here it is :
Code:
> adb shell
$ su
# echo 0 > sys/devices/platform/hkled/leds/green/brightness
# echo 0 > sys/devices/platform/hkled/leds/red/brightness
# exit
$ exit
Good luck !

surdu_petru said:
Hello !
Here it is :
Code:
> adb shell
$ su
# echo 0 > sys/devices/platform/hkled/leds/green/brightness
# echo 0 > sys/devices/platform/hkled/leds/red/brightness
# exit
$ exit
Good luck !
Click to expand...
Click to collapse
sudru ..
i replaced bootanimation.zip bxcos i want original animation.. but instead is just small android write in the middle .. why it doesnt work ?

surdu_petru said:
Hello !
Here it is :
Code:
> adb shell
$ su
# echo 0 > sys/devices/platform/hkled/leds/green/brightness
# echo 0 > sys/devices/platform/hkled/leds/red/brightness
# exit
$ exit
Good luck !
Click to expand...
Click to collapse
Hey surdu_petru, what options else are there? You say echo 0 with output at red and green....can i find the options somewhere?
My red and green/red files are on zero but i have light at charging.

surdu_petru said:
Hello !
Here it is :
Code:
> adb shell
$ su
# echo 0 > sys/devices/platform/hkled/leds/green/brightness
# echo 0 > sys/devices/platform/hkled/leds/red/brightness
# exit
$ exit
Good luck !
Click to expand...
Click to collapse
It works
Thank you very much and good luck with the CM port.

Dont work on Mate S

surdu_petru said:
Hello !
Here it is :
Code:
> adb shell
$ su
# echo 0 > sys/devices/platform/hkled/leds/green/brightness
# echo 0 > sys/devices/platform/hkled/leds/red/brightness
# exit
$ exit
Good luck !
Click to expand...
Click to collapse
I tried that now under Lollipop, but it doesn't survive a reboot. When only setting brightness to zero, the light returns after un- and replugging. So, I set the rights to -r--r--r--, now it works until reboot.
There is also a file called trigger, which I can't change at all, although the rights are -rw-r--r--. I could save, but when opening the next time, it is like it was originally.
Does anyone have an idea how to make those changes permanent? Might the reset be caused by the kernel?

Related

How to Enable fast charge and disable Fsync

I am using nyakkernel which supports fast charge and Disabling Fsync and i tried typing commands in terminal but i always get nothing can anyone tell me what i should do exactly ?
You could use an application like nsTools or:
To enable Fast Charge:
Enter in terminal emulator:
su
echo 1 > /sys/kernel/fast_charge/force_fast_charge
To disable:
su
echo 0 > /sys/kernel/fast_charge/force_fast_charge
Dynamic Fsync:
Disable:
su
echo 0 > /sys/kernel/dyn_fsync/Dyn_fsync_active
Re-enable:
su
echo 1 > /sys/kernel/dyn_fsync/Dyn_fsync_active
is this tested?

[How to] Set Selinux to permissive on boot

Everyone ecxited about xposed framework released for lollipop.. But there are many facing problems installing framework because of SELinux set to enforce by default.
You can check you Selinux status in settings - About phone
You can set the SELinux to Permissive temporarily by running the bellow two commands in Terminal emulator
su
setenforce 0
But it SElinux will change to default once you hard reboot your phone.. In order to keep it in permissive, you need to soft reboot always whenever reboot needed and it's quite annoying..
So I found a workaround to Set the SELinux to permissive on boot itself.
For this you need to have init.d support.. If you don't have just install it via universal init.d tool available in xda.. (just do a search, u will get it) install universal init.d and activate init.d..
Then go to /etc/init.d directory, create a file and rename it as "08setperm" (without quotes) and add the below lines in the file and save it..
#!/system/sh
setenforce 0
And give full permission (rwxrwxrwx) .. Use root Explorer to edit and give permissions..
Now hard reboot your phone and you can see SELinux is set to "permissive" on boot itself..
Now install Xposed framework by following the steps mentioned in the official xposed thread..
This method is tested in moto G and working fine for me... I'm not responsible for anything if happened with your mobile after trying this..
Ps: if you flash any new nightly or new rom, you need to add the file in to init.d directory again..
I posted this using my mobile. So pardon me if any formatting issues..
Hit thanks if i helped you..
Very obviously, can't set permissive on Galaxy S5. Hopefully soon though.
Thanks, I was looking for the enforce command to make a script. It worked perfectly for me on an S4.
LGtMgG2t said:
Thanks, I was looking for the enforce command to make a script. It worked perfectly for me on an S4.
Click to expand...
Click to collapse
Press thanks button dude instead of saying it..
Doesn't work on Z3 Compact (D5803) CM12 nightly.
Nexus 6
"Alright So i have everything down according to your installation guide, When i want to set the file "08setperm" is when root browser tells me that the operation failed even though it has SU Granted."
Okay so I did some tinkering, Got it to work Reboot but after the 2nd Reboot it Boot-looped, On my Nexus But it can work .
Scriptkiddie7 said:
"Alright So i have everything down according to your installation guide, When i want to set the file "08setperm" is when root browser tells me that the operation failed even though it has SU Granted."
Okay so I did some tinkering, Got it to work Reboot but after the 2nd Reboot it Boot-looped, On my Nexus But it can work .
Click to expand...
Click to collapse
Upgrade your root Explorer or super Su and try
Using the commands below should get permissive even after reboot
per http://forum.xda-developers.com/showpost.php?p=58887725&postcount=230
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "echo 0 > /sys/fs/selinux/enforce" >> /system/su.d/permissive.sh
chmod 755 > /system/su.d/permissive.sh
Zwulf said:
Doesn't work on Z3 Compact (D5803) CM12 nightly.
Click to expand...
Click to collapse
Which part didn't work? As far as I can tell, we don't have init.d support on the Z3 Compact yet. Was it the Universal init.d Tool that didn't work for you?
mattdm said:
Which part didn't work? As far as I can tell, we don't have init.d support on the Z3 Compact yet. Was it the Universal init.d Tool that didn't work for you?
Click to expand...
Click to collapse
CM has init.d support buddy.
aalupatti said:
Using the commands below should get permissive even after reboot
per http://forum.xda-developers.com/showpost.php?p=58887725&postcount=230
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "echo 0 > /sys/fs/selinux/enforce" >> /system/su.d/permissive.sh
chmod 755 > /system/su.d/permissive.sh
Click to expand...
Click to collapse
Doesn't work this way. You should have read following posts.
Solution:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Click to expand...
Click to collapse
Works!
Finally got a permissive system on reboot.
Edit: Doesn't help to get XPosed working on my Z3C though.
Another z3c here on the latest nightly, none of these methods even give me permissive status on boot...
EDIT: I lied I just had to install SuperSu
Solution:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Click to expand...
Click to collapse
This method worked for me also thank you sir :good:
Just dd the kernel partition and hex-edit the kernel command line (androidboot.selinux=permissive).
So i am using Xperia Z2 with CM12.
Now, the issue with this particular CM12 is that, in case if we do a soft reboot then xposed starts working but networks vanishes. The Network comes back upon a normal restart but with soft reboot the issue comes back.
I have used these steps to
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Make permissive survive a normal reboot but it doesnt work till i do a soft reboot. any help?
Exact same issue for me
I have same phone with CM12, when I soft reboot
1st soft reboot: no network
2nd soft reboot: screen goes black after unlocking the device
in last 2 days of multiple soft reboots, i got one soft reboot where xposed and network everything worked.
manu44 said:
So i am using Xperia Z2 with CM12.
Now, the issue with this particular CM12 is that, in case if we do a soft reboot then xposed starts working but networks vanishes. The Network comes back upon a normal restart but with soft reboot the issue comes back.
I have used these steps to
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Make permissive survive a normal reboot but it doesnt work till i do a soft reboot. any help?
Click to expand...
Click to collapse
Ok, so..
I want script who started on boot(set permissive), because i do not have soft reboot after every normal reboot to working Xposed. How to do it? I have CM12 Nightly on Xperia Z1.
If i wrote in terminal this script:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Click to expand...
Click to collapse
It's work on every boot phone or once?
Code:
su
mount -o remount,rw /system
mkdir /system/su.d
echo "#!/system/bin/sh" > /system/su.d/permissive.sh
echo "setenforce 0" > /system/su.d/permissive.sh
echo "0" > /sys/fs/selinux/enforce
chmod 755 /system/su.d/permissive.sh
Work cm12. No need soft reboot:good::good:
@UP:
Only wrote this in Terminal and all is it?
Rygiel98 said:
@UP:
Only wrote this in Terminal and all is it?
Click to expand...
Click to collapse
SuperSu + android terminal or adb shell

How to run a script?

How can I run a script with the code that I will give on kitkat , because my touchscreen get unresponsive and this script should fix it?
#!/system/bin/sh
echo 20 > /sys/devices/i2c-3/3-0024/main_ttsp_core.cyttsp4_i2c_adapter/finger_threshold
chmod 666 /sys/devices/i2c-3/3-0024/main_ttsp_core.cyttsp4_i2c_adapter/signal_disparity
echo 0 > /sys/devices/i2c-3/3-0024/main_ttsp_core.cyttsp4_i2c_adapter/signal_disparity

Need help with enabling Diag port on Z3+ (E6553) with zROM v1.1

Hi all,
I have unlocked bootloader and flashed zROM v1.1 so I got root. I want to enable Diag port to connect phone to the QXDM. Here is what i know.
Most important files are /init.usbmode.sh and /init.usbmode.platform.sh:
/init.usbmode.sh:
-disables USB and writes VendorID
Code:
echo 0 > /sys/class/android_usb/android0/enable
echo ${VENDOR_ID} > /sys/class/android_usb/android0/idVendor
-it setups engineering port with /init.usbmode.platform.sh if "getprop perist.usb.eng" is set to 1
-writes PID and USB FUNCTION
Code:
echo ${PID} > /sys/class/android_usb/android0/idProduct
echo ${USB_FUNCTION} > /sys/class/android_usb/android0/functions
-enables USB
Code:
echo 1 > /sys/class/android_usb/android0/enable
/init.usbmode.platform.sh:
Code:
setup_engmode()
{
PID_PREFIX=0
SUPPORT_RMNET=1
case ${1} in
"mass_storage,adb") PID_PREFIX=6 ;;
"mtp,adb") PID_PREFIX=5 ;;
"rndis,adb")
PID_PREFIX=D
SUPPORT_RMNET=0
;;
*)
/system/bin/log -t ${TAG} -p i "No eng PID for: ${1}"
exit 1
;;
esac
PID=${PID_PREFIX}146
USB_FUNCTION=${1},serial,diag
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
if [ ${SUPPORT_RMNET} -eq 1 ] ; then
USB_FUNCTION=${USB_FUNCTION},rmnet
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
fi
echo "${PID} ${USB_FUNCTION}"
exit 0
}
set_rndis_qc()
{
(...)
}
case ${1} in
"eng_setup")
if [ $# -ne 2 ] ; then
exit 1
fi
setup_engmode ${2}
;;
"set_rndis_qc")
set_rndis_qc
exit 0
;;
esac
-returns PID and USB_FUNCTION to /init.usbmode.sh, By default phone has USB_FUNCTION set to "mtp,adb" so there should be PID=5146 and USB_FUNCTION=mtp,adb,serial,diag,rmnet
-echoes
Code:
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
The main issue is that "getprop perist.usb.eng" doesn't exist.
As you know this Android runs on SE Linux. In /property_contexts file we can find following lines:
Code:
#line 1 "vendor/semc/system/sepolicy/Bootstrap_Applications/1.0.0/usbeng/property_contexts"
persist.usb.eng u:object_r:usb_eng_prop:s0
sys.usb.diag_mode u:object_r:usb_diag_mode_prop:s0
persist.sys.usb.config u:object_r:usb_config_prop:s0
persist.service.adb.enable u:object_r:usb_adb_enable_prop:s0
Only "persist.sys.usb.config " is visible in getprop command. This custom ROM has script located in /system/su.d/permissive.sh which enables permissive mode on SE Linux:
Code:
#!/system/bin/sh
/system/bin/setenforce 0
So in theory restrictions to the file types and process domains should not operate. Correct me if I am wrong.
Also there is a file /system/bin/usbeng which should be stared as a service by /init.sony.usb.rc
Code:
#Start usbeng
service usbeng /system/bin/usbeng
user system
group system
class late_start
oneshot
But it can't be seen in services list or process list. Also "getprop init.svc.usbeng" says it is "stopped". We can find SE Linux properties of this file in /file_contexts:
Code:
#line 1 "vendor/semc/system/sepolicy/Bootstrap_Applications/1.0.0/usbeng/file_contexts"
/system/bin/usbeng u:object_r:usbeng_exec:s0
I have tried echoing mentioned lines with a script:
Code:
echo 0 > /sys/class/android_usb/android0/enable
echo diag > /sys/class/android_usb/android0/f_diag/clients
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
echo 5146 > /sys/class/android_usb/android0/idProduct
echo mtp,adb,serial,diag,rmnet > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
But last line seems to fail and USB doesn't get enabled and reboot is needed.
Seems that SE Linux is one of main reasons that Diag port can't be enabled. In effect there is lack of "persist.usb.eng" "sys.usb.diag_mode" in "getprop" command and "usbeng" service. Here comes question to you guys. Do you have idea how to enable mentioned properties and service? I will very appreciate any help or information that will help me enabling Diag port.
Best regards,
Piotr
solution?
did you find the solution, i need the same?
same here, i'm xperia z3 user

samsung ultra power save mode

Can I use gasket to enable upsm at 5% ? I'm complete noob so will need talking through thanks
ROOT + shell
echo "0" > /sys/devices/virtual/mdnie/mdnie/accessibility
echo "1" > /sys/devices/virtual/mdnie/mdnie/accessibility
echo "2" > /sys/devices/virtual/mdnie/mdnie/accessibility
echo "3" > /sys/devices/virtual/mdnie/mdnie/accessibility
0 : Normal Screen
1 : Inverted Colors
2 : Ultra Power Save Mode
3 : Screen off but not locked and touchscreen is still working
Thanks for reply but that means nothing to me?
No one with a basic guide
Do you have ROOT?
If not, you can"t auto turn on UPSM.
Yes I have root
@bandit250
you are still interested?
Yes please
First, Make a test.
Task:
1. Run shell [mark ROOT]
Command:
echo "2" > /sys/devices/virtual/mdnie/mdnie/accessibility
Push play
upsm should turn on.
Hi I get this error
17.49.16/E Run Shell: ->
17.49.16/E Run Shell: ->
17.49.16/E Run Shell: ->
17.49.16/Shell runBackground echo "2" > /sys/devices/virtual/mdnie/mdnie/accessibility root: true timeout: -1
17.49.16/Shell start process-thread ID 4097
17.49.16/E add wait type Shell1 time 2147483647
17.49.16/E add wait type Shell1 done
17.49.16/E add wait task
17.49.16/E Error: 1

Categories

Resources