• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[mido] initd, ad-blocking and "bad audio in videos fix" mod

Search This thread

DarthJabba9

Senior Member
May 5, 2014
3,729
3,566
Greater London
Here is a copy of my own personal mod for mido. I am only making it available because I thought others might find it useful.

What this mod does
1. Implements init.d functionality - any script in /system/etc/init.d/ with a name that starts with "00" (ie, zero zero) and has a ".sh" extension will be executed every time the phone boots up. My own script for interactive governor (based on @FaustTN tips in this thread is included as "/system/etc/init.d/00_userinit.sh")

2. Ad blocking with a replacement "/system/etc/hosts" file (built from various freely available lists)

3. Modified /system/etc/mkshrc that launches bash automatically (if bash is found) when a terminal session is opened (if bash is not found, then nothing is done)

4. Implements the "bad audio in videos" fix described by @gianluca212 in this thread

Compatibility
This is a mido only mod. It is based on patched files from OctOS, and I am using it successfully on OctOS. It should also be fine for Slim, because the relevant patched files are identical. This may indicate that it is also suitable for other LOS based Nougat ROMs for mido. However, I have not tested it on others. The original files are first backed up (with a ".old" extension) before being patched

Disclaimer
All the usual disclaimers apply. The mod works perfectly fine for me, but your mileage may vary. Use at your own risk!

Download
Get your updated copy from this link (version 2)

AUDIO FIX ONLY
If you are only interested in fixing audio problems (i.e., no initd, and no ad-blocking) then download the attached zip file below only ("mido-audiofix-mod-aosp-LOS.zip"). It is based on SlimOS files, but should be compatible with any CAF/AOSP/LOS based ROM.

Installation
1. Make a full nandroid backup of your ROM. At the very least, the system partition should be backed up (do NOT skip this step)
2. Boot to TWRP recovery, and install the mod (no need to wipe anything)
3. Reboot

Bugs?
You tell me.
 

Attachments

  • mido-audiofix-mod-aosp-LOS.zip
    11.8 KB · Views: 387
Last edited:

DarthJabba9

Senior Member
May 5, 2014
3,729
3,566
Greater London
UPDATED (NEW ("v2") ZIP FILES)

If you are interested in only the initd implementation, and are not interested in the other stuff listed above, see the links below.
* The first zip is an initd patch for AOSP / LOS based Nougat ROMs
* The second zip is an initd patch for MIUI based Nougat ROMs
* The third zip is a generic initd patch for all Nougat ROMs for mido - it should work equally well with AOSP/LOS/MIUI. New users should use this in preference to the first two zips.

Notes:
1. Since only one file needed to be patched to implement initd, the first zip should also work fine for MIUI based ROMs (there are only minor differences between the AOSP/LOS and the MIUI files). However, a separate zip is supplied for MIUI to avoid all doubt. The third zip adopts a different approach by directly patching the existing file on the fly. Thus, it is not ROM dependent or version dependent.
2. The zip installer contains only the initd patch. No sample initd script is provided - you have to supply your own.
3. Make sure that the name of your initd script starts with "00", and that it has the extension ".sh"
4. Copy your initd script to the /system/etc/init.d directory.
5. Your ROM must be rooted before you can copy your initd script to the /system/etc/init.d directory (you need a file editor that can access root - eg, Root Explorer).
6. If you are using a Windows text editor to create your script, make sure that the script is saved with unix line endings.

As usual, all disclaimers apply.

Installation
1. Make a full nandroid backup of your ROM. At the very least, the system partition should be backed up (do NOT skip this step)
2. Boot to TWRP recovery, and install the mod (no need to wipe anything)
3. Reboot

Bugs?
You tell me.
 

Attachments

  • mido-initd-mod-aosp-LOS-v2.zip
    42.1 KB · Views: 490
  • mido-initd-mod-miui-v2.zip
    42.1 KB · Views: 468
  • mido-initd-mod-generic.zip
    3.1 KB · Views: 303
Last edited:

DarthJabba9

Senior Member
May 5, 2014
3,729
3,566
Greater London
I need only instal this zip for AOSP or I must do something with init.d in system or not?
If you install the mod from post #1, then it already has installed an initd script ("/system/etc/init.d/00_userinit.sh") that tweaks the interactive governor. You can edit that, or remove it. If you install the mod from post #2, then all you get is initd functionality, and you will need to create your own scripts from the start.
 

DarthJabba9

Senior Member
May 5, 2014
3,729
3,566
Greater London
I have updated Post #2 with a new "generic" version of the initd mod (the third zip) which should work equally well with any Nougat ROM for mido.

