[SCRIPT] Move any file via terminal - Miscellaneous Android Development

I wrote a small (<1kb) script which moves (copy and removes source).
First it copy the source file (which you provide) to dest folder (you also provide that) and then it removes the source.
Standard Disclaimer:
Spoiler
I am NOT responsible for any damage/data lose.
You choose to try this script.
If something brakes, you are responsible not me!
If you blame me, I will laugh at you.
My script is stable and works great.
How to use:
1. Install my script (see below)
2. Open (any) terminal emulator
3. Type su (see note below)
4. Type move_file
5. Type source file
6. Type dest folder
Everything should be ok now.
How to install:
1. Get file from here
2. Copy to /system/bin or /system/xbin
3. Set permissions to 777 (I think that what is needed)
Should be all right.
Note: The script needs busybox & to be run as root because it mounts /system as RW at the beginning and mounts it back to RO at the end.
Click "thanks" if it helped you .

Related

[HOWTO´S] collection of how to do it :)

Hi all, im making a NEW thread for how to make custom ROM, change build.prop, how to theme (coming later)! i will make a colection of how to´s to this thread for now all of the how to´s are made by me but in future i will take how to´s from others too (with their permission ofc )
so subscribe to this thread!!
i hope that there will be many custom ROMs after this
now you all think why did i do this if theres another tutorial for making custom ROM? answer: this is good alternative and this is not just one HOWTO!
HOWTO´S
-custom ROM
-edit build.prop
-5 lockscreen mod and extended power menu
-deodexing
-install android sdk and use ADB
-port themes (coming later)
-make own bootanimation (coming later)
** you can also post your ideas for new how to´s!!!
have a nice day
p.s dont blame me if something happens to your device while doing these how to´s
p.p.s if you want some special how to you can always suggest it in this thread
[HOWTO] make a custom ROM
How to make custom rom:
you will need: ADB, root explorer (maybe) and the files that are going to be in your rom!
the guide is based on The Dark Lestat's guide, i made it more easier and specific
code to delete unwanted apps: (if ADB)
Code:
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
rm /system/app/nameofapk.apk
code to add apps and stuff: (if ADB)
Code:
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
exit
exit
adb push nameofapk.apk /system/app/
1. flash the ROM that will be your ROMs base. example: my ROMs base is JPM so i flashed clean JPM
2. make a list of the features that are going to be in your ROM
3. then start adding those features. example: i added live wallpaper support so i did this --> http://forum.xda-developers.com/showthread.php?t=793823 i also added JIT so i ran the automatic batch file from the thread --> http://forum.xda-developers.com/showthread.php?t=1026870 . then you just add those features.
4. put your sd card on to your phone (if it isnt there already )
5. when your done adding different features you go to ADB and type this:
Code:
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
dd if=/dev/block/stl6 of=/sdcard/factoryfs.rfs
then you wait about 2 minutes and there will be some text and then you type this
Code:
exit
exit
and in your sd-card will be freshly created factoryfs.rfs, import your freshly created factoryfs.rfs to your desktop. now you choose your kernel.
5. kernel, download the kernel you want to your desktop.
6. download total commander to your pc
7. open total commander, open the base ROM.tar. example: my base ROM was JPM so i opened the JPM.tar and replaced the kernel and factoryfs.rfs with my factoryfs.rfs and my kernel (fugumod 2.2) using total commander.
delete everything else in the .tar but, Cache.rfs, factoryfs.rfs, zlmage and data.rfs and the logo!
then you test if you can flash your ROM... if it boots, you did it. if it doesnt, try again.
[HOWTO] edit BUILD.prop
HOW TO change firmware version, phone model, build version in "about phone"
1. open root explorer
2. go to /system, find build.prop, change to read/write mode. open the build.prop in text editor
* change build version: 4th line should say ro.build.display.id=(here you write your build version name), reboot and check build version in "about phone"
* change model number: 15th line should say ro.product.model=(here write your model number ), reboot and check model number in "about phone"
* change firmware version: 8th line should say ro.build.version.release=(here write your firmware version, like 3.0 honeycomb ), reboot and check firmware version in "about phone"
you can also change different things but ill write a guide of that later
hope you like it!
[HOWTO] port a THEME
reserved for later use
[HOWTO] get 5 lockscreen mod and extended power menu
-your ROM must be deodexed!
-you can get extended power menu and 5 lockscreen mod by downloading this --> http://www.megaupload.com/?d=PKHVA57W
-extract it to root of your sd-card
-open root explorer and copy/paste the files to /system/framework
-reboot and done
OR
use adb like this:
Code:
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
exit
exit
adb push nameoffile.jar /system/framework/
-reboot and done
***NOTE rebooting might take some time so dont panic
[HOWTO] deodex ROM
you must be rooted
What you'll need:
A Windows based machine
xUltimate v2.2
Patience
Process:
-Unzip xUltimate v2.2, and launch "Main.exe"
-If everything goes well xUltimate should recognize the phone and make a connection. You now should see a list of options.
-Run option 1. After option 1 is done, run option 2.
-Now these well take a while. Run option 3.
-IMPORTANT: After you have run option 3, you MUST navigate to the xUltimate folder and find "origi_frame" folder, and delete "guava.odex" (if you even have it). It's a bad file, and interferes with deodexing process.
-Now run option 4, and wait.
-Exit xUltimate, and put the phone in USB mass storage.
-Go back into the xUltimate folder and copy "done_frame", and "done_app", and move them to the root of the sdcard.
-Open a command prompt, and do the following:
Code:
adb shell
su
stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/done_app/* /system/app/
cp /sdcard/done_frame/* /system/framework/
rm /system/app/*.odex
rm /system/framework/*.odex
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
reboot
and voila your phone is deodexed
original guide by webst3r, i changed it so its easier to understand
[HOWTO] get ADB up and running (easy way)
ADB is an acronym for Android Debug Bridge and is a development tool for the Android Mobile Operating System
NOTE this is only for windows!
-open this link --> http://adf.ly/Xfyl wait 5 secs and click upper right corner "skip ads" it will download a program that automaticly installs android sdk (wich includes ADB)
-Open the app, leave the destination as C:\ and click ok/install
-Installing ADB/USB Drivers:
*NOTE* You may need additional (Device Specific) Drivers for your Device!
- Connect your Android Device to your PC using the provided USB Cable or just a plain ole 6-pin to 4-pin usb cable... (I prefer to use one with a ferite core)
- When the new hardware device notification pops-up on your pc point windows to the driver folder we moved to our C-drive(C:\android-sdk-windows\google-usb_driver) and install the adb driver.
** if your having issues with installing ADB drivers read this --> http://dl.dropbox.com/u/20575563/ADB_Drivers_for_dummies.pdf
-Running ADB from the Command Prompt:
-Windows XP: Select Start or Tap the Windows Key on your Keyboard, select
"Run" and type "CMD" then hit "Enter".
-Windows Vista/Win7: Select Start or Tap the Windows Key on your Keyboard, select the search box on the left and type "cmd" then hit "Enter".
Add the "ADB" directory path as a system variable in windows:
-To do this right-click on "My Computer" and select Properties. Next select the Advanced tab(Advanced Settings in Vista/7) then select Environment Variables.
-Click "New" under System Variables and add the following:
Variable =
Code:
adb
Value =
Code:
C:\android-sdk-windows\platform-tools
-Call up your Command Prompt:
Time to start adb
- Open up a Command Prompt Windows
- Type the commands below:
Code:
cd C:\android-sdk-windows\platform-tools
<-- Press Enter
Code:
adb.exe
<--Press Enter
and voila You will see alot of scripting fly through the command prompt window.
***note! you have to enable usb debugging in --> settings --> applications --> developement --> check usb debugging
tutorial is not made by me, its made by AndroidSamurai. i found it after lot of researching
[HOWTO] make your own update.zip
download and install, then watch the video
http://youtu.be/i0KzFPMA6-8
program and video made by Daneshm90
balaji.admin said:
Please include a Post for Deodexing the ROM. I've tried to deodex the DDJP2. But never succeeded.
Hope your post will help me.
Click to expand...
Click to collapse
there is a tut by rudolf..
[HOWTO] change app icon
How to change icons for app!
1.)
Things you need:
original app
your custom icon (size should be 48x48)
win rar
2.)
Unpack APK
3.)
Find file, for example: ic_launcher_settings.png (for settings.apk)
It should be in: res/drawable-mdpi or res/drawable-ldpi (dont know which icon phone uses, just replace both)
4.)
Rename you icon to, for example: ic_launcher_settings.png (for settings.apk)
5.)
Replace it
6.)
Final step is add files to old settings.apk archive and using root explorer copy it into /system/app/
DONE!
guide by peldax
jazux said:
hey, one question coming from me our device has the same resolution as htc wildfire? right? and device is ldpi or mdpi? please answer ASAP!!! i may have found very useful HOWTO that you will LOVE!!!
>>>>>>>>>>>>>>>>>>>>>>>>>
POX v.1.0 beta 2 released! be sure to try it out :]
<<<<<<<<<<<<<<<<<<<<<<<<<
GreeModding from finland :]
Click to expand...
Click to collapse
galaxy3 has ldpi - look there: http://developer.android.com/guide/practices/screens_support.html
jazux said:
-your ROM must be deodexed!
-you can get extended power menu and 5 lockscreen mod by downloading this --> http://www.megaupload.com/?d=PKHVA57W
-extract it to root of your sd-card
-open root explorer and copy/paste the files to /system/framework
-reboot and done
OR
use adb like this:
Code:
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
exit
exit
adb push nameoffile.jar /system/framework/
-reboot and done
Click to expand...
Click to collapse
is this suit for every rom?
dxdiag32 said:
is this suit for every rom?
Click to expand...
Click to collapse
what do you mean? like does this work on other fw's than JPM? im not sure because i havent tested it, but i think it should work.
but it will surely work on every JPM based ROMs
>>>>>>>>>>>>>>>>>>>>>>>>>
POX v.1.0 beta 2 released! be sure to try it out :]
<<<<<<<<<<<<<<<<<<<<<<<<<
GreeModding from finland :]
Hey man a really nice tutorial
Can you add my tutorial on how to make bootanimations too
It would be appreciated
P.S. : If you tell yes,i'll give you a shortened version too
Deodexed Rom? How can i do it?.
cdesai said:
Hey man a really nice tutorial
Can you add my tutorial on how to make bootanimations too
It would be appreciated
P.S. : If you tell yes,i'll give you a shortened version too
Click to expand...
Click to collapse
yes i can add it
>>>>>>>>>>>>>>>>>>>>>>>>>
POX v.1.0 beta 2 released! be sure to try it out :]
<<<<<<<<<<<<<<<<<<<<<<<<<
GreeModding from finland :]
AndroKite said:
Deodexed Rom? How can i do it?.
Click to expand...
Click to collapse
ill do a tutorial later tonight!
>>>>>>>>>>>>>>>>>>>>>>>>>
POX v.1.0 beta 2 released! be sure to try it out :]
<<<<<<<<<<<<<<<<<<<<<<<<<
GreeModding from finland :]
AndroKite said:
Deodexed Rom? How can i do it?.
Click to expand...
Click to collapse
for now you can use this:
Thanks,i dont remenbre that you make a tutorial ,Thx.
AndroKite said:
Thanks,i dont remenbre that you make a tutorial ,Thx.
Click to expand...
Click to collapse
you welcome

[MOD][APK+SCRIPT+ZIP] Enable Init.d for Any Phones w/o Need of Custom Kernels!!!

** NOT Android 4.3 compatible!!! Term-init is recommended for now!!!
**Note...this is only for those who do not have init.d support...if you are using custom kernels (cyanogen mod original kernel etc.) that already supports init.d, you shouldn't run this......but if you accidentally ran this, it is ok...won't mess up anything...
{
"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"
}
v1.0
init.d support through an app!!!​
What is init.d:
the_scotsman (Moderator Liaison Admin / Moderator Committee / XDA News Writer) said:
Init.d plays an important role in the world of Android development and customization It allows users to install scripts and mods to be run at boot—everything from battery tweaks to performance tweaks. It essentially opens the door to a world of mods only possible through the Init.d process, which in turn is usually only available on custom kernels.
Click to expand...
Click to collapse
But how?
Concept:
I have recently learnt some linux scripting and was searching for a method to enable init.d scripts support for my phone which has a stock kernel. Inspired by this thread by iridaki, I finally managed to get init.d working in my phone!!! However, I thought of the other users who still do not have a proper custom recovery...how are they gonna flash zip packages? And if it has to be done manually, it requires a lot of typing, changing file permissions etc....a very tedious process...
Therefore, I've decided to come up with a script to automate this process!!! *Drum rolls*...lol
BUT now, with the aid of Androguide.fr (creator of Pimp My ROM), we managed to integrate the script into an app to save the hassle of typing commands in terminal emulator! With just a button click, the commands will be carried out! With just a button click, the app will verify whether is there init.d support or not!
Do I have init.d support?:
Well, here is a way to test:
1. Download the file from here: View attachment 1612958
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
Features:
- Utilises install-recovery.sh (if your kernel supports that, but of course, but most do...) to enable init.d scripts (busybox run-parts required)
- Will add lines in install-recovery.sh if it already exists (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing (shows time of execution), another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysinit in /system/bin, will add the required lines if it already exists
- Deletes duplicate files and lines to ensure the least of errors
Requirements:
- a rooted phone of course...
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: Link and please reboot after installing before running this script......use "normal install" method, don't use "smart install"...
Instructions:
1. Download the apk.
2. Install the apk like any normal app.
3. Launch the app.
4. The rest are pretty self-explanatory...
5. You can uninstall the app after that...
Screenshots:
**To check whether init.d is really working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have a WORKING init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
Uni-init v1.0.apk
Credits:
Thanks to:
Androguide.fr for the android app base!
Donators (big thank you! ):
@bigknowz
Feel free to posts questions below...I will try my best to help......By the way, those who used the app and found that it works, please leave a post here, stating you phone model, android version and ROM...thanks! but don't just leave comnents saying 'it doesn't work' etc...give more details if possible...
Please don't mirror / modify my work, ask for permissions first...​
**UPDATE: v3 is out now! Android 4.3 compatible!
**Term-init is also used in Droid Manager!!!**
**Featured in the XDA News Portal: Init.d Support for Any Rooted Phone (Thanks to the_scotsman!)
Hi guys...as stated in the title above, I have created a script to be ran in terminal emulator so that it will enable the support of init.d scripts!!!
**Note...this is only for those who do not have init.d support...if you are using custom kernels (cyanogen mod original kernel etc.) that already supports init.d, you shouldn't run this......but if you accidentally ran this, it is ok...won't mess up anything...
init.d support through terminal emulator!!!​
What is init.d:
the_scotsman (Moderator Liaison Admin / Moderator Committee / XDA News Writer) said:
Init.d plays an important role in the world of Android development and customization It allows users to install scripts and mods to be run at boot—everything from battery tweaks to performance tweaks. It essentially opens the door to a world of mods only possible through the Init.d process, which in turn is usually only available on custom kernels.
Click to expand...
Click to collapse
But how?
Concept:
I have recently learnt some linux scripting and was searching for a method to enable init.d scripts support for my phone which has a stock kernel. Inspired by this thread by iridaki, I finally managed to get init.d working in my phone!!! However, I thought of the other users who still do not have a proper custom recovery...how are they gonna flash zip packages? And if it has to be done manually, it requires a lot of typing, changing file permissions etc....a very tedious process...
Therefore, I've decided to come up with a script to automate this process!!! *Drum rolls*...lol
Do I have init.d support?:
Well, here is a way to test:
1. Download the file from here: View attachment test_initd.zip
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
Features:
- Auto checks for required files [v2]
- Utilises install-recovery.sh (if your kernel supports that, but of course, but most do...) to enable init.d scripts (busybox run-parts required)
- Will move install-recovery.sh to install-recovery-2.sh if it already exists and call it from the main install-recovery.sh (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't [v3]
- If Superuser is using install-recovery.sh, will use install-recovery-2.sh instead [v3]
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing (shows time of execution [v2]), another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysinit in /system/bin, will add the required lines if it already exists. This is for utilising a similar method to enabling init.d in AOSP ROMs
Requirements:
- a rooted phone of course...
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: Link and please reboot after installing before running this script......use "normal install" method, don't use "smart install"...
- terminal emulator such as this: Link
Instructions:
1. Download the file.
2. Place it in the root of your sdcard directory.
3. Launch terminal emulator.
4. Type: su
5. Grant SuperUser access if prompted
6. Type: sh /sdcard/term-init.sh
7. The script will run and follow the instructions! As simple as that...
**To check whether init.d is working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
term-init.sh v3
Feel free to posts questions below...I will try my best to help......By the way, those who used my script and found that it works, please leave a post here, stating you phone model, android version and ROM...thanks! but don't just leave comnents saying 'it doesn't work' etc...give more details and screenshots if possible...
Please don't mirror / modify my work, ask for permissions first...
Source code & changelog: https://github.com/Ryuinferno/Term-init​
** NOT Android 4.3 compatible!!! Term-init is recommended for now!!!
**Note...this is only for those who do not have init.d support...if you are using custom kernels (cyanogen mod original kernel etc.) that already supports init.d, you shouldn't run this......but if you accidentally ran this, it is ok...won't mess up anything...
As Term-init does not work for certain people, I have came up with a CWM flashable zip:
init.d support through CWM!!! ​
What is init.d:
the_scotsman (Moderator Liaison Admin / Moderator Committee / XDA News Writer) said:
Init.d plays an important role in the world of Android development and customization It allows users to install scripts and mods to be run at boot—everything from battery tweaks to performance tweaks. It essentially opens the door to a world of mods only possible through the Init.d process, which in turn is usually only available on custom kernels.
Click to expand...
Click to collapse
Do I have init.d support?:
Well, here is a way to test:
1. Download the file from here: test_initd.zip
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
Features:
- Utilises install-recovery.sh (if your kernel supports that, but of course, but most do...) to enable init.d scripts (busybox run-parts required)
- Will add lines in install-recovery.sh if it already exists (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing, another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysinit in /system/bin, will add the required lines if it already exists
- Deletes duplicate files and lines to ensure the least of errors
Requirements:
- a rooted phone of course...
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: Link and please reboot after installing before running this script......use "normal install" method, don't use "smart install"...
- a working CWM custom recovery
Instructions:
1. Download the file.
2. Flash zip-init.zip thorough CWM.
3. Reboot and you are done!
**If you get a status 0 error in CWM, please replace the update-binary in zip-init.zip with a working update-binary of your phone (just extract it from any CWM zip meant for your phone)...
**To check whether init.d is working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
zip-init.zip v2
Feel free to posts questions below...I will try my best to help......By the way, those who used my mod and found that it works, please leave a post here, stating you phone model, android version and ROM...thanks! but don't just leave comnents saying 'it doesn't work' etc...give more details and screenshots if possible...
Please don't mirror / modify my work, ask for permissions first...​
Troubleshooting
Troubleshooting:
**CWM might warn something about disable recovery flash when using this mod, it is just a false positive, please DO NOT select yes or else it won't work anymore**
If you have already applied the script but there is no /data/Test.log, please refer the steps below:
1. Check whether have you installed busybox properly, especially run-parts. REBOOT after installing, then only apply this script.
2. If you are using the busybox installer by Stericson, please use "normal installation method", NOT "smart installation method".
3. Check whether are these files present with the correct permissions (please change if the permissions are wrong):
- /system/bin/sysint (rwxr-xr-x) [owner: root (0), group: shell (2000)]
- /system/etc/init.d (rwxrwxrwx) [owner: root (0), group: root (0)]
- /system/etc/init.d/00test (rwxrwxrwx) [owner: root (0), group: root (0)]
-/system/etc/init.d/08setperm (rwxrwxrwx) [owner: root (0), group: root (0)]
- /system/etc/install-recovery.sh (rwxr-xr-x) [owner: root (0), group: root (0)]
- /system/etc/install-recovery-2.sh (rwxr-xr-x) [owner: root (0), group: root (0)] (may or may not be present)
4. Check whether you have run-parts installed. Go to /system/xbin, you should be able to find a fine named "run-parts"
5. Check whether you have these lines in /system/etc/install-recovery.sh (if not, please add them in manually (using Root Explorer or keep the EOL in Unix format...Google about it), remember to leave an EMPTY line at the end of the file)
Code:
# init.d support
busybox run-parts /system/etc/init.d/
6. If all the above are still not helping, please download this: run-parts.zip and extract it (DO NOT flash it). Place the file named "run-parts" in /system/xbin. Change permissions to rwxrwxrwx, owner to root (o) and group to shell (2000). Reboot and check /data again.
7. Still fails? Check your /init.rc for any lines containing "install-recovery"...if there are none, this method won't work...so use the Script Manager method.
8. Use this as a last resort: Download Script Manager from Play Store: Link. Then navigate to /etc/install-recovery.sh, select it and run as root and at boot (select the skull and gear icon).
9. If all the above are not working, and the "install-recovery" line is present, then please paste the contents of your /etc/install-recovery.sh and /etc/install-recovery-2.sh if present somewhere (like http://pastebin.com and after applying the mod of course) here for me to debug. Take a screenshot of the output after running Term-init and post here, along with your ROM version, android version and name of device.
ace 5830i stock rom
Ryuinferno said:
Hi guys...as stated in the title above, I have created a script to be ran in terminal emulator so that it will enable the support of init.d scripts!!!
Term-init --> init.d support through terminal emulator!!!
But how?
Concept:
I have recently learnt some linux scripting and was searching for a method to enable init.d scripts support for my phone which has a stock kernel. Inspired by this thread by iridaki, I finally managed to get init.d working in my phone!!! However, I thought of the other users who still do not have a proper custom recovery...how are they gonna flash zip packages? And if it has to be done manually, it requires a lot of typing, changing file permissions etc....a very tedious process...
Therefore, I've decided to come up with a script to automate this process!!! *Drum rolls*...lol
Features:
- Utilises install-recovery.sh to enable init.d scripts (busybox run-parts required)
- Will add lines in install-recovery.sh if it already exists (will not replace install-recovery.sh because certain apps such as Link2SD requires that to work), creates it if it doesn't
- Creates the init.d folder with correct permissions
- Adds 2 init.d scripts: one for testing, another to ensure that the scripts in init.d folder always have the correct permissions
- Adds sysint in /system/bin, will add the required lines if it already exists
- Deletes duplicate files and lines to ensure the least of errors
Requirements:
- busybox with required applets (especially run-parts), if not sure what is this, just install this by Stericson: BusyBox
- terminal emulator such as this
Instructions:
1. Download the file.
2. Place it in the root of your sdcard directory.
3. Launch terminal emulator.
4. Type: su
5. Grant SuperUser access if prompted
6. Type: sh /sdcard/term-init.sh
7. The script will run and follow the instructions! As simple as that...
Example:
**To check whether init.d is working or not, reboot your phone and navigate to /data...you should find a Test.log in there...If it is present, congrats, you have init.d support!
Download:
If you have already read all the instructions and understand them, then click here to download:
term-init.sh
Feel free to posts questions below...I will try my best to help...
Hit the thanks button if you liked my work...it gives me a boost!
Please don't mirror / modify my work, ask for permissions first...​
Click to expand...
Click to collapse
its not working
ranjitkhera said:
its not working
Click to expand...
Click to collapse
Well, are the all the files present? Did you follow all the steps? I suggest you to reinstall busybox by using the link I gave...then attempt this again...
This mod work on MIUI UK official for desire s
Tested with v6 supercharger by zep
Thanks a lot
Sent from my HTC Desire S using xda app-developers app
Hi ,
I use an Motoluxe xt615 , i Fllow your guide step by step . But nothing.
The Phone Restarts an in /data is no Test.log
Busybox install Terminal install . Terminal say all is ok but the test.log fails. After Reboot i cant find it.
Sorry for my bad Englisch
hexer7568 said:
Hi ,
I use an Motoluxe xt615 , i Fllow your guide step by step . But nothing.
The Phone Restarts an in /data is no Test.log
Busybox install Terminal install . Terminal say all is ok but the test.log fails. After Reboot i cant find it.
Sorry for my bad Englisch
Click to expand...
Click to collapse
Ok...let me interpret...you installed busybox by using the link I gave, then you ran this in terminal emulator right? Can you please give me a screenshot of your terminal emulator running this script? Thanks...
Ryuinferno said:
Ok...let me interpret...you installed busybox by using the link I gave, then you ran this in terminal emulator right? Can you please give me a screenshot of your terminal emulator running this script? Thanks...
Click to expand...
Click to collapse
how can i make this???
ah ok
http://s1.directupload.net/file/d/3042/ofxoh9z3_png.htm
Err...run the script in terminal emulator, when it finished running, take a screenshot...
Ryuinferno said:
Err...run the script in terminal emulator, when it finished running, take a screenshot...
Click to expand...
Click to collapse
http://s1.directupload.net/file/d/3042/ofxoh9z3_png.htm
hexer7568 said:
how can i make this???
ah ok
http://s1.directupload.net/file/d/3042/ofxoh9z3_png.htm
Click to expand...
Click to collapse
Ok...by looking at your first few lines...I saw that su permissions for terminal emulator are not granted properly...and my script seems to be only running in the surface (only shows the text)...did you reboot after installing busybox? And by the way, please check your /system/etc...is there a init.d folder and a file named "install-recovery.sh"? And what andriod version are you using?
P.s. A working example should be like my screenshot on the first page...the first few lines in your screenshot should not appear...
Ok...I will include a flashable zip soon...cause terminal emulator does not seem to work with some...
Ryuinferno said:
Ok...by looking at your first few lines...I saw that su permissions for terminal emulator are not granted properly...and my script seems to be only running in the surface (only shows the text)...did you reboot after installing busybox? And by the way, please check your /system/etc...is there a init.d folder and a file named "install-recovery.sh"? And what andriod version are you using?
P.s. A working example should be like my screenshot on the first page...the first few lines in your screenshot should not appear...
Click to expand...
Click to collapse
1 Reboot after busybox install no
2, no
3. no
That's why...the script did not have the correct permissions to run...did you grant terminal emulator su access when you type "su"? Try installing busybox again, reboot, run the script and reboot again...
Ryuinferno said:
That's why...the script did not have the correct permissions to run...did you grant terminal emulator su access when you type "su"? Try installing busybox again, reboot, run the script and reboot again...
Click to expand...
Click to collapse
When i type su , the first massage is "log_write: cannot open Device" , then after this massage i have su
When you type "su" for the first time after installing terminal emulator, a pop up will appear, asking you to grant or deny superuser access...did that happen?
Ryuinferno said:
When you type "su" for the first time after installing terminal emulator, a pop up will appear, asking you to grant or deny superuser access...did that happen?
Click to expand...
Click to collapse
i install emulator new, and i lock that
Ok..seems that the su access in your terminal emulator is not working well, so I will upload a cwm zip soon...wait for that...

enable init.d support in rooted phones and for every ROM

Requirement:
Rooted phone
Busy box
Terminal emulator (available in Google Play)
Download:
Term-init.zip
Instruction:
Extract the zip and Place the term-init.sh in internal sdcard
Open terminal emulator
Type: su
Allow Supersu / Superuser
Type: sh /sdcard/term-init.sh
Follow the instruction
Finish, Reboot your phone
To check whether init.d working or not:
After you reboot your phone
Go to /data directory (use Root Explorer)
You should find Test.log there, open that and make sure "init.d is working" text there
Please leave a comment if you don't understand

BootBuddy - Run Boot Scripts from SDcard (a safe alternative to init.d)

INTRODUCTION:
Boot Buddy will allow you to run Linux shell scripts when your Android device is booting up. It will run your scripts early in the boot process, before the home screen appears.
The intended audience is generally intermediate to advanced users, and those who want to play with shell scripting on their device.
FEATURES:
BootBuddy is similar to init.d scripts, but with a core difference that it stores boot scripts on your SDcard instead of the internal system. This allows for several interesting enhancements. Feature listing-
Much more Safe than init.d. If you have a script that is malfunctioning, just boot with the sdcard out, and put the sdcard back in after your device reaches home screen. Your device is Saved, No Problem!
Boot Buddy is designed from the start to run scripts right from your SDcard. Just download any scripts to your boot_buddy_scripts directory and they're ready to run. (No more screwing around with permissions and files in your /system/etc/init.d/*)
SDcard storage allows you to copy a script to another device, or multiple devices easily.
Boot Buddy's author has several years of scripting and programming experience. It is streamlined, fast, and doesn't perform worthless functions like repeatedly logging the authors name and time (*hint to a t-init author*).
Clear goals of making operation simple, intuitive, and clean.
If you're currently using an "init.d" solution, BootBuddy can integrate seamlessly with it.
If you try BootBuddy and you don't like it, the installer also works as an uninstaller for easy clean removal.
BootBuddy is Open Source GNU GPL. Open for anyone to modify and improve upon.
As a developer, I make software to operate the way I would want if I were an end user, because I actually do use it, and I am an end user like you.
REQUIREMENTS:
Android 4.0 and up
Rooted device
An sdcard
Script Manager Free (or any other app that can run scripts as root)
Boot Buddy Installer bb_install.sh
INSTALL:
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
The script will run quickly. It will automatically detect your sdcard location and create a folder on your sdcard named "boot_buddy_scripts". In that folder, you put the scripts you want to run at system boot. A log file will be kept at /data/boot_buddy.log
If you need your scripts to run in order, they are ordered by filename using the busybox "sort" program. They will run in alphabetical order using this format 0-9A-Za-z.
YOUR FIRST SCRIPTS: (OPTIONAL)
Here are a couple example scripts you may use.
The Android /system is normally mounted with read-only permissions by default. We will change that with the first script listed below. It will cause /system to be remounted to read-write permissions during boot.
The second script will create a file at every boot named /mnt/sdcard/sys_mount_info.txt. That txt file will give us information about how /system is currently mounted.
Download the file 00rw_system.sh into your boot_buddy_scripts folder.
Download the file 99sys_mount_info.sh into your boot_buddy_scripts folder.
Reboot your phone.
That's it, you just installed 2 new scripts and had them run at boot. It's Really just that simple to add startup scripts to your system.
To verify they are running, use any text viewer to open the file /mnt/sdcard/sys_mount_info.txt. It may show more than one line of text. There should be a line similar to this:
/dev/block/(device specific text) /system (fstype) rw,(more text)
The rw means that /system was successfully remounted as read-write during boot.
At any time you can delete either script if you choose. Easy!
UNINSTALL:
If for any reason you find you don't want or don't like Boot Buddy, you can cleanly uninstall it using the installer bb_install.sh. These instructions are almost identical to installing. (All match the installation steps, except step 4)
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
Type --uninstall in the text area labeled Arguments.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
Boot Buddy will be uninstalled. It will not remove the contents of your boot_buddy_scripts folder. If you have an "init.d" system installed, it will cleanly remove only Boot Buddy parts and leave the rest.
MUST READ
ADVANCED NOTES:
Boot Buddy will Not cause harm to your system, but it may not work on custom roms. Also, it may fail to detect the real location of your SDcard. It requires that /system/etc/install-recovery.sh is run during the boot process, and that file will be created if it does not exist. Also the file /data/boot_buddy.sh will be created. The script /system/etc/install-recovery.sh will run /data/boot_buddy.sh. The script /data/boot_buddy.sh will run the scripts on your sdcard. The file /data/boot_buddy.log will log any script output.
For Windows and Mac users- If you download the installer to your pc first, do not edit the installer with a text editor. Your computer will add hidden markers at the ends of each line that will prevent the installer from running. If you want to edit it, you should do so on a Linux pc or directly on your Android device.
Tell us about your results!!!
BootBuddy source code: http://github.com/Sepero/bootbuddy
NOTE : I AM NOT A DEVELOPER I AM ONLY SHARING THIS. So Try On Your Own Risk. I Can't Help Anything.
Credits :
[email protected]
Script mgr says I'm not root, despite me in a root terminal elsewhere. wtf ?? ...
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
I give you 5 stars to the thread
Almost first!!! haha.... this is awesome dude this could be HUGE.
Steve Eligoyo said:
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
Click to expand...
Click to collapse
You must to select root when start on script mgr, you have skull head with crossed bones
Steps to complete failure: Page 96 ?? ...
Here are the steps I've taken to get kicked in the teeth:
Boot phone > menu > script mgr. > start > scroll to file (in this case bb _install.sh ) > open file > tick su ( tried boot and bgr several times, nada amigo ) as instructions state > run > unexpected oper error: your not root > rinse and repeat sixty times > open terminal > su > Works just fine > Post my question on xda in the WTF Thread
Update:
After creating the directories and files needed to make this train wreck into a working setup, (obviously a few are missing here, working on it), I reopened script mgr and browsed the file system, which shows bb _install.sh file (and the other two in this
Thread as well) with the green su skull and crossbones with the boot dot next to those skulls, yet the apps shell /console says oper error - Your not root.
Again, I open terminal, su > enter > Viola!, I'm root.
I've installed the sdcard v. of script mgr as well and I get a message stating /data/system/xbin does not exist.
I'll likely need to tweak the script mgr settings to /sdcard 0/externalsd /directory bind /system /xbin/bb _install.sh - something like that.
Still doesn't explain why the app is putting the brakes on root terminal in the nag screen.
Any ideas ??
MAN THANK YOU !!!! as a noob i couldn´t get init.d to work right. so i tried your script on the xperia z3c with stock 4.4.4
to make it compatible with z3c you need to edit the file /data/boot-buddy.sh after the installation
and replace both
/boot_buddy_scripts/
with
/storage/emulated/legacy/boot_buddy_scripts/
or
/storage/sdcard1/boot_buddy_scripts/
or another prefered location
then make a new folder boot_buddy_scripts in the location.
really it executes the scripts way before the apps are starting , this is so nice and will be on my phones from now on !
edit: i also now changed the log file creation to the sd card for quick access (most filebrowsers open there by default)..
the logfile is major awesome btw if something didn´t go right , its easy to debug , thanx alot again
Won't install says I don't have busybox. I have it but it has to go in system bin instead of xbin. Amy way to get this working?

[TOOL][LOG] Easy-to-share log and report for developers and users

Hello XDA comunity!
I want to share you a very useful tool that I have created, its name is: "kielyd".
What's keilyd?
Keilyd is a BASH daemon that constantly dumps the system's logs, warnings and other useful info in a easy-to-share "ZIP" with the main purpose to create a very informative and useful bug report.
keilyd is expansible and configurable. It's very easy to add new features because BASH interacts directly with the Linux/BSD commands in the Android System.
How does it works?
Keilyd is launched at device boot, with the "init.d support" and as root (see requeriments below). After launched, keilyd relaunches itself in a "daemon mode", that runs in the background, then, it dumps several information in the /sdcard and compress it in a single zip, so, the user can send that zip (in fact, are 2 zip's or more if you use the "snapshot" feature) to the developer of their ROM, to a forum or send it to a 3rd party developer and report a bug with all the system logs included.
Keilyd stores 2 zips: the first one is the current log (the "very last file") and the second one is the last log before keilyd were launched again.
If you won't enable de daemon, you can create a single zip when you use the "snapshot" feature, if you take two or more snapshots in the same minute, the ZIP will be the same, otherwise, one script per different minute will be created. The Snapshot feature can create as much zips as needed.
What info is collected?
That's a good question!
The info that is collected is (this applies ONLY for a vanilla copy of keilyd):
Kernel log (aka "dmesg") and other kernel info
Logcat (aka "logcat")
List of process running and memory statics
A copy of all tweaks in init.d (including keilyd itself)
A copy of build.prop and sysctl.conf
A copy of /proc/config.gz (if exists)
Some cpuinfo
Mounted filesystems and usage
How does this "daemon" can help me?
Developer:
Have you had the need to get some system log from a user?
Probably the answer is "yes", but, the user may have no idea how to do that, so, you have to give them a "step-by-step" guide of "how to get a system log in the terminal".
This simplifies the process, so, the user can report a bug with logs with no terminal (if the daemon is enabled) or with a single command that looks like
Code:
keilyd --snap
User:
Well, the complement of the developer... You can share "golden" information just by sending 2 zips files to the dev. Minimal Android knowledge is the only prerequisite if the daemon is working as spected.
This daemon is not a demon, but it can be very bad if not implemented as spected. Please, ensure that ALL THE COMMANDS ARE KNOWN and that THERE IS NO PORPRIETARY interference.
Why BASH?
A good idea is to create a daemon in C/C++ and share it as a "binary", BUT, as we are recolecting information from the device, the user must have to be concient of what are the script recollecting, if the user can't read bash, it can ask to a 3rd developer. You can feel safer because it's under the GPLv3 licence!
In addition, BASH run in (almost) any UNIX based OS, including but not limited to Apple OS X, GNU/Linux, Android, iPhone OS, etc...
This prevent a "blind trust" from the user, and give them facility of enable-disable the script, add features and so on.
Requeriments
- A rooted device
- Busybox (or run-parts)
- init.d support
- BASH 4.3.x ONLY SUPPORTED by the moment.
- Terminal emulator/HIDE]
How can I include it in my ROM?
Take a look of my repo in GitHub, it contains the last version of keilyd and the implementation during compilation in the Makefile.
If you are a ROM modder, download the latest version from above, include init.d and bash support in you ROM.
Or you can create a CWM/TWRP/Philz... flashable zip (it would be great!)
Users: how to use
When something goes weird, open the terminal emulator and write:
Code:
keilyd --snap
and send to the developer all zips in
Code:
/sdcard/keilyd/out
type
Code:
keilyd --help
and a helpful message will be printed.
If something goes wrong and you need to reboot the device (or the device reboots itself), just send both zips to the developer or the forum where you are asking help (This feature only works if the daemon is enabled).
Developers: how to use
You can add/remove things in order to fit your needs, the only thing that we ask you is that you write the whole script in BASH, without "blobs" that may private the user from know what is exacly logged and stored.
If some user sends you the zip, you will notice that the files are plain-text, and you can view it in any text editor.
TODO:
List all apps installed (system and user)
Secure "user-modificable" settings (Allmost DONE)
A graphical interface (an app) to manage the daemon
A flashable ZIP
Aports and sugestions are WELLCOME, please, coment in the box below
Install redistributable package:
If the avobe requeriments are meet...
1. Open this GItHub URL
Click in the "Download ZIP" icon in the right.
2. Put the zip in your phone
3. Unzip it.
4. If you want to use the script... A; otherwise, B.
A.
a. Open the terminal emulator.
b. cd to the folder that contains
Code:
install.sh
c. As root, type "
Code:
sh install.sh
" in the terminal.
B.
a. Open ES File Explorer
b. Enable root explorer and mount /system as rw
c. Copy
Code:
daemon/18keily
to
Code:
/etc/init.d
d. Tap and hold the
Code:
18keily
file and open the poperties
e. Change te permisions to
Code:
rwx r-x r-x
f. Copy the
Code:
redistrib/bash
file to
Code:
/system/xbin/bash
g. Change the permisions as above.
h. Symlink /etc/init.d/18keily to /system/xbin/keilyd
i. Reboot
NOTE:
Keilyd can be used in 2 ways:
1. As a daemon that does it job without human interaction, that constatantely and automaticaly creates 2 zips in the output directory.
2. As a Script that only needs to be called with the '--snap' parameter, but it requieres human interaction and does not constantely repeat the process.
Use the first one if you are a beta tester, or if you know that you ROM can hang sudently. Recomended for Unstable ROM'S.
Use the Last One if your ROM is stable or official, but you want to do a bug report.
You can allways use the second option if you use the first one.
By default, the daemon is disabled. You can enable if you change the "ENABLED" variable to "Y". I personally recommend values for "MINS" between 5 and 15.
BUGS REPORTS in the GITHUB REPOSITORY
Reserved
Hi there,
This looks like what I need, did you close the repo? Can you share a link to the script? I have a few devices, and I want to have some forensic information for troubleshooting (I.E. log all the warnings, errors and critical logs, + a snapshot every n minutes about the system usage). Right now I have to go where the device is, connect it with ADB and query the logs (most of the time, the logs were overwrited)... Thanks in advance.

Categories

Resources