[SCRIPT] defrost from terminal - Samsung Galaxy Nexus

I made a small script to defrost ALL disabled packages, useful for enabling frozen APKs or for re-enabling them after a reboot.
It will enable apps disabled by user too, so keep that in mind.
Just push it via ADB to /system/bin or /system/xbin, then chmod 755 to make it executable.
You can use a file manager with root features to move the file, but remember to set permissions to -rwxr-xr-x.
It requires root, so you have to run su command in terminal before executing it.

rewritten, it's faster now

Related

[Thinktank] Root

I know Paul over at MoDaCo announced he has root but I think that should not prevent us from trying to figure it out ourselves.
I have been fiddling around with the device and its filesystem and, as some might have tried, most commands are very restricted and you can't even list the /system folder.
Recently I found a directory which has write permissions and installed busybox there through adb, here are the instructions:
Download a precompiled busybox binary from http://benno.id.au/blog/2007/11/14/android-busybox
Push it using adb: adb push busybox /data/local/rights
Start a shell: adb shell
Change directory to the folder: cd /data/local/rights
Give it execution permissions: chmod 755 busybox
Play around with it: ./busybox ls /system
Figure out how we can use the new capabilities to root the phone
Any thoughts?
I was trying something also.. although I dont really know what I am doing mostly, I was trying to use some kernel exploits to get root access without luck. Good learning experiece though..
It would be nice if he gave a hint..

Moving Power Manager Pro to /system/app

Long post but, hopefully an easy answer that someone can walk me through. I have fully rooted my EVO along with the NAND. I'm trying to move/install (?) Power Manager Pro into the /system/app folder to get full rights so it can turn GPS on/off. The website for the app says that I need to do the following:
After root is obtained you need to install the application into the /system/app directory so that it has enough permission to change the location settings. Open a Terminal Emulator app and execute the following command to copy the application to the sdcard (for the full version the name of the application is /data/app/com.acme.android.powermanagerpro.apk):
su
cp /data/app/com.acme.android.powermanager.apk /sdcard/PowerManager.apk
If you can't find the application in /data/app try /data/apps-private/
Then, un-install Power Manager from the device
Execute the following commands in the terminal emulator to remount the /system directory as read/write and to install the application into the /system/app directory:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cp /sdcard/PowerManager.apk /system/app
If you prefer to use adb from your computer, execute these commands:
adb remount
adb shell cp /sdcard/PowerManager.apk /system/app
Several users have utilized root explorer from the Google marketplace to simplify this process.
I have Root Explorer so I would like to do it through there is possible, but I can't seem to get it to work without it getting a FC when it opens after trying to move it.
hmmm, it might be force closing because the system is not mounted as read/write. Never used the app before so I dont know. But you can search the market for terminal emulator and then follow the steps the showed above. It looks like it should work.
...or you could do it through adb shell if you are connected to your 'puter
Trying it in Terminal Emulator with no luck... Wondering if the path is right or if i need to change that? It says:
xport PATH=/data/local/bin:$PATH
$su
cp /data/app.acme.android.powermanagerpro.apk /sdcard/PowerManager.apk
cp: not found
the path seems right (I assume you mean export and not xport). I dont think you need anything special on the rom to access cp through terminal emulator...
Have you tried hooking it up to a computer and entering it through adb shell to see if that works?

[Q] Bloatware Help

I rooted my Evo, running Fresh's newest update but I have a question about removing bloatware. There are a bunch of apps that I don't want or need, but most of them are defaults and I can't remove them. I've tried using Titanium's default app removal software but when the phone reboots, it's all still there. Anybody know an easier way to remove it other than taking the ROM on my computer and removing the apk's before sending it to my SD card?
You can remove using Root Explorer if you have it. It's a paid market app.
I prefer the below methods:
If you installed the Android SDK you should be able to use ADB to remove system apps.
ADB:
adb remount
adb shell
cd /system/app/
rm appnameyouwanttoremove.apk
adb reboot
Terminal Emulator is a free app on the market that also works great. Here is the code to enter when in TE:
TERMINAL EMULATOR:
su
cd /system/app/
mount -o remount,rw /dev/mtdblock3 /system
rm appnameyouwanttoremove.apk
reboot
DONE AND DONE!

[FIX]LedMeKnow enabe fix

Hi Everyone,
I was pissed of when I've realized that LedMeKnow app is not working on my favorite ROMs. So I've started to dig around this issue and finally managed to workout the way to fix it. And here it is...:cyclops:
Description
With the upgrade to GingerBread (and Ice Cream Sandwich) the permissions on leds have changed forbidding write access for every one except root. The way to work it around was to gain root privileges every time writing to brightness file in leds directory. However this option work, it tends to be very slow because of slowness of Superuser or SuperSU applications.
My workaround changes the permissions of brightness files located in leds directory to 666 allowing every one to write. As those permissions have to be set every time phone is rebooted I've created init.d script that will do it automatically.
Used commands
Code:
busybox chmod 666 /sys/devices/platform/leds-microp/leds/amber/brightness
busybox chmod 666 /sys/devices/platform/leds-microp/leds/blue/brightness
busybox chmod 666 /sys/devices/platform/leds-microp/leds/green/brightness
busybox chmod 666 /sys/devices/platform/leds-microp/leds/button-backlight/brightness
Declaimer
I take no responsibility for any issues connected with usage of my script.
Installation
Easy way
1. Download LedMeKnow-fix-Beta1.zip from this thread.
2. Flash it under CWM.
3. Reboot your phone.
4. Enjoy...
Less easy way
1. Download 91LedMeKnowFix.zip and unpack the script.
2. Push it into your phone.
3. Using ADB or Root Explorer move 91LedMeKnowFix to /system/etc/init.d/
4. Using Root Explorer set permissions to readwrite and execute for everyone or using ADB execute
Code:
su
chmod 777 /system/etc/init.d/91LedMeKnowFix
5. Reboot your phone.
6. Enjoy...
:cyclops: IF YOU LIKED IT DON'T FORGET TO THANK :cyclops:

[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.

Categories

Resources