Enable init.d on Any Android - Android General

Basics:
The android boot sequence is divided into 3 parts.
1) First stage bootloader
2) Kernel loads and prepares hardware
3) User space programs load - this is where init.d scripts loaded.
Init.d scripts execute commands as if they were entered into a terminal.
These commands modify the value of parameters that influence our devices behavior.
They are much more flexible than tweaking apps and give end users the ability to tweak and optimize their device as they see fit.
They are small, fast, clean... and awesome.
To Enable init.d Follow the steps below.
Requirements:
1:init.d enabling script (by Ryuinferno @ XDA )
2:Terminal emulator (by Jackpal )
3:Busy Box 1.24.1 (Stephen (Stericson)
Lets start
Step1: Download the script and keep it in root of internal memory
Step2: Now install Busy Box
Step3: Goto Terminal Emulator
Step 4: Type su

Related

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

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?

[App] [ 4.0+] [ROOT] Boot Shell - Execute Shell Commands and scripts at Boot [V 3.5]

Boot Shell allows you to save Linux Shell commands and execute them at boot. The Pro version allows to execute complete shell scripts at boot.
{
"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"
}
You can also save your favourite Linux commands and execute them at your will.
It can also eliminate the need of using init.d scripts for basic needs such as setting CPU parameters at boot such as, CPU Frequencies, governors, and also IO Governers,enable/disable Fastcharge, GPU Overclock etc.
REQUIREMENTS -
->ROOT
->BUSYBOX
Pro Version Extras -
-Ability to Execute Scripts at boot
-View outputs and errors after command execution
-Inbuilt Text/Script Editor
For any queries or problems please feel free to E-mail me at [email protected]mail.com
Try not to execute a resource intensive task or scripts at boot, it can slow down your device startup.
Explanation for Permissions -
-> Read/Write USB Storage - Allow the Shell commands to read/write on Device Storage
-> SuperUser Permission - To Execute Shell Commands
-> Run at Startup - To be able to execute Shell commands at Boot
Credits:
-> CMDProcessor Library, for making Root easy, and to @Androguide.fr for sharing it.
-> @nikwen - For being a very helpful and active contributor in the Java for Android App Development section, and for clearing my initial programming doubts.
Changelog-
8/2/14 -
Initial Release
10/2/14 -
Added notification to confirm execution of commands at boot.
Execution of commands at boot time should be faster now.
12/02/14 -
Added option to enable/disable execution of commands at boot.
Added link to XDA thread in settings.
21/02/14 -
Uploaded to play store
Added option to export saved commands as txt file to sdcard
Fixed a command delete bug
Added help documentation
25/02/14-
Fixed up some strings
Added more feedback options in settings
07/03/2014-
Fixed a bug with exporting of commands
Added a cancel option to command edit dialog
Minor code cleanup
21- Mar - 2014
-Major Overhaul
-Ability to Execute Scripts at boot [Pro Version]
-View outputs and errors after command execution [Pro Version]
-Inbuilt Text/Script Editor [Pro Version]
Click to expand...
Click to collapse
Please try to download from Google Play as it will help me to keep record of number of downloads, app crashes, etc.
For those who do not use Gapps download V3.0 from the attachments below.
P.S. - If you are coming from the Beta Version of the app, the signature for the app has changed so you will have to uninstall the old version to be able to install the new one. To backup your commands, please backup app data using titanium backup or helium, uninstall, reinstall from play store and restore app data. I am really sorry for this inconvenience.
Screenies !!!!
Some useful Shell Commands
USB FAST CHARGE Enable:
Code:
echo 1 > /sys/kernel/fast_charge/force_fast_charge
USB FAST CHARGE Disable:
Code:
echo 0 > /sys/kernel/fast_charge/force_fast_charge
SET GPU CLOCK:
Code:
echo x > /sys/devices/system/cpu/cpu0/cpufreq/gpu_oc
where x is your desired GPU Frequency or frequency step
SET CPU GOVERNER
Code:
echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
replace interactive with your desired governer
LOAD A KERNEL MODULE
Code:
insmod /system/lib/modules/module_name
TCP CONGESTION ALGORITHM
Code:
/system/xbin/sysctl -w net.ipv4.tcp_congestion_control=reno
replace reno with your desired value
SET CPU MIN FREQUENCY
Code:
echo 350000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
replace 350000 (350 MHz)with your desired frequency
SET CPU MAX FREQUENCY
Code:
echo 1500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
replace 1500000(1.5 Ghz) with your desired frequency
SET READ AHEAD BUFFER
Code:
echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb
replace 1024 with your desired value(in KB)
SET I/O SCHEDULER
Code:
echo row > /sys/block/mmcblk0/queue/scheduler
replace row with your desired governer
gh0stslayer said:
mine
Click to expand...
Click to collapse
Boot Shell has stopped....
My system is 4.0.4
you one picture system UI is beautiful,can you sharing me?
:good:
Lumia997 said:
Boot Shell has stopped....
My system is 4.0.4
:good:
Click to expand...
Click to collapse
@Lumia997 :
Sorry about that, a new version has been uploaded , please try it. Thanks
you one picture system UI is beautiful,can you sharing me?
Click to expand...
Click to collapse
sorry I don't understand, what do you want me to share ?
OK, how does this baby work? That is, what executes the commands? When (linux boot, zygote startup, dalvik up and running)??
How does this relate to selinux?
I have scripts in /data/local/userinit.d/ which are supposed to be run by the init.d system. The only one I know that runs is link2sd's script if I move it to there. Others, apparently do not run, even in cm-10.2 with permissive selinux. I have tasker run them, successfully, when it begins its "listening."
The lead question here is critical! If the app must be present at boot (it is an apk, however!), then it needs be on internal storage or better, on system! If the app needs be present only for its UI, it can be on sdcard or linked (link2sd). It is a user app but maybe it needs place something on system or /etc/init.d/ to operate?
Dovidhalevi said:
OK, how does this baby work? That is, what executes the commands? When (linux boot, zygote startup, dalvik up and running)??
How does this relate to selinux?
I have scripts in /data/local/userinit.d/ which are supposed to be run by the init.d system. The only one I know that runs is link2sd's script if I move it to there. Others, apparently do not run, even in cm-10.2 with permissive selinux. I have tasker run them, successfully, when it begins its "listening."
The lead question here is critical! If the app must be present at boot (it is an apk, however!), then it needs be on internal storage or better, on system! If the app needs be present only for its UI, it can be on sdcard or linked (link2sd). It is a user app but maybe it needs place something on system or /etc/init.d/ to operate?
Click to expand...
Click to collapse
The commands saved on this app are executed in the same way they are executed by a Linux Shell Emulator, or a Terminal on a Native Linux system. The only difference is it save the commands you enter and executes them as soon as the device finishes booting. You can also save commands to a favourite list , which will not be executed at boot, but allows you to manually execute them as you wish.
Edit: - Info: - It uses busybox to execute shell commands
The app works fine when placed on the internal storage of the device, though I am not sure about if it will work if placed on SD Card but in theory it should work, no need to place it on the /system partition.
It cannot run whole shell scripts only single commands, but you can save as many commands as you like
Just make sure you enter a valid command and that you kernel or device supports it.
gh0stslayer said:
The commands saved on this app are executed in the same way they are executed by a Linux Shell Emulator, or a Terminal on a Native Linux system. The only difference is it save the commands you enter and executes them as soon as the device finishes booting. You can also save commands to a favourite list , which will not be executed at boot, but allows you to manually execute them as you wish.
Edit: - Info: - It uses busybox to execute shell commands
The app works fine when placed on the internal storage of the device, though I am not sure about if it will work if placed on SD Card but in theory it should work, no need to place it on the /system partition.
It cannot run whole shell scripts only single commands, but you can save as many commands as you like
Just make sure you enter a valid command and that you kernel or device supports it.
Click to expand...
Click to collapse
Thanks for the info. In other words, would work as I use tasker now but with a much easier UI for scripts entry. Not really a substitute for /etc/init.d functionality because would get run later but otherwise, quite nice. Note that current cm-11 ROMs (for my old LG P500 at any rate) are quite slow getting startup services going.
Dovidhalevi said:
Thanks for the info. In other words, would work as I use tasker now but with a much easier UI for scripts entry. Not really a substitute for /etc/init.d functionality because would get run later but otherwise, quite nice. Note that current cm-11 ROMs (for my old LG P500 at any rate) are quite slow getting startup services going.
Click to expand...
Click to collapse
Yup, not really a substitute for complex init.d scripts, and yes quite similar to the way tasker does shell commands at boot.
But it should be more than enough for some simple CPU, I/O and kernel tweaking etc.
gh0stslayer said:
Yup, not really a substitute for complex init.d scripts, and yes quite similar to the way tasker does shell commands at boot.
But it should be more than enough for some simple CPU, I/O and kernel tweaking etc.
Click to expand...
Click to collapse
... and maybe a tasker plugin to execute "favorites" entered to this app?
Dovidhalevi said:
... and maybe a tasker plugin to execute "favorites" entered to this app?
Click to expand...
Click to collapse
Hmmm, I will have to look into it. I have no knowledge about how to develop plugins for tasker :silly: but I can try, no promises though.
But can't you already add commands in tasker and schedule their execution ?
gh0stslayer said:
Hmmm, I will have to look into it. I have no knowledge about how to develop plugins for tasker :silly: but I can try, no promises though.
But can't you already add commands in tasker and schedule their execution ?
Click to expand...
Click to collapse
It is excruciatingly difficult to enter this stuff on the phone's keyboards. So if I have a "favorite"command in this app and later on decide to use it in tasker, I would not be to happy with struggling to enter it a second time
BTW, most of what I have entered as script are in bash script files. Can these be run by the app or only single line commands?
Dovidhalevi said:
It is excruciatingly difficult to enter this stuff on the phone's keyboards. So if I have a "favorite"command in this app and later on decide to use it in tasker, I would not be to happy with struggling to enter it a second time
BTW, most of what I have entered as script are in bash script files. Can these be run by the app or only single line commands?
Click to expand...
Click to collapse
Single line commands only, you can add the next line of bash script as another command .
Edit:
If you wanna use the same command else where , click on the command select edit and copy the command from the textbox. No need to enter it again.
Sent from my Galaxy Nexus using Tapatalk
gh0stslayer said:
Credits:
-> CMDProcessor Library, for making Root easy, and to @Androguide.fr for sharing it.
-> @nikwen - For being a very helpful and active contributor in the Java for Android App Development section, and for clearing my initial programming doubts.
Click to expand...
Click to collapse
Big thanks for that.
In my opinion it's great that you finished your app. Good job. :good:
nikwen said:
Big thanks for that.
In my opinion it's great that you finished your app. Good job. :good:
Click to expand...
Click to collapse
Thank you very much
Hello everyone, Boot Shell is now available on Play Store. Please find it here
https://play.google.com/store/apps/details?id=com.kislay.bootshellcommand
The signature for the app has changed so you will have to uninstall the old version to be able to install the new one. To backup your commands, please backup app data using titanium backup or helium, uninstall, reinstall from play store and restore app data. I am really sorry for this inconvenience.
New version is up-
Changes -
Fixed up strings
Added feedback options (E-mail and Play Store)
There is an easter egg somewhere too
Version 1.2 is now up-
Changes -
-Fixed a bug with exporting commands to SD Card
-Added a cancel option to command edit dialog
-Minor Code Cleanup
Please feel free to drop your feedback/ comments/ ratings
Email if you need any help, guidance or wanna report a bug.
New major update -
Changelog-
Version 2.0 -> 21- Mar - 2014
-Major Overhaul
-Ability to Execute Scripts at boot [Pro Version]
-View outputs and errors after command execution [Pro Version]
-Inbuilt Text/Script Editor [Pro Version]
Pro Version Link - Boot Shell Pro
help
I use that bootshell but need more time for executing ,its that normal because i already w8 for 4 hours

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

[GUIDE/DEV] Microsoft Android "Emulator"

I can't find much of any information on hacking the microsoft android emulator. Ideally, I'd like to get it working with superuser, exposed, etc, so it can be a fully functional way to see how android itself and apps work in different environments, all from my desktop. Also, I can just play around with stuff that I wouldn't touch on my tablet for fear of bricking it. I like playing with things.
Disclaimer: I'm not interested in maintaining anything, but as mentioned above, I can't find any information. Therefore, I'm simply posting what information I have here, in the hopes it will interest someone else enough to take a harder look at it. My original post was over here, but I've expanded beyond simply adding supersu to the image.
Things I can't do:
- Install superuser
- Install Xposed
- Install Google Play for anything more recent than KitKat
- Install recovery scripts
Things I can do:
- Run commands as root.
- Install Google Play Services on KitKat
- Change the screen resolution
- Change the amount of internal disk space
- Change the amount of memory and cpu cores available.
- Install busybox
- Flash simple scripts that don't require recent versions of cwm/twrp/other modern recovery.
----------------------------------------
Background information: The Microsoft Android "Emulator" is actually a HyperV virtual machine. When you install it, it enables the HyperV virtualization service in windows*. The effect of this is that instead of running android by emulating an arm processor, it runs android natively, with far better performance, by using Microsoft's hypervisor that's built into windows (win8+). You can work with it with Visual Studio and with Android Studio, but I don't use either much, so I can't help you with that. You can download it from Visual Studio if you want to (VS 2015 is free), or you can download a standalone version. I don't know if there's a difference between the two.
* I'm not sure if it installs the HyperV GUI as well, as I already use HyperV for other things and had it already installed. If you need to do so, you can install the GUI by going to add-remove windows features in the control panel ('appwiz.cpl' from the control panel).
----------------------------------------
Modifying the properties of the emulated system.
Configuration file location: After you create a device, the .cfg file for it will be located in %localappdata%\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices
To change the resolution: So far, I haven't identified any supported resolutions other than those listed in the device profiles list. So far, supported resolutions that I've used successfully are 480x800, 720x1080. You can edit the .cfg file for the specific device that you want to change the resolution of, and change the `device.screen.resolution=` line to any supported (see previous) resolution.
To change the size of the internal storage, follow the instructions here. You'll need an ubuntu cd; minimal install cd is fine if you have slow internet/computer or low ram.
To change the amount of ram or processors allocated to the virtual machine: Open Hyper-V manager, right-click the appropriate VM and click settings.
- Change the ram allocation by clicking Memory in the list at left. I do not know what happens if you try using Dynamic Memory; if it works, it should be more memory-efficient, but I left that alone. Now update the `device.vm.ram.size=` line in the .cfg file.
- Change the cpu allocation by clicking the Processor field. Please note that if you have hyper-threading, you should only use half your logical processors as cpus; the hyperthreaded 'cores' won't work as well (according to information online; you can check number of logical processors in windows task manager's performance tab). Now update the 'device.vm.cpu.count=' line in the .cfg file
----------------------------------------
Info on "recovery" and "flashing" - Installing google play
So far, I have only managed to get Google Play Services working on KitKat. I can't get it to work on Lollipop or Marshmallow (and haven't tried earlier versions at all); the virtual machine does *not* have a recovery or fastboot because of the way it works, and I haven't figured out any way of installing such. Instead, there's a simple shell file called install_zip.sh. It does not work with modern flashable zips that require TWRP/CWM; it only works with the old style zip designed for a specific architecture. As such, opengapps flashable zips will not work.
To install Google Play Services on KitKat (4.4.4)
1. Inside the emulator, open the browser and go to http://www.teamandroid.com/gapps/ and download the file linked under Gapps CyanogenMod 11.
2. Open the window the the android VM from the Hyper-V Manager to get console access. If you have ADB installed locally, you can use that in the future, but getting the VM's shared IP requires terminal access anyways (run `ip addr` as root inside the emulator to get the list of IPs).
3. Run `adb shell` to get access to the root shell (yes, it's that easy).
4. Run `install_zip.sh /sdcard/Downloads/gapps-kk-20140105-signed.zip` (or whatever the name/path for the downloaded gapps file is).
5. It should complete successfully. Now type exit to exit the adb shell, and close the hyper-v console window (the android emulator will continue running).
6. Click the 'X' at the top right of the Emulator to shut down/close the VM
7. Start the emulator back up. You should now have access to Google Play Services.
----------------------------------------
Busybox
The emulator does not come with a preinstalled copy of busybox. It does come with the android toolbox, but this has only a very minimal amount of commands in it. The instructions below are for installing stericson's busybox.
1. Get a copy of stericson's busybox from somewhere--your personal device, etc, it doesn't matter. The easiest way is to either install it on a real android device and grab it with airdroid (or other), or to use a play store scanner to get it. The file name will probably be something like stericson.busybox.apk.
2. Rename it to .zip so you can access the contents.
3. Extract the busybox-x86.png file from the 'assets' folder inside the zip, and rename it to `busybox`.
4. In the Android Emulator, click the >> button for tools, and click the sdcard header. Choose a folder (a new one on your dekstop will do) and tell it to pull the contents of the sdcard to the folder.
5. Move the busybox file into the Download folder that you just pulled from the sdcard. If you created a folder for this, you can delete it now.
6. Back in the android emulator, push the folder structure back into the sdcard; this will move the busybox onto the emulator.
7. Open the HyperV console for the emulator or open a terminal app in the android emulator (installing it is up to you)
8. Run `adb shell` to get a root prompt.
9. Run `mount -o rw,remount /system` to remount the system partition as writable
10. Run `cp /sdcard/Download/busybox /system/xbin` to copy the busybox binary over
11. Run `chmod 777 /system/xbin/busybox` to make the busybox binary executable.
12. Run `busybox --install /system/xbin` to copy the busybox binary for all the included applets. I think the -s paramter will symlink the applets to the main binary instead, but I'm not sure.
13. Type exit in the adb shell.
14. You can now run busybox commands in the terminal, and use apps that require busybox to be installed.
Now that you have busybox installed, you can use unzip, etc.
----------------------------------------
Hacking the OS itself.
The android emulator uses a VHD file for the disks. I've mounted the vhd file inside an ubuntu server to play with, and discovered several things about the way it works. The first partition is the boot partition, it contains 3 files:
- kernel - the android/linux kernel
- ramdisk - the ramdisk for the root filesystem. gzipped cpio archive.
- cmdline - the kernel parameters(? not sure what to call this)
I've tried modifying the ramdisk to add the init files for the superuser, but this doesn't seem to work properly; when I boot up the vhd file, I can open the console with hyper-v manager (the android emulator machines show up there automatically), and when it gets to the ramdisk, it says so--then the caps/num/scroll lights start flashing and it hangs. I haven't gotten any further than that at this time.

Categories

Resources