Init.d for Oreo - root required - Xiaomi Redmi Note 4 Themes, Apps, and Mods

I have created a mod (initd-DJ9) to add init.d functionality to Oreo ROMs.
Anyone who has added init.d to Nougat ROMs by patching "init.qcom.post_boot.sh" will have learnt that this does not work with Oreo.
The initd-DJ9 mod avoids that problem.
What use is init.d?
1. init.d allows you to fine-tune/tweak your device or fix problems, and to make the changes persistent (i.e., to survive reboots) without changing your ROM
2. Typical uses include: a) setting new cpu frequencies (overclock or underclock) to override the stock ones; b) tweak interactive governor values; c) disable/enable cpu cores; d) running fstrim on your device's storage; d) retrieve hardware information that is normally difficult to ascertain; e) tweak I/O values; f) set the brightness of led/torch; g) do certain things that you want to happen each time the phone is booted up, etc, etc. - see the sample script that is attached.
Downloads
1A initd-DJ9 installer: Generic (activated on boot_completed)
OR;
1B. initd-DJ9 installer: Snapdragon only (activated on completion of qcom post-boot)
2. Readme
3. Sample init.d script (updated)
Installation
1. Backup your current boot image - if case something goes wrong, you can restore it with TWRP/OrangeFox recovery
2. Download your preferred initd-DJ9 zip installer to your internal (or external) SD
3. Boot to recovery
4. Install it as a normal zip, from TWRP/OrangeFox (or any other) recovery (what the installer does is to patch the boot image's ramdisk, using anykernel2 functionality by @osm0sis)
5. You are ready to roll!
Usage (your phone must be rooted)
1. Install initd-DJ9
2. Create a shell script (it must have the extension ".sh", and must have unix/linux line endings - not Windows or Mac line endings) - see the attachment below for a sample (rename it to sample.sh)
3. Copy the shell script to /system/etc/init.d/
4. Reboot the phone. Every time that the phone is booted, the init.d script(s) will be executed.
5. Check "/data/local/sysinitd.log" to see whether the scripts were executed. This file is updated on every bootup, and so you might want to delete it once in a while , so that it doesn't get too big.
6. This mod has been tested on a number of Oreo ROMs. It has not been tested on Nougat ROMs. It uses anykernel2 functionality, and so might work on Nougat and other ROMs. However, I have only tested it on Oreo. I would not recommend using it on Nougat or Marshmallow ROMs. If you do, you are on your own!

For what it will be helpful???
Sent from my Redmi Note 4 using XDA-Developers Legacy app

Vinay Patani said:
For what it will be helpful???
Click to expand...
Click to collapse
See the "What use is init.d?" section in the OP.

LeoPantera said:
Sample script say 'echo "0" > /proc/touchpanel/enable_dt2w' (disable double-tap-to-wake). You echo "1" to enable?
Click to expand...
Click to collapse
All you need to do is to delete the line, or comment it out.

LeoPantera said:
This can repleace kernel aduitor run startup script?
Click to expand...
Click to collapse
If you are asking about running scripts during the bootup process, then "yes".

Thank you for this.
One question though, is root required for your init.d mod to function or just to push the scripts and set the required permission.
I tried to figure it out by looking at the codes but I'm kinda noob to this.

thapaavijeet said:
Thank you for this.
One question though, is root required for your init.d mod to function or just to push the scripts and set the required permission.
I tried to figure it out by looking at the codes but I'm kinda noob to this.
Click to expand...
Click to collapse
Note the "root required" in the title of the thread? Although it should be possible for the init.d process to kick in without root, you would definitely need to be rooted to use the feature. How would you create or edit your own initd scripts in the /system/etc/init.d/ directory without root?

DarthJabba9 said:
Note the "root required" in the title of the thread? Although it should be possible for the init.d process to kick in without root, you would definitely need to be rooted to use the feature. How would you create or edit your own initd scripts in the /system/etc/init.d/ directory without root?
Click to expand...
Click to collapse
If you could include the directory creation in you mod, if not already there then placing scripts in it and chmod 775 on the script can be done though TWRP file manager itself.
The code should be something like this but I'm not sure about it. However, I was able to place scripts through custom recoveries on un rooted devices.
Code:
INITDIR=/system/etc/init.d
if [ ! -d $INITDIR ]; then
mkdir -p $INITDIR
fi

thapaavijeet said:
If you could include the directory creation in you mod, if not already there then placing scripts in it and chmod 775 on the script can be done though TWRP file manager itself.
Click to expand...
Click to collapse
All that is already there.

Can you correct me if this init.d script is right or wrong, if it is wrong how would it be right?
#!/system/bin/sh
# Cloudflare DNS
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 1.1.1.1:53
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 1.0.0.1:53
iptables -t nat -I OUTPUT -p tcp --dport 53 -j DNAT --to-destination 1.1.1.1:53
iptables -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to-destination 1.0.0.1:53
setprop net.eth0.dns1 1.1.1.1
setprop net.eth0.dns2 1.0.0.1
setprop net.dns1 1.1.1.1
setprop net.dns2 1.0.0.1
setprop net.ppp0.dns1 1.1.1.1
setprop net.ppp0.dns2 1.0.0.1
setprop net.rmnet0.dns1 1.1.1.1
setprop net.rmnet0.dns2 1.0.0.1
setprop net.rmnet1.dns1 1.1.1.1
setprop net.rmnet1.dns2 1.0.0.1
setprop net.pdpbr1.dns1 1.1.1.1
setprop net.pdpbr1.dns2 1.0.0.1
setprop 2606:4700:4700::1111
setprop 2606:4700:4700::1001

DarthJabba9 said:
I have created a mod (initd-DJ9) to add init.d functionality to Oreo ROMs.
Anyone who has added init.d to Nougat ROMs by patching "init.qcom.post_boot.sh" will have learnt that this does not work with Oreo.
The initd-DJ9 mod avoids that problem.
What use is init.d?
1. init.d allows you to fine-tune/tweak your device or fix problems, and to make the changes persistent (i.e., to survive reboots) without changing your ROM
2. Typical uses include: a) setting new cpu frequencies (overclock or underclock) to override the stock ones; b) tweak interactive governor values; c) disable/enable cpu cores; d) running fstrim on your device's storage; d) retrieve hardware information that is normally difficult to ascertain; e) tweak I/O values; f) set the brightness of led/torch; g) do certain things that you want to happen each time the phone is booted up, etc, etc. - see the sample script that is attached.
Downloads
1A initd-DJ9 installer: Generic (activated on boot_completed)
OR;
1B. initd-DJ9 installer: Snapdragon only (activated on completion of qcom post-boot)
2. Readme
3. Sample init.d script (updated)
Installation
1. Backup your current boot image - if case something goes wrong, you can restore it with TWRP/OrangeFox recovery
2. Download your preferred initd-DJ9 zip installer to your internal (or external) SD
3. Boot to recovery
4. Install it as a normal zip, from TWRP/OrangeFox (or any other) recovery (what the installer does is to patch the boot image's ramdisk, using anykernel2 functionality by @osm0sis)
5. You are ready to roll!
Usage (your phone must be rooted)
1. Install initd-DJ9
2. Create a shell script (it must have the extension ".sh", and must have unix/linux line endings - not Windows or Mac line endings) - see the attachment below for a sample (rename it to sample.sh)
3. Copy the shell script to /system/etc/init.d/
4. Reboot the phone. Every time that the phone is booted, the init.d script(s) will be executed.
5. Check "/data/local/sysinitd.log" to see whether the scripts were executed. This file is updated on every bootup, and so you might want to delete it once in a while , so that it doesn't get too big.
6. This mod has been tested on a number of Oreo ROMs. It has not been tested on Nougat ROMs. It uses anykernel2 functionality, and so might work on Nougat and other ROMs. However, I have only tested it on Oreo. I would not recommend using it on Nougat or Marshmallow ROMs. If you do, you are on your own!
Click to expand...
Click to collapse
-------
Thank you,
finally, I drop here and found a solution to enable init.d for Mido SND (stock kernel-Android N)
Try a lot solutions around but seem not to work (cann't find /data/init_test.log), even the solution to put scripts in magisk/.core/post-fs-data.d,...etc
until this zip (patch boot.img) is working for me

Related

Load Kernel Modules On Boot?

Hi guys,
I'm trying to get my Xoom to load some kernel modules automatically when it restarts/boots. I placed the built .ko files in /system/lib/modules, and I tried to edit/replace both init.rc and init.stingray.rc, but they seem to get overwritten by the default file whenever the Xoom restarts. I figured I'd create a service in init.rc that would load the modules (insmod) directly, or call a shell script to load the modules, but neither worked when the init files get overwritten every time. Is there a better solution or way to avoid this?
Thanks in advance for any help.
i will post a init script that will load them tomorrow. Use modprobe for modules. It installs the entire driver stack. Insmod often gives errors because some drivers, like compat-wireless, have 6 or 7 modules. And they have to be loaded in correct order. Modprobe handles all that automatically.
bigrushdog said:
i will post a init script that will load them tomorrow. Use modprobe for modules. It installs the entire driver stack. Insmod often gives errors because some drivers, like compat-wireless, have 6 or 7 modules. And they have to be loaded in correct order. Modprobe handles all that automatically.
Click to expand...
Click to collapse
Thanks bigrushdog, much appreciated. I only use insmod for single modules, and I'm sure it works because when I run it manually it correctly loads and starts the modules I'm using (they are all self-contained single modules with no deps). How do you modify the init scripts so that they are not erased when the device is rebooted?
mattberman said:
Thanks bigrushdog, much appreciated. I only use insmod for single modules, and I'm sure it works because when I run it manually it correctly loads and starts the modules I'm using (they are all self-contained single modules with no deps). How do you modify the init scripts so that they are not erased when the device is rebooted?
Click to expand...
Click to collapse
My bad. I "assumed" you were unlocked and root. Otherwise it becomes many factors more difficult. You would have to write an app extending service. Even then you may not be able to set perms high enough without being root.
bigrushdog said:
My bad. I "assumed" you were unlocked and root. Otherwise it becomes many factors more difficult. You would have to write an app extending service. Even then you may not be able to set perms high enough without being root.
Click to expand...
Click to collapse
I am unlocked and rooted. Sorry, maybe my description of the problem was vague. I'm trying to edit any of the boot scripts to load my kernel modules when the device resets. Whenever I make any edits, they are lost when the device reboots, and my commands/scripts are never called.
That is because the init scripts are in the ramdisk.
drop this in /system/etc/init.d
give it a filename like "06loadModules"
Code:
#!/system/bin/sh
#
# Load any extra modules
MODPATH=/system/lib/modules/
for i in `ls $MODPATH | grep -v bcm4329.ko`
do
modprobe `basename $i .ko` >/dev/null 2>&1
done
exit 0
dont forget to
Code:
chmod 755 /system/etc/init.d/06loadModules
this will cleanly install all modules in /system/lib/modules on boot
bigrushdog said:
drop this in /system/etc/init.d
give it a filename like "06loadModules"
Code:
#!/system/bin/sh
#
# Load any extra modules
MODPATH=/system/lib/modules/
for i in `ls $MODPATH | grep -v bcm4329.ko`
do
modprobe `basename $i .ko` >/dev/null 2>&1
done
exit 0
dont forget to
Code:
chmod 755 /system/etc/init.d/06loadModules
this will cleanly install all modules in /system/lib/modules on boot
Click to expand...
Click to collapse
I don't have an /init.d folder in /system/etc; don't only certain ROMs use init.d? I'm not using any ROM, so maybe that is the problem. If the init scripts are stored in the ramdisk, can I just extract the ramdisk, edit the init scripts and reflash? I know that's more of a hassle, but it should work the same way right? Thanks again for your help.

[MOD] One stop for tweaks and other useful cool stuff

ok, from my android tweaking and playing around with all kinds of settings and other things i know it can be somewhat hard to find everything you might need to make the most of your android device so i will put links to them here along with providing support and my own little discoveries here...if anyone knows anything else that is cool or useful just post it and i'll update this post (btw these are tested on droid 1 only but many may apply to most android devices)
*Anyone who knows of any other tweaks/mods/scripts/useful terminal commands please feel free to post and i'll add it here (after testing it if possible)*
***disclaimer- I am not responsible for any damage you may do to your device, please make sure to have a backup before doing any of these tweaks***
first off how about a simple rooting/returning to stock guide?
quick root guide
1)download these files
http://www.motorola.com/staticfiles/Support/Experiences/Global_Drivers/MotoHelper_2.0.40_Driver_4.9.0.exe
http://wonderly.com/bb/DROID/OEM/rsdlite_5.0.msi
http://wonderly.com/bb/DROID/OEM/VZW_A855_QSC6085BP_RZRECOVERY_UPDATE.sbf
http://wonderly.com/bb/DROID/OEM/update.zip
2)install the first 2 links in order
3)connect your phone via usb to your computer and copy the update.zip you downloaded to your sdcard
4)reboot your phone and hold power + vloume up + the camera button until you see the screen that says bootloader battery ok
5)open rsd lite and see if it recognizes your phone (basically any entry in the model column) and slide your phone keyboard open
6) click the ... near the start button and navigate and select the VZW_A855_QSC6085BP_RZRECOVERY_UPDATE.sbf file
7)click start and WATCH FOR "Phone[0000]: Phone is being rebooted" On your phone the screen will change to "SW Update Complete" and your phone will reboot within a second or two. You want to be already holding the x button on your keyboard to boot into recovery mode when the phone actually reboots so the stock OS doesnt erase the new recovery you just flashed
8) using the volume keys to move through the menu, the camera button to select and the power button to go back, go to install and select the update.zip you put on your sdcard earlier and select install update.zip
9) then select "reboot into android" and enjoy the benefits of being rooted
return to stock
1)download these files
http://www.motorola.com/staticfiles...al_Drivers/MotoHelper_2.0.40_Driver_4.9.0.exe
http://wonderly.com/bb/DROID/OEM/rsdlite_5.0.msi
http://wonderly.com/bb/DROID/OEM/VZW_A855_FRG22D_QSC6085BP_C_01.43.01P_SW_UPDATE.sbf
2)install the first 2 files
3)reboot your phone and hold power + vloume up + the camera button until you see the screen that says bootloader battery ok
4)connect your phone via usb to your computer and reboot your phone and hold power + vloume up + the camera button until you see the screen that says bootloader battery ok
5)open rsd lite and see if it recognizes your phone (basically any entry in the model column)
here are are some useful build.prop tweaks I've encountered along the way, just put the line into the build.prop or modify it if its already in there, save, wipe dalvik cache and reboot
6) click the ... near the start button and navigate and select the VZW_A855_FRG22D_QSC6085BP_C_01.43.01P_SW_UPDATE.sb f you downloaded earlier
7)click start and let it run and reboot automatically (it should work even if rsd lite says the result was fail)
8) you are now on stock unrooted froyo
FRG22D
(optional) 9) go to settings > about phone> check for updates and allow system updates to download and install (allows for a super clean setup if you are planning to re-root)
for possibly better scrolling speed, can be set to any number from 35-300:
# This defines the max event window manager can
# handle in 1 s. We may adjust this # for performance
# reason later
windowsmgr.max_events_per_sec=
change lcd density (already in build.prop), which is like changing the resolution on a windows computer can be anywhere from 140 to 260 (under 200 not recommended because everything may be too small for the phone to be usable:
ro.sf.lcd_density=
dalvik cache virtual memory size (already in build.prop)...can also help performance. set anywhere from 24m to 64m based on how complex your setup is. i.e. tons of apps, in depth theme, memory intensive apps, etc.
dalvik.vm.heapsize=
incoming ringer delay (already in build.prop) sets how soon the phone starts ringing when a call comes in. set between 0 and 2000
ro.telephony.call_ring.delay=
proximity delay. sets how long before screen turns off during call. set between 0 and 600
# Proximit sensor screen off delay
mot.proximity.delay=
tcp stack- optimizes data performance
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
enable hardware acceleration
# Render UI through GPU instead of CPU
# Comment out if this causes laggy UI (it should speed up UI)
debug.sf.hw=1
sleep mode for battery savings. 0 means power collapse suspend, 1 is power collapse (usually the best choice), 2 is apps go to sleep, 3 is show clock and wait, 4 is wait for interrupt...not sure which each one does or is good for, just know about this little tweak lol
# Battery Savings (Sleep Mode)
pm.sleep_mode=
more battery savings
# When moving through zones or losing signal, having a delay
# smooths out constant disconnects and reconnects, which in turn
# saves a ton of battery life!
ro.mot.eri.losalert.delay=1000
disable sending usage data
ro.config.nocheckin=1
wifi scan interval (already in build.prop) can save battery as well. set from 15 to 999
# Time between scans in seconds. Keep it high to minimize battery drain.
# This only affects the case in which there are remembered access points,
# but none are in range.
wifi.supplicant_scan_interval=
ok, now for some useful links (all credit goes to the creators of these cool tweaks/apps/programs
v6 supercharger by zepplinrox - http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021
Deodex/odex tweak by Nibras, Reeza & Danzano (thanks to BrUhNiGGs for finding this) - http://www.droidforums.net/forum/steel-droid/200388-ram-tweak-free-up-more-ram-make-apps-load-faster.html
setcpu for free (legitimately legal lol) - http://forum.xda-developers.com/showthread.php?t=505419
wifi tethering app Downloads - http://code.google.com/p/android-wifi-tether/downloads/list
wired tethering app Downloads - http://code.google.com/p/android-wired-tether/downloads/list
easy install of adb http://www.droidforums.net/forum/chevyno1/162984-your-1-adb-source-7-29-11-a.html
Guide to building a rom from source (credit to chevycam and SnkBitten) - http://www.droidforums.net/forum/steel-droid/196475-guide-how-build-your-own-rom-cm7-source.html
Ok, here's a new section with just general tips, tricks and scripts
Useful terminal emulator scripts run as superuser (su)
*Using the debugging logging to report issues
Code:
logcat > /mnt/sdcard/logcat.txt
wait 4-5 seconds then hold volume up and press f on the keyboard to stop it
if logcat is disabled then do this instead
Code:
dmesg > /mnt/sdcard/dmesg.txt
wait 4-5 seconds then hold volume up and press f on the keyboard to stop it
*Find top CPU/memory using apps. value after -m is how many apps to show, value after -n is how many times to update (be sure to set this value or it will run endlessly until terminal is closed)
Code:
top -m 10 -n 1
*Find md5sum for downloaded files (checks to ensure proper downloads especially for roms, just compare your result to whatever value the rom developer provides and they should match)
Code:
md5sum /mnt/sdcard/(file path on sdcard)
For example
Code:
md5sum /mnt/sdcard/download/SD_9.0.0.zip
*Use swap partition without swapper2.
Add this script to the end of any file in the /etc/init.d folder. If you don't have one just run it in terminal emulator each reboot and run it in terminal first since sometimes its mmcblk0p2 instead of mmcblk0p3 depending on where you have the swap partition (or use the app script manager to make it run at boot. Script manager doesn't run continuously like swapper2)
Code:
swapon /dev/block/mmcblk0p3
And to turn swap off
Code:
swapoff /dev/block/mmcblk0p3
*Setting swappiness
Add or edit this line in the file etc/sysctl.config using whatever value you want, just keep the spaces (open in text editor)
vm.swappiness = 30
Or add this to the end of a script in init.d or run in terminal emulator
Code:
sysctl -w vm.swappiness=30
*Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
Code:
insmod /system/lib/modules/ext3.ko
or the simple way
Code:
modprobe ext3
*Listing loaded modules
Run this in terminal emulator with superuser permissions
Code:
lsmod
*Forcing a hot reboot to clear caches
Run this in terminal emulator with superuser permissions
Code:
pkill zygote
*terminal tips-
Find list of many possible scripts to run
Code:
busybox
List sysctl commands
Code:
sysct -h
List first or last 10 lines of another scripts output (note | is not lower case L, its a separate character)
First 10-
Code:
(script) | head
Last 10
Code:
(script) | tail
Example (list first 10 sysctl values)
Code:
sysctl -a | head
Finding lines with certain letters/word in another scripts output
Code:
(script) | grep (letters/word)
Example (show only sysctl lines with vm in them) (note | is not lower case L, its a separate character)
Code:
sysctl -a | grep vm
Don't worry more to come soon
Ok, those are the well tested tweaks, now for a few experimental ones. Please make sure to have a backup ready to restore since these ARE experimental and may cause your rom not to load
improve peformance?
Add this to the build.prop
#disable the zygote loader
ro.wmt.blcr.enable=0
Fix app issues? (change it to 0 to improve performance)
Add this to build.prop
ro.kernel.android.checkjni=1
Change the I/O scheduler (effects how your phone reads and writes data)(first line tells you whats available and what you currently have in [ ], then put whichever one you want in the "" after echo, and the last line will confirm the change)
Code:
cat /sys/block/*/queue/scheduler
for i in /sys/block/*/queue/scheduler
do
echo "deadline" > $i
done
cat /sys/block/*/queue/scheduler
Increse overall touch resposivness?
Add these to build.prop
debug.performance.tuning=1
video.accelerate.hw=1
ro.min_pointer_dur=8
Raise Photo and video quality?
Add these to build.prop
ro.media.enc.jpeg.quality=100
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
change sdcard buffer speed
run in terminal emulator as superuser (su) or put #!/system/bin/sh as first line and put in /system/etc/init.d (you can change the value in the "echo 512 > /sys/devices/virtual/bdi/179:0/read_ahead_kb" line to suit your needs- common values are 256, 512, 1024, 2048, 3072, 4096, 5120, 6144)
Code:
for i in /sys/devices/virtual/bdi/*
do
echo 2 > $i/read_ahead_kb
done
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo 2 > /sys/devices/virtual/bdi/default/read_ahead_kb
or you can try just simply using the simple version
Code:
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Disable boot animation
add to build.prop (use caution after wiping dalvik, it will appear to hang at the M but its usually still booting up all the way)
dev.sfbootcomplete=0
Use dalvik JIT compiler
add to build.prop (Just In Time compiler is much faster)
dalvik.vm.execution-mode=int:jit
Improve performance?
change in build.prop
ro.setupwizard.mode=DISABLED
Rom dependent tweaks (will only work if these features are included in your rom and most are included in settings anyway, most of the time they are but if not sure then ask the dev) add these to build.prop, 1 is on 0 is off
help to free up unused ram-
persist.sys.purgeable_assets=
stop usb debugging on notification-
persist.adb.notify=
Force capacitive buttons to stay on while screen is on?-
ro.mot.buttonlight.timeout=
Improve screen quality at the cost of performance-
persist.sys.use.dithering=
*reserved*
**reserved**
and one more just in case
***reserved***
btw, i hope i posted this right, I'm still new here to xda forums, i hope i posted in the right section too...if not then someone can go ahead move it (if possible)
Nice collection!
Say, do you have anything specific to CDMA bandwidth?
I know my 3G TurboCharger has a positive effect somehow even though most of the entries are GSM related but hey... every bit helps
zeppelinrox said:
Nice collection!
Say, do you have anything specific to CDMA bandwidth?
I know my 3G TurboCharger has a positive effect somehow even though most of the entries are GSM related but hey... every bit helps
Click to expand...
Click to collapse
not sure if any of these would apply to data at all but i know kfazz posted them as the only ril settings for the droid, maybe this could further improve speed on all devices if anything applies to mobile data
Moto ril sholes accepted properties found via strings
persist.ril.mux.timeout.enbld
persist.ril.enableradio.powerup
persist.ril.uart.flowctrl
persist.ril.mux.noofchannels
persist.ril.mux.ttydevice
persist.ril.mux.retries
persist.ril.mux.sleep
persist.ril.mux.logmask
persist.ril.rssi.enable.param6
persist.ril.modem.ttydevice
persist.ril.pppd.start.fail.max
ro.ril.ecclist
ro.ril.barcode
ro.build.id
/data/data/com.motorola.motoapr.service/paniclogging
/data/misc/ril/ril_apr.log
Click to expand...
Click to collapse
Ok I guess those are boolean values soget either = 0 or =1 values then?
Well that's weird.. I didn't know there are ro.cdma values...
http://pastebin.com/LWWcSMTD
zeppelinrox said:
Ok I guess those are boolean values soget either = 0 or =1 values then?
Well that's weird.. I didn't know there are ro.cdma values...
http://pastebin.com/LWWcSMTD
Click to expand...
Click to collapse
i searched for ro.cdma and found some others too
ril.cdma.ppp.up=3
ro.radio.use-ppp=yes
net.cdma.ppp-exit=0
cool... maybe you can test them see if you notice a difference?
zeppelinrox said:
cool... maybe you can test them see if you notice a difference?
Click to expand...
Click to collapse
I'll try it out but it I'll try it on something where the radio fully works lol, is still being fixed on the ics build but obviously I have to go back to gingerbread to make and receive calls, if it does anything on GB, then I'll test on ics, who knows it might fix the radio issues somehow
A friend of mine just asked me to root his old droid for him to use merely as a multimedia (music & video) and google docs device. Strictly Wifi, no service plan.
i plan on rooting, wiping, and running SteelDroid on it for him:
http://forum.xda-developers.com/showthread.php?t=1098483
I came across these tweaks and they look AWESOME. I just have a few questions about some of them in particular.
metalspring said:
for possibly better scrolling speed, can be set to any number from 35-300:
# This defines the max event window manager can
# handle in 1 s. We may adjust this # for performance
# reason later
windowsmgr.max_events_per_sec=
Click to expand...
Click to collapse
Is this in the build.prop or elsewhere?
metalspring said:
tcp stack- optimizes data performance
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
Click to expand...
Click to collapse
where do i find and change these? build.prop or elsewhere?
metalspring said:
enable hardware acceleration
# Render UI through GPU instead of CPU
# Comment out if this causes laggy UI (it should speed up UI)
debug.sf.hw=1
disable sending usage data
ro.config.nocheckin=1
Click to expand...
Click to collapse
in build.prop?
metalspring said:
Useful terminal emulator scripts run as superuser (su)
*Use swap partition without swapper2.
Add this script to the end of any file in the /etc/init.d folder. If you don't have one just run it in terminal emulator each reboot (or use the app script manager to make it run at boot. Script manager doesn't run continuously like swapper2)
swapon /dev/block/mmcblk0p3
And to turn swap off
swapoff /dev/block/mmcblk0p3
*Setting swappiness
Add or edit this line in the file etc/sysctl.config using whatever value you want, just keep the spaces (open in text editor)
vm.swappiness = 30
Or add this to the end of a script in init.d or run in terminal emulator
sysctl -w vm.swappiness=30
*Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
insmod /system/lib/modules/ext3.ko
Click to expand...
Click to collapse
Can i make 2 scripts in script manager that can do this? or are there any available? I know on such a low ram & low internal storage device, swap and apps2sdext would be INCREDIBLY useful.. any tips on making this permanent? If i can make a script in SM i know i can set it start at boot. But i wouldn't need to do that for a2sdext right? once that's set, it's set and needs no changes right?
Also, would you suggest a custom rom like steeldroid or would i be better off stripping out the crapware from the stock ota rom (froyo) and just flashing a better compatible kernel and using some tweaks & scripts to speed things up a bit and optimize them for his purposes.
Let me know what you think?
thanks!
Originally Posted by metalspring
for possibly better scrolling speed, can be set to any number from 35-300:
# This defines the max event window manager can
# handle in 1 s. We may adjust this # for performance
# reason later
windowsmgr.max_events_per_sec=
Click to expand...
Click to collapse
Is this in the build.prop or elsewhere?
Originally Posted by metalspring
tcp stack- optimizes data performance
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
Click to expand...
Click to collapse
where do i find and change these? build.prop or elsewhere?
Originally Posted by metalspring
enable hardware acceleration
# Render UI through GPU instead of CPU
# Comment out if this causes laggy UI (it should speed up UI)
debug.sf.hw=1
disable sending usage data
ro.config.nocheckin=1
Click to expand...
Click to collapse
in build.prop?
Originally Posted by metalspring
Useful terminal emulator scripts run as superuser (su)
*Use swap partition without swapper2.
Add this script to the end of any file in the /etc/init.d folder. If you don't have one just run it in terminal emulator each reboot (or use the app script manager to make it run at boot. Script manager doesn't run continuously like swapper2)
swapon /dev/block/mmcblk0p3
And to turn swap off
swapoff /dev/block/mmcblk0p3
*Setting swappiness
Add or edit this line in the file etc/sysctl.config using whatever value you want, just keep the spaces (open in text editor)
vm.swappiness = 30
Or add this to the end of a script in init.d or run in terminal emulator
sysctl -w vm.swappiness=30
*Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
insmod /system/lib/modules/ext3.ko
Click to expand...
Click to collapse
Can i make 2 scripts in script manager that can do this? or are there any available? I know on such a low ram & low internal storage device, swap and apps2sdext would be INCREDIBLY useful.. any tips on making this permanent? If i can make a script in SM i know i can set it start at boot. But i wouldn't need to do that for a2sdext right? once that's set, it's set and needs no changes right?
Also, would you suggest a custom rom like steeldroid or would i be better off stripping out the crapware from the stock ota rom (froyo) and just flashing a better compatible kernel and using some tweaks & scripts to speed things up a bit and optimize them for his purposes.
Let me know what you think?
thanks!
Click to expand...
Click to collapse
to the first 4 yes, just add them to the build.prop and for the last ones you can either use script manager to make a new script in the folder /system/etc/init.d
if you dont have an init.d folder then you have to have script manager to run them at boot (i'd suggest having the scripts in /data) and for apps2sdext, i'd suggest using the app link2sd, its basically the only way to control moving apps to the sdcard ext
also the biggest help for low ram devices is v6 supercharger and all the other zeppelinrox scripts
http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021
and i'd highly highly suggest steeldroid 10, its what i currently run and most of the tweaks i have in this thread are already included in it
and btw if you didnt know, in order to use swap and link2sd you have to format your sdcard and repartition it, the easiest way is installing rom manager, flashing clockwork recovery and there should be an option to partition your sdcard in rom manager (it will erase everything on your sdcard so back everything up)
also i'm going to update this thread with more stuff i've found
updated and cleaned up op
awesome! thanks! yea i know about partitioning the sdcard. I use both swap and a2ext on my htc g2, but they are part of the kernel on the ROM i run, i've never used any other software to initiate them.
Thanks for the tips!
Also, how can ANYONE flash roms from XDA and NOT know about the AMAZING supercharger v6 script!
first of all I want to thank the OP! being how this is not my phone but my brothers. he wants me to root it and install a rom. this thread made everything a whole lot simple.
now to bug you guys.. where can I find a suitable system recovery apk for this phone? I have one installed but it never boots into recovery. also I haz steel droid 10 running.
Sent from my DROID X2 using XDA App
motrinHD said:
first of all I want to thank the OP! being how this is not my phone but my brothers. he wants me to root it and install a rom. this thread made everything a whole lot simple.
now to bug you guys.. where can I find a suitable system recovery apk for this phone? I have one installed but it never boots into recovery. also I haz steel droid 10 running.
Sent from my DROID X2 using XDA App
Click to expand...
Click to collapse
if you're talking about a droid 1 then the instructions to root should install a custom recovery
If you're talking about a droid x2 as your signature suggests then I'd say try looking on droidforums.net... They are more dedicated to the droid series of android phones and I know any Motorola phone other than the droid 1 is more complicated because of a locked bootloader
You can try downloading rom manager to flash a recovery for either phone I believe
Also if you are already rooted and think you have a working recovery then try installing android terminal emulator from the market and typing in
su
reboot recovery
metalspring said:
if you're talking about a droid 1 then the instructions to root should install a custom recovery
If you're talking about a droid x2 as your signature suggests then I'd say try looking on droidforums.net... They are more dedicated to the droid series of android phones and I know any Motorola phone other than the droid 1 is more complicated because of a locked bootloader
You can try downloading rom manager to flash a recovery for either phone I believe
Also if you are already rooted and think you have a working recovery then try installing android terminal emulator from the market and typing in
su
reboot recovery
Click to expand...
Click to collapse
I am talking about the droid 1. tho I spf'd to 2.2 I then went with the one click root method. and it placed a system recovery apk on my sd but I find that it does not work. I'm going to try that emulator thing you suggested
Sent from my DROID X2 using XDA App
metalspring said:
to the first 4 yes, just add them to the build.prop and for the last ones you can either use script manager to make a new script in the folder /system/etc/init.d
if you dont have an init.d folder then you have to have script manager to run them at boot (i'd suggest having the scripts in /data) and for apps2sdext, i'd suggest using the app link2sd, its basically the only way to control moving apps to the sdcard ext
also the biggest help for low ram devices is v6 supercharger and all the other zeppelinrox scripts
http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021
and i'd highly highly suggest steeldroid 10, its what i currently run and most of the tweaks i have in this thread are already included in it
and btw if you didnt know, in order to use swap and link2sd you have to format your sdcard and repartition it, the easiest way is installing rom manager, flashing clockwork recovery and there should be an option to partition your sdcard in rom manager (it will erase everything on your sdcard so back everything up)
also i'm going to update this thread with more stuff i've found
Click to expand...
Click to collapse
MS,
I have learned alot from your posts. Thanks for the time spent sharing them. A few questions.
You mention and I have noticed many of the tweaks are already incorporated into Steel Droid X. (I am currently running the rc1 version with the last Deprimed Kernel.) Am am liking it ALOT!!.
Is there anyway you could somehow put a denotion on the tweaks that are already included in SDX? I think it would be helpful, as I certainly would find it so.
How much of a effect did you find running v6 supercharger had given the other changes already in SDX? Any conflicts or issues running it with this ROM?
I am planning on partitioning my SD card as I would like to try the benefits of a swap partition. Upon checking my usage I am considering a 128mb. Seems like a safe size all around. Believe you have posted this somewhere as well? Card is a 32g class 4. I have never messed with running a swap. Currently, I have a standard single FAT32 format part. I have a number of programs already set as loaded on the SD card so I will have to move those back.
I believe SDX has apps2sdext already, correct?
From your post I take I still need links2sd to have the apps to go to that swap partition?
Is there a good link to info on the hows, workings, etc on the swap partition, apps works? I can search for one, only if you happen to have a link handy.
Thanks for all your help.
BE

[MOD](UPDATED) For those with battery issues

please dont forget to thank
loSconosciuto
ilcorsaronero
PureMotive
credits to loSconosciuto for modifying this mod to our galaxy sl and most especially to ilcorsaronero for the modification and for making the universal cwm flashable zip for our device
ilcorsaronero said:
Since noone was updating it, I provide a working flashable zip basing on this mod. There were more than one problem in the zip, but now I fixed them. Please report:
* if you notice a battery performance improvement
* how much is this improvement
* which MOD are you on
* which KERNEL are you on. This mod works only on init.d featured mod/kernels.
thanks.
Flash this through CWM recovery!
Click to expand...
Click to collapse
link to cwm flashable zip file
http://forum.xda-developers.com/showpost.php?p=25536103&postcount=27
original thread of this mod
credits to PureMotive
PureMotive said:
Okay guys, I just thought I'd give you my mod for achieving good-great battery life. This is the mod I use in Anthem™ which has given me 50+ hours on a single charge. Feel free to include it in your own ROM or whatever. Giving credit would be nice
First: Here is a flashable .zip of the mod that may or may not work with your ROM. I'd still advise doing it manually.
Sysctl.conf​
Step 1
Open up your ROM.zip (or whatever it's called) in 7zip (Windows) or Betterzip (OSX) and locate
sysctl.conf in /system/etc
If it's not in this directory, create it.
Step 2
In your sysctl.conf file, paste the following code and save it.
Code:
#sysctl.conf file
fs.nr_open=1053696;
fs.inotify.max_queued_events=32000;
fs.inotify.max_user_instances=256;
fs.inotify.max_user_watches=10240;
fs.lease-break-time=10;
fs.file-max=165164;
kernel.threads-max=525810;
kernel.random.write_wakeup_threshold=256;
kernel.random.read_wakeup_threshold=128;
kernel.panic=5;
kernel.sched_compat_yield=1;
kernel.panic=0;
kernel.panic_on_oops=1;
kernel.msgmni=2048;
kernel.msgmax=64000;
kernel.shmmni=4096;
kernel.shmall=2097152;
kernel.shmmax=268435456;
kernel.sem='500 512000 64 2048';
kernel.sched_features=24189;
kernel.hung_task_timeout_secs=30;
kernel.sched_latency_ns=18000000;
kernel.sched_min_granularity_ns=1500000;
kernel.sched_wakeup_granularity_ns=3000000;
kernel.sched_shares_ratelimit=256000;
kernel.sched_child_runs_first=0;
fs.lease-break-time=10;
fs.file-max=65536;
net.core.wmem_max=524288;
net.core.rmem_max=524288;
net.core.rmem_default=262144;
net.core.wmem_default=262144;
net.core.optmem_max=20480;
net.unix.max_dgram_qlen=50;
net.ipv4.tcp_keepalive_time=900;
net.ipv4.tcp_keepalive_probes=5;
net.ipv4.tcp_keepalive_intvl=156;
net.ipv4.tcp_timestamps=0;
net.ipv4.tcp_sack=1;
net.ipv4.tcp_fack=1;
net.ipv4.tcp_window_scaling=1;
net.ipv4.tcp_tw_recycle=1;
net.ipv4.tcp_tw_reuse=1;
net.ipv4.tcp_congestion_control=cubic;
net.ipv4.tcp_syncookies=1;
net.ipv4.conf.all.rp_filter=1;
net.ipv4.conf.default.rp_filter=1;
net.ipv4.tcp_synack_retries=2;
net.ipv4.tcp_syn_retries=2;
net.ipv4.tcp_max_syn_backlog=1024;
net.ipv4.tcp_max_tw_buckets=16384;
net.ipv4.icmp_echo_ignore_all=1;
net.ipv4.icmp_ignore_bogus_error_responses=1;
net.ipv4.tcp_no_metrics_save=1;
net.ipv4.tcp_fin_timeout=15;
net.ipv4.tcp_keepalive_intvl=30;
net.ipv4.tcp_keepalive_probes=5;
net.ipv4.tcp_keepalive_time=1800;
net.ipv4.ip_forward=0;
net.ipv4.conf.default.accept_source_route=0 ;
net.ipv4.conf.all.accept_source_route=0;
net.ipv4.conf.all.accept_redirects=0;
net.ipv4.conf.default.accept_redirects=0;
net.ipv4.conf.all.secure_redirects=0;
net.ipv4.conf.default.secure_redirects=0;
net.ipv4.udp_rmem_min=6144;
net.ipv4.udp_wmem_min=6144;
net.ipv4.tcp_rfc1337=1;
net.ipv4.ip_no_pmtu_disc=0;
net.ipv4.tcp_ecn=0;
net.ipv4.route.flush=1;
net.ipv4.tcp_rmem='6144 87380 524288';
net.ipv4.tcp_wmem='6144 87380 524288';
net.ipv6.conf.default.use_tempaddr=2;
net.ipv6.conf.all.use_tempaddr=2;
net.ipv6.conf.all.temp_prefered_lft=3600;
net.ipv6.conf.default.temp_prefered_lft=3600;
vm.dirty_ratio=90;
vm.dirty_background_ratio=80;
vm.oom_kill_allocating_task=1;
vm.overcommit_memory=1;
vm.page-cluster=3;
vm.drop_caches=3;
vm.min_free_kbytes=4096;
vm.panic_on_oom=0;
vm.dirty_expire_centisecs=1000;
vm.dirty_writeback_centisecs=2000;
vm.oom_kill_allocating_task=0;
vm.vfs_cache_pressure=10;
vm.min_free_order_shift=4;
vm.laptop_mode=0;
vm.block_dump=0;
Step 3
Now we need to enable it. So, navigate to /system/etc/init.d and create a file with the following code:
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
# Load /sys/etc/sysctl.conf
sysctl -p
sysctl -p is what initializes the code.
Just FYI: You don't actually need these lines:
Code:
# grep sysctl /etc/init.d/*
Code:
# Load /sys/etc/sysctl.conf
So this would have just sufficed.
Code:
#!/system/bin/sh
sysctl -p
If the above code does not work for any reason, try this:
Code:
#!/system/bin/sh
sysctl -p /system/etc/
Name your file something like this 10sysctl
Save your file.
NOTE: Your ROM must support init.d. You can do this by using dsixda's android kitchen
Step 4
Save your ROM and install it via recovery
OR
you could just push the files into your current ROM and try them out.
----------- For knowledge -----------​
Credits to imoseyon for portions of the info​
Ok, so what exactly is sysctl.conf?
The sysctl.conf is a configuration file for "sysctl" which is an interface for dynamically changing kernel parameters in the Linux OS. The configuration file contains the following elements, vm.min_free_kbytes, vm.dirty_ratio, vm.dirty_backgroud_ratio, vm.vfs_cache_pressure, vm.oom_kill_allocating_task. There are many other elements within the file, but we will be primarily focusing on these specifically (the vm prefix stands for virtual memory). The sysctl.conf file should be located in /etc (/system/etc) by default. To enable it you need your ROM to execute "sysctl -p" somewhere during the boot process (or shortly afterward). We will also be discussing how to enable it if it is not already done so. You can also run sysctl -p manually to enable it any time after the OS is started.
Now, let’s get down to what sysctl.conf does and how it works.
min free kbytes (vm.min_free_kbytes)
This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.
dirty ratio (vm.dirty_ratio) and dirty background ratio (vm.dirty_background_ratio)
This controls how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.
VFS Cache Pressure
Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.
oom allocating task (vm.oom_kill_allocating_task)(enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.)
This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.
block_dump (vm.block_dump)
This enables block I/O debugging when set to a nonzero value. If you want to find out which process caused the disk to spin up (see /proc/sys/vm/laptop_mode), you can gather information by setting the flag.
When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk needs to spin up, and to increase battery life even more. The output of block_dump is written to the kernel output, and it can be retrieved using "dmesg". When you use block_dump and your kernel logging level also includes kernel debugging messages, you probably want to turn off klogd, otherwise the output of block_dump will be logged, causing disk activity that is not normally there.
overcommit_memory (vm.overcommit_memory)
This controls overcommit of system memory, possibly allowing processes to allocate (but not use) more memory than is actually available.
0 - Heuristic overcommit handling. Obvious overcommits of address space are refused. Used for a typical system. It ensures a seriously wild allocation fails while allowing overcommit to reduce swap usage. root is allowed to allocate slighly more memory in this mode. This is the default.
1 - Always overcommit. Appropriate for some scientific applications.
2 - Don't overcommit. The total address space commit for the system is not permitted to exceed swap plus a configurable percentage (default is 50) of physical RAM. Depending on the percentage you use, in most situations this means a process will not be killed while attempting to use already-allocated memory but will receive errors on memory allocation as appropriate.
page-cluster (vm.page-cluster)
This controls the number of pages which are written to swap in a single attempt. The swap I/O size.
It is a logarithmic value - setting it to zero means "1 page", setting it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
The default value is three (eight pages at a time). There may be some small benefits in tuning this to a different value if your workload is swap-intensive.
panic_on_oom (vm.panic_on_oom)
This enables or disables panic on out-of-memory feature. If this is set to 1, the kernel panics when out-of-memory happens. If this is set to 0, the kernel will kill some rogue process, by calling oom_kill().
Usually, oom_killer can kill rogue processes and system will survive. If you want to panic the system rather than killing rogue processes, set this to 1.
The default value is 0.
Panic is a system error that is detected by the kernel.
dirty_expire_centisecs (vm.dirty_expire_centisecs)
How old "dirty" data should be before the kernel considers it old enough to be written to disk. It is expressed in 100ths of a second.
dirty_writeback_centisecs (vm.dirty_writeback_centisecs)
This is the interval of when the writeback daemons periodically wake up and write "old" data out to disk. It is expressed in 100ths of a second.
Click to expand...
Click to collapse
source:
http://forum.xda-developers.com/showthread.php?t=1621808
i use juice defender...with okayish usage, i got 3 days and 1 hour(1 time thing).....with my normal usage i get 24+ hours......
would have given this a try had there been just a .zip file
it comes with a zip file but flash at your own risk
Code:
http://www.androidfilehost.com/main/Incredible_Developers/PureMotive/Mods/Universal/Sysctl-conf.zip
i just saw this thread and see it really interesting as we all love longer battery life
it was classified as universal but i have not flashed file yet and am hoping first feedbacks about this from developers in our phone model
noypi_ako said:
it comes with a zip file but flash at your own risk
Code:
http://www.androidfilehost.com/main/Incredible_Developers/PureMotive/Mods/Universal/Sysctl-conf.zip
i just saw this thread and see it really interesting as we all love longer battery life
it was classified as universal but i have not flashed file yet and am hoping first feedbacks about this from developers in our phone model
Click to expand...
Click to collapse
I cannot flash it (status 0) in my MIUI 10.5...
tomjoad2 said:
I cannot flash it (status 0) in my MIUI 10.5...
Click to expand...
Click to collapse
Replace the meta-inf folder with the one in your rom zip file
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CleanKpu rom
I had problems installing the zip on UC kernel stock rom. Nonetheless the kind of hack proposed in this mod should work here as well. It makes sense. Is anyone able to fix it?
it was mentioned by the developer that the best to do it is manually
and that custom rom developers can implement it on their roms
Those having status 0 error: replace the meta-inf folder in the flashable zip with the one in your rom
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CleanKpu rom
bscraze said:
Those having status 0 error: replace the meta-inf folder in the flashable zip with the one in your rom
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CleanKpu rom
Click to expand...
Click to collapse
thanks...done, but now I get error (status 7)
tryng to do it manually
i think it would be best if we hear feedbacks first from our kernel/rom developers of i9003
Even though sysctl.conf accepts ";", it breaks the conf file and sysctl can't parse it.
Use this instead:
http://pastebin.com/raw.php?i=3tDgbmG3
EDIT:
This file is simply the one in the OP without ";".
FYI some of its values overwrite the values used by kernel developers.
EDIT 2:
And without single quotes.
loSconosciuto said:
Even though sysctl.conf accepts ";", it breaks the conf file and sysctl can't parse it.
Use this instead:
http://pastebin.com/raw.php?i=3tDgbmG3
Click to expand...
Click to collapse
Done manually... but when I try to review with sysctl -a| grep vm cannot see any changes
tomjoad2 said:
Done manually... but when I try to review with sysctl -a| grep vm cannot see any changes
Click to expand...
Click to collapse
Sorry, I didn't notice the single quotes in sysctl.conf
File updated (same link).
loSconosciuto said:
Sorry, I didn't notice the single quotes in sysctl.conf
File updated (same link).
Click to expand...
Click to collapse
Still nothing...maybe sysctl -p cannot activate the script...
tomjoad2 said:
Still nothing...maybe sysctl -p cannot activate the script...
Click to expand...
Click to collapse
deeper part of the first post
developer said if this dont work
Code:
#!/system/bin/sh
sysctl -p
then try this
Code:
#!/system/bin/sh
sysctl -p /system/etc/
tomjoad2 said:
Still nothing...maybe sysctl -p cannot activate the script...
Click to expand...
Click to collapse
It should work. Maybe you don't have /etc, but only /system/etc (/etc is just a symlink)
If you run
Code:
sysctl -p
you should get as output the content of sysctl.conf
If you get
Code:
sysctl: /etc/sysctl.conf: No such file or directory
Try with
Code:
sysctl -p /PATH/TO/THE/FILE/sysctl.conf
Where /PATH/TO/THE/FILE/ is, of course, the path to sysctl.conf,
noypi_ako said:
deeper part of the first post
developer said if this dont work
Code:
#!/system/bin/sh
sysctl -p
then try this
Code:
#!/system/bin/sh
sysctl -p /system/etc/
Click to expand...
Click to collapse
This is what I get
and when a write sysctl -p then ---> sysctl: short write
tomjoad2 said:
This is what I get
and when a write sysctl -p then ---> sysctl: short write
Click to expand...
Click to collapse
i believe loSconosciuto is highly qualified for this one
many thanks to him for looking into this mod
Code:
ls -l /proc/sys/net/ipv4/route/flush
--w------- 1 root root 0 Apr 28 14:26 /proc/sys/net/ipv4/route/flush
That means no one can read the content of this file, even 'root'. That's why you get
Code:
sysctl: error reading key 'net.ipv6.route.flush': Permission denied
sysctl: error reading key 'net.ipv4.route.flush': Permission denied
sysctl tries to read it, but it can't.
tomjoad2 said:
This is what I get
and when a write sysctl -p then ---> sysctl: short write
Click to expand...
Click to collapse
Are you sure your sysctl.conf is correct? Did you remove all the ";" and "'"?
loSconosciuto said:
Code:
ls -l /proc/sys/net/ipv4/route/flush
--w------- 1 root root 0 Apr 28 14:26 /proc/sys/net/ipv4/route/flush
That means no one can read the content of this file, even 'root'. That's why you get
Code:
sysctl: error reading key 'net.ipv6.route.flush': Permission denied
sysctl: error reading key 'net.ipv4.route.flush': Permission denied
sysctl tries to read it, but it can't.
Are you sure your sysctl.conf is correct? Did you remove all the ";" and "'"?
Click to expand...
Click to collapse
would it work if we chmod 644 those file?

[ROOT] SpeedUp My YT (for a faster Youtube)

There are quite a lot of users (especially in germany) who get very low download speeds at Youtube.
One solution might be to block several youtube IPs:
see here
So I created this app, which uses the iptables command to block those IP ranges.
It requires root to add blocked ips.
It may not work on your device. (Works on my Nexus 4 with latest ParanoidAndroid)
Just hit "Speed Up" once to add the IPs to the blocklist.
To undo hit "Undo" .
Let me know if you see a difference.
This is not permanent! A reboot will undo the changes.
For a permanent solution, check out this post by 5pace:
http://forum.xda-developers.com/showpost.php?p=40918388&postcount=4
-Cheers dak
You can do this in a terminal without the app aswell (this is what the app does):
switch to root, then:
"Speed Up" commands:
iptables -A INPUT -s 173.194.55.0/24 -j DROP
iptables -A INPUT -s 206.111.0.0/16 -j DROP
Undo commands:
iptables -D INPUT -s 173.194.55.0/24 -j DROP
iptables -D INPUT -s 206.111.0.0/16 -j DROP
List:
iptables -L INPUT -v -n | less
DOWNLOAD V1.01:
http://goo.gl/kXzFO
USE THIS AT YOUR OWN RISK ! The app has ZERO error handling and was coded in about 10 minutes.
Check out my other apps:
https://play.google.com/store/apps/developer?id=Stefan+Pledl
Awesome!
Tried it right now, works perfectly.
Had to restart to see the effect. Now Youtube seems to load a lot faster. Will report again after watching some videos.
Thank you a lot!
Some infos:
- Sony Xperia Z (Stock rooted)
- Tested with 3G and WiFi.
- Switzerland (Cablecom / Orange)
Thanks, but rebooting seems to undo the blocking.
Sometimes you just get lucky and get a faster download.
The init.d way
Well I already posted a 'init.d' method on Reddit, so I thought it would be just as good to share it here!
For all those rooted people out there, I created a init.d script to execute these commands at phone startup. The only pre-requisites are:
• A kernel with init.d support. (Not sure what it is? [Look for a folder called "init.d" inside "/system/etc/", if it is there you are good to go!]).
• Root Explorer
- Steps to follow:
• Download S99youtube from here: http://db.tt/hktE9rlr
• Copy over this file to "/system/etc/init.d/".
• Using any root explorer give it permissions like this: http://www.imgur.com/2GD5EGE.png
• Lastly again using Root Explorer change owner to to: http://www.imgur.com/VTGeaA3.png
• Reboot.
VOILA! No need to execute these commands after startup everytime or use any third-party app!
Click to expand...
Click to collapse
Added a link to your post in the OP.
Thanks for pointing it out!
Thanks
Used the init.d method works great. Thanks to both of you
Uploaded a minor update, which properly updates the displayed ips after adding them.
(new link in OP)

phh's SuperUser/ OpenSource SELinux-capable SuperUser

Hi,
IT MIGHT BRICK YOUR DEVICE.
Always ensure you have a way back.
Here is a thread about my fork of Koush's Superuser, to handle SELinux: https://github.com/seSuperuser/Superuser
So I would like your help to make this SuperUser a proud opensource SU app!
If you have an application that requires root, and which needs specific SELinux configuration please ask!
Build bot: https://superuser.phh.me/
Currently, four flavors of su are available on the build-bot:
- "eng" which puts "su" in permissive mode. This is the most compatible mode, but you should trust the apps you give root to. This does NOT put SELinux in permissive mode.
- "noverity" is eng and dm-verity disabled
- "nocrypt" is eng, dm-verity and dm-crypt disabled
- "user" is meant to give a safe su. su-apps won't be able to access to your Android Pay (for instance) informations, or keep persistent su access without your consent
Please note that user is in heavy development and isn't up to its promises at the moment.
I setup a build bot, which generates boot.img based on my solution, and pushes them to https://superuser.phh.me/
I did this build bot in a way so it is easy to add new ROMs, so don't hesitate asking for new ROM/devices support.
Supporting new devices might mean some additional work on http://github.com/seSuperuser/super-bootimg/ if they are using non-standard boot.img format, but the aim is to support as many devices as possible.
You need to install the APK from PlayStore afterwards: https://play.google.com/store/apps/details?id=me.phh.superuser
Bot-supported devices
Here are some devices, but there are many more !
- A *lot* of Archos devices
- All Nexus-es, including Pixel C (if some Nexus is missing, just ask!)
- nVidia Shield TV
- nVidia Shield Tablet
- Fairphone 2
update.zip format
The zip is available at https://superuser.phh.me/superuser.zip
It should be able to root any device supported by super-bootimg from TWRP (and possibly other custom recoverys)
You still need to install the APK afterwards. https://play.google.com/store/apps/details?id=me.phh.superuser https://f-droid.org/repository/brow...lob/master/known-imgs/nexus/hammerhead/MRA58N describes a firmware, nothing device-specific). This only requires to do some PRs to add a device, or on updated firmwares
- Testers
- UI designer: The current UI dates back from 4.1...? It is really ugly and not really usable.
- Testers
- Root-related devs: SELinux policies are still being written
- Testers
- Security reviewers
- Testers
Bug report
If some app doesn't work, please ask me, not the dev.
I consider I have to fix support for other apps, not the other way around.
ChangeLog
2016-01-31 r170: superuser.zip can be included in other update.zip
2016-01-27 r166: Add support for Viper4Android
2016-01-15 r162: Add su --bind and su --init commands
2016-01-10 r154: Files are no longer copied multiple times. Fixes MultiROM, and multiple install for update.
2016-01-06 r152: Fix support for ChromeOS-like format (Pixel C)
2016-01-01 r144: Detect chromeos-style signature, and don't try to resign it in that case
2015-12-30 r143: Improved compatibility with apps.
2015-12-28 r142: Changed naming convention to include device name and release
2015-12-28: Added "nocrypt" target
2015-12-13: Added "noverity" target to buildbot
2015-12-13: Add options for noencrypt, noverity
2015-12-03: Fix TitaniumBackup
2015-11-24: mount --bind to /system/xbin/su if it exists to override ROM's su
2015-11-23: Fix CF.Lumen
2015-11-14: Add super-bootimg's version in boot.img, several network/firewall-related permissions
2015-11-11: Access to Android's services
2015-11-10: Recursive su access
2015-11-09: Fix pm disable command
Do you mean that latest galaxy s5 neo sm-g903f might be rooted soon ?
(Exynos5 & Mali T-720)
It seems like many people still haven't understood the purpose of apps like SuperSu and Superuser. They are no exploits and don't gain your root access. What they do is they manage the root access and enable you to select which apps to grant root access, otherwise every single application on your device would have it. They are root managers. So this project won't help you in getting root for your device as long as there's no method (exploit) to gain it.
Not much activity here, but a lot on my side.
Android 6.0 is now out, with its new SELinux policy, which makes it impossible to update the policy after the boot, and dm-verity becomes mandatory (so no /system change without boot.img)
I'm thus totally retargetting my work:
- I've created https://github.com/phhusson/super-bootimg which will edit boot.img (the complicated part, because it needs A LOT of testing across many devices)
- change sepolicy
- Add su in /sbin/su
- Enable su daemon
With various options to disable dm-verity, encryption, etc. (please note that this is NOT required, since only boot.img is changed)
dude - you should kickstarter this. SuperSu is pretty much a mandatory install for every rooted device. this is big for the XDA community and we would love to support you.
Cannot express enough how much i want this project to succeed
And, at least for myself
"I also wonder about displaying an user-understandable SELinux policy, so that root applications can be "more secure
Would anyone be interested in such a feature?"
......Hell yeah, that most certainly does interest me.........controllable levels of su right?
Obviously, if its possible to do........even if android denies this possibility, an open source su is most assuredly welcome from this neck of the woods
I wish this project major luck
Edit
"(I'm thinking that I'm trying to be even more secure than "standard" non-rooted ROMs, that's perhaps a bit optimistic.)"
I love that mentality, and im enjoying immensley your discussions on github with lbdroid........i love that your taking security more seriously then most...love where your coming from on this.....major props
To better test on shell of recovery without making an update.zip , I modified the sepolicy-inject.c so that the usage() no longer blocks the "booting.sh"
on sepolicy-inject.c:377, insert a line "if ( NULL == optarg ) break;", as in my shell there will be a parameter value with null on last entry of "char** arguv", which will trigger the default switching case and exit the sepolicy-inject unexpectedly.
......
while ((ch = getopt_long(argc, argv, "a:f:g:s:t:c:Z:z:n", long_options, NULL)) != -1) {
if ( NULL == optarg ) break;
switch (ch) {
......
kennylam said:
To better test on shell of recovery without making an update.zip , I modified the sepolicy-inject.c so that the usage() no longer blocks the "booting.sh"
on sepolicy-inject.c:377, insert a line "if ( NULL == optarg ) break;", as in my shell there will be a parameter value with null on last entry of "char** arguv", which will trigger the default switching case and exit the sepolicy-inject unexpectedly.
......
while ((ch = getopt_long(argc, argv, "a:f:g:s:t:c:Z:z:n", long_options, NULL)) != -1) {
if ( NULL == optarg ) break;
switch (ch) {
......
Click to expand...
Click to collapse
I'm not sure I understand...
When calling what command do you need this?
phhusson said:
Hi,
IT MIGHT BRICK YOUR DEVICE.
Always ensure you have a way back.
I'm the author of a fork of Koush's Superuser, to handle SELinux: https://github.com/phhusson/Superuser
It is in early-stage, but thanks to recent events related to SuperSU, it got some spotlight.
So I would like your help to make this SuperUser a proud opensource SU app!
I have mostly two sides of things left to do:
- Device compatiblity/update.zip
- Application compatbility
I've tested my Superuser on Qualcomm/CAF 5.1 devices, on MTK 5.1 devices, on CAF 6.0, on Nexus 5/9 6.0, and I believe it should work on most devices which are close enough to AOSP.
I have missing steps to be compatible with SuperSU (see https://github.com/phhusson/Superuser#todo-list ).
I'd like to have feedback from app developers about which features they need the most.
If you have an application that requires root, and which needs specific SELinux configuration please ask!
There are main two types of builds, and some sub-types in it:
- @doitright did an integration in an AOSP tree, to make it suitable for ROM integration, https://github.com/lbdroid/AOSP-SU-PATCH/
- I did http://github.com/phhusson/super-bootimg/ which integrates su in a binary boot.img, and outputs a root-ed boot.img
@doitright's source solution currently has one SELinux policy, which is fully enforcing, and currently works in most cases.
My solution currently has two different policies, one which has su permissive, meaning it can do anything, which is not as safe as source-based s solution, and one which is WIP (basically unusable, because almost nothing is allowed to root).
I setup a build bot, which generates boot.img based on my solution, and pushes them to https://superuser.phh.me/
I did this build bot in a way so it is easy to add new ROMs, so don't hesitate asking for new ROM/devices support.
Supporting new devices might mean some additional work on http://github.com/phhusson/super-bootimg/ if they are using non-standard boot.img format, but the aim is to support as many devices as possible.
The plan is to have a third method for rooting:
super-bootimg will work from a recovery, so that you can root any ROM from recovery.
Thanks !
Click to expand...
Click to collapse
my question is how to change a file label to u: object_r:system_file:s0
i modify system.img to add some additional apps into /system/app/ directory i did modification then build a new system.img after flashing phone with new system.img the app was appear in menu but once i am trying to open it gives me error (com.xxxxxx.andriod) stopped working then i execute ls -Z command in /system/app/ directory to see the different and i realize that the new app i copied in system/app/ directory it has a different label than others
so i tried to change .apk file label to (u: object_r:system_file:s0) using chcon command but failed
chcon: Could not label u: object_r:system_file:s0
can you please guide me how to do it ?
zameer_yus said:
my question is how to change a file label to u: object_r:system_file:s0
i modify system.img to add some additional apps into /system/app/ directory i did modification then build a new system.img after flashing phone with new system.img the app was appear in menu but once i am trying to open it gives me error (com.xxxxxx.andriod) stopped working then i execute ls -Z command in /system/app/ directory to see the different and i realize that the new app i copied in system/app/ directory it has a different label than others
so i tried to change .apk file label to (u: object_r:system_file:s0) using chcon command but failed
chcon: Could not label u: object_r:system_file:s0
can you please guide me how to do it ?
Click to expand...
Click to collapse
Can you check in audit log?
How did you put the file?
Don't you have any other message?
Maybe in your intro you can eloborate on the naming convention of your bot built .img’s?
one which has su permissive (power?), meaning it can do anything, which is not as safe as source-based s solution (user?), and one which is WIP (eng?)
Your HTTPS link to superuser.phh.me is refusing connections?:
This webpage is not available
ERR_CONNECTION_REFUSED
ReloadHide details
Google Chrome's connection attempt to superuser.phh.me was rejected. The website may be down, or your network may not be properly configured.
Check your Internet connection
Check any cables and reboot any routers, modems, or other network devices you may be using.
Allow Chrome to access the network in your firewall or antivirus settings.
If it is already listed as a program allowed to access the network, try removing it from the list and adding it again.
If you use a proxy server...
Check your proxy settings or contact your network administrator to make sure the proxy server is working.
If I do a flash-all.sh of mra58r, reboot to bootloader, fastboot flash boot your-boot.img, would you expect this to boot fine?
Can you detail which phones can take a custom keystore?
For https, I know it is a must, but i'm waiting for let's encrypt.
For naming convention, I have to rethink those, and i'll update first post.
Anyway it's user < power < eng.
User has only safe permissions, power has all known permissions, eng is permissive. There is nothing source based.
For custom keystore, at the moment I have only seen CAF 5.1/6.0 bootloader with verity enabled to work, and it doesn't display key ID, so it is useless everywhere.
I should get a hand on a Nexus 5X soon, to test properly and get screenshots if it works as advertised.
For your last question, yes. I always work with factory image's partitions, and only change boot.img
I welcome any suggestion about naming convention.
Some times I dont know where to post, here or the Nexus 6 doitright thread. Anyway, I found this interesting.
http://events.linuxfoundation.org/sites/events/files/slides/ABS Lollipop MR1 Verified Boot.pdf
"• We relax some security policies in eng/userdebug loaders to make life less annoying for development • Persistent Data Block ignored, device always unlockable"
If this is true of the boot.img's you build, the only one we could trust is user or are they talking bootloader? Maybe the factory bootloader (user) that google is distributing does not have the verification functionality? Is the bootloader AOSP? If so, what would prevent someone from creating a bootloader, boot.img and /system that circumvents all the verification?
I used your bot built mra58r.
Unfortunately, if forced encryption is on, local.prop does not get parsed and I dont get my custom LCD. This means unless you offer variants of the auto built boot.img with forced encryption off or the ability to pass a noencrypt parameter to the update.zip or build.sh for modifying fstab, I will be forced to modify source and build myself. As for mount -o bind /data/local/tmp/hosts /system/etc, as long as the custom hosts has chcon ubject_r:system_file:s0, things work great.
I still like idea of having the ability to establish a trust between boot.img and a config file in /data/ that do things like custom hosts file, lcd density, iptables (one of my favorites: iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to 8.8.8.8:53; iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to 8.8.8.8:53)
havealoha said:
Some times I dont know where to post, here or the Nexus 6 doitright thread. Anyway, I found this interesting.
http://events.linuxfoundation.org/sites/events/files/slides/ABS Lollipop MR1 Verified Boot.pdf
"• We relax some security policies in eng/userdebug loaders to make life less annoying for development • Persistent Data Block ignored, device always unlockable"
If this is true of the boot.img's you build, the only one we could trust is user or are they talking bootloader? Maybe the factory bootloader (user) that google is distributing does not have the verification functionality? Is the bootloader AOSP? If so, what would prevent someone from creating a bootloader, boot.img and /system that circumvents all the verification?
Click to expand...
Click to collapse
They are talking about the bootloader, but as it is built in the Android build system, they are using Android build system flags.
I know the Nexus 6/9 doesn't have this functionnality. I'm waiting to get a Nexus 5X in my hands to say for 5X/6P.
Either way, we can't circumvent the verification, all we can do is have a YELLOW state instead of ORANGE, which displays the fingerprint of the keystore.
I forgot this presentation from Intel, so I thought I'd give it a try on Nexus Player. Intel has a proper implementation of the bootloader of Google's recommendation, it sounds logical the Nexus Player would implement it.
Oh wait. Google's logic striked again. No they didn't implement it on Nexus Player.
There is no AOSP bootloader... Or there are three (there are two LK and one u-boot), but neither of them are supported, and neither of them support the different verified boot states.
CAF bootloader handles the four states, but doesn't display them. Thanks to you I checked Intel reference bootloader, and it DOES implement the full spec \o/. Though I have no device to test. But basically, there is no opensource arm bootloader implementing it, and that makes me rant a lot against Google.
havealoha said:
I used your bot built mra58r.
Unfortunately, if forced encryption is on, local.prop does not get parsed and I dont get my custom LCD. This means unless you offer variants of the auto built boot.img with forced encryption off or the ability to pass a noencrypt parameter to the update.zip or build.sh for modifying fstab, I will be forced to modify source and build myself. As for mount -o bind /data/local/tmp/hosts /system/etc, as long as the custom hosts has chcon ubject_r:system_file:s0, things work great.
Click to expand...
Click to collapse
Two sides:
1. For LCD density, have you tried just doing adb shell wm density? Possibly it doesn't even break SafeNet
2. My plan on the matter is to keep my current builds as is, but add a configuration file, and when I'll make an update.zip, the user will be able to change the config file directly in the update.zip
I still like idea of having the ability to establish a trust between boot.img and a config file in /data/ that do things like custom hosts file, lcd density, iptables (one of my favorites: iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to 8.8.8.8:53; iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to 8.8.8.8:53)
Click to expand...
Click to collapse
Well for iptables, I put it in standard su permission. Well ATM because of some bugs it's only in "power", but I expect it to get into "user" when a bug concerning pts is fixed.
phhusson said:
Two sides:
1. For LCD density, have you tried just doing adb shell wm density? Possibly it doesn't even break SafeNet
Click to expand...
Click to collapse
Yay! As su in Terminal Emulator, wm density 360 worked. The launcher didn't work until #am start -c android.intent.category.HOME -a android.intent.action.MAIN and other apps also needed to be killed before they would display at the new density like lock screen and existing notifications. There are a few issues with the status bar and nav buttons depending on what app you try to run. I assume that if you set this early enough with a hook from init.rc, (nudge nudge) say a trusted file from /data/ that there would be no problem.
LCD density set from setprop, local.prop and wm density all break SafeNet. Even worse, SafeNet now checks /sbin/ for su, requiring a mount bind to a copy of sbin without su. Next thing you know, it will check for bind mounts!
How about a build of SuperSU, su in a random directory with random names? I know, name it the hash of boot.img or the public key from the user generated keystore.
Dont read on, I fixed it , the /data/setlcd.sh 560 needed quotes around it.
I created a Terminal Emulator widget in an attempt to make it easy to switch between resolutions. Interestingly, when set with #wm density 360 and then #am restart, the density sticks across reboots, I was not expecting that!
Ive tried the widget with different combinations of explicit paths for su with options like --context and -c with wm density and am restart and even with a /data/setlcd.sh that is chmod 750 and chcon ubject_r:system_file:s0. Any tricks to accomplish this? I would expect the widget to prompt for root permission and then run my setlcd.sh taking the DPI as argument $1 I am envisioning one main .sh that has a function for each of my customizations, wm density, hosts, iptables and mount bind to a /sbin that has no su. I dont want to keep building boot.img's with special init.rc's.
The closest I have gotten is a widget with command /sbin/su with the arguments -c /data/setlcd.sh 560
This results in a terminal launching that asks for su permission and then:
$"/sbin/su" -c /data/setlcd.sh 560
sh: /data/setlcd.sh: can't execute: Permission denied
nothing in dmesg
Click to expand...
Click to collapse
So I made a test of verified boot feature here: http://forum.xda-developers.com/and...rified-boot-disk-encryption-testings-t3248161
The tl;dr is that verified boot is IMO a great feature of 5X/6P, and we have to find a way to have su enabled with this feature.
But this requires to have working OTA.
I have finally gotten the functionality I need with the exception of iptables which I understand you are working on adding. I am testing with shamu mra58r and the boot-su-power.img.
Here is my setup that features:
custom hosts file for browsing without advertisements
set the LCD density to tablet mode
quickly disable su and revert density when I want to use Android Pay
As root, I created a script in /data/android.sh and set the context to system via chcon ubject_r:system_file:s0 and chmod 700 here are its contents:
Code:
#!/system/bin/sh
#bind mounts transcend am restarts
#wm density transcends reboots
function lcd
{
/system/bin/wm density $density
/system/bin/sleep 3
/system/bin/am restart
}
function hosts
{
mount -o bind /data/hosts /system/etc/hosts
}
function nosu
{
/system/bin/wm density 560
cp /sbin /data/sbin -r
rm -f /data/sbin/su
mount -o bind /data/sbin /sbin
/system/bin/am restart
}
function dns
{
#not working yet in phh
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to 8.8.8.8:53
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to 8.8.8.8:53
}
density=$2
case "$1" in
lcd) lcd ;;
hosts) hosts ;;
nosu) nosu ;;
dns) dns ;;
esac
The hosts file was copied from http://winhelp2002.mvps.org/hosts.txt and placed in /data, its context was also set chcon ubject_r:system_file:s0 and chmod 644. The local host entries were modified to match those found in /system/etc/hosts. It was important that the contents of this file were terminated on each line and with a blank line at the end.
The tricky part was creating launchers on a home screen using the Terminal Emulator Widget. It seemed that you could not just type in /sbin/su, instead you had to browse to it. Screenshot of widget config attached.
I learned a few interesting things during testing.
Using a /data/local.prop with an encrypted disk resulted in the local.prop not being read during init.
Once wm density is set, it is persistent.
Using mount -o bind gives persistent mounts if you reboot using am restart from the terminal
SafetyNet now checks for su in /sbin
SafetyNet for AndroidPay checks for LCD density regardless of setting it via local.prop (if unencrypted), setprop or wm density
This will be easy for me to reproduce across all my devices without granting persistent root to any app and without adding any app but superuser and terminal emulator.
Thanks for your test! It's really interesting.
You must be the first user of something other than eng
iptables does work for me (in adb shell). Looking back, it should have been fixed by https://github.com/phhusson/super-bootimg/commit/31d3a635eea4fe66071346e05913acfb00d60144
That made me realize that if I don't do releases, I still need to know what users are using, so I added /super-bootimg which contains the git version of super-bootimg repo
For local.prop I'm happy to see you don't need it. I really feel like user shouldn't be allowed to change it (but I'm thinking only about some properties which are in /default.prop so it can't be overriden. perhaps local.prop is safe enough)
am restart is not a reboot, so it's normal mount bind stays
I think you could just mount bind an empty folder to /sbin. The only risks are if adbd/ueventd/watchdogd/healthd restarts, but they shouldn't
Any idea why busybox nslookup is not working?
[email protected]:/data # ls -Z nslookup busybox-android.bin
lrwxrwxrwx root root ubject_r:system_data_file:s0 nslookup -> busybox-android.bin
-rwxr-xr-x root shell ubject_r:system_file:s0 busybox-android.bin
[email protected]:/data # ./nslookup superuser.phh.me 8.8.8.8
Server: 8.8.8.8
Address 1: 8.8.8.8
nslookup: can't resolve 'superuser.phh.me'
1|[email protected]:/data # dmesg
[39764.686702] healthd: battery l=91 v=4144 t=28.1 h=2 st=3 c=-439 chg=
[email protected]:/data #

Categories

Resources