[GUIDE][XSP]Easy init.d support for Stock ROMs - Xperia SP General

Easy init.d support for Stock ROMs
Disclaimer: Credits belong to original authors. I'm sharing this intending that others might benefit. This worked for me without problems, but I'm not responsible for any unwanted effects others might experience. Keep a CWM backup just in case.
What is this?
This is an easy method to add init.d support to our stock ROMs running on stock kernels. Then, scripts placed in /system/etc/init.d/ folder will be executed automatically at boot.
Requirements:
1.Rooted phone.
2.Root explorer or similar app.
3.Busybox installed.
check:
Type "busybox run-parts" (without quotes) in a terminal emulator and press enter. If you get an output similar to what's shown below you're all set. It means that busybox is installed and the command is present. (It's needed for the MOD).
Code:
1|[email protected]:/ $ busybox run-parts
BusyBox v1.20.2-jb static (2012-11-25 17:47 +0100) multi-call binary.
Usage: run-parts [-t] [-l] [-a ARG] [-u MASK] DIRECTORY
Run a bunch of scripts in DIRECTORY
-t Print what would be run, but don't actually run anything
-a ARG Pass ARG as argument for every program
-u MASK Set the umask to MASK before running every program
-l Print names of all matching files even if they are not executable
1|[email protected]:/ $
If busybox not installed, install it from Google play.
How to:
1) Open root explorer, go to /system/etc/ folder.
2) Mount /system as R/W by pressing the button at upper right corner.
3) Open init.qcom.post_boot.sh file for editing. (Long-press> Open in Text Editor)
4) Add this line to the bottom end of that file.
Code:
busybox run-parts /system/etc/init.d/
**Add an empty line after that. It's very important**​
{
"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"
}
5) Save the file. (You can delete the .bak file that Root explorer creates).
Then..
6) Create 'init.d' folder in /system/etc/ if not already present.
7) Change it's permissions to 755/rwxr-xr-x (Long-press> permissions)
That's it!
Testing:
To see whether it works, extract the test script (from attachment) to init.d folder, change script's permissions to 755/rwxr-xr-x and reboot the phone. You should see a file called Test.log in /data/ with a message saying that it's working.
(Tested on Android 4.3 (.201). Should work in others.)
How it works:
It's quite obvious. The init.qcom.post_boot.sh is one of the scripts that runs at boot, which in turn executes the busybox command to execute the scripts in init.d folder. Simple!
Credits & Sources
1) @iridaki and original thread here.
2) @smokin1337 and original thread here.
Note: Following the first tutorial broke my root. Second method executed only the first script in the list. So, I combined the needed parts of two guides!
Alternative methods:
#'Universal init.d' app from Google play would also execute init.d scripts, but at the app level.
#'SManager' is another app that can execute scripts at boot.
There maybe other methods...
You may point out any shortcomings/improvements.
Thanks and Regards!

mrhnet said:
Easy init.d support for Stock ROMs
Disclaimer: Credits belong to original authors. I'm sharing this intending that others might benefit. This worked for me without problems, but I'm not responsible for any unwanted effects others might experience. Keep a CWM backup just in case.
What is this?
This is an easy method to add init.d support to our stock ROMs running on stock kernels. Then, scripts placed in /system/etc/init.d/ folder will be executed automatically at boot.
Requirements:
1.Rooted phone.
2.Root explorer or similar app.
3.Busybox installed.
check:
Type "busybox run-parts" (without quotes) in a terminal emulator and press enter. If you get an output similar to what's shown below you're all set. It means that busybox is installed and the command is present. (It's needed for the MOD).
Code:
1|[email protected]:/ $ busybox run-parts
BusyBox v1.20.2-jb static (2012-11-25 17:47 +0100) multi-call binary.
Usage: run-parts [-t] [-l] [-a ARG] [-u MASK] DIRECTORY
Run a bunch of scripts in DIRECTORY
-t Print what would be run, but don't actually run anything
-a ARG Pass ARG as argument for every program
-u MASK Set the umask to MASK before running every program
-l Print names of all matching files even if they are not executable
1|[email protected]:/ $
If busybox not installed, install it from Google play.
How to:
1) Open root explorer, go to /system/etc/ folder.
2) Mount /system as R/W by pressing the button at upper right corner.
3) Open init.qcom.post_boot.sh file for editing. (Long-press> Open in Text Editor)
4) Add this line to the bottom end of that file.
Code:
busybox run-parts /system/etc/init.d/
**Add an empty line after that. It's very important**​
5) Save the file. (You can delete the .bak file that Root explorer creates).
Then..
6) Create 'init.d' folder in /system/etc/ if not already present.
7) Change it's permissions to 755/rwxr-xr-x (Long-press> permissions)
That's it!
Testing:
To see whether it works, extract the test script (from attachment) to init.d folder, change script's permissions to 755/rwxr-xr-x and reboot the phone. You should see a file called Test.log in /data/ with a message saying that it's working.
(Tested on Android 4.3 (.201). Should work in others.)
How it works:
It's quite obvious. The init.qcom.post_boot.sh is one of the scripts that runs at boot, which in turn executes the busybox command to execute the scripts in init.d folder. Simple!
Credits & Sources
1) @iridaki and original thread here.
2) @smokin1337 and original thread here.
Note: Following the first tutorial broke my root. Second method executed only the first script in the list. So, I combined the needed parts of two guides!
Alternative methods:
#'Universal init.d' app from Google play would also execute init.d scripts, but at the app level.
#'SManager' is another app that can execute scripts at boot.
There maybe other methods...
You may point out any shortcomings/improvements.
Thanks and Regards!
Click to expand...
Click to collapse
Will try thanks!!

I doesnt have the init.qcom file
Just have a init.goldfish and the init.d folder, but is always empty...
Help please...

janolucero said:
I doesnt have the init.qcom file
Just have a init.goldfish and the init.d folder, but is always empty...
Help please...
Click to expand...
Click to collapse
Do you have any other file with "post_boot" part, in system/etc/ folder? What's your ROM?

mrhnet said:
Do you have any other file with "post_boot" part, in system/etc/ folder? What's your ROM?
Click to expand...
Click to collapse
.254
i will try to reflash and start fresh.-

janolucero said:
.254
i will try to reflash and start fresh.-
Click to expand...
Click to collapse
I haven't tested it on 4.1.2. You may list what are the files in /system/etc folder..
(Just do this command in a terminal emulator, it will save the filelist to a file in sdcard. Post that file here.)
Code:
ls /system/etc/ >> /sdcard/filelist.txt

mrhnet said:
I haven't tested it on 4.1.2. You may list what are the files in /system/etc folder..
(Just do this command in a terminal emulator, it will save the filelist to a file in sdcard. Post that file here.)
Code:
ls /system/etc/ >> /sdcard/filelist.txt
Click to expand...
Click to collapse
Y not add the runparts command in install-recovery.sh file?
Sent from my C5303 using Tapatalk

Siddhesh said:
Y not add the runparts command in install-recovery.sh file?
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
Yes, was thinking like that. Wanted to know whether any other post_boot script is there in 4.1.2

mrhnet said:
Yes, was thinking like that. Wanted to know whether any other post_boot script is there in 4.1.2
Click to expand...
Click to collapse
No needed if everyone uses supersu then there will be a file called install-recovery.sh but don't add runparts command in it make another file named install-recovery-2.sh(Only for supersu users) and add the runparts command. Our init.rc makes install-recovery.sh to start on boot
Sent from my C5303 using Tapatalk

Thanks for the tip. Adding runparts to the second file would prevent breaking init.d even if SuperSU update is flashed again. Good idea!

mrhnet said:
Thanks for the tip. Adding runparts to the second file would prevent breaking init.d even if SuperSU update is flashed again. Good idea!
Click to expand...
Click to collapse
Yes but its only for SuperSU users if someone using Superuser from koush then this trick will not work so u have to edit the original install-recovery.sh in that situation and please test this trick coz on my previous Xperia phones Wt19i and arcs only first script is executed never used scripts on XSP
Sent from my C5303 using Tapatalk

Siddhesh said:
Yes but its only for SuperSU users if someone using Superuser from koush then this trick will not work so u have to edit the original install-recovery.sh in that situation and please test this trick coz on my previous Xperia phones Wt19i and arcs only first script is executed never used scripts on XSP
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
This the situation. Xperia Arc on C-rom KK ver 5.6 with nAa ver 3.4...
There is already a init.d file in system/etc.
Upon viewing the file install-recovery.sh there is a directive to create another install-recovery.2sh - i.e. as pix below:
Using SuperSU ver 1.94
So I will try this and report.
Sent from my Xperia Arc using XDA Free mobile app

