[Android Software/Hacking General [Developers Only]] Ryuinferno:
**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!!! :D

**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...:D

init.d support through terminal emulator!!!​

What is init.d:

But how? :confused:

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!!! :D 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 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:

- 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...:p

- 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! :D 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​