This is for new users or those who have upgraded their ROM after having installed one of the first two zips. If you have already installed either of the first two, you should not try to install this one. It will simply refuse to install, because it would be wholly unnecessary to install the mod twice.
 
  • Like
Reactions: abrahamt24

fahad96

Member
Dec 30, 2014
18
5
Okay, so I get these values from the terminal. What do u think?
jXPxhm


---------- Post added at 11:01 AM ---------- Previous post was at 10:49 AM ----------

I keep getting a bad request error while uploading!

---------- Post added at 12:15 PM ---------- Previous post was at 12:01 PM ----------

Check the values of the things that you have changed in your initd script. You can do this from a root terminal window - eg
Okay
For the "target_load" command I get
"80 652800:57 1036800:67 1401600:75
1689600:9 1804800:85 1958400:87"
And for the "highspeed_freq" command I get
"652800"
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Here is a copy of my own personal mod for mido. I am only making it available because I thought others might find it useful.

    What this mod does
    1. Implements init.d functionality - any script in /system/etc/init.d/ with a name that starts with "00" (ie, zero zero) and has a ".sh" extension will be executed every time the phone boots up. My own script for interactive governor (based on @FaustTN tips in this thread is included as "/system/etc/init.d/00_userinit.sh")

    2. Ad blocking with a replacement "/system/etc/hosts" file (built from various freely available lists)

    3. Modified /system/etc/mkshrc that launches bash automatically (if bash is found) when a terminal session is opened (if bash is not found, then nothing is done)

    4. Implements the "bad audio in videos" fix described by @gianluca212 in this thread

    Compatibility
    This is a mido only mod. It is based on patched files from OctOS, and I am using it successfully on OctOS. It should also be fine for Slim, because the relevant patched files are identical. This may indicate that it is also suitable for other LOS based Nougat ROMs for mido. However, I have not tested it on others. The original files are first backed up (with a ".old" extension) before being patched

    Disclaimer
    All the usual disclaimers apply. The mod works perfectly fine for me, but your mileage may vary. Use at your own risk!

    Download
    Get your updated copy from this link (version 2)

    AUDIO FIX ONLY
    If you are only interested in fixing audio problems (i.e., no initd, and no ad-blocking) then download the attached zip file below only ("mido-audiofix-mod-aosp-LOS.zip"). It is based on SlimOS files, but should be compatible with any CAF/AOSP/LOS based ROM.

    Installation
    1. Make a full nandroid backup of your ROM. At the very least, the system partition should be backed up (do NOT skip this step)
    2. Boot to TWRP recovery, and install the mod (no need to wipe anything)
    3. Reboot

    Bugs?
    You tell me.
    6
    UPDATED (NEW ("v2") ZIP FILES)

    If you are interested in only the initd implementation, and are not interested in the other stuff listed above, see the links below.
    * The first zip is an initd patch for AOSP / LOS based Nougat ROMs
    * The second zip is an initd patch for MIUI based Nougat ROMs
    * The third zip is a generic initd patch for all Nougat ROMs for mido - it should work equally well with AOSP/LOS/MIUI. New users should use this in preference to the first two zips.

    Notes:
    1. Since only one file needed to be patched to implement initd, the first zip should also work fine for MIUI based ROMs (there are only minor differences between the AOSP/LOS and the MIUI files). However, a separate zip is supplied for MIUI to avoid all doubt. The third zip adopts a different approach by directly patching the existing file on the fly. Thus, it is not ROM dependent or version dependent.
    2. The zip installer contains only the initd patch. No sample initd script is provided - you have to supply your own.
    3. Make sure that the name of your initd script starts with "00", and that it has the extension ".sh"
    4. Copy your initd script to the /system/etc/init.d directory.
    5. Your ROM must be rooted before you can copy your initd script to the /system/etc/init.d directory (you need a file editor that can access root - eg, Root Explorer).
    6. If you are using a Windows text editor to create your script, make sure that the script is saved with unix line endings.

    As usual, all disclaimers apply.

    Installation
    1. Make a full nandroid backup of your ROM. At the very least, the system partition should be backed up (do NOT skip this step)
    2. Boot to TWRP recovery, and install the mod (no need to wipe anything)
    3. Reboot

    Bugs?
    You tell me.
    2
    Could you please create a version for only the bad audio in video problem?
    Now attached to the original post.
    1
    I have updated Post #2 with a new "generic" version of the initd mod (the third zip) which should work equally well with any Nougat ROM for mido.

    This is for new users or those who have upgraded their ROM after having installed one of the first two zips. If you have already installed either of the first two, you should not try to install this one. It will simply refuse to install, because it would be wholly unnecessary to install the mod twice.
    1
    Thank for your work, can i use this with GovTuner mod?
    Sorry but I have no idea.