Thanks for the post.. I'm going to try your method for adding init.d support but I have a question :
I found the "init.qcom.post_boot.sh" script in the root directory not "system/etc" nor "system/" is that an issue? should I edit it with no concerns? or should i edit the "install-recovery.sh" found in "system/etc/" ?
my device is HTC desire 816 with stock rom, rooted & with unlocked bootloader

Siddhesh said:
No needed if everyone uses supersu then there will be a file called install-recovery.sh but don't add runparts command in it make another file named install-recovery-2.sh(Only for supersu users) and add the runparts command. Our init.rc makes install-recovery.sh to start on boot
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
Where to add the runparts command?
the other sh script is not running

In grand prime SM-G530FZ ( 5.0.2 ), This file exists ( i.e, qcom.....)
Did the mentioned steps. But not working

Related

[Guide] Change default orientation to portrait!

After days (literally days...) of staring at this code trying to make sense of it (I am not a coder, but am the IT guy at a software company so that helped a litte), it finally started making sense and I found the one tiny change necissary to make the default orientation portrait. Since I cannot make the new .odex file for a specific build without installing it (which I dont want to do), I'll just post the instructions to do this yourself.
{
"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"
}
Disclaimer: The usual, I don't accept responsibility for any harm to your phone, any changes you make should be reversible if you mess up. These steps will only work for stock Dell roms. If you are on StreakDroid it can still be accomplished but is slightly different. You should only proceed if you have a decent knowledge of adb/shell/command line. This guide is intended for Windows PCs. Make a nandroid backup and/or backup your android.policy.odex
What you need
Android SDK (if you're a member of xda and you dont have this already then it's a must)
Java JDK
7-zip
Smali/Baksmali (download both jar files and rename them to remove the version number. For example rename 'baksmali-1.2.6.jar' to just 'baksmali.jar')
dexopt-wrapper (attached)
busybox (easiest way to install is to install titanium backup and select problems as many of you know from the superuser.zip root method)
your BOOTCLASSPATH (can be found in /init.rc on your phone)
Install the Android SDK, Java JDK, and 7-zip if you havent already. If you are installing the SDK for the first time you should probably familiarize yourself with the SDK first (lots of guides out there) then make sure to run SDK Manager and download the platform tools. Place the smali.jar and baksmali.jar files in the same folder as adb.exe (whether it be in the tools or platform tools folder or wherever you have moved adb). Place dexopt-wrapper on your Streak's sdcard.
Steps
> means a command (dont type the >)
1. Open a command window to the same folder as adb.exe (in Win7 ctrl + shift + right-click in the folder and select "open command window here")
2. Plug in your phone then pull the entire framework folder
> adb pull /system/framework/ framework
3. Decompile the android.policy.odex file
> cd framework
> java -jar ..\baksmali.jar -x android.policy.odex -o ..\androidpolicy
4. Navigate to the androidpolicy\com\android\internal\policy\impl folder and replace the PhoneWindowManager.smali with the one attached to this post.
5. Compile the code
> cd ..\
> java -jar smali.jar -o classes.dex androidpolicy
6. Add the resulting "classes.dex" file to the android.policy.jar file. To do this open the framework folder, right click on android.policy.jar and 7-zip -> open archive, drag the classes.dex into the 7-zip window so that you now see a META-INF folder and the classes.dex file. The resulting android.policy.jar should be around 96 KB in size.
7. Put the resulting android.policy.jar onto your phone sdcard. Fastest way is to put the jar file into the same folder as adb.exe and
> adb push android.policy.jar /sdcard/
8. Open shell
> adb shell
9. Become super user (if you havent done this before, make sure your phone is on so you can grant it superuser permissions)
> su
----------------------------------------------------------------------------
This section only needs to be done once
----------------------------------------------------------------------------
10. Put dexopt-wrapper into the correct folder with the correct permissions
> cd /system/bin/
> busybox cp /sdcard/dexopt-wrapper . (yes after dexopt-wrapper is a space and a period)
> busybox chmod 755 dexopt-wrapper
> cd /sdcard/
----------------------------------------------------------------------------
11. Create a new .odex file from the .jar file
> dexopt-wrapper android.policy.jar new.odex BOOTCLASSPATH
BOOTCLASSPATH should be the value of your bootclasspath from init.rc. For example my command looked like this (all one command):
dexopt-wrapper android.policy.jar new.odex /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/kafdex.jar:/system/framework/OmaDrmClient.jar
12. Copy the "signature" from the original .odex file to the newly created one
> busybox dd if=/system/framework/android.policy.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
13. Replace the original android.policy.odex with the new one (you will need to mount your /system/framework/ with r/w permissions, can be done with root explorer or this app
> cd /system/framework/
> busybox cp /sdcard/new.odex android.policy.odex
> busybox chmod 644 android.policy.odex
14. Done
> sync
> reboot
Your phone will now reboot, be patient as it may take slightly longer to boot up the first time. On initial bootup the lockscreen will still be in landscape with the sliders also in landscape. Just unlock, let the phone boot up some more, turn off the screen and turn it back on...
Troubleshooting
If for some reason you run into problems and your phone hangs at the dell logo...
1. Boot into recovery
2. Put the original android.policy.odex (the one in the framework folder) into the same folder as adb.exe
3. Open a command window to same folder as adb.exe (should still be open from the install steps)
4. Type the following commands
> adb shell mount /dev/block/mtdblock6 /system
> adb push android.policy.odex /system/framework/
5. Select the reboot option in the recovery menu and you should be back to stock.
For GingerStreak 2.4 look here - Thanks TheManii
If you use adw you can lock the screen to eitherportrait of landscape in settings. I haveit locked to landscape because I prefer it.
I prefer launcher pro for a few reasons and would like the lockscreen to be in portrait so that I don't have to use widgetlocker
Interesting note. I have compared the streak code for the file specified to the dell venue which is a portrait default device and they are identical...not sure what to think about that.
Think I found what needs to be changed, but must sleep. will report back tomorrow
Hope you will be able to sort this one out!
I am one of the many that want this fix.
Original post updated with guide!
good work! I will give it a try soon.
Sent from my Dell Streak using XDA App
I'm having a headache just reading the instructions! Ha ha. I guess I'll just wait for jhotmann or another android genius to come up with a Recovery flashable .pkg or even an installable .apk, whichever is feasible. Great work, jhotmann!
jhotmann, maybe you can share this mod of yours with Dj_steve. He might be able to incorporate it into a new ROM.
I have messaged steve on twitter. I know krad can do this and he's probably on the latest build.
Sent from my Dell Streak 2.2.1 (339)
Amazing! It's a phone now, not a Tablet! It worked perfectly for me!
Very nice, but not so easy. I am at the 11. and can't find when to get BOOTCLASSPATH. I know it is in init.rc in the phone, I can find it with ASTRO file manager or with adb shell, but I don't know how to open it and get BOOTCLASSPATH??? Please help somebody. I was trying to find it on the internet but no success...
Thank you in advance
Type exit to get out of shell (you may have to do it twice), then adb pull /init.rc
Sent from my Dell Streak 2.2.1 (339)
Thank you for your effort, but it says permission denied. I tried to reopen command line (always as admin), but id didn't help. Found somewhere operation 'adb remount', but it didn't help either (Operation not permitted).
I have rooted Dell Streak with Gingerbreak, maybe this information will help.
However, I copied init.rc with busybox to my sdcard and get it from there, but now I can't open it (I found, that it can be open with MS Visual Studio, then tried Notepad plus, Total commander... always just mess of black squares etc.)
I guess I am too tired today, but I will try to finish this tomorrow, because I really want Dell Streak in portrait and it is only 4 more steps
But thank you anyway, I must be really hard to find this. The way is not easy but at least it can be accomplished now
Weird, I have had no problems opening it in notepad. Theres a good chance the bootclasspath is the same as mine so you can probably copy it from my example
Nice work!! Too bad I'm not on stock. Hopefully Steve will integrate this in 1.9.1
Edrill said:
Nice work!! Too bad I'm not on stock. Hopefully Steve will integrate this in 1.9.1
Click to expand...
Click to collapse
Steve said it'll be there but not active by default, so it's a go!
Question: So can we now lock the default orientation to portrait for apps like the dialer? I'm using us240 density and the landscape dialer while in a call or when you receive a call hides the name of the person and looks ugly.
the entire system can be locked to portrait. Or you could probably set up a tasker to lock the phone app (and contacts app) in portrait if you dont want the whole system locked in portrait.
Edit: just created a tasker profile to do that...good call sir
Can you port cyanogen 7 to streak. Just loaded a nightly on my ole craptivate and it had 2.3.4 ginger goodness.
Sent from my Dell Streak
jhotmann said:
I have messaged steve on twitter. I know krad can do this and he's probably on the latest build.
Sent from my Dell Streak 2.2.1 (339)
Click to expand...
Click to collapse
Thanks jhotmann!

[Q] Randomised boot animations?

Would it be at all possible to get something like this made for Defy?
This is a script from Galaxy Nexus forums, so I don't think it would work on Defy..
http://forum.xda-developers.com/showthread.php?t=1434950
What it Does
There are various apps out there that can achieve the same result but this is a simple script that uses a random number generator to swap in a random boot animation each time you boot. The script runs one just before the animation and never again until you boot the next time.
You can have any number of animations that will randomise and you can also set a flag to have just one run without needing to delete the others.
Click to expand...
Click to collapse
Couldn't you write a quick shell script to randomly choose a file from SD and copy it over the current bootanimation.zip? It would be executed after boot finishes, perhaps by an app to manage scripts. Just an Idea.
ArRaY92 said:
Couldn't you write a quick shell script to randomly choose a file from SD and copy it over the current bootanimation.zip? It would be executed after boot finishes, perhaps by an app to manage scripts. Just an Idea.
Click to expand...
Click to collapse
I haven't a clue :s I really hope it can be done though.. there are so many awesome boot animations!
Plus I'm making one of my own... or trying to.
Hoping for someone who knows about scripts and things
Okay, I think I will have a go. Let me just find out how to get a random number in unix shell that is in a certain range.
okay, so lets try.
Code:
#!/system/bin/sh -
#Change folder
cd /mnt/sdcard/bootanimations
ls > list
#Get random file
set -- *
length=$#
ran=$(hexdump -e '1/1 "%d"' -n 1 /dev/urandom)
rand=$(( $ran % ($length + 1) ))
file=$(sed -n "${rand}"p list)
#Copy over old animation
cp -f "$file" /system/media/bootanimation.zip
echo "successful if 0: " $?
rm list
Works now, took a piece of code from the other script because I could not get ${!rand} to work on the phone.
Works great for pictures and such too.
ArRaY92 said:
Okay, I think I will have a go. Let me just find out how to get a random number in unix shell that is in a certain range.
Click to expand...
Click to collapse
Perhaps looking at the script I linked to will help?
My script should work, only drop animations into /sdcard/bootanimations.
run once after boot with smanager from playstore
ArRaY92 said:
My script should work, only drop animations into /sdcard/bootanimations.
run once after boot with smanager from playstore
Click to expand...
Click to collapse
I'll give it a try!
After running this I reboot (a couple) and test it?
I'm assuming it needs SU in SManager?
Is this a patch? Will it need anything to remove it if it doesn't work and I can't a boot?
Sorry haha
pk92 said:
I'll give it a try!
After running this I reboot (a couple) and test it?
I'm assuming it needs SU in SManager?
Is this a patch? Will it need anything to remove it if it doesn't work and I can't a boot?
Sorry haha
Click to expand...
Click to collapse
No, this is only a small shell script. I think it needs SU to copy the animation over the existing one.
I am however not sure, if cp copies over the old file without forcing, let me look this up
You can just delete it from sManager if it does not work. Will not prevent you from booting if it fails, phone boots fine without animation. In case of failure, I would however think that it would just fail to change the animation
edit: I added the -f flag to cp.
ArRaY92 said:
No, this is only a small shell script. I think it needs SU to copy the animation over the existing one.
I am however not sure, if cp copies over the old file without forcing, let me look this up
You can just delete it from sManager if it does not work. Will not prevent you from booting if it fails, phone boots fine without animation. In case of failure, I would however think that it would just fail to change the animation
edit: I added the -f flag to cp.
Click to expand...
Click to collapse
Thanks so much for writing it by the way
I'd take a guess that it does need SU to copy the animation, as it is going to a root directory (/system/media).
Does your script mount /system/media as RW or is that not needed in a script? (I have NO idea haha, I'm studying Software Dev but no idea about Android development).
I'll try it out later tonight when I get home (Going out for a few drinks)
pk92 said:
Thanks so much for writing it by the way
I'd take a guess that it does need SU to copy the animation, as it is going to a root directory (/system/media).
Does your script mount /system/media as RW or is that not needed in a script? (I have NO idea haha, I'm studying Software Dev but no idea about Android development).
I'll try it out later tonight when I get home (Going out for a few drinks)
Click to expand...
Click to collapse
Will test it on my own mobile now.
edit: **** wont work
For the hell of it, I cant make it work with sh. Bash works nicely. Most stupid thing is: sManager always forces sh when executing scripts. If you tap on start konsole from within sManager, it starts /system/xbin/bash. calling the script from there works.
I have no Idea for a clean workaround
ArRaY92 said:
Will test it on my own mobile now.
edit: **** wont work
For the hell of it, I cant make it work with sh. Bash works nicely. Most stupid thing is: sManager always forces sh when executing scripts. If you tap on start konsole from within sManager, it starts /system/xbin/bash. calling the script from there works.
I have no Idea for a clean workaround
Click to expand...
Click to collapse
Will I have to run the script each boot? Sorry for all the questions haha.
I'm trying to make my own Boot Animation at the moment... Using Flash CS6 for now..
The part0 (non loop) will be drawing the Pentagram, then the elements appearing
The part1 (loop) will be the elements animated until boot.
I'll be using it with this Boot Logo
{
"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"
}
https://dl.dropbox.com/u/25175326/bootlogos/pentagram.raw
Ok, The only problem I get now is this:
Code:
localhost bootanimations # cp -f $file /system/media/bootanimation.zip
cp: can't create '/system/media/bootanimation.zip' : File Exists
Going to try deleting the boot animation from there and running.
-EDIT-
Deleted /system/media/bootanimation.zip
Ran the script
Ended up with the default Android boot animation :|
Hm. I added the -f to force overwriting. For me it works, I tried it with pictures, every time the the script is executed, I have another picture with the same name. Only make sure to not include sub folders or other files then zip files in the folder.
Sent from my MB525 using xda app-developers app
ArRaY92 said:
Hm. I added the -f to force overwriting. For me it works, I tried it with pictures, every time the the script is executed, I have another picture with the same name. Only make sure to not include sub folders or other files then zip files in the folder.
Sent from my MB525 using xda app-developers app
Click to expand...
Click to collapse
Does the script need to be ran each boot to work?
My process:
Open SManager
Click script - Edit - Copy all
Menu > Console
Run Shell
Hold screen - Paste
No errors at all
Back button - Kill
Reboot (normal)
/sdcard/bootanimations contains the following files:
"Portal.zip"
"CM9.zip"
The only one that seems to run is Portal.zip, making me think that it does need to be run each boot.. Any way around this?
Perhaps it being a flashable zip that does something along these lines or this or something ?
Possible way to get it to run at startup:
Install Autostart (Root)
Download the script Autostart.sh and place it at /data/opt/autostart.sh (Permissions 755 I think)
Place your Boot Animations in /sdcard/bootanimations - They can be named anything.
Reboot your phone, and the script should run
When you next reboot your phone you should have random boot animations working..
This is all just theory so far, I haven't tested it yet!
Nevermind, It seems the Autostart app doesn't work on ICS (so I'm assuming JB too.)
Perhaps a flashable .zip is the best way, editing system files
pk92 said:
Does the script need to be ran each boot to work?
My process:
Open SManager
Click script - Edit - Copy all
Menu > Console
Run Shell
Hold screen - Paste
No errors at all
Back button - Kill
Reboot (normal)
/sdcard/bootanimations contains the following files:
"Portal.zip"
"CM9.zip"
The only one that seems to run is Portal.zip, making me think that it does need to be run each boot.. Any way around this?
Perhaps it being a flashable zip that does something along these lines or this or something ?
Click to expand...
Click to collapse
What shell does smanager open?
Also, did you try just creating a script.sh file with the code I posted and when opening it in sManager klick run? Without any copy and paste?
There is even a button to give su rights to script.
ArRaY92 said:
What shell does smanager open?
Also, did you try just creating a script.sh file with the code I posted and when opening it in sManager klick run? Without any copy and paste?
There is even a button to give su rights to script.
Click to expand...
Click to collapse
After I click run shell it says:
Code:
exec sh -c "cd '/mnt/sdcard' ; exec /system/xbin/bash"
dcard' ; exec /system/xbin/bash"
[COLOR="Red"]localhost[/COLOR] [COLOR="Blue"]sdcard #[/COLOR]
No errors, but the boot anim doesn't seem to change (from what I can see)
I did try saving it as a .sh and open in sManager but you said it only uses sh not bash?
Result of running .sh file without editing anything:
Code:
exec sh 'mnt/sdcard/Random Boot Animation.sh'
andom Boot Animation.sh' <
:not found/Random Boot Animation.sh:line 2:
/mtn/sdcard/Random Boot Animation.sh: cd: line 4:
can't cd to /mnt/sdcard/bootanimations
/mnt/sdcard/Random Boot Animation.sh: line 5: ca:
read-only file system
:not found/random Boot Animation.sh: line 6:
sed: list: No such file or directory
:not found /Random Boot Animation.sh: line 13:
': no such file or directory
Seems to be a bit... messed up lol
(when running as executable i get this:
Code:
# exec sh -c '/mnt/sdcard/script.sh'
sh: /mnt/sdcard/script.sh: Permission Denied
Code:
#!/system/bin/sh -
#Change folder
cd /mnt/sdcard/bootanimations
rm list
ls > list
#Get random file
set -- *
length=$#
ran=$(hexdump -e '1/1 "%d"' -n 1 /dev/urandom)
rand=$(( $ran % ($length + 1) ))
file=$(sed -n "${rand}"p list)
#Copy over old animation
cp -f "$file" /system/media/bootanimation.zip
echo "successful if 0: " $?
This one works for me reliably...
pk92 said:
After I click run shell it says:
Code:
exec sh -c "cd '/mnt/sdcard' ; exec /system/xbin/bash"
dcard' ; exec /system/xbin/bash"
[COLOR="Red"]localhost[/COLOR] [COLOR="Blue"]sdcard #[/COLOR]
No errors, but the boot anim doesn't seem to change (from what I can see)
I did try saving it as a .sh and open in sManager but you said it only uses sh not bash?
Result of running .sh file without editing anything:
Code:
exec sh 'mnt/sdcard/Random Boot Animation.sh'
andom Boot Animation.sh' <
:not found/Random Boot Animation.sh:line 2:
/mtn/sdcard/Random Boot Animation.sh: cd: line 4:
can't cd to /mnt/sdcard/bootanimations
/mnt/sdcard/Random Boot Animation.sh: line 5: ca:
read-only file system
:not found/random Boot Animation.sh: line 6:
sed: list: No such file or directory
:not found /Random Boot Animation.sh: line 13:
': no such file or directory
Seems to be a bit... messed up lol
(when running as executable i get this:
Code:
# exec sh -c '/mnt/sdcard/script.sh'
sh: /mnt/sdcard/script.sh: Permission Denied
Click to expand...
Click to collapse
Sorry for my intermission.
The
:not found/random Boot Animation.sh: line 6:
line, is related with EOL. You are using MS-Dos end of line, but Android (as linux, unix based system) needs Unix end of line for scripts.
When I edit script on Windows, I use Scite it allows change and convert EOL.
There is a lot of Text editors whith this EOL feature.
I would like implement EOL check in SManager, but it is my eternal TODO.
Regards,
Devwom
devwom said:
Sorry for my intermission.
The
:not found/random Boot Animation.sh: line 6:
line, is related with EOL. You are using MS-Dos end of line, but Android (as linux, unix based system) needs Unix end of line for scripts.
When I edit script on Windows, I use Scite it allows change and convert EOL.
There is a lot of Text editors whith this EOL feature.
I would like implement EOL check in SManager, but it is my eternal TODO.
Regards,
Devwom
Click to expand...
Click to collapse
So you wrote sManager? Nice work. One thing that bothers me though, is that if you start a console it starts up bash, but if you run a script it forces sh. That really sucks for testing. Please correct me if I am wrong, or if you have any advice.
Also, the design is kind of old But as long as it works...

[TIPS][SCRIPTS][ROOT]egingell's scripts. Updated 11/22/13 11:30 MST

I will be using this thread to post my scripts and link them to other threads as needed. For this thread, I am assuming you know what you're doing. You don't need mad hacking skills and you don't need to be an expert (I'm sure as hell not), but knowing your way around the file system and basic shell scripting are helpful.
Some background: I am using the stock ROM and kernel (SGS2 - GB27, SGS4 - MDC), so all of my tips revolve around using stock and all of my scripts (even the flashable ones) will work without flashing from recovery (just extract the script from the ZIP and execute it while the phone is in phone-mode - you know... powered on ).
You are welcome to use my scripts in your apps. I only ask that you give me some credit.
I am not responsible for bricking your phone. I have only tested my scripts on my personal Samsung Galaxy S2 and S4 from Sprint. You are welcome to try on your phone, but I offer no warranties or guarantees as to whether they will work or not. Back up your ****!
All of this requires root!
Below is a list of the scripts I have written for y'alls. Enjoy.
Custom df: Shows where irregular mounts ("mount -o bind") are mounted. [ Forum post | Download ]
Currently doesn't work on my SGS4.
Easily move Phonesky.apk and GoogleServicesFramework.apk to /system or /preload for Multi DPI Play Store. [ Forum post | Download ]
Untested on my SGS4, but there's no reason to think that it won't work.
Use your SGS2's internal SD card for Link2SD instead of making a second partition on your external SD card (although, depending on the setup, you may still need to make a tiny partition on your external SD card) and your external SD card as your internal SD card [ Forum post ]
Untested on my SGS4. I have no need for it.
Clean up Link2SD: Delete files associated with Link2SD when uninstalling it. It does not revert the links Link2SD makes. It only deletes the mount scripts. [ Forum post | Download ]
If you use the debuggerd script to enable init.d, running this script will cause you to lose init.d.
Untested on my SGS4, but there's no reason to think that it won't work.
Delete Samsung's bloatware from the Sprint SGS2. [ Forum post | Download ]
Untested on my SGS4, but there's no reason to think that it won't work; however, it was written specifically for the SGS2's bloatware. See thread S4 System Apps Safe To Remove for a list of SGS4 bloatware apps.
Google Home Launcher (from Kit Kat).
Works on Jelly Bean.
Below are some other tweaks.
You can use custom boot animations with the stock ROM. All you need to do is swipe a "/system/bin/bootanimation" binary file from another ROM (such as @rujelus22's Blu Kuban FL24 (ICS) or Blu Kuban GB27 (JB 4.1.2)), paste it into "/system/bin", and make it executable.
For JB 4.2.2, make sure the user and group are root and shell respectively. This doesn't seem to be a problem with JB 4.1.2 and below. It's also possible that my initial testing involved a boot animation that didn't work on my SGS4, so if it works with root as both user and group, then roll with it. :good:
Also for JB 4.2.2, use the file from a JB 4.2.2 ROM, such as The Blu Kuban S4.
You can enable init.d scripts very easily by renaming "/system/bin/debuggerd" to "/system/bin/debuggerd.bin", replace it with the following, and make both files executable. If "/system/bin/debugger.bin" already exists, then edit "/system/xbin/busybox run-parts /system/etc/init.d" into "/system/bin/debuggerd".
As with the above, make sure the user and group are root and shell.
Code:
[color=green]#!/system/bin/sh[/color]
LOG=/data/debuggerd.log
echo "$(date)" > $LOG
echo "init.d" >> $LOG
/system/xbin/busybox run-parts /system/etc/init.d 1>>$LOG 2>>$LOG
echo "$(date) finished" >> $LOG
echo debuggerd.bin launched >> $LOG
exec /system/bin/debuggerd.bin
Below are some tips.
Most of the things you can do with a custom kernel, you can do with the stock kernel, it just requires more work and more risk.
If you replace an odexed system app with a deodexed system app, make sure you delete the app's ODEX file (it's the same file name except with the extension .odex).
Conversely: if you replace a deodexed system app with an odexed system app, you better have the ODEX file to go with it.
You can clear the dalvik-cache without a custom kernel by deleting the contents of "/data/dalvik-cache". You can even delete an individual app's dalvik-cache by finding the file "/data/dalvik-cache/[email protected]@[email protected]" or "/data/dalvik-cache/[email protected]@[email protected]" and delete it.
You can manually uninstall a system app's update by finding the file "/data/app/.apk" and delete it.
You can manually delete all user data by deleting the contents of "/data/data". You can even delete an individual app's data by finding the folder "/data/data/" and delete it.
Making scripts and binaries executable:
They must be on an EXT formatted filesystem (e.g. /data, /system, /preload).
They must be at least readable and executable by the user 'shell' (755 (read/execute for all, write only for user - "u=rwx,a=rx" if your busybox supports that method) is what I usually use).
Code:
chown root:shell ""
chmod 755 ""
chmod u=rwx,a=rx "" # busybox must support symbolic modes
Changing file permissions requires read/write access to the filesystem on which the file resides:
Code:
mount -o remount,rw /system # make the /system partition read/write
mount -o remount,ro /system # make the /system partition read only
The stock kernel is considered "production" whether or not it's rooted; therefore, you cannot use ADB to push or pull files directly to or from protected partitions, nor run ADB as root, nor use ADB's remount command, so you have to use unprotected partitions as a sort of buffer. You can, however, access the ADB shell and issue the "su" command wherein you can use "cp" to copy files to or from protected partitions prior to using ADB to push or pull the desired file. However, there is an app aptly named [root] adbd Insecure by @Chainfire that patches the ADB daemon to get around this limitation.
Example:
Code:
c:/android-sdk> adb shell
[email protected]:/ $ su
[email protected]:/ # cp /system/bin/debuggerd /sdcard/debuggerd
[COLOR="green"]-- open a new command prompt window --[/COLOR]
c:\android-sdk> adb pull /sdcard/debuggerd debuggerd
c:\android-sdk> adb push debuggerd /sdcard/debuggerd
[COLOR="green"]-- switch to the first command prompt window --[/color]
[email protected]:/ # mount -o remount,rw /system
[email protected]:/ # cp /sdcard/debuggerd /system/bin/debuggerd
[email protected]:/ # chown root:shell /system/bin/debuggerd
[email protected]:/ # chmod 755 /system/bin/debuggerd
[email protected]:/ # mount -o remount,ro /system
Some noteworthy files and folders:
/proc/self/mountinfo: If you can read it, it tells you where your partitions and folder binds are mounted.
/proc/partitions: Shows all of your SD card's partitions, how many blocks each has, and their vold numbers (eg "179 1 30578964 mmcnlk0p1").
/dev/block/platform/dw_mmc/by-name: This folder contains symlinks to your internal eMMC's partitions indexed by what they are for (eg UMS for your internal SD card - "realpath /dev/block/platform/dw_mmc/by-name/UMS" will print out the device path (ie "/dev/block/mmcblk0p11")).
/dev/block/platform/dw_mmc/by-num: This folder is like the previous except that they are indexed by partition number (eg "p11").
/proc/version: Shows what version of Linux is currently being used.
/data/system/batterystats.bin: Delete this when your battery is fully charged and still plugged in to recalibrate it.
Footnotes:
For "/data/app", "/data/data", and "/data/dalvik-cache" files you need to know the package name. There are various apps that will tell you, including Link2SD (mentioned above), Titanium Backup, and the web URL of the app in the Play Store (ex: https://play.google.com/store/apps/details?id=com.devname.appname).
More:
Random boot sound using your notification sounds
Make ADB work for all users - Jelly Bean 4.2.2 (Updated 07/15/13 00:35 MST)
Stock ROM - SGS4 - init.d
No-data restore tips
SGS4 Bloatware Remover
Make apps run faster and increase battery life
Random boot sound using your notification sounds
The attached ZIP contains a script that can be run pre or post boot. It just needs to be executable.
Preboot requires init.d. See the OP for enabling it if you are on a stock rooted ROM and requires the file to be readable and executable ("chmod 755" works fine).
Postboot requires an app such as Scripter (ROM Toolbox) or Script Manager to execute the script at boot.
Requires the variable $RANDOM. You can make sure it's available from the command line ("echo $RANDOM").
Use this script at your own risk. I provide no warranties or guarantees.
What does this script do?
Check for carrier boot up sounds (sub folders in the "/system/media/audio/ui" folder) and moves them to "/system/media/audio/notifications" renaming them as needed.
Create symlinks in the above folders to "/system/media/audio/ui/PowerOn.ogg".
Check if "/system/media/audio/notifications/PowerOn.ogg" is present and copy it to "/system/media/audio/ui/PowerOn.ogg" it's not.
Count the number of files in "/system/media/audio/notifications".
Grab a random number between 1 and the number of files found inclusive (math notation: "[1, numFiles]").
Go through "/system/media/audio/notifications" and copy the file at index random to "/system/media/audio/ui/PowerOn.ogg".
Notes:
The stock file is included. If you want a different sound in its place, you can either comment out that line in the script and delete the "/system/media/audio/notifications/<subfolder>_PowerOn.ogg" files from "/system/media/audio/notifications" or just replace "/system/media/audio/notifications/PowerOn.ogg" with some other sound file and still delete the "/system/media/audio/notifications/<subfolder>_PowerOn.ogg" files from "/system/media/audio/notifications".
If you want more sounds, just copy them to "/system/media/audio/notifications" (OGG files only).
The script does not check for valid files and blindly renames the destination file to "PowerOn.ogg".
It does not look in "/sdcard/media/audio/notifications" or anywhere else for audio files.
I do not recommend using alarms or ringtones files as they are usually looped which can cause the media scanner to get stuck and overheat your phone or tablet - those files may continue to play even if you can't hear them.
If you can't hear a sound on boot, it is likely that the file is either invalid or has no audio (ex: my /system/media/audio/ui/BST/PowerOn.ogg has no audio).
It was tested and works on a Samsung Galaxy S2 (stock JB 4.1.2) and a Samsung Galaxy S4 (stock JB 4.2.2) both from Sprint and using stock kernels.
There's no obvious reason it won't work on other phones and tablets with other ROMs from other carriers.
Nice work E.
cerj said:
Nice work E.
Click to expand...
Click to collapse
:good:
Make ADB work for all users - Jelly Bean 4.2.2 (Updated 07/15/13 00:35 MST)
With Android 4.2.2, ADB now requires RSA keys. This poses a problem when attempting to connect to the device's ADB server from the device itself and the device won't ask for authorization unless it's connected via USB. Well, there's hope, yet.
For the following, I'm assuming you used my method for adding init.d support to your device.
Use these scripts at your own risk. I provide no warranties or guarantees.
Add the following script to /system/bin/debuggerd. If you use an alternate method, please note that it must be executed by the debugger daemon. You must do this first or you'll have to manually restart the debugger daemon after editing this file and executing the run-once script (next step), so edit this file first and save it.
Code:
if [ ! -e "/.android" ]; then
busybox mount -o rw,remount /
mkdir /.android
mount -o bind /data/.android /.android
busybox mount -o ro,remount /
fi
Then run this script once from the device (not over ADB on your PC).
Code:
[COLOR="Green"]#!/system/bin/sh[/COLOR]
HOME=/data
adb kill-server
adb start-server
stop adbd
cat /data/.android/adbkey.pub >> /data/misc/adb/adb_keys
echo "" >> /data/misc/adb/adb_keys # Add a blank line at the end of the file
start adbd
HOME=/
adb kill-server
stop debuggerd
start debuggerd
Notes:
You can also find the abdkey.pub file on your Windows' PC here, C:\Users\<user name>\.android\adbkey.pub. Copy it to your device by whatever means necessary, then append it to /data/misc/adb/adb_keys and you won't need to initially use the USB to allow the PC connection. Not really necessary unless your PC has no USB or you've broken your USB cable.
This may have inadvertently corrected the mounting issue introduced in Jelly Bean 4.2.2.
You can also allow other Android 4.2.2 devices, but it requires ADB version 1.0.31 and for you to manually append the contents of /data/.android/adbkey.pub from device A (the one you want to use to ADB on) to /data/misc/adb/adb_keys on device B (the target device).
Don't delete /data/.android
This won't fix apps. Just allow you to use ADB to connect to your device from itself.
Tested on my SGS4. No reason it won't work on other devices.
If you already have a /data/.android directory, you may not need to do this. On my SGS4, HOME defaults to "/" which the ADB daemon can't write to, so it can't make the RSA key.
The run-once script temporarily changes HOME to "/data", a writable directory, so the ADB daemon can write the RSA key then it append it to the allowed clients file then restarts the debugger daemon thus binding /data/.android to the /.android directory allowing all Linux users ADB access to the device.
Reassigning HOME to a new value on one user only changes its value for that user which is why I'm binding /data/.android to /.android.
Code:
# Example
[email protected]:/ $ echo $HOME
/
[email protected]:/ $ HOME=/data
[email protected]:/ $ echo $HOME
/data
[email protected]:/ $ su 1000
[email protected]:/ $ echo $HOME
/
Alternatively (much easier):
Make the .android folder in /data (mkdir /data/.android).
Add the script, the first code block in this post, to your debuggerd file or an init.d script.
Restart the debugger (stop debuggerd; start debuggerd) or reboot the phone.
Restart ADB (stop adbd; start adbd).
Copy the newly created public key to the allowed clients (cat /data/.android/adbkey.pub >> /data/misc/adb/adb_keys; echo "" >> /data/misc/adb/adb_keys).
Restart the ADB server (adb kill-server; adb start-server).
SGS4 Bloatware Remover
I have written a live-script to delete all of the SGS4 bloatware except GoogleContactsSycAdapter and SecLauncher3. If you want to delete those, remove the "#" from that line in the script. If you want to exclude an app, add a "#" to that line and put the app name in quotes (ie AppName / becomes "#AppName" / (including the forward slash) or just remove that line. If you remove the last item (YouTube in this case), remove the forward slash from the previous line.
Use this scripts at your own risk. I provide no warranties or guarantees.
What this script does:
Move the app's APK and ODEX to /sdcard/SystemAppsBackup.
Delete its dalvik-cache.
Reboot the phone. If it doesn't reboot, you'll have to do this yourself.
What this script does not do:
Delete the app's data. Because the script doesn't know the package name.
Delete its Play Store update (located in /data/app). Because the script doesn't know the package name.
Mount the SD card if it's not mounted. If you want backups, make sure the SD card is mounted.
Care if you delete a system app you wanted to keep. Most apps that you would want to keep may be available in the Play Store.
Restore apps.
Notes:
Apps will crash left and right when you execute this script in running mode. Don't fret, this is normal.
This is a live-script which means you have to manually execute the script either with a terminal emulator, a script executor like Scripter, or ADB.
This is not flashable.
If executing via ADB in Recovery mode, you may need to mount the SD card to /storage/sdcard0 manually or settle for no backups.
If you restore an app from /sdcard/SystemAppsBackup, make sure you get the ODEX file if present and set the permissions for both to 644.
This list is based off the list in the thread, S4 System Apps Safe To Remove.
Here You Go Guys, I took me about 30 mins, but I have successfully added all the app in the Op to a flashable Zip.
The Zip is base of TrulyClean v1.6 script code, I just deleted his ;delete/system/...apk and replaced it with all the ones from the OP
bigtobitobs said:
Here You Go Guys, I took me about 30 mins, but I have successfully added all the app in the Op to a flashable Zip.
The Zip is base of TrulyClean v1.6 script code, I just deleted his ;delete/system/...apk and replaced it with all the ones from the OP
Click to expand...
Click to collapse
Looks like you're deleting bloatware, perhaps you should post that in the right thread... or at least a more appropriate thread.
Sent from my SGS4.
egingell said:
Looks like you're deleting bloatware, perhaps you should post that in the right thread... or at least a more appropriate thread.
Sent from my SGS4.
Click to expand...
Click to collapse
LOL OMG I am so sorry, I had multiple tabs open and put this in the wrong forum. Please Delete
bigtobitobs said:
LOL OMG I am so sorry, I had multiple tabs open and put this in the wrong forum. Please Delete
Click to expand...
Click to collapse
Would that I could.
Sent from my SGS4.
Make apps run faster and increase battery life using Xposed App Settings.
Did you install GravityBox on your SGS4 then uninstall it and now you can't hear your games or music?
I think it has to do with GravityBox's "Volume Steps" option not undoing when GB is uninstalled. This is how I fixed it (forum post).
Stock ROM - SGS4 - init.d
I recently found out that my debuggerd hack to enable init.d support on my stock SGS4 wasn't working. So, I did this and now it works.
Make a file named "install-recovery.sh" and drop it into /system/etc. Whatever script you put in here will execute at boot up so long as the user/permissions are correct.
Code:
chown shell:shell "/system/etc/install-recovery.sh"
chmod 755 "/system/etc/install-recovery.sh"
chmod u=rwx,a=rx "/system/etc/install-recovery.sh" # busybox must support symbolic modes
Use this script at your own risk. I provide no warranties or guarantees.
My "/system/etc/install-recovery.sh" script:
Code:
[COLOR="Green"]#!/system/bin/sh[/COLOR]
LOG="/data/install-recovery.log";
echo "Executing install-recovery.sh" > $LOG;
echo "" >> $LOG;
echo "$(date) install-recovery hack..." > $LOG
echo "" >> $LOG
echo "init.d" >> $LOG
[COLOR="green"]# I can't get run-parts to work for some reason, but this will run every *.sh script in /system/etc/init.d as root.[/COLOR]
for N in /system/etc/init.d/*.sh; do
su -c "$N" 1>>$LOG 2>>$LOG
done;
Notes:
Mount binding (in JB 4.2.2+) seems to work. E.g. mount -o bind /folder1 /folder2
$(date) does not provide the correct date (mine said: "Wed Apr 15 13:24:13 MST 1970").
The Package Manager is not available. (There may be other unavailabilities, but I don't intend to test it thoroughly.)
Somethings I discovered recently while doing a no-data system restore for the second time in the same night and some tips relating to system restores:
* When doing a no-data restore, disabled/frozen system apps remain disabled.
* Apps that can't be disabled even with Titanium Backup will not remain disabled after a reboot and will sometimes crash/FC repeatedly until uninstalled.
* If an app won't open or FCs, try converting it to a system app and back to user app or vice versa.
* Don't integrate system app updates into the ROM. In the event that you have to do a no-data restore, those updates will be retained.
* Don't convert user apps to system apps for the same reason.
* Disregard the previous two tips if disk space is a problem. It's just more time consuming (redownloading updates, reintegrating, and reinstalling) after a restore.
* Save all modified system files, such as /system/bin/debuggerd, /system/build.prop, /system/etc/install-recovery.sh, and if your ROM uses /system/etc/unit.d, any modified or extra files there. If you use them, you'll need them after a restore.
* For a smoother post no-data restore, use Titanium Backup's labels so you can batch-uninstall those pesky system apps you don't want.
SGS2 - JB 4.1.2 GB27
SGS4 - JB 4.2.2 MF9
any command for updater script to make directory in root of android ??
HassanMirza01 said:
any command for updater script to make directory in root of android ??
Click to expand...
Click to collapse
Creating directories in / and all the files contained therein must be redone on every boot. That said, you just need to make root writable and make the directory.
mount -o remount,rw /
mkdir /whatever
mount -o remount,ro /
Note: Every time you wish to create, modify, or delete files you'll have to make root writable.
Sent from my LG-H811 using Tapatalk
egingell said:
Creating directories in / and all the files contained therein must be redone on every boot. That said, you just need to make root writable and make the directory.
mount -o remount,rw /
mkdir /whatever
mount -o remount,ro /
Note: Every time you wish to create, modify, or delete files you'll have to make root writable.
Sent from my LG-H811 using Tapatalk
Click to expand...
Click to collapse
Actually.... I wanna add some files within folder in root of android root... So i need to use above three commands nd then after making directory, i should extract files to that folder ??
HassanMirza01 said:
Actually.... I wanna add some files within folder in root of android root... So i need to use above three commands nd then after making directory, i should extract files to that folder ??
Click to expand...
Click to collapse
Yes.
Sent from my LG-H811 using Tapatalk
:good:

MAKING SYSTEM WRITABLE - [Z5] [Nougat] AFTER ROOT

after ROOTING Nougat 32.3.A.0.376 (E6833 E6853 E6883) (E6633 E6653 E6683 ), we will still face ERROR while removing system apps, because GOOGLE has changed file system properties in Android N to READ ONLY
in order to make system directory WRITABLE, install busybox, and terminal,
type these lines and enter one by one in #terminal
Code:
su
mount -o rw,remount /system
ORRR
Code:
su
busybox mount -o rw,remount,rw /system
-----------
What???
Why ??? I still can not write anything on the SYSTEM partition
I have full ROOT access and everything , no reboot or error issue !!
Please share if you find any solution to that
chinmoy32 said:
Why ??? I still can not write anything on the SYSTEM partition
I have full ROOT access and everything , no reboot or error issue !!
Please share if you find any solution to that
Click to expand...
Click to collapse
Mee too unable to write on system
download terminal on google play
open terminal
write "su" command and give root permission
then you will see "#"
after that, write this command:
Code:
echo 0 > /sys/kernel/security/sony_ric/enable
then you write this command:
Code:
mount -o rw,remount /system
if you see "#" again, it worked
but if you see "mount: Operation not permitted" it has not, sorry
Credits: https://forum.xda-developers.com/showpost.php?p=70677335&postcount=92
I did what @serajr described here:
https://forum.xda-developers.com/xp...-kernel-dm-t3301605/post70595975#post70595975
works like a charm, system always writable!
Can any of you share here your perfectly rooted working kernel for Z5 E6683 DSDS ????
chinmoy32 said:
Why ??? I still can not write anything on the SYSTEM partition
I have full ROOT access and everything , no reboot or error issue !!
Please share if you find any solution to that
Click to expand...
Click to collapse
i found a workaround and it goes
installing busybox
installing terminal
and writing following codes
Code:
su
'to give terminal root access
busybox mount -o rw,remount /system
later using ROOT APP REMOVER i manage to remove all bloatware!
toncheee said:
I did what @serajr described here:
https://forum.xda-developers.com/xp...-kernel-dm-t3301605/post70595975#post70595975
works like a charm, system always writable!
Click to expand...
Click to collapse
@serajr workaround was fo when rootkernel4.51 wasn't able to support Nougat kernel
however if you follow carefully, the lines mentioned
Code:
on post-fs
export LD_PRELOAD libNimsWrap.so:libdrmfix.so
and
Code:
write /sys/kernel/security/sony_ric/enable 0
will switchoff SONYRIC and will fix DRM
the issue is NOT sony RIC,
Google in general with or without any security/rootaccess changed the system folder properties from default Writable in <+ 6.01 Android version to READABLE ONLY from android 7.xx
so when i followed the both method of altering file via notepad++ in the ramdisk folder using N kernel and rootkernel version4.5, I ended up having fully root system with READLY ONLY ACCESS to /system partition and i could only switchoff the apps but can't remove!
YasuHamed said:
@serajr workaround was fo when rootkernel4.51 wasn't able to support Nougat kernel
however if you follow carefully, the lines mentioned
Code:
on post-fs
export LD_PRELOAD libNimsWrap.so:libdrmfix.so
and
Code:
write /sys/kernel/security/sony_ric/enable 0
will switchoff SONYRIC and will fix DRM
the issue is NOT sony RIC,
Google in general with or without any security/rootaccess changed the system folder properties from default Writable in <+ 6.01 Android version to READABLE ONLY from android 7.xx
so when i followed the both method of altering file via notepad++ in the ramdisk folder using N kernel and rootkernel version4.5, I ended up having fully root system with READLY ONLY ACCESS to /system partition and i could only switchoff the apps but can't remove!
Click to expand...
Click to collapse
I also think the issue is not the RIC but something to do with the Nougat filesystem itself.
I can delete all the files and folders with any file managers I like but like after 1 sec they all reappear as nothing ever happened to them !!!
How strange is that ??
It shows file sizes when I delete them and take times to delete the folders with , say for 500MB
but they still reappear after just 1 refresh or 1 sec.
I cant figure it out at all for the sake of my sanity --- why the hell this is happening ????
https://www.dropbox.com/sh/2kf8wg3g13pv869/AACB3l8iPJHJnBlpnGorRqrha?dl=0
@bungadudu @chinmoy32
I followed bungadudu-s steps and it worked i can change permissions and prove it with link i provided.
And chenges, yes they stick after reboot and i can rename files allso, but:
after reboot i have to repeat this steps if i want to change something elsewhere, old changes do stick aroind though
I deletet phone to 0 mb in twrp, flashed AU nougat .372 with flashtool, rebooted into twrp, flashed zip file provided in link, then flashed supersu in link and rebooted, no custom kernel used
Next i will try to copy modified thermal files now and see if they stick after reboot and if kernel aduitor uses them, see you later
Observations:
-i changed permissions from file /system/build.prop and changed lcd density to 320 and i have bootloop
working on how to boot it up...
YasuHamed said:
after ROOTING Nougat 32.3.A.0.372 (e6833 e6853 e6883) (E6633 E6653 E6683 ), we will still face ERROR because GOOGLE has changed file system properties in Android N to READ ONLY
in order to make system directory WRITABLE, install busybox, and terminal,
type these lines and enter one by one in terminal
Code:
su
busybox mount -o rw,remount /system
-----------
Click to expand...
Click to collapse
Please share the exact name / way to install busybox and terminal
i.e. which version of busybox I need to install from where ?? Which terminal app you used ?? if possible please share the links
https://www.dropbox.com/s/d9ie598b618feiz/recovery.log?dl=0
i managed to get somesort of log from twrp in link from previous post will this sufice?
i am reflashing my phone so i can not look at versions, for now i used:
when i reboot it i can look into busybox version
SR3-SuperSU-v2.79-SR3-20170114223742, on top of that i installed pro:
https://play.google.com/store/apps/details?id=eu.chainfire.supersu.pro
busyboxpro
https://play.google.com/store/apps/details?id=stericson.busybox.donate
terminal from romtoolbox pro:
https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro
those are some apps i support so i dot know if it makes a diference from non paid
chinmoy32 said:
Please share the exact name / way to install busybox and terminal
i.e. which version of busybox I need to install from where ?? Which terminal app you used ?? if possible please share the links
Click to expand...
Click to collapse
chinmoy32 said:
Please share the exact name / way to install busybox and terminal
i.e. which version of busybox I need to install from where ?? Which terminal app you used ?? if possible please share the links
Click to expand...
Click to collapse
I install both of them via play.google.com
https://play.google.com/store/apps/details?id=stericson.busybox&hl=en
&
https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en
later i opened terminal and ran those commands
later i installed System App remover
https://play.google.com/store/apps/details?id=com.jumobile.manager.systemapp&hl=en
granted it SU rights and removed HANGOUTS and GOOGLE MOVIES etc
It seems to work to some extend but if you want to go tweak it up, kablaaam
i did not managed to boot it up after bootloop sadly, i need my phone so this is it for me this week
stipi69 said:
https://www.dropbox.com/s/d9ie598b618feiz/recovery.log?dl=0
i managed to get somesort of log from twrp in link from previous post will this sufice?
i am reflashing my phone so i can not look at versions, for now i used:
when i reboot it i can look into busybox version
SR3-SuperSU-v2.79-SR3-20170114223742, on top of that i installed pro:
https://play.google.com/store/apps/details?id=eu.chainfire.supersu.pro
busyboxpro
https://play.google.com/store/apps/details?id=stericson.busybox.donate
terminal from romtoolbox pro:
https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro
those are some apps i support so i dot know if it makes a diference from non paid
Click to expand...
Click to collapse
I just clean install 372 and patched the kernel once again .................
tried the terminal commands ---- both commands were successful (without any errors )
but still the deleted apps and the edited files came back to normal as before
I did not manage to delete anny apps as my phone crashed before, i am glad you get commands to work.
oh, by the waj roomtoolbox is great as you can make shortcuts of the commands and then you klik it one after another and you get rid of the typing
example (first shortcut command depends of busybox install folder i think)
1.st shortcut "cd /su"
2.nd shortcut "su"
3.rd shortcut "echo 0 > /sys/kernel/security/sony_ric/enable"
4.th shortcut "mount -o rw,remount /system"
that way some people can do this quick and you dont need to remember commands, and you can experiment quicker.
sorry i dont know howto annything else for now
chinmoy32 said:
I just clean install 372 and patched the kernel once again .................
tried the terminal commands ---- both commands were successful (without any errors )
but still the deleted apps and the edited files came back to normal as before
Click to expand...
Click to collapse
stipi69 said:
I did not manage to delete anny apps as my phone crashed before, i am glad you get commands to work.
oh, by the waj roomtoolbox is great as you can make shortcuts of the commands and then you klik it one after another and you get rid of the typing
example (first shortcut command depends of busybox install folder i think)
1.st shortcut "md /su"
2.nd shortcut "su"
3.rd shortcut "echo 0 > /sys/kernel/security/sony_ric/enable"
4.th shortcut "mount -o rw,remount /system"
that way some people can do this quick and you dont need to remember commands, and you can experiment quicker.
sorry i dont know howto annything else for now
Click to expand...
Click to collapse
I just managed to restart my phone successfully after changing the LCD density to 320 [I also use this value since always ]
But then I carefully just deleted 1 single app and booom--- boot loop
PS. i used root explorer to just click mount as R/W and then do anything to system partition --
Great you magaged it, and yes 320 seems so right.
And i asume there is no way to break bootloop?...other than reflashing?
I had trouble afterwards on downgrading to.253, 3x times error on start, even after reseting " power & + " and couple of full wipes in twrp.
I had to flash lineage from twrp and boot it up and only then flashtool succeeded pushing. 253.
This nougat will be fun i see
If there is something to try tell me i will flash it once more tonight, otherways i can do it on weekends
Oh i did not tell, i managed to copy modified thermal files with no error and then changed lcd density so i can not 100% tell which caused bootlop, since i did not reboot in between...
chinmoy32 said:
I just clean install 372 and patched the kernel once again .................
tried the terminal commands ---- both commands were successful (without any errors )
but still the deleted apps and the edited files came back to normal as before
Click to expand...
Click to collapse
there is another way which i did not try because the busybox commands worked for me
its about flashsing updater script
delete_recursive(
"/system/app/GoogleAnalyticsProxy",
"/system/priv-app/GoogleBackupTransport",
"/system/priv-app/textinput-chn-xxhdpi",
);
https://forum.xda-developers.com/showpost.php?p=70920831&postcount=2015

[Root] [App] [All tablets] Disable & replace lock screen - set custom wallpaper

Here is a quick guide on disabling Amazon's lock screen and replacing it with a friendlier one, much closer to AOSP stock. You'll even be able to set a custom wallpaper. This should work on all Amazon tablets.
Requirements:
- Must be rooted, have access to ADB or install a terminal emulator on your tablet.
- M-Locker. Download the APK at the end of this post.
Instructions:
1. Thank @Thibor69 for this step: Plug your tablet into your PC and open an ADB window or open a terminal on device. Make sure you have SuperUser rights. Copy and paste the code below. This will disable your lock screen (sets option to none in security settings). When done, reboot:
Code:
adb shell
su
sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
2. Download, install, and make a system application (/system/priv-app), M-Locker (attached at the end of this post). Make sure to give it access to notifications and enable accessibility service. I found the application here. Thank @-XperiaMan- for posting this application.
You can add a wallpaper or a small message (pretty much the same as a custom carrier label).
{
"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"
}
Will try it on my Fire 7 2017!
DragonFire1024 said:
2. Download, install, and make a system application (/system/priv-app), M-Locker (attached at the end of this post). Make sure to give it access to notifications and enable accessibility service. I found the application here. Thank @-XperiaMan- for posting this application.
Click to expand...
Click to collapse
What is your preferred method for performing this step?
MisterMalakai said:
What is your preferred method for performing this step?
Click to expand...
Click to collapse
Just download the app, place it in system/priv-app (make a folder with the same name as the apk and place it in there) and set permissions to 644 and reboot.
Sent from my Amazon KFSUWI using XDA Labs
might want to add
requirements:
must have sqlite3 installed (can be installed through magisk?)
*edit, whelp tried the command twice as su (karnak #), looked like it took, but still see lock screen after both attempts and reboots.
HD 8 2018, 6.3.01, rooted,magisk,twrp,xposed, nova launcher using hijacklauncher, installed sqlite3 through magisk
LukasB1 said:
might want to add
requirements:
must have sqlite3 installed (can be installed through magisk?)
*edit, whelp tried the command twice as su (karnak #), looked like it took, but still see lock screen after both attempts and reboots.
HD 8 2018, 6.3.01, rooted,magisk,twrp,xposed, nova launcher using hijacklauncher, installed sqlite3 through magisk
Click to expand...
Click to collapse
Magisk may revert the setting to default (default being the img that magisk mirrored when installed). You may have to go into magisk settings, toggle on core mode only, make the changes in the magisk image, reboot and toggle off coremode only.
Sent from my Amazon KFSUWI using XDA Labs
Interesting, I installed sqlite3 with magisk, but get 'No such file or directory' when trying to run the binary. The really weird part is:
Code:
karnak:/ # sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
/system/bin/sh: /system/xbin/sqlite3: No such file or directory
1|karnak:/ # which sqlite3
/system/xbin/sqlite3
karnak:/ # ls -la /system/xbin/sqlite3
-rwxr-xr-x 1 root root 1198888 2019-06-10 16:53 /system/xbin/sqlite3
It's clearly there... So... wtf, I've been a Linux user for over 10 years... I can't recall seeing anything like this.
Ziffnil said:
Interesting, I installed sqlite3 with magisk, but get 'No such file or directory' when trying to run the binary. The really weird part is:
Code:
karnak:/ # sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
/system/bin/sh: /system/xbin/sqlite3: No such file or directory
1|karnak:/ # which sqlite3
/system/xbin/sqlite3
karnak:/ # ls -la /system/xbin/sqlite3
-rwxr-xr-x 1 root root 1198888 2019-06-10 16:53 /system/xbin/sqlite3
It's clearly there... So... wtf, I've been a Linux user for over 10 years... I can't recall seeing anything like this.
Click to expand...
Click to collapse
Permissions?
Ziffnil said:
Interesting, I installed sqlite3 with magisk, but get 'No such file or directory' when trying to run the binary. The really weird part is:
Code:
karnak:/ # sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
/system/bin/sh: /system/xbin/sqlite3: No such file or directory
1|karnak:/ # which sqlite3
/system/xbin/sqlite3
karnak:/ # ls -la /system/xbin/sqlite3
-rwxr-xr-x 1 root root 1198888 2019-06-10 16:53 /system/xbin/sqlite3
It's clearly there... So... wtf, I've been a Linux user for over 10 years... I can't recall seeing anything like this.
Click to expand...
Click to collapse
i get the "no such file" error like you unless you add "su" to the beginning of the line
su sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
after hitting enter, there is no error. it goes to a new line with karnak #
but when you look at the file modification times, it has not changed at all.
i've also copy/pasted the file into sdcard, modified it, cut/copy/paste it back, and got stuck in boot loop.
if you delete the locksettings files, on the next system reboot, the files are created again.
so far i have not found a working solution for HD8 2018. even searching for how to do this you can find a ton of answers spread across sites and that line works, but those are for other devices /phones/etc. HD8 2018, not sure what to do.
*edit, forgot to mention that i did try dragon's reply above about putting magisk into core mode, but still the same outcome. no error after the command line, looks like it took, but file was not modified and nothing changes at all. and as mentioned above, i tried and tried different ways, permissions, moving the file elsewhere to modify it and put it back which caused bootloop, etc.
LukasB1 said:
Interesting, I installed sqlite3 with magisk, but get 'No such file or directory' when trying to run the binary. The really weird part is:
i get the "no such file" error like you unless you add "su" to the beginning of the line
su sqlite3 /data/system/locksettings.db "UPDATE locksettings SET value = '1' WHERE name = 'lockscreen.disabled'"
after hitting enter, there is no error. it goes to a new line with karnak #
but when you look at the file modification times, it has not changed at all.
i've also copy/pasted the file into sdcard, modified it, cut/copy/paste it back, and got stuck in boot loop.
if you delete the locksettings files, on the next system reboot, the files are created again.
so far i have not found a working solution for HD8 2018. even searching for how to do this you can find a ton of answers spread across sites and that line works, but those are for other devices /phones/etc. HD8 2018, not sure what to do.
*edit, forgot to mention that i did try dragon's reply above about putting magisk into core mode, but still the same outcome. no error after the command line, looks like it took, but file was not modified and nothing changes at all. and as mentioned above, i tried and tried different ways, permissions, moving the file elsewhere to modify it and put it back which caused bootloop, etc.
Click to expand...
Click to collapse
I don't use magisk. Its too much trouble when you need or want to change anything in /system. So unfortunately I'm unable to assist you in this regard beyond the only piece of advise I gave. Apologies.
Sent from my Droid Razr M using XDA Labs
Can install the M Locker as an user app without root

Categories

Resources