Controlling the LEDs - Blade General

I've been looking for how to control the LEDs on our blade for quite some time now, and, since I didn't find anything, I decided to try myself and succeeded.
Heres the How-to:
1. Install the Android SDK(Or just ADB)
2. Run "adb shell"
3. Run any of these commands:
Activate Backlight-leds(White): echo 255 > /sys/class/leds/button-backlight/brightness
Deactivate(White) echo 0 > /sys/class/leds/button-backlight/brightness
Activate Red leds: echo 255 > /sys/class/leds/red/brightness
Deactivate echo 0 > /sys/class/leds/red/brightness
Blink: echo 1 > /sys/class/leds/red/blink
echo 0 > /sys/class/leds/red/blink
Activate Green leds: echo 255 > /sys/class/leds/green/brightness
Deactivate echo 0 > /sys/class/leds/green/brightness
Blink: echo 1 > /sys/class/leds/red/blink
echo 0 > /sys/class/leds/red/blink
Just a little tip: If you want to control the green or red led, you have to "deactivate"(Turn off brightness) of the White ones..

yellow is red + green.

wbaw said:
yellow is red + green.
Click to expand...
Click to collapse
Hmm, that makes sense, for some reason i can't get it working, the red led just keeps overriding the green
Edit: The only thing I'm able to make thus far is Orange with Red: 100; Green: 255;

is it possible to run this commands inside an android app or shell script without adb?

frapeti said:
is it possible to run this commands inside an android app or shell script without adb?
Click to expand...
Click to collapse
typically yes. you have to invoke the "sh" command when using an app so that it can also port root permissions to superuser to grant. i am working on that for my thunderbolt. my attempt will be to set the LED to full brightness (beyond the 128 setting that the system allows) and get the LED to stay on for more than the 1 second that it does. YES i am aware that setting my LED to beyond the default max can of all things shorten the life of it. i really dont care about that. i have insurance on my phone anyhow. so if i break it, i pay the copay and presto! new phone.
anyhow, back to the topic at hand...
so, i will get to programming that shell command pretty soon, once i figure out how to integrate and build apps to android... lol. i know how it works in theory, and know linux commands, but its another thing entirely to build something and have it work.

Hello all, need a help solving a problem. I want to switch the back -led on and off. i can access the sys/class/leds/button-backlight and can change the brightness of the variable to "170", the thing is the variable's value is changin, but the LED is not glowing! ,i tried "1" and it has the same response. Lemme post a screenshot indicating my situation here!
My device : Letv Le X509
Status: Rooted
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This screenshot indicates the files that i have within the leds folder.

Related

[FIX][CM12] LMK Fixer and ADJ

I make my own script for LMK (low memory killer) and adj.
Init.d doesn't work on CM12 so the unique way to make it automatically at boot is with an paid app.
"Boot Shell + Pro Version" (no spoiler)
1. Download Boot Shell and buy Pro version (you also can "buy" it on Aptoide , but highly recommended support the developer is the correct way)
2. Open it , in lateral menu and select "New script" and put it a name. (Ex: LMK)
3. Copy and paste it:
Code:
chmod 644 /sys/module/lowmemorykiller/parameters/adj
echo '0,58,117,176,529,1000' > /sys/module/lowmemorykiller/parameters/adj
chmod 644 /sys/module/lowmemorykiller/parameters/minfree
echo '12288,15360,18432,21504,24576,30720' > /sys/module/lowmemorykiller/parameters/minfree
4. In app settings select "Execute script at boot"
5. Restart and enjoy best RAM management
Credits:
@BlueFlame4 one part of the code
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
..
Does Music apps run better on background? My only problem with CM12 was that Google Music closed A LOT while on background.
Yes is for that , better ram management
Hi,
I don't want to sound rude but am I supposed to get partial credits for this?
I forgot it , sorry @BlueFlame4
How many apps can you run in the background now? Do you also have Facebook app inbetween them? Wasn't there an app called Kernel Audiator which does the same thing?
XT1033 CM12 Nightly. Upon screen off this script undoes itself... No clue why
Odd, it works on the weekly build and on the Asia retail soak...
good job
This script does the work. Thank you man @Lans98. I really needed multitasking which is absent in current cm.
Well I have a query
can i just place the script in init.d folder to make it work?
Working 100% for me now. Cm12 nightlies. Xt1033. Thanks
Why is showing an error when I select "execute and show output"? Then I suppose it does not execute fine at boot :S

Setting SElinux boolean may unlock Amazon tablets

Guys. Everyone I need your undivided attention please. This might be it. This may be the key we have been seeking. However a once wise man said "these aren't the keys you're looking for" A true geek knows the reference. Now serious business.
Ok I did some research. So this Boolean folder is important. In fact this may be the jem we need.
In /system/bin you have two executables getsebool and setsebool. I'm going to explain this as easy as possible.
An*SELinux boolean*is a single string (hopefully sufficiently interpretable) that changes how SELinux reacts. With*getsebool*you can get a list of booleans and their current value. Changing SELinux booleans can be done through*setsebool*(where you add the desired state of the boolean, such as*on*or*off) or*togglesebool*(which flips the current value of a boolean).
Click to expand...
Click to collapse
Let's play a little game. Unfortunately for this to do anything, you need to be root already i think.
Code:
getsebool -a
This will list any booleans set in the SElinux policy and their values (on or off). On the HD 10, there is one boolean present. At the moment, this device is the only one I have run into that has anything set in the booleans. I own about a dozen different devices (phones and tablets) all of them work and are either rooted or boot loader unlocked (only my Moto E4 isnt). Not a single one of them have anything in the booleans in this folder, except for this HD 10. It is wiped clean on every other device. HD 10 boolean:
Code:
$ su
# getsebool -a
device_unlocked --> off
Here's the fun part:
Code:
# setsebool device_unlocked on
# getsebool device_unlocked
device_unlocked --> on
However there is a problem with changing this value, even being root:
When you do this, the changed value will take effect immediately but only for the duration that the current loaded policy is active. That means, if the system reboots, you loose the changes. Or when you explicitly would reload the SELinux policy, you loose the changes. On the other hand, switching booleans this way is fast and helps you to debug problems.
Click to expand...
Click to collapse
There is a way to change this, running a simple command. However I'm certain the bin file or files have been modified and the commands removed from the policy.
Code:
setsebool -P device_unlocked on
In a normal world, the above command would make the value we set persist upon a reboot. So why alter the policy? That doesn't make sense to me. I know as an OEM you can write said policy, but why go through the massive effort if only to leave this boolean in place? Now given this potential massive discovery, what does this now mean? Did I just do what I think I did? Was this really that easy?
I was not able to find the single log entry of the event on my HD 10. However the Fire 7, even with the custom ROM by @ggow, has the same boolean and value. I did the same steps on that tablet and I was able to get the single log entry. Can we get excited and jump...or cry for joy yet? I am totally lost in this neck of the woods.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
References:
https://wiki.gentoo.org/wiki/SELinux/Tutorials/Using_SELinux_booleans
https://www.thegeekdiary.com/understanding-selinux-booleans/
Well this may or may not be anything. A few months ago I discovered a booleans in /sys/fs/selinux/booleans called 'device_unlocked'. You can set the bool, but the value persists to 'off' (of course) when you reboot. In a terminal:
Code:
su
setsebool device_unlocked on
getsebool device_unlocked
on
Reboot and it will be set to 'off'. Well thanks to the su.d shell commands/script I found here on xda, I can now make that persists on reboot. In a terminal:
Code:
su
mount -o remount,rw /system
mkdir /system/su.d
chmod 700 /system/su.d
echo "#!/system/bin/sh" > /system/su.d/unlocked.sh
echo "setsebool device_unlocked on" > /system/su.d/unlocked.sh
echo "on" > /sys/fs/selinux/booleans/device_unlocked
chmod 700 /system/su.d/unlocked.sh
No need to reboot. Now the question is...what is it?
If you have an unlocked tablet now, in a shell do this:
Code:
su
getsebool -a
device_unlocked --> on
it's definitely tied into the unlocking procedure. Because my fire 7 says 'on' and I never set the bool.
Sent from my Amazon KFSUWI using XDA Labs

Disable swipe-up lockscreen?

How do i disable the swipe-up lockscreen? I don't see anything in settings to disable it.
peachpuff said:
How do i disable the swipe-up lockscreen? I don't see anything in settings to disable it.
Click to expand...
Click to collapse
You want to got rid of this lock screen?
Using Activity Launcher:
1. Install Activity Launcher from Google Play or APKPure
2. Open Activity Launcher
3. Scroll down, select Settings and find the activity Settings$ScreenLockSuggestionActivity
4. If in lock screen settings, select None
Or if didn't find, try another way:
Disable via ADB:
1. Enable ADB in developer options
2. Connection your Fire tablet to your PC
3. Enter this command
Code:
adb shell
settings put secure lockscreen_disabled 1
4. Reboot
Code:
adb reboot
Or you want to watch a full tutorial on YouTube:
Disabling it via adb didn't work for me on Fire HD 10 2019.
Setting Keyguard to off in Tasker works for about a day. Running the task on device boot, you may need to wait a few seconds, and then running it every few hours should keep it off.
AmznUser444 Dev said:
You want to got rid of this lock screen?
Using Activity Launcher:
1. Install Activity Launcher from Google Play or APKPure
2. Open Activity Launcher
3. Scroll down, select Settings and find the activity Settings$ScreenLockSuggestionActivity
4. If in lock screen settings, select None
Click to expand...
Click to collapse
That did the trick, tried the adb thing before but it didn't work.
activity launcher helped me to get rid of the lockscreen. Unfortunately, I tried the ADB command before, this did not work and either disabled the activity entry. So i had to revert the ADB command with value 0. But anyway, thx a lot for the hlp here in the forum.
peachpuff said:
How do i disable the swipe-up lockscreen? I don't see anything in settings to disable it.
Click to expand...
Click to collapse
For what it's worth, this is a copy & paste which is my solution for non-rooted devices:
I use the Gravity Screen app on a non-rooted Fire HD10 (2019) which uses motion to unlock/ wake up the device which you can get here.
I have the app set up to "Turn Screen ON by Motion" and under it's "Special Settings", I have "Disable Lock Screen" checked:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
What worked for me on my 8th gen HD 8 was:
Step 1: Disable screen unlock in the official system settings:
Step 2: Run this:
Code:
adb shell locksettings set-disabled true
I got some error messages from locksettings once when I was trying this. If that happens to you, try this more elaborate version:
Code:
adb shell
settings put global LOCKSCREEN_AD_ENABLED 0
settings put secure lockscreen.disabled 1
locksettings clear
locksettings set-disabled true
exit
Interestingly, after a reboot LOCKSCREEN_AD_ENABLED goes back to 1 and lockscreen.disabled goes back to 0, but the lockscreen stays disabled.

[MOD] Enable/Disable Gesture Line | Hidden Settings | No Root

Enable/Disable Gesture Line
I found a hidden setting to enable/disable the "gesture line" which is shown in the bottom of the screen when using screen gesture mode instead of navigation bar.
Tested on latest Xiaomi.eu v12.1.2 stable firmware (Android R) but I think it may work in other MIUI firmware versions, maybe in other MIUI devices too.
Requirements
Properly installed ADB/USB/Fastboot drivers on PC
Enabled USB debugging on phone
How to
Open any command or terminal window, and use below commands:
Disable
Code:
adb -d shell settings put global hide_gesture_line 1
Enable
Code:
adb -d shell settings put global hide_gesture_line 0
Screenshots
Enabled
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Disabled
Enjoy!
this is not working on Poco F2 global rom
tuilalnvinh said:
this is not working on Poco F2 global rom
Click to expand...
Click to collapse
This is because of the Launcher. Xiaomi decided to build this feature within the Launcher. Now since you can't install the xiaomi launcher by apk on stock rom, this feature isn't available. Unless you install weekly or beta xiaomi.eu
Doesn't this setting is here: Settings > Additional Settings > Full screen display > Hide full screen indicator?
Saratoga79 said:
Enable/Disable Gesture Line
I found a hidden setting to enable/disable the "gesture line" which is shown in the bottom of the screen when using screen gesture mode instead of navigation bar.
Tested on latest Xiaomi.eu v12.1.2 stable firmware (Android R) but I think it may work in other MIUI firmware versions, maybe in other MIUI devices too.
Requirements
Properly installed ADB/USB/Fastboot drivers on PC
Enabled USB debugging on phone
How to
Open any command or terminal window, and use below commands:
Disable
Code:
adb -d shell settings put global hide_gesture_line 1
Enable
Code:
adb -d shell settings put global hide_gesture_line 0
Screenshots
Enabled
Disabled
Enjoy!
Click to expand...
Click to collapse
Thank you SO SO SO MUCH!!!!!!
This worked perfectly for me.
For whatever reason, my XIaomi Tab 5's option to turn off the full screen gestures indicator JUST DISAPPEARED. This adb trick was a life saver!!!!!!!!!
THank you!
greate! it worked!
ROM: MIUI 13 21.12.30
Phone: Redmi K30 Pro Zoom Edition

[TIP] How to Enable 2 Button Navigation on the OnePlus 8 (no root)

Presumably this also works on the OnePlus 8 Pro. Here's hoping it also works on Oxygen OS 11.
If you search under Apps and Notifications, you may notice that the OnePlus 8 still has a hidden "2 Button Navigation" App installed. That's because it's still capable of using it, even though there's no option to do so in Settings. You can enable and disable it using adb commands.
You must enable Developer options to access adb commands (Tap build number in About Phone until it tells you that you are a developer. Go to Developer options and enable "USB debugging").
If you are on Windows, download the minimal adb fastboot zip here, then extract it to its own folder and click cmd-here.exe to use adb commands.
Plug your phone into your computer. Type "adb devices". Make sure only one device appears (your phone should be the only android device plugged in . If your device appears, check your phone to see if its asking permission to use debugging over usb, then grant it.
The following command will enable the 2 Button Navigation Bar:
adb shell cmd overlay enable com.android.internal.systemui.navbar.twobutton
To disable the 2 Button Navigation Bar:
adb shell cmd overlay disable com.android.internal.systemui.navbar.twobutton
It's as simple as that. :good:
Swiping up from the Home button brings up Recents, and tapping the Home button goes Home, like it should.
If you are using a third party launcher, you may have to swipe up and hold to get Recents to appear while you are on your Homescreen or App drawer.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If Oxygen OS 11 still has this hidden app, then these commands should still work after updating. I would also disable 2 Button Navigation before upgrading to Oxygen OS 11 from 10, just in case. You can enable it afterwards as long as it still exists.
Does it work for Realme/color OS too

Categories

Resources