TL; DR HydrogenOS, OxygenOS, LineageOS and most of custom ROMs for oneplus3 has ifaa and soter binary blobs for fingerprint/iris authorization which is used for confirm payment in Alipay and WeChat Pay the most popular mobile payment Apps in mainland China, in case you don't use them, just want to get rid of them, or having privacy or security concern, you can just flash this zip in TWRP to deblob them (require firmware OxygenOS 9.0.2+, system-as-root). You probably need to flash it along with your ROM each time you install a new ROM or update existing one.
IFAA is used by Alipay, Tencent soter is used in WeChat Pay.
Those blobs and proprietary files (including IFAAService and SoterService apk) are used for biometric authentication during confirm payment in Alipay and WeChat Pay (usually by touching fingerprint censor to avoid typing password each time during confirm payment, they are disabled by default in those Apps and password authentication works without them)
This zip remove binary blobs alipay.* and soter.* from modem partition (which comes from NON-HLOS.bin the FAT filesystem image in official OxygenOS zip), IFAAService and SoterService apk and related proprietary libraries.
IFAA Manager (org.ifaa.android.manager) is open source, this zip does not remove IFAA Manager because it's probably included in BOOTCLASSPATH and removing them will cause lags on app start. You may ask ROM maintainers to remove them at compile time to remove them.
faceapp.* in modem and vendor/lib/libmmcamera_facedetection_lib.so in system also looks suspicious, but this zip does not remove it. You can edit it to suit your needs.
Tested on firmware from OxygenOS 9.0.6, LineageOS 17.1 (unofficial), TWRP 3.3.1-0
META-INF/com/google/android/updater-script
Code:
assert(getprop("ro.product.device") == "OnePlus3" || getprop("ro.build.product") == "OnePlus3" ||
getprop("ro.product.device") == "oneplus3" || getprop("ro.build.product") == "oneplus3" ||
getprop("ro.product.device") == "OnePlus3T" || getprop("ro.build.product") == "OnePlus3T" ||
getprop("ro.product.device") == "oneplus3t" || getprop("ro.build.product") == "oneplus3t" || abort("E3004: This package is for device: OnePlus3,oneplus3,OnePlus3T,oneplus3t; this device is " + getprop("ro.product.device") + "."););
assert(op3.verify_modem("2019-05-11 00:00:51") == "1" || abort("This package is for modem firmware from OxygenOS 9.0.2 or newer"););
ui_print(" ");
ui_print("## Deblob alipay ifaa and tencent soter ##");
ui_print("## for OnePlus 3 and OnePlus 3T ##");
ui_print("## this won't remove org.ifaa.android.manager ##");
ui_print("## because it's may included in BOOTCLASSPATH ##");
ui_print("Mounting system and modem...");
run_program("/sbin/toybox", "mount", "/system");
run_program("/sbin/toybox", "mount", "/dev/block/by-name/modem", "/system/system/vendor/firmware_mnt");
ui_print("Deblob alipay from modem...");
delete("/system/system/vendor/firmware_mnt/image/alipay.b00");
delete("/system/system/vendor/firmware_mnt/image/alipay.b01");
delete("/system/system/vendor/firmware_mnt/image/alipay.b02");
delete("/system/system/vendor/firmware_mnt/image/alipay.b03");
delete("/system/system/vendor/firmware_mnt/image/alipay.b04");
delete("/system/system/vendor/firmware_mnt/image/alipay.b05");
delete("/system/system/vendor/firmware_mnt/image/alipay.b06");
delete("/system/system/vendor/firmware_mnt/image/alipay.mdt");
ui_print("Deblob soter from modem...");
delete("/system/system/vendor/firmware_mnt/image/soter64.b00");
delete("/system/system/vendor/firmware_mnt/image/soter64.b01");
delete("/system/system/vendor/firmware_mnt/image/soter64.b02");
delete("/system/system/vendor/firmware_mnt/image/soter64.b03");
delete("/system/system/vendor/firmware_mnt/image/soter64.b04");
delete("/system/system/vendor/firmware_mnt/image/soter64.b05");
delete("/system/system/vendor/firmware_mnt/image/soter64.b06");
delete("/system/system/vendor/firmware_mnt/image/soter64.mdt");
ui_print("Remove proprietary files of ifaa from system...");
delete_recursive("/system/system/priv-app/IFAAService");
delete("/system/system/lib64/[email protected]");
delete("/system/system/vendor/bin/hw/[email protected]");
delete("/system/system/vendor/etc/init/[email protected]");
## removing org.ifaa.android.manager will cause lags on app start if it's included in BOOTCLASSPATH
# run_program("/sbin/sed", "-i", "s#:/system/framework/org.ifaa.android.manager.jar##", "/system/init.environ.rc");
# delete("/system/system/framework/org.ifaa.android.manager.jar");
# delete("/system/system/framework/boot-org.ifaa.android.manager.vdex");
# delete("/system/system/framework/arm/boot-org.ifaa.android.manager.art");
# delete("/system/system/framework/arm/boot-org.ifaa.android.manager.oat");
# delete("/system/system/framework/arm/boot-org.ifaa.android.manager.vdex");
# delete("/system/system/framework/arm64/boot-org.ifaa.android.manager.art");
# delete("/system/system/framework/arm64/boot-org.ifaa.android.manager.oat");
# delete("/system/system/framework/arm64/boot-org.ifaa.android.manager.vdex");
ui_print("Remove proprietary files of soter from system...");
delete_recursive("/system/system/app/SoterService");
delete("/system/system/vendor/bin/hw/[email protected]");
delete("/system/system/vendor/etc/init/[email protected]");
delete("/system/system/vendor/lib64/hw/[email protected]");
delete("/system/system/vendor/lib64/[email protected]");
show_progress(1, 5);
ui_print("Unmounting...");
run_program("/sbin/toybox", "umount", "/system/system/vendor/firmware_mnt");
run_program("/sbin/toybox", "umount", "/system");
ui_print("## Finished deblob alipay ifaa and soter ##");
ui_print(" ");
To check if you have successfully deblob and removed these files, just check if these files are been removed in any file manager with root on Android, or run the following command in a Terminal Emulator App or adb and check the output.
Code:
OnePlus3:/ # find /system -iname "*ifaa*"
/system/framework/arm64/boot-org.ifaa.android.manager.art
/system/framework/arm64/boot-org.ifaa.android.manager.oat
/system/framework/arm64/boot-org.ifaa.android.manager.vdex
/system/framework/org.ifaa.android.manager.jar
/system/framework/arm/boot-org.ifaa.android.manager.art
/system/framework/arm/boot-org.ifaa.android.manager.oat
/system/framework/arm/boot-org.ifaa.android.manager.vdex
/system/framework/boot-org.ifaa.android.manager.vdex
OnePlus3:/ # find /system -iname "*soter*"
OnePlus3:/ #
UPDATE:
Rewrote the post to reduce the mess. Thanks @nvertigo67 for pointing out BOOTCLASSPATH and performance drop issue when ifaa manager was removed.
This is a good idea!
Just some notes:
It only works for system-as-root roms (most - if not all - android 10 source build roms), for all other roms (oos and most - if not all - android 9 and below source build roms) you need to replace "system/system" by "system". For my taste it would be easier to use a shell script instead of the edify interpreter. To tell sar roms from non-sar roms you can use something like this:
Code:
#!/sbin/sh
OUTPUT=/proc/self/fd/$2;
ui_print() {
until [ ! "$1" ]; do
echo -e "ui_print $1\nui_print" >$OUTPUT;
shift;
done;
}
ui_print "***********************************";
ui_print "Settting ";
ui_print "ro.build.version.security_patch to ";
ui_print "2019-04-01 matching OOS 9.0.2";
ui_print "build fingerprint";
ui_print "(c) 2019 [email protected] ";
ui_print "***********************************";
ui_print "mount system";
system_mounted=$(mount | grep "system")
if [ -z "$system_mounted" ]; then
mount -o rw /system;
else
umount /system;
mount -o rw /system;
fi
if [ -e /system/build.prop ]; then
PROPFILE=/system/build.prop
ui_print "using /system/build.prop";
else
if [ -e /system/system/build.prop ]; then
PROPFILE=/system/system/build.prop
ui_print "using /system/system/build.prop";
else
ui_print "Can't locate the build.prop file,";
ui_print "nothing will be changed!";
ui_print "unmounting system";
umount_msg=$(umount /system 2>&1);
if [ -z "$umount_msg" ]; then
ui_print "system unmounted";
else
ui_print "$umount_msg";
fi
exit 1;
fi
fi
Instead of PROPFILE set SYSTEM_PATH to /system/system or /system accordingly, before mounting firmware_mnt, then you can throw away the not needed files with
Code:
find $SYSTEM_PATH -iname \*ifaa\* -o -iname \*soter\* -o -iname \*alipay\* |xargs rm -rf
For some source build roms (at least for all los-16.0 and los-17.1 based roms) deleting the mentioned files is only the first part of the job. The second part is removing "/system/framework/org.ifaa.android.manager.jar:" from "BOOTCLASSPATH" in /init.environ.rc (for non-sar roms; probably /system/init.environ.rc for sar roms). Otherwise boot.art can't be assemled on boot time. The rom works without boot.art in image-less mode, but this is significantly slower causing lags on app start, unlock and many more actions as e.g. opening of Settings.
I guess this is easy for sar roms (just sed /system/init.environ.rc) but is ugly for non-sar roms: you need to unpack the ramdisk from the boot partition change init.environ.rc repack the boot image, resign (for locked bootloaders) and reflash it to the boot partition.
For extracting, changing init.environ.rc and reflashing the boot image you can use @osm0sis' anykernel3 templates (https://forum.xda-developers.com/showthread.php?t=2670512 ); for resigning you may want to use @Chainfire's VerifiedBootSigner (https://forum.xda-developers.com/an...signing-boot-images-android-verified-t3600606 ). I've made one, which uses the oneplus bootloader required aosp keys: https://forum.xda-developers.com/showpost.php?p=78433989&postcount=4
There's also some more cosmetics: to completely remove all traces of ifaa, soter and alipay, from the build I've needed these commits:
https://github.com/nvertigo/android...mmit/2ab32d492f0b8d109b503c86208394c8fa5e7486
https://github.com/nvertigo/proprie...mmit/99a6fdf5dbbc8f5f7a9d2ccf43d139b5eecc08d5
Hope this helps making a final zip.
Johan2020 said:
Could you already share your zip?
I tried the same but ended with a rom which was much slower as mentioned in the link above. Probably the environment.rc issue (luisrom btw, so based on Lineage 17)
Click to expand...
Click to collapse
I've not decided which way to go, so I've no zip currently. For testing I've made a build with the mentioned commits and deleted the fw stuff manually with find and xargs.
On los17 (sar) you should be able to locate init.environ.rc and delete the boot jar entry manually.
Phaech4x said:
Alipay and WeChat Pay works without these stuff but you can use fingerprint payment when you have them (by press on fingerprint censor to confirm a payment instead of typing password).
Click to expand...
Click to collapse
Can somebody confirm the validity of this information, please? With the op-mentioned files removed only the fingerprint authorized payment is lost, but Alipay and WeChatPay is still working with apps installed from playstore.
Thanx in advance.
nvertigo67 said:
I've not decided which way to go, so I've no zip currently. For testing I've made a build with the mentioned commits and deleted the fw stuff manually with find and xargs.
On los17 (sar) you should be able to locate init.environ.rc and delete the boot jar entry manually.
Click to expand...
Click to collapse
I have made a little script to remove some stuff after flashing and it seems this is doing the job, though performance is still dropping, even with modified /system/init.environ.rc.
Since I have limited Android background knowledge, I have no idea where to search to get an idea where the performance drop is coming from.
This is the script:
Code:
# First mount firmware_mnt
mount /dev/block/by-name/modem /system/system/vendor/firmware_mnt
# Remove all files with ifaa, soter and alipay
bloblist="
/system/system/framework/arm/boot-org.ifaa.android.manager.art
/system/system/framework/arm/boot-org.ifaa.android.manager.oat
/system/system/framework/arm/boot-org.ifaa.android.manager.vdex
/system/system/framework/arm64/boot-org.ifaa.android.manager.art
/system/system/framework/arm64/boot-org.ifaa.android.manager.oat
/system/system/framework/arm64/boot-org.ifaa.android.manager.vdex
/system/system/framework/boot-org.ifaa.android.manager.vdex
/system/system/framework/org.ifaa.android.manager.jar
/system/system/lib64/[email protected]
/system/system/vendor/bin/hw/[email protected]
/system/system/vendor/bin/hw/[email protected]
/system/system/vendor/etc/init/[email protected]
/system/system/vendor/etc/init/[email protected]
/system/system/vendor/firmware_mnt/image/alipay.b00
/system/system/vendor/firmware_mnt/image/alipay.b01
/system/system/vendor/firmware_mnt/image/alipay.b02
/system/system/vendor/firmware_mnt/image/alipay.b03
/system/system/vendor/firmware_mnt/image/alipay.b04
/system/system/vendor/firmware_mnt/image/alipay.b05
/system/system/vendor/firmware_mnt/image/alipay.b06
/system/system/vendor/firmware_mnt/image/alipay.mdt
/system/system/vendor/firmware_mnt/image/soter64.b00
/system/system/vendor/firmware_mnt/image/soter64.b01
/system/system/vendor/firmware_mnt/image/soter64.b02
/system/system/vendor/firmware_mnt/image/soter64.b03
/system/system/vendor/firmware_mnt/image/soter64.b04
/system/system/vendor/firmware_mnt/image/soter64.b05
/system/system/vendor/firmware_mnt/image/soter64.b06
/system/system/vendor/firmware_mnt/image/soter64.mdt
/system/system/vendor/lib64/hw/[email protected]
/system/system/vendor/lib64/[email protected]
"
for blobname in $bloblist
do
if [ -d "$blobname" ]; then
chmod -R 777 "$blobname" 2>/dev/null
rm -rf "${blobname:?}"/* 2>/dev/null
else
chmod 777 "$blobname" 2>/dev/null
rm -f "$blobname" 2>/dev/null
fi
done
# Remove org.ifaa.android.manager.jar from environ.rc
sed -i 's/:\/system\/framework\/org.ifaa.android.manager.jar//' /system/init.environ.rc
umount /system/system/vendor/firmware_mnt
And this is init.environ.rc after using sed (org.ifaa.android.manager.jar removed):
Code:
# set up the global environment
on early-init
export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
export ANDROID_STORAGE /storage
export ANDROID_RUNTIME_ROOT /apex/com.android.runtime
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
export EXTERNAL_STORAGE /sdcard
export ASEC_MOUNTPOINT /mnt/asec
export BOOTCLASSPATH /apex/com.android.runtime/javalib/core-oj.jar:/apex/com.android.runtime/javalib/core-libart.jar:/apex/com.android.runtime/javalib/okhttp.jar:/apex/com.android.runtime/javalib/bouncycastle.jar:/apex/com.android.runtime/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.test.base.jar:/system/framework/telephony-ext.jar:/system/framework/WfdCommon.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar
export DEX2OATBOOTCLASSPATH /apex/com.android.runtime/javalib/core-oj.jar:/apex/com.android.runtime/javalib/core-libart.jar:/apex/com.android.runtime/javalib/okhttp.jar:/apex/com.android.runtime/javalib/bouncycastle.jar:/apex/com.android.runtime/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.test.base.jar:/system/framework/telephony-ext.jar:/system/framework/WfdCommon.jar
export SYSTEMSERVERCLASSPATH /system/framework/org.lineageos.platform.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar
I have not used find because I had some issues in the past with find in combination of double astrix (*string*), though searching through /system after boot does not give any positive results on soter, alipay or ifaa so all seems removed. Have the feeling though, somewhere 'things' are linked to removed stuff which is the reason for the performance drop.
@Johan2020
for find: you need to make sure that the wildcards are passed to find and arn't substituted by the shell. If you don't escape the wildcards for the shell, they are only passed if the shell can't expand the expression.
for lag: you need to check the log. Increase the logbuffer size to 1 Mio (at least) to catch the complete boot, reboot and do something like
Code:
adb logcat -d | grep -i -e ifaa -e soter -e ali
nvertigo67 said:
@Johan2020
for find: you need to make sure that the wildcards are passed to find and arn't substituted by the shell. If you don't escape the wildcards for the shell, they are only passed if the shell can't expand the expression.
for lag: you need to check the log. Increase the logbuffer size to 1 Mio (at least) to catch the complete boot, reboot and do something like
Code:
adb logcat -d | grep -i -e ifaa -e soter -e ali
Click to expand...
Click to collapse
I guess I found something:
Code:
03-12 12:58:12.521 1818 1818 E dex2oat : Could not create image space with image file '/system/framework/boot.art'. Attempting to fall back to imageless running. Error was: Unexpected component count in /system/framework/arm64/boot.art, received 14, expected non-zero and <= 13
No output on ifaa, soter or ali though, but seems some checks are done in boot.art which are not correct anymore because of removed blobs?
Edit:
Did a new flash without removing the blobs (script from above) and do not have those errors in logcat.
So seems indeed related to removal.
Let me know if I can help with some other testing...
The number of boot jars seems to be somewhere, if rebooting to twrp and wiping caches doesn't help, I've no idea where to start searching. Maybe google is your friend to start investigating this.
nvertigo67 said:
The number of boot jars seems to be somewhere, if rebooting to twrp and wiping caches doesn't help, I've no idea where to start searching. Maybe google is your friend to start investigating this.
Click to expand...
Click to collapse
Ok, thanks. I always clear caches after new flash; rebooting and wiping did not solve the issue.
I probably have to live with it and keep the Ali, Soter and Ifaa stuff there where it is.
I only tried Alipay and it still works after removing these files. Fingerprint authorization payment for Alipay does not seems works on lineageos-17.1 tho (with official modem and keep these proprietary files), but I remembered it works on lineageos-16.0
I'm a bit curious now about who wrote IFAA Manager (org.ifaa.android.manager), where are these source code from and how was it been adopted by LineageOS. The comment message says IFAA protocol support fingerprint and iris authorization.
@nvertigo67 Thanks for your information, I didn't know removing these files cause lags for app start before. I can also confirm it cause noticeable lag, 1.30s to open settings, but cost 2.10s after remove these files.
@Johan2020 I have update the post and add a link to the updated zip, does not seems lag here after flash the zip which deblobbed the modem and removed IFAAService+SoterService apk but keep ifaa manager and other proprietary files.
This command output every *.odex file in `/system`, {boot,boot-org.ifaa.android.manager}.{oat,art} and org.ifaa.android.manager.jar
Code:
grep -rl org.ifaa.android.manager /system
Maybe this explained why it still lags after removed ifaamanager from init.environ.rc, then the only solution to remove these proprietary files without performance drop is remove them at build stage.
Phaech4x said:
I only tried Alipay and it still works after removing these files. Fingerprint authorization payment for Alipay does not seems works on lineageos-17.1 tho (with official modem and keep these proprietary files), but I remembered it works on lineageos-16.0
Click to expand...
Click to collapse
Thanx! I hate not being able to test something myself.
BTW: Is there any source of current data of WeChatPay usage? Honestly, I havn't known about the existence of WeChatPay until the tencent security/privacy flaw some time back...
Phaech4x said:
I'm a bit curious now about who wrote IFAA Manager (org.ifaa.android.manager), where are these source code from and how was it been adopted by LineageOS. The comment message says IFAA protocol support fingerprint and iris authorization.
Click to expand...
Click to collapse
It's from oss (don't mix with oos): https://github.com/LineageOS/androi...0ee28ea#diff-1eba4e28cf441865f85a2298f9bd8312
The very first version has been reverse engineered: https://github.com/LineageOS/androi...b113b64#diff-1eba4e28cf441865f85a2298f9bd8312
Phaech4x said:
@nvertigo67 Thanks for your information, I didn't know removing these files cause lags for app start before. I can also confirm it cause noticeable lag, 1.30s to open settings, but cost 2.10s after remove these files.
@Johan2020 I have update the post and add a link to the updated zip, does not seems lag here after flash the zip which deblobbed the modem and removed IFAAService+SoterService apk but keep ifaa manager and other proprietary files.
Click to expand...
Click to collapse
I guess it's safe to disable the ifaa daemon service as well, as long as the manager jar is available for assembling the boot jar.
Phaech4x said:
This command output every *.odex file in `/system`, {boot,boot-org.ifaa.android.manager}.{oat,art} and org.ifaa.android.manager.jar
Code:
grep -rl org.ifaa.android.manager /system
Maybe this explained why it still lags after removed ifaamanager from init.environ.rc, then the only solution to remove these proprietary files without performance drop is remove them at build stage.
Click to expand...
Click to collapse
Yep. Removing all ifaa, soter, AliPay stuff at compile time works flawlessly - inspired by your first posting: https://github.com/nvertigo/android...mmit/d8f0471eee92fe608b5e9b0b30d52b63d6d3d79f
JFYI: I've made alipay* and soter* free firmware packages with referenve to this very thread: https://forum.xda-developers.com/showpost.php?p=81997531&postcount=164
I'm running this combination without lag, drain or side effects (so far ). Though I've done it for los-16, I see no reason why it shouldn't work for los-17.1 as well.
What seems to work for removing on existing roms (so not on build stage) is to remove everything except org.ifaa.android.manager related stuff.
What I have removed is IFAAServices, Soterservices and everything related except in /system/system/framework.
This is what I have left:
Code:
/system/system/framework/arm/boot-org.ifaa.android.manager.art
/system/system/framework/arm/boot-org.ifaa.android.manager.oat
/system/system/framework/arm/boot-org.ifaa.android.manager.vdex
/system/system/framework/arm64/boot-org.ifaa.android.manager.art
/system/system/framework/arm64/boot-org.ifaa.android.manager.oat
/system/system/framework/arm64/boot-org.ifaa.android.manager.vdex
/system/system/framework/boot-org.ifaa.android.manager.vdex
/system/system/framework/org.ifaa.android.manager.jar
No delays and no issues in daily usage.
Edit:
Script part I am using now on non-deblobbed rom to remove just the stuff which can be removed (not the ifaa.android.manager files):
Code:
#!/sbin/sh
#
# https://forum.xda-developers.com/oneplus-3/how-to/guide-deblob-alipay-ifaa-tencent-soter-t4064893/
echo -n "Deblob AliPay, Soter & IFAA stuff..."
# First mount firmware_mnt
mount /dev/block/by-name/modem /system/system/vendor/firmware_mnt
# Remove all ifaa, soter and alipay blobs in Firmware
bloblist1="
/system/system/vendor/firmware_mnt/image/alipay.b00
/system/system/vendor/firmware_mnt/image/alipay.b01
/system/system/vendor/firmware_mnt/image/alipay.b02
/system/system/vendor/firmware_mnt/image/alipay.b03
/system/system/vendor/firmware_mnt/image/alipay.b04
/system/system/vendor/firmware_mnt/image/alipay.b05
/system/system/vendor/firmware_mnt/image/alipay.b06
/system/system/vendor/firmware_mnt/image/alipay.mdt
/system/system/vendor/firmware_mnt/image/soter64.b00
/system/system/vendor/firmware_mnt/image/soter64.b01
/system/system/vendor/firmware_mnt/image/soter64.b02
/system/system/vendor/firmware_mnt/image/soter64.b03
/system/system/vendor/firmware_mnt/image/soter64.b04
/system/system/vendor/firmware_mnt/image/soter64.b05
/system/system/vendor/firmware_mnt/image/soter64.b06
/system/system/vendor/firmware_mnt/image/soter64.mdt
"
for blobname in $bloblist1
do
if [ -d "$blobname" ]; then
chmod -R 777 "$blobname" 2>/dev/null
rm -rf "${blobname:?}"/* 2>/dev/null
else
chmod 777 "$blobname" 2>/dev/null
rm -f "$blobname" 2>/dev/null
fi
done
# Remove all ifaa, soter and alipay stuff in vendor and lib
bloblist2="
/system/system/vendor/bin/hw/[email protected]
/system/system/vendor/bin/hw/[email protected]
/system/system/vendor/etc/init/[email protected]
/system/system/vendor/etc/init/[email protected]
/system/system/vendor/lib64/hw/[email protected]
/system/system/vendor/lib64/[email protected]
/system/system/lib64/[email protected]
"
for blobname in $bloblist2
do
if [ -d "$blobname" ]; then
chmod -R 777 "$blobname" 2>/dev/null
rm -rf "${blobname:?}"/* 2>/dev/null
else
chmod 777 "$blobname" 2>/dev/null
rm -f "$blobname" 2>/dev/null
fi
done
# /system/system/framework/arm/boot-org.ifaa.android.manager.art
# /system/system/framework/arm/boot-org.ifaa.android.manager.oat
# /system/system/framework/arm/boot-org.ifaa.android.manager.vdex
# /system/system/framework/arm64/boot-org.ifaa.android.manager.art
# /system/system/framework/arm64/boot-org.ifaa.android.manager.oat
# /system/system/framework/arm64/boot-org.ifaa.android.manager.vdex
# /system/system/framework/boot-org.ifaa.android.manager.vdex
# /system/system/framework/org.ifaa.android.manager.jar
# Remove org.ifaa.android.manager.jar from environ.rc
# sed -i 's/:\/system\/framework\/org.ifaa.android.manager.jar//' /system/init.environ.rc
umount /system/system/vendor/firmware_mnt
echo " done!"
nvertigo67 said:
BTW: Is there any source of current data of WeChatPay usage? Honestly, I havn't known about the existence of WeChatPay until the tencent security/privacy flaw some time back...
I guess it's safe to disable the ifaa daemon service as well, as long as the manager jar is available for assembling the boot jar.
Click to expand...
Click to collapse
Ipsos's Report of Market Share of Third Party Mobile Payment in China (in Simplified Chinese)
Chi*na’s Mo*bile Pay*ments Mar*ket Grows Over 15% in Q3 2019, Ali*pay’s Mar*ket Share Ex*ceed Half | China Banking News (in English) seems the articles is about this report
In mainland China, Alibaba and Tencent own over 90% of mobile payment market, Alipay almost own the whole mobile payment market a few years ago, probably because of Alibaba's Taobao which is one of the most popular online shopping site in China.
Tencent has WeChat Pay, QQ Wallet and Tenpay. these reports which mentioned market share Tencent owned probably include them. WeChat Pay is included in WeChat and QQ Wallet is included in QQ, WeChat and QQ are most most popular instant messaging app in mainland China. imo the main reason WeChat Pay been popular in China is it has Red Envelope (Alipay also has it tho), Chines ppl like social, WeChat and QQ are more like social network than other instant messaging platform. WeChat Pay require fee for withdraw while Alipay is free to withdraw, and lots of Chinese ppl love the Red Envelope thing. It's like almost every smartphone/"internet" user in mainland China has a WeChat account, not only just for communicating with others, they use it to order a takeout, use Mini Program or something.
And Tencent also own the most Gaming Market in mainland China, there is QQ Currency which is usually used to buy items in games.
https://www.scmp.com/lifestyle/gadg...-wechat-pay-and-payme-put-test-find-out-which
According to a 2018 survey conducted by the Hong Kong Productivity Council on brand awareness of e-wallet services, Alipay, WeChat Pay, Apple Pay and PayMe were ranked top among users.
Click to expand...
Click to collapse
In Hong Kong, Apple Pay is the second most frequently used mobile payment in 2019, according to the survey conducted by JD Power, second only to AlipayHK.
Click to expand...
Click to collapse
I think Alipay and WeChat Pay are almost only used in China and Hong Kong. The only reason I can think of those mainland Chinese smartphone manufacturers include ifaa/soter in their international firmware/modem is that Alipay and WeChat Pay is also popular in Hong Kong where people have access to Internet and use GMS, beside they are too lazy to maintain variants of firmware/modem.
Johan2020 said:
What seems to work for removing on existing roms (so not on build stage) is to remove everything except org.ifaa.android.manager related stuff.
No delays and no issues in daily usage.
Click to expand...
Click to collapse
Thanks I have confirmed just keep ifaa manager won't cause lag on app start. In the other words, all of related blobs, proprietary files and related services files are been removed, only keep ifaa manager the open source part.
nvertigo67 said:
Can somebody confirm the validity of this information, please? With the op-mentioned files removed only the fingerprint authorized payment is lost, but Alipay and WeChatPay is still working with apps installed from playstore.
Thanx in advance.
Click to expand...
Click to collapse
Confirmed. Alipay and Wechatpay still works by typing password.
Firware: OP3T-9.0.6-fw-without-ifaa/soter
Rom: nlos-16.0-20200312
PS: It also affects unlocking Alipay using fingerprint which I don't use.
In case anyone is wondering:
I installed this with LineageOS 17.1 and nothing appears to be broken.
I do not use AliPay or any of those services so cannot comment on related effects.
Installed it on Lineageos 17.1 with SAR TWRP and it terminated with success. However, when rebooting to system and cross-checking, I recognised that the Blobs were still there. So I edited the updater script to replace /system with /system_root and voila, after flashing the modified package the Blobs are finally gone.
Ideally we'd have a check in the script if we're on SAR (check fstab?) and change the mount point accordingly, I think I've seen that somewhere here in the forums but lost the reference...
{Deleted, was sleeping I guess, had already answered my question myself....}
FYI, this is how I am removing Soter, Ifaa and Alipay stuff now, which is actually just a one-liner:
Code:
# Set root correctly depending on system as root or not
if [ -e "/system_root/system" ]; then
root="/system_root"
else
root="/system"
fi
# Mount firmware_mnt if not mounted already
if ! mountpoint -q "$root/system/vendor/firmware_mnt"; then
mount /dev/block/by-name/modem $root/system/vendor/firmware_mnt
fi
sleep 0.5
# Find and remove alipay, soter and ifaa stuff except boot-org.ifaa.android.manager
find $root/system ! -name "*manager*" -name "*alipay*" -name "*soter*" -name "*ifaa*" -type f -exec rm -f {} + 2>/dev/null
# Unmount firmware_mnt
umount $root/system/vendor/firmware_mnt
So the line which is removing the stuff is just:
Code:
find $root/system ! -name "*manager*" -name "*alipay*" -name "*soter*" -name "*ifaa*" -type f -exec rm -f {} + 2>/dev/null
Johan2020 said:
FYI, this is how I am removing Soter, Ifaa and Alipay stuff now, which is actually just a one-liner:
So the line which is removing the stuff is just:
Click to expand...
Click to collapse
Can u pls make it a flashable zip?
Adam Hui said:
Can u pls make it a flashable zip?
Click to expand...
Click to collapse
No, you can just make a bash script which you run after flash from TWRP command line
But if you want, feel free ofcourse :good:
Related
OK, here we go. Following the model from Desire thread, I made this one for Legend too.
Backgroud:
If I sum up some key points from this thread... there is no way of writing to system partition (Legend, Desire...) even if it is mounted in read-write mode. The only way of writing to system partition is via recovery mode (if you have already rooted your Legend) which makes a process of updating/testing a pain... you have to reboot your phone into recovery mode each time you want to change something on system partition. So guys at Desire subforum came up with an idea to put a writable overlay over the /system directory. This principle is very well known from live CD distros of Linux and Asus also introduced this on their EEE systems running Linux.
This method can be used not only on system partition (so we can "write" to it) but also on data partition which brings us really a neat way of point-in-time backup. Basically one could make overlay of an entire system just after the system was installed and set-up (with all software and custom settings). Then when anything goes wrong after this point, all one has to do is to wipe the directory/partition where writes were being made - no need to factory reset (wiping data partition), setting things up and installing all the apps all over again. This method can well be a better alternative of nandroid backup, because restoring from nandroid backup wipes out all partitions and restore data to them from images. And we all know that frequent repetition of this process really deteriorates non-removable NAND flash chips in our phones.
Contents:
shell script that does the actual /system overlay
statically compiled mount (for compatibility reasons)
auplink utility for flushing pseudo-links to writable device (not used atm)
Shell script that does the overlay is made so it can use any (first) ext2/3 partition on your sdcard. That means you can use your a2sd partition for overlay too. If a2sd is not active but you still have ext2/3 partition on your sdcard, it will be mounted and used for overlay. If you don't have ext2/3 partition on your sdcard, then internal data partition will be used instead. In this case you will have to be careful not to fill it up entirely.
Requirements:
rooted Legend of course
any kernel with built-in aufs support
busybox
run-parts integrated in init.rc script (/etc/init.d)
a2sd script should run before the overlay script (only if you use a2sd)
(When I mention a2sd in this post I mean any a2sd; a2sd, a2sd+, apps2sd, DarkTremor, LightSabre, GoldenThrone )
Installation
Boot to recovery mode (ClockworkMod) and apply this update. After applying it (re)boot your phone. At this point overlay is not yet enabled. You have to issue:
Code:
adb shell aufs --enable
...to enable it and reboot your phone afterwards for changes to take effect.
Configuration
If you want to enable/disable overlay later on, issue:
Code:
adb shell aufs --disable
...to disable overlay or:
Code:
adb shell aufs --enable
...to enable overlay again. Reboot your phone for changes to take effect.
Be advised that after wiping (Factory data reset) overlay is disabled so you will have to enable it again.
Troubleshooting
Make logcat of boot process and check for errors in 1st 50 or so lines.
Warning!!!
Please, do not even try to flash this "update" if you don't know what you are doing or what things I mentioned above mean!!!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Changelog
0.7 (December 16, 2010)
compatibility enhancements
some minor changes
0.6.1 (December 2, 2010)
script is now calling e2fsck or e2fsck_recvy
0.6 (December 1, 2010)
dropped auplink binary
some more error handling
changed installation script
0.5.1 (October 4, 2010)
minor change in installation script
0.5 (October 4, 2010)
added enable/disable ability (dumfaq was here also)
improved error handling
0.4 (September 30, 2010)
updated aufs script to check if aufs support is already on
added statically compiled mount to support mount-move on any ROM
0.3 (September 28, 2010)
updated aufs script to check presence of /data/local/dosysoverlay file (to enable/disable)
0.2 (September 20, 2010)
updated aufs script to check availability of ext partition on SD card (thanks to dumfaq)
0.1 (September 3, 2010)
initial release
Wow impressive..
I'll try to include into my rom!
Thank you so much!
This sounds very good... But please enlighten me...
Will this only work on stock/modified stock roms.. or will this work on CM6 roms also? (Azure 1.0 etc.)
Hey Neon, this would certainly overwrite your OC kernel.
But you can always build your own with aufs support and use my overlay script (maybe you'll find some glitch in it ).
I would just ask you to consider putting init.d into /data/local (making symlink in /system/etc). That would ease up adding/removing/chmoding scripts inthere. I think this approach is very handy.
I have put together a little script that would look for init.d link or directory in /system/etc (or directory in /data/local) and then decide to make /data/local/init.d directory or not.
whitetigerdk said:
This sounds very good... But please enlighten me...
Will this only work on stock/modified stock roms.. or will this work on CM6 roms also? (Azure 1.0 etc.)
Click to expand...
Click to collapse
It would work on CM6 too, but you would have to copy WiFi module from stock ROM, because I didn't include it in this update. But bare in mind that CM6 is based on kernel 2.6.32 and above and we are talking 2.6.29 here!
Ahh one more thing. CM6 kernel should already contain AUFS support (if I'm not mistaken) so you could use just my overlay loading script and auplink binary.
Blayo, an alternative way for nandroid backup sounds really interesting. if included in the rom along with a few further instructions Im sure it could be brought down to the level of no-obs. Ill wait till puppy is 100% tested
Learners Lisence said:
Blayo, an alternative way for nandroid backup sounds really interesting. if included in the rom along with a few further instructions Im sure it could be brought down to the level of no-obs. Ill wait till puppy is 100% tested
Click to expand...
Click to collapse
Oh.. you can't wait.. you are the one who is ment to be doing the testing .. so the rest of us are waiting for your result.
Sent from my Legend using XDA App
So...basically, this will helps installing Ad-free and OpenVPN on our Legend, right?
BlaY0 said:
Ahh one more thing. CM6 kernel should already contain AUFS support (if I'm not mistaken) so you could use just my overlay loading script and auplink binary.
Click to expand...
Click to collapse
The CM6 port from Ali Baba (Azure 1.0) contains a 2.6.29 kernel and no AUFS module... So it should work with your zip. Great work BlaY0!!!
Just to be sure.
This should work with Azure 1.0, right? What was that thing about the wifi?
cryshop said:
So...basically, this will helps installing Ad-free and OpenVPN on our Legend, right?
Click to expand...
Click to collapse
I'm not sure what you mean... but it will certainly help you adding/removing stuff to/from /system on-the-fly...
Briix said:
Just to be sure.
This should work with Azure 1.0, right? What was that thing about the wifi?
Click to expand...
Click to collapse
It's for 2.6.29 kernel (check the thread title!) and you have to provide your own WiFi driver, because it is not included in this update. Be advised that modules/drivers versions and kernel versions can not mix most of the times. You also can not use just aufs module from this update with any non-aufs kernel (even if versions match), it just won't work.
well, I got this working on my slide (I have no ext partition) however, I had to make some changes...
Code:
7,8c7,8
< RODIR=/data/sysro
< COUNT=0
---
> RODIR=/system
> COUNT=2
16c16
< while [ ! -e /dev/block/mmcblk0p1 ]; do
---
> while [ ! -e /dev/block/mmcblk0p$COUNT ]; do
48,49d47
< insmod /system/lib/modules/aufs.ko
< mount --move /system $RODIR
Without changing the while loop, it always detected an ext partition even though none existed.
Haven't tested it with an ext partition though.
Obviously I used my own kernel and modules.
Thanks alot.
Tested on CM6.0 (Azure latest) and the ROM still works perfectly including my WiFI. I have not tested the overlay functions itself just that it did not screw up CM6.0 which it didn't!
Will let you know the results of the AUFS side of things once I have finished playing!
Let us know how it goes... I'm still trying to figure out how to the the aufs stuff working.
!!!ignore me!!!
dumfuq said:
well, I got this working on my slide (I have no ext partition) however, I had to make some changes...
Code:
7,8c7,8
< RODIR=/data/sysro
< COUNT=0
---
> RODIR=/system
> COUNT=2
16c16
< while [ ! -e /dev/block/mmcblk0p1 ]; do
---
> while [ ! -e /dev/block/mmcblk0p$COUNT ]; do
48,49d47
< insmod /system/lib/modules/aufs.ko
< mount --move /system $RODIR
Without changing the while loop, it always detected an ext partition even though none existed.
Haven't tested it with an ext partition though.
Obviously I used my own kernel and modules.
Click to expand...
Click to collapse
Hi m8,
Thanks for the input but I think that you are missing the point why this while loop is there
...it is there just to check when SD card is ready to be used. The thing is that it depends of what speed is your SD card. If you have a class 6 for example, it can be available in less than a second, but if you have stock SD card or slower one, it is available only after 2 or even 3 seconds.
But you were right about the script not doing overlay if there's SD card present and no ext partition on it so I changed it a little. here's the patch:
Code:
--- 70aufs.old 2010-09-20 10:29:49.000000000 +0200
+++ 70aufs 2010-09-20 10:28:57.000000000 +0200
@@ -26,13 +26,20 @@
done
if [ -z "$NOSD" ]; then
DEV=`fdisk -l /dev/block/mmcblk0|grep Linux|head -n1|awk '{print $1}'`
- SD=/data/sd
- RWDIR=${SD}/sysrw
- [ -d "$SD" ] || mkdir $SD
- e2fsck -y $DEV
- mount -t auto -o noatime,nodiratime $DEV $SD
- chown 1000.1000 $SD
- chmod 775 $SD
+ if [ -n "$DEV" ]; then
+ SD=/data/sd
+ RWDIR=${SD}/sysrw
+ [ -d "$SD" ] || mkdir $SD
+ e2fsck -y $DEV
+ mount -t auto -o noatime,nodiratime $DEV $SD
+ chown 1000.1000 $SD
+ chmod 775 $SD
+ else
+ mkdir /dev/shm
+ mount -t tmpfs -o size=4m shm /dev/shm
+ RWDIR=/data/sysrw
+ MTOPTS="xino=/dev/shm/.aufs.xino,dirs=${RWDIR}:${RODIR}=ro"
+ fi
else
mkdir /dev/shm
mount -t tmpfs -o size=4m shm /dev/shm
...now it will check the availability of SD card and if it's there it will check for ext partition on it. If one is present it will prepare and mount it, otherwise it will do the overlay on data partition.
Update is also available in 1st post.
BlaY0 said:
Hi m8,
Thanks for the input but I think that you are missing the point why this while loop is there
...it is there just to check when SD card is ready to be used. The thing is that it depends of what speed is your SD card. If you have a class 6 for example, it can be available in less than a second, but if you have stock SD card or slower one, it is available only after 2 or even 3 seconds.
But you were right about the script not doing overlay if there's SD card present and no ext partition on it so I changed it a little. here's the patch:
Code:
--- 70aufs.old 2010-09-20 10:29:49.000000000 +0200
+++ 70aufs 2010-09-20 10:28:57.000000000 +0200
@@ -26,13 +26,20 @@
done
if [ -z "$NOSD" ]; then
DEV=`fdisk -l /dev/block/mmcblk0|grep Linux|head -n1|awk '{print $1}'`
- SD=/data/sd
- RWDIR=${SD}/sysrw
- [ -d "$SD" ] || mkdir $SD
- e2fsck -y $DEV
- mount -t auto -o noatime,nodiratime $DEV $SD
- chown 1000.1000 $SD
- chmod 775 $SD
+ if [ -n "$DEV" ]; then
+ SD=/data/sd
+ RWDIR=${SD}/sysrw
+ [ -d "$SD" ] || mkdir $SD
+ e2fsck -y $DEV
+ mount -t auto -o noatime,nodiratime $DEV $SD
+ chown 1000.1000 $SD
+ chmod 775 $SD
+ else
+ mkdir /dev/shm
+ mount -t tmpfs -o size=4m shm /dev/shm
+ RWDIR=/data/sysrw
+ MTOPTS="xino=/dev/shm/.aufs.xino,dirs=${RWDIR}:${RODIR}=ro"
+ fi
else
mkdir /dev/shm
mount -t tmpfs -o size=4m shm /dev/shm
...now it will check the availability of SD card and if it's there it will check for ext partition on it. If one is present it will prepare and mount it, otherwise it will do the overlay on data partition.
Update is also available in 1st post.
Click to expand...
Click to collapse
sweet thanks man. I'll give it a go tomorrow.
BlaY0 said:
Hi m8,
Thanks for the input but I think that you are missing the point why this while loop is there
...it is there just to check when SD card is ready to be used. The thing is that it depends of what speed is your SD card. If you have a class 6 for example, it can be available in less than a second, but if you have stock SD card or slower one, it is available only after 2 or even 3 seconds.
But you were right about the script not doing overlay if there's SD card present and no ext partition on it so I changed it a little. here's the patch:
...now it will check the availability of SD card and if it's there it will check for ext partition on it. If one is present it will prepare and mount it, otherwise it will do the overlay on data partition.
Update is also available in 1st post.
Click to expand...
Click to collapse
Works great for non ext now, thanks. I still have to set sysro to /system and take out the mount --move or it breaks though.
What's the logic/purpose of moving the sysro anyways, I noticed they are not doing that in the desire version. Just curious.
Thanks again
The purpose of mount moving /system to some place else is that you have only one instance of "/system" in /proc/mounts eventually. If you just do the overlay over /system, you have two instances of "/system" in /proc/mounts and that causes some root apps to panic because they chose the first instance (to remount it read-write) which we don't actually want.
But as soon as you mount move /system to some place else you also loose everything that's in it (bin, xbin, lib). And since you are on CM6 (i believe), your busybox is compiled dinamically thus it depends first on /system/bin/linker and then on libraries in /system/lib. You can catch those lib deps with LD_LIBRARY_PATH variable but the problem is still /system/bin/linker absolute path which is compiled into your busybox and all other native binaries.
There is actually only one solutions to this problem and that is to get statically built busybox, copy it to let say /data/bin and call this busybox from script.
I will add to 1st post that statically built busybox is imperative.
UPDATES, WARNINGS, AND INSTALLATION STEPS ARE AVAILABLE IN THE 2ND POST
WHAT DOES THIS SCRIPT DO?
* It is the only method, that I am aware of to have apps trully run, and be installed directly to the external storage without completely switching the internal storage with the external storage.
This bings different benefits to different people:
1 - If you have a device that comes from factory with only a small amount of storage available, you can now install as many apps, and apps as big as the partition you setup to use with this script. For example, if you have a phone with only 512 MB of app storage, you can now install games that take over 1GB of app storage so long as your external partition has the space available.
2 - If you bought a 16GB device and wish you had bought a 32GB device, this is great for you as well (I'm one of these). With this script, your apps will not take up any space in your internal storage, which means that your 16GB (or whatever is left of it after factory partitioning, 11.66 GB in my case) is now available for pictures, videos, downloads, backups, or whatever else you might want to put there or have easy access to when you connect your device to your computer.
3 - If you have a lot of Android games, this is great for you too, specially if you're playing games that take a lot of space. Just get a large MicroSD (I have a 64GB partitioned to 32/32) and put as much space as you need in the second partition, and now you can have all your games intalled at the same time. No need to keep uninstalling games so that you can install other ones.
* Once and Done, across the board setup. That's right, launchers, keyboards and widgets will run from the external storage natively, something never done before in Android as far as I know.
This means that once you have the script up and running, you're good to go until the next time you reflash your /system partition. No need to choose what apps to move. No symlinks or anything. Your apps now belong in the external storage, plain and simple.
* No need to backup all your stuff before running the script (and eventually no need to back up your stuff when you want to disable it either).
That's right, the script does the hard work for you. All your stuff gets safely moved to the external storage, with all ownerships and permissions intact. It all happens so smoothly that some people have a hard time telling that the script is already at work. Nothing gets deleted from the internal storage until you're certain that everything is working as expected either. So even if something goes wrong, as long as you have ADB, all your stuff can go back to normal without a problem
(Even though you don't have to backup and restore in order to get the script going, it's always greatly recommended that you keep a backup of your apps).
* Simple intallation:
To get the script going all you have to do is download it, extract it, and run 3 commands in the terminal. It will then ask you a couple of questions, and then you'll be all set. The one downfall is that because the script requires user input (no, the required information cannot be picked from a list), the script cannot be run from a recovery zip. However, I'll emphasize once again that it only takes 3 commands to get the script going.
Also, the script comes with an options file that allows you to setup device specific variables, making the script malleable to work on just about any Android device. Just open the USER_OPTIONS file before runing the install script, and as long as you have the variables there set correctly, the script should be compatible with your device.
* You can still use the external partition for other stuff if you want to. Just remember that it's mounted to /mnt/sd-ext (or /storage/sd-ext in JB). So if you still have a ton of space left in the partition and need the space, you can still use it. Just ensure not to touch the folders Android, app and data.
* Now this is a bit more technically, but in theory, you could a third partition for this script instead of the second partition, and then still be able to use app2sd solutions, though personally I don't see what advantage there would be to doing this since apps would still be in the external storage no matter what.
WHAT DOES THIS SCRIPT NOT DO?
*** IT CANNOT BE CONVERTED INTO A RECOVERY ZIP DUE TO USER INPUT REQUIREMENT ***
*** YOU CANNOT PICK AND CHOOSE WHAT APPS TO MOVE, THAT'S PLAIN AND SIMPLE NOT THE PURPOSE OF THIS SCRIPT ***
SCREENSHOTS
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Above you can see my storage screen. If you add the amount of used space and the amount of available space, it's ~18 GB, well over the available 11.66GB in the internal storage. Also note that when the script is enabled, the bar displaying storage usage is unreliable. All other information is reliable, including, and most importantly, the amount of available free space.
Above you can see the output of some commands in the terminal. The most important part of the output for mount above are
Code:
/dev/block/mmcblk0p12 on /mnt/temp/data type ext4 (rw,relatime,barrier=1,journal_async_commit,data=ordered,noauto_da_alloc,discard)
/dev/block/mmcblk1p2 on /mnt/sd-ext/data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/media/Android type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/app type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
As you can see, mmcblk1p2, the external storage, is mounted to /data/app, /data/data and /data/media/Android, which means that as far as Android is concerned, those folders are in the external storage. Also note that all these mounts took place before /sdcard itself was mounted, meaning that the script is ensuring that these mounts take place soon enough in the boot process to avoid problems related to mounting the app storage locations after Android has loaded the available apps.
Finally, the fact that mmcblk0p12 is mounted to /mnt/temp/data is important because of the next two commands
The output of du -sh shows the amount of storage used by a folder, and as such because the internal storage is mounted to /mnt/temp/data;
/mnt/temp/data/app = internal /data/app = 8KB
/mnt/temp/data/data = internal /data/data = 72KB
/mnt/temp/data/media/Android = internal /data/media/Android = 4KB
whereas
/data/app = 1GB
/data/data = 624.3 MB
/data/media/Android = 5.6 GB
For a grand total of 7.22 GB of used app storage in the external storage as opposed to 84 KB in the internal storage.
CREDITS
*smaw51 - Testing
*ArangeLTX - Testing and Debugging
*Laggan - Testing
*aadiflesher - Testing
*Others who tested the script but weren't in direct contact with me.
*People who said it wasn't possible to run widgets, launchers and keyboards from External Storage (They provided the challenge I needed to make this work)
If anybody needs help or if anything doesn't work, I'll help through irc (much quicker than posting here) on freenode - #and-host
UPDATES:
09-26-2012: Major Update, Overhauled most of previous code.
09-27-2012: Found badass typo in one of the files, fixed and uploaded correction.
09-27-2012: Added install Script.
10-02-2012: Corrected install script so that things now run properly. Don't forget to double check USER_OPTIONS and set ENABLED=true
10-02-2012: Added MMCBLKXPX variable to user options so now devices that mount SD-EXT to different block can use script easily.
10-03-2012: More fixes to the install script, also added check for storage location as well as user input. Started working on compatibility for devices where /sdcard/Android is in different partition from /data
10-03-2012: Updated this post with more organized information.
10-04-2012: Modified script so that debugging output works properly in JB
10-05-2012: Finished working on compatibility for devices with /sdcard and /data in different partitions (PENDING TESTING)
10-05-2012: Added automatic detection for such devices ^ (New variable is automatically created in USER_OPTIONS, called fukedupFS)
10-05-2012: Added extra security for $deletepostmove (Will not take effect until stage 3 is detected)
10-05-2012: Added switch on install script to do a clean install, (using sh ./install-a2sd -clean) which will erase all current options/vars and reset stage to 0.
WARNINGS:
1 - PROCEED WITH THE FOLLOWING STEPS AT YOUR OWN RISK. IF ANYTHING BREAKS I'LL GLADLY TRY TO HELP (IF I CAN), BUT YOU DO WHAT YOU DO AT YOUR OWN RESPONSIBILITY.
2 - THE INSTALLATION SCRIPT REQUIRES USER INPUT, WHICH MEANS THAT IT CANNOT BE MADE INTO A RECOVERY ZIP. DO NOT BOTHER TO ASK FOR ONE. IF YOU CAN'T LEARN HOW TO USE THE TERMINAL, THEN JUST STICK TO OTHER SUCKY APP2SD SOLUTIONS.
3 - THIS SCRIPT IMPLEMENTS INIT.D BY DEFAULT, IF YOU ALREADY HAVE INIT.D FUNCTIONALITY MAKE SURE TO CHANGE:
Code:
/system/bin/logwrapper busybox run-parts /system/etc/init.d
TO
Code:
# /system/bin/logwrapper busybox run-parts /system/etc/init.d
IN THE B]sysinit[/B] FILE.
4 - THIS SCRIPT IMPLEMENTS INIT.A, WHICH IS ESSENTIALLY LIKE INIT.D, BUT HAPPENS EXTREMELY EARLY AT BOOT TIME, IT IS SUGGESTED THAT REGULAR USERS DO NOT PUT ANY SCRIPTS IN INIT.A UNLESS THEY KNOW WHAT THEY'RE DOING, JUST USE INIT.D FOR OTHER SCRIPTS.
5 - UPDATE YOUR BUSYBOX TO THE LATEST VERSION (1.20.2 AT THE WRITING OF THIS). SOME EARLIER VERSIONS OF BUSYBOX ARE KNOWN TO NOT HAVE SOME OF THE REQUIRED SWITCHES FOR THE COMMANDS USED IN THE SCRIPT.
6 - AT THIS POINT THE SCRIPT REQUIRES THAT YOU HAVE A SECOND PARTITION IN YOUR MICROSD FORMATTED TO EXT4, ANYTHING ELSE WILL NOT WORK. THIS MAY CHANGE IN THE FUTURE, BUT AT THIS POINT IT'S A REQUIREMENT.
7 - FULLY READ THE INSTALLATION INSTRUCTIONS, MORE THAN ONCE IF POSSIBLE, BEFORE RUNNING THE SCRIPT. FAILING TO COMPREHEND WHAT'S GOING ON CAN POSSIBLY LEAVE YOUR DEVICE SEMI-BRICKED/CAUSE MAJOR HAVOC AND FORCE-CLOSES AND YOU'LL HAVE TO RESTORE A BACKUP. MORE THAN ANYTHING MAKE SURE TO BACKUP YOUR APPS.
INSTALLATION:
1 - Download the attached file on your device or PC.
2 - Extract the files and move it to an easy to access location in your device, such as /sdcard. Open USER_OPTIONS and ensure that all variables correctly apply to your device, LEAVE deletepostmove='false' until later. Set ENABLED='true' once you're reviewed everything.
3 - Open a terminal app (Rom Toolbox and such probably won't work because the script requires user input)
4 - Assuming that you moved all 6 files to /sdcard, execute the following commands in the terminal:
Code:
su
cd /sdcard
sh ./install-a2sd
You can also perform a clean install by using the command:
Code:
sh ./install-a2sd -clean
5 - The script will ask a couple of questions, answer them (ask someone for help if you're not sure).
6 - If all went well (The script will tell you that folders were created, files were copied and permissions were set) you'll be told that upon pressing enter your device will be rebooted. Press ENTER when ready or reboot manually if it fails to reboot on its own.
7 - STAGE 1 - NOTHING WILL HAVE NOTICIABLY CHANGED UPON THE FIRST REBOOT. This is normal. The first reboot will only garther many variables needed for the script to run properly, it will also give the opportunity to review the variables and ensure that everything is ok, so that you can disable the script in case the gathered variables are not correct, so that things don't get broken unecessarily. Please take a look at:
Code:
/sdcard/Tweaked.Scripts/A2SD/options/vars
If all looks good in there (even if you don't understand what the variables are for, ensure that the paths make sense, don't worry if you don't have /mnt/sd-ext and /mnt/temp, or /storage/sd-ext and /storage/temp as these will be created).
Reboot again after reviewing the variables.
8 - STAGE 2 - ONCE AGAIN, WHEN YOU REBOOT, NOTHING WILL APPEAR TO HAVE HAPPENED. In fact, this is not the case this time. If all variables were correct in STAGE 1, every app along with their data and files will have started to be copied over to the external storage as soon as the device finished booting. You should be able to see the process for this by opening the terminal and running the command:
Code:
logcat | busybox grep "01a2sd"
You can also run the following command in the terminal to ensure that there are extra mounts that did not exist prior:
Code:
mount
***THIS IS THE MOST IMPORTANT STEP IN THE PROCESS. MAKE SURE THAT YOU DO NOT REBOOT YOUR DEVICE UNTILL THE FOLLOWING FILE IS CREATED:
Code:
/sdcard/Tweaked.Scripts/A2SD/DEVICE_IS_READY
Failing to do so is the single worst mistake that you can do. Rebooting the device before the copying is done might cause all your apps to look like they're not installed, as well as major FCs, to the point where stuff is unusable and you have to restore a backup.
Just be patient during this step, specially if you already have a lot of apps installed, even more so if you have games that use a large amount of space.
9 - STAGE 3 - After rebooting from STAGE 2, the device will mount the external storage in every location where apps would reside in the internal storage. This is why it's extremely important that STAGE 2 is completed properly, because unless everything has been moved properly, files that were not copied will seem like they don't exist, possibly causing FCs and major havoc.
If everything went ok, it will actually look like nothing happened, but in fact, everything should be running from the external storage. You can confirm this by running the following command in the terminal:
Code:
mount
You should see three mounts that weren't there before that look like
Code:
/dev/block/mmcblk1p2 on /data/media/Android type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/app type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
At this point, it should be safe to open USER_OPTIONS in /sdcard/Tweaked.Scripts/A2SD/options and change deletepostmove='true'. Just remember that with this variable set on, all your apps will be wiped from external storage. This means that if you reboot without your MicroSD or if you lose the stuff in the MicroSD your alls will be gone. Becase of this, ensure that you have your apps backed up somewhere.
TweakerL said:
To install, download attached file (then rename it to 01a2sd) or copy code and save it to (01a2sd).
Copy the file to /system/etc/init.d (Can be done with any file manager that has root access)
Change permission to 755 (Can be done with most file managers with root access)
Change Options in script to your liking.
Enjoy the extra storage after reboot.
Code:
#! /system/bin/sh
########################################################################################################
########################################################################################################
## ##
## Super APP2SD by TweakerL ##
## Visit us at http://and-host.com ##
## Chat with us on freenot at #and-host ##
## ##
########################################################################################################
########################################################################################################
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
########################################################################################################
## Options #############################################################################################
## ##
## Feel free to change these: ##
## ##
## moveAndroid: Moves /sdcard/Android to external storage. ##
## moveApps: Not yet implemented ##
## moveData: Not yet implemented ##
## ##
## deletepostmove: If 'true ' Deletes files from internal storage after they have been moved. ##
## ##
## pruneoldlogs: If 'true' Deletes logs older than X hours set in prunehoursold. ##
## prunehoursold: If 'X' greater than 0 logs older than X hours will be deleted ##
## If 'X' equal 0 all logs will be deleted ##
## ##
## debugging: If 'true' files will be created in /sdcard for debugging purposes ##
## ##
moveAndroid='true' ##
##
deletepostmove='true' ##
##
pruneoldlogs='true' ##
prunehoursold='1' ##
##
debugging='false' ##
########################################################################################################
########################################################################################################
## Constants ###########################################################################################
## ##
## Don't touch these unless you're told to by someone who knows what they're doing: ##
## ##
append_android='/Android' ##
append_data='/data' ##
append_obb='/obb' ##
append_ext4='/ext4' ##
append_tweaked='/Tweaked.Scripts' ##
append_movethis='/movethis.txt' ##
append_temp='/temp' ##
append_media='/media' ##
append_A='A' ##
append_logs='/logs' ##
##
data='/data' ##
########################################################################################################
########################################################################################################
if [ -f /sbin/busybox -o -f /system/sbin/busybox -o -f /system/xbin/busybox -o -f /system/bin/busybox ]
then
has_busybox='true'
fi
if busybox blkid | busybox egrep -i "mmcblk1p2" > /dev/null
then
has_mmcblk1p2='true'
fi
if busybox blkid | busybox egrep -i "mmcblk1p2" | busybox awk '{print $4}' | busybox cut -f2 -d'"' > /dev/null
then
is_ext4='true'
fi
if [ $has_busybox == 'true' -a $has_mmcblk1p2 == 'true' -a $is_ext4 == 'true' ]
then
# DEBUGGING
# Get vars part 1
if [ $debugging == 'true' ]
then
set > /sdcard/vars.1
fi
# END DEBUGGING
# Start defining functions
makedir () {
if [ ! -d $1 ]
then
busybox mkdir -p $1
fi
busybox chmod $2 $1
busybox chown $3:$4 $1
}
# End defining functions
mnt_sd=$( busybox mount | busybox egrep -i '/sdcard' | busybox awk '{print $3}' )
mnt=$( busybox dirname $mnt_sd )
sd_uid=$( busybox ls -ln $mnt_sd | busybox egrep -i "Android" | busybox awk '{print $3}' )
sd_gid=$( busybox ls -ln $mnt_sd | busybox egrep -i "Android" | busybox awk '{print $4}' )
blk_ext4=$( busybox ls -lR /dev | busybox egrep -i "mmcblk1p2 ->" | busybox awk '{print $11}' )
blk_data=$( busybox mount | busybox egrep -m 1 '/data' | busybox awk '{print $1}' )
mnt_ext4=$mnt$append_ext4
ext_data=$mnt_ext4$data
ext_android=$ext_data$append_android
mnt_temp=$mnt_ext4$append_temp
temp_android=$mnt_temp$append_media$append_android
datetime=$( busybox date -Iseconds )
sd_android=$mnt_sd$append_android
sd_tweaked=$mnt_sd$append_tweaked
tweaked_logs=$sd_tweaked$append_logs
txt_movethis=$sd_tweaked$append_movethis
makedir $sd_tweaked 775 $sd_uid $sd_gid
data_media=$( busybox dirname $( busybox find /data -type d -follow -name 'Tweaked.Scripts' ) )
data_android=$data_media$append_android
data_uid=$( busybox ls -lnd $data | busybox awk '{print $3}' )
data_gid=$( busybox ls -lnd $data | busybox awk '{print $4}' )
android_uid=$( busybox ls -ln $data_media | busybox egrep -i "Android" | busybox awk '{print $3}' )
android_gid=$( busybox ls -ln $data_media | busybox egrep -i "Android" | busybox awk '{print $4}' )
# DEBUGGING
# Get vars part 2
if [ $debugging == 'true' ]
then
set > /sdcard/vars.2
busybox diff /sdcard/vars.1 /sdcard/vars.2 | busybox grep "+" | busybox egrep -v "@|_=" > /sdcard/vars.txt
fi
# END DEBUGGING
busybox chmod 775 $sd_tweaked
busybox chown $android_uid:$android_gid $sd_tweaked
makedir $tweaked_logs 775 $sd_uid $sd_gid
echo 'Logging Started' > $tweaked_logs/a2sd-$datetime.log
echo '' >> $tweaked_logs/a2sd-$datetime.log
busybox mount -o remount,rw /
makedir $mnt_ext4 775 $data_uid $data_gid
busybox mount $blk_ext4 $mnt_ext4
sleep 1
makedir $mnt_temp 775 $data_uid $data_gid
busybox mount $blk_data $mnt_temp
sleep 1
makedir $ext_data 775 $data_uid $data_gid
makedir $ext_android 775 $android_uid $android_gid
busybox mount -o bind $ext_android $data_android
sleep 3
busybox mount -o remount,ro /
if [ $moveAndroid == 'true' ]
then
busybox find $temp_android -type f -follow -print > $txt_movethis
fi
if [ $moveAndroid == 'true' ]
then
echo 'Copying files from internal storage to external storage\n' >> $tweaked_logs/a2sd-$datetime.log
while read line
do
source=$line
destappend=$append_A$( echo "$line" | busybox cut -f2-100 -d'A' )
dest=$ext_android/$destappend
destfolder=$( busybox dirname $dest )
if [ ! -f "$dest" ]
then
if [ ! -d "$destfolder" ]
then
busybox mkdir -p "$destfolder"
fi
busybox cp -pdf "$source" "$dest"
if [ -f "$dest" ]
then
echo -e $source'\ncopied to\n'$dest'\n' >> $tweaked_logs/a2sd-$datetime.log
else
echo -e 'Failed to copy: '$source'\n' >> $tweaked_logs/a2sd-$datetime.log
fi
else
echo -e 'Already exists: '$dest'\n' >> $tweaked_logs/a2sd-$datetime.log
fi
if [ $deletepostmove == 'true' ]
then
if [ -f "$dest" ]
then
busybox rm -f "$line"
if [ ! -f "$line" ]
then
echo -e 'deletepostmove = true - Deleted: '$source'\n' >> $tweaked_logs/a2sd-$datetime.log
echo -e '____________________________________________________________ ' >> $tweaked_logs/a2sd-$datetime.log
else
echo -e 'Failed to delete: '$source'\n' >> $tweaked_logs/a2sd-$datetime.log
echo -e '____________________________________________________________ ' >> $tweaked_logs/a2sd-$datetime.log
fi
fi
fi
done < $txt_movethis
busybox rm -f $txt_movethis
busybox chmod -R 775 $ext_android/*
busybox chown -R $android_uid:$android_gid $ext_android/*
fi
busybox umount $mnt_temp
if [ $pruneoldlogs == 'true' ]
then
(( prunehours = ($prunehoursold * 60) ))
find $tweaked_logs -mmin +$prunehours -exec rm {} \;
echo "All logs older than "$prunehoursold" hours old have been deleted"
fi
echo -e '\nEnd of Log' >> $tweaked_logs/a2sd-$datetime.log
fi
Click to expand...
Click to collapse
Where to find premission? Please advice.
Sent from my GT-N8000 using xda app-developers app
andylam16 said:
Where to find premission? Please advice.
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
use a root file browser then press and hold on the file, select permissions. Change to: Owner (rwx), group and other (rx)
Sent from my GT-N8013 using Tapatalk 2
My device doesn't have intI. D folder in system/Etc
I have to create new folder?
Rename the file without . Txt?
Sent from my GT-N8000 using Tapatalk 2
lm that guy said:
use a root file browser then press and hold on the file, select permissions. Change to: Owner (rwx), group and other (rx)
Sent from my GT-N8013 using Tapatalk 2
Click to expand...
Click to collapse
Thanks bro, is r = read , w = write , x = ???
Please advice.
Sent from my GT-N8000 using xda app-developers app
andylam16 said:
Thanks bro, is r = read , w = write , x = ???
Please advice.
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
Execute
Sent from my GT-N8013 using Tapatalk 2
lm that guy said:
Execute
Sent from my GT-N8013 using Tapatalk 2
Click to expand...
Click to collapse
Got it, thanks!:thumbup:
Sent from my GT-N8000 using xda app-developers app
kaipro said:
My device doesn't have intI. D folder in system/Etc
I have to create new folder?
Rename the file without . Txt?
Sent from my GT-N8000 using Tapatalk 2
Click to expand...
Click to collapse
+1
fauzin said:
+1
Click to expand...
Click to collapse
I suggest this thread: http://forum.xda-developers.com/showthread.php?t=1883125
Sent from my GT-N8013 using Tapatalk 2
kaipro said:
My device doesn't have intI. D folder in system/Etc
I have to create new folder?
Rename the file without . Txt?
Sent from my GT-N8000 using Tapatalk 2
Click to expand...
Click to collapse
Check link in my sig for my other thread where you can get the init.d enabler.
After did the procedure as mentioned nothing happened the apps still go to the scared not the external. Please advice anything I missed. Thanks
Sent from my GT-N8000 using xda app-developers app
---------- Post added at 10:54 AM ---------- Previous post was at 10:12 AM ----------
One more thing there is a file "99testinit" inside the init.d , do I need to anything about it?
Sent from my GT-N8000 using xda app-developers app
andylam16 said:
After did the procedure as mentioned nothing happened the apps still go to the scared not the external. Please advice anything I missed. Thanks
Sent from my GT-N8000 using xda app-developers app
---------- Post added at 10:54 AM ---------- Previous post was at 10:12 AM ----------
One more thing there is a file "99testinit" inside the init.d , do I need to anything about it?
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
Exactly same as me.
Sent from my GT-N8000 using Tapatalk 2
If you guys read everything, this is still an early version. At the moment, only /sdcard/Android is getting moved, which is the location that stores extra files downloaded by apps, not the apps themselves. If the script is running, you can go on terminal and type:
Code:
df -h
and you should see mmcblk1p2 (which is the ext4 partition in the MicroSD) and how much space is being used, which is the amount of space that should be getting saved from the internal storage. Also, if you look under storage under settings, the amount of space available should have increased considerably, specially if you have a lot of games.
I'll be working on the other two parts throughout this week (moving APK and DATA) Then you will be able to notice a bigger difference, although it will always look like apps are installed in the internal storage, even when they're in the external storage.
The reason for this is because the script works by mounting the external storage to:
/data/app (not yet implemented)
/data/data (not yet implemented)
/data/media/Android (already implemented)
while at the same time copying the contents of those locations from internal to external then wiping them from internal. Essentially when it's all said and done, the OS pretty much thinks that nothing has changed, except that whenever anything gets written to those folders it takes space from the external storage instead of internal.
A good way to test it would be to download a free gameloft game like MIB3 or Six Guns. Take a look at storage before installing. After you install MIB3, your available storage should drop by roughly 500MB, but if you're using the script, even at preview stage, the available storage will only drop by about 30MB, even though storage settings will say that the game takes up ~500MB.
Also, you can mount your normal data partition and take a look at how much space is being used there, as opposed to the external partition like this:
(All the following commands in terminal)
make sure which partition is mounted to /data
# mount
mount data to temp location (assuming data is mmcblk0p12)
# mount /dev/block/mmcblk0p12 /mnt/ext4/temp
check amount of space used in internal storage:
# du -dh /mnt/ext4/temp/media/Android
check amount of space used in external storage
# du -dh /mnt/ext4/data/Android
In the future I'll add to the script a way to automatically calculate the amount of space saved
The script itself is not working. Init.d is working, did rename the file and changed permission. I use script manger and try to run the script but it's got error,
Sent from my GT-N8000 using xda app-developers app
htainlin said:
The script itself is not working. Init.d is working, did rename the file and changed permission. I use script manger and try to run the script but it's got error,
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
I'm gonna be uploading a new version soon with more debugging so I can see why people might have issues.
EDIT - Done updating OP
Is there any recommendations for the partition other than ext4, like swap size and what not? I also assume a reboot is required in order to get it to run right? I am still getting insufficient storage available when updating apps in the play store. I was getting that error before, even though I have plenty of space, like more than 10 gb on the internal memory so I don't know if it is just a batch update issue on the play store with my note for whatever reason. But even individual updates stop with an insufficient storage error.
I have tried using both the attached file in the op as well as the copy and paste method. The file should have no extension once in place right?
It seems as though it is still not working right
I have init.d working, confirmed with the test file and your method, Busybox installed, partitions with 0 swap and 1024 size at ext4
I have not been able to locate a log created, where is it dumped to to see if it is even running the script?
EDIT: never-mind, I figured out why my stuff was't updating but still able to add new apps, in rom tool box, I set it to install to sd card after most of my apps were already put on the internal memory. Just switched it to auto and it fixed it up
smaw51 said:
Is there any recommendations for the partition other than ext4, like swap size and what not? I also assume a reboot is required in order to get it to run right? I am still getting insufficient storage available when updating apps in the play store. I was getting that error before, even though I have plenty of space, like more than 10 gb on the internal memory so I don't know if it is just a batch update issue on the play store with my note for whatever reason. But even individual updates stop with an insufficient storage error.
I have tried using both the attached file in the op as well as the copy and paste method. The file should have no extension once in place right?
It seems as though it is still not working right
I have init.d working, confirmed with the test file and your method, Busybox installed, partitions with 0 swap and 1024 size at ext4
I have not been able to locate a log created, where is it dumped to to see if it is even running the script?
EDIT: never-mind, I figured out why my stuff was't updating but still able to add new apps, in rom tool box, I set it to install to sd card after most of my apps were already put on the internal memory. Just switched it to auto and it fixed it up
Click to expand...
Click to collapse
Had a similar problem when i had the tf201, kept getting an error whenever playstore started installing an app after the initial download, and i had the same problem a couple of days ago with the note which i resolved by deleting all odex files in the data\apps folder, i used es file explorer, navigated to the app folder and did a search for 'odex', then deleted them, i can now install apps again
Dont know if this is the same issue as yours , and ive just now seen your edit, so i see youve resolved it, so no worries, hopefully our solutions will help out others
Edit: dont quote me but my particular issue i 'think' has something to do with titanium backup, so for those having 'inssuficient storage errorr' in the playstore AND you have titanium backup, this may help
It might be a restore from backup in general issue, after you mention you used titanium. I used my backup pro to restore apps and data from my tf 700 to the my note. Only halfsies worked but maybe that caused some issues.
This is going to be very nice one apk and data are enabled to move to sd
how do I know that I have ext4 in my SDcard? and if I dont have it , How do I make ext4 ?
Thanks
Hi All,
Workaround http://forum.xda-developers.com/showpost.php?p=37246757&postcount=11
I've put together aroma installer for installing Google Apps to NATIVESD Jelly bean ROM's.
Theoretically it should work for all rom's, but I haven't tested it yet
You can download it from: gapps-jb-20121011_NativeSD_v1.zip - 90.33 MB
Changelog:
v1: 20.01.2012 attempt to add suport for PAC
Old version:gapps-jb-20121011_NativeSD.zip - 90.33 MB
IF you want to say thanks to anyone, say thanks to Securecrt, Xylograph for giving us NATIVESD
HypoTurtle for providing code for universal installer His work
Hi, has anyone tried it, is it working? I would appreciate to get feedback on which ROMs is it working or not.
Thanks
Sent from my HTC HD2 using xda premium
Does't work for me
Sent from my HTC HD2 using xda premium
samehfarahat said:
Does't work for me
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
What is your setup? ROM name, etc..?
PAC 1.2a
Sent from my HTC HD2 using xda premium
OK, I'll check it out during the weekend
GAPPS NativeSD installer Does not Work
Doesn't work for me either
I am using "16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD] "
Please help!
Thanks
Hi guys,
I think I found the issue at least for PAC rom. I was caused by slightly different way of mounting partitions. I'm uploading new zip right now, first post should be updated in few minutes.
Please let me know if it's working for you now.
If you do not want to wait, you can replace contents of mount_NativeSD.sh file with following script:
Code:
#!/sbin/sh
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
cp /ext4p/NativeSD/initrd.gz /tmp/initrd.gz
mkdir /tmp/ramd
cd /tmp/ramd
gzip -d -c ../initrd.gz | cpio -i -d
#!/bin/sh
if [ -a "init.android" ]
then
sed -n '/rom_name=/w romname.txt' /tmp/ramd/init
sed -i 's/rom_name=//' romname.txt
else
if [ -f "mountfs.sh" ]
then
sed -n '/rom_name=/w mount.txt' mountfs.sh
sed -n '1w romname.txt' mount.txt
sed -i 's/rom_name="//' romname.txt
sed -i 's/"//' romname.txt
else
sed -n '/--bind/,/system/w initrc.txt' init.rc
sed -n '1w romname.txt' initrc.txt
sed -i 's,exec /bin/busybox mount --bind /NativeSD/,,
s,/system /system,,
s/ *//g' romname.txt
sed -i 's/[[:blank:]]//g' romname.txt
fi
fi
export ROM_NAME=`cat romname.txt`
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
asisislam said:
Doesn't work for me either
I am using "16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD] "
Please help!
Thanks
Click to expand...
Click to collapse
If new version is still not working for you, please post initrd.gz from your NATIVESD folder.
I tried the gapps-jb-20121011_NativeSD_v1.zip
for 2 ROMs:
[Dec. 9, 2012][ROM][720p] NexusHD2-JellyBean-4.1.2-CM10 V1.3a [NativeSD]
and
[16JAN2013][ROM][JB][4.1.2]C.A.M.P.S_HD2_v1.3[CM10/AOKP/MIUI/PA/SONY][WIP][NATIVESD]
Unsuccessfull in both cases, I got the following error message:
Applying to SD-EXT
Mounting EXT PArtition
file_getprop: failed to stat "/tmp/nfo.prop": No such file or directory
(Attached are the initrd.files)
Well it seems that just about every ROM has a bit different method of setting ROM name. It's going to be very hard to create automatic script.
In the meantime you can do the following.
1. download zip file
2. create new file called mount_NativeSD.sh anywhere with following contents
Code:
#!/sbin/sh
# Set the ROM name
ROM_NAME=[COLOR="Red"]ROM_NAME[/COLOR]
export ROM_NAME
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
# mkdir -p /sdcard/NativeSD/$ROM_NAME
# mkdir -p /boot /boot_dir
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
# mkdir -p /ext4p/$ROM_NAME/system /ext4p/$ROM_NAME/data
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
# mount --bind /sdcard/NativeSD/$ROM_NAME /boot
# mount --bind /sdcard/NativeSD /boot_dir
#delete the old system
# rm -rf /system/*
#clean the dalvik-cache
# rm -rf /data/dalvik-cache/*
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
3. Replace red text with desired ROM name (eg. JellyBelly, PA_LEO, PAC, etc...)
4. replace mount_NativeSD.sh file inside the zip with the file you just created (name should be mount_NativeSD.sh)
hi, I tried with JellyTime R32 but it doesn't work, I tried replacing the rom name with JellyTime and JellyTime_R32 but I got file_getprop: failed to stat "/tmp/nfo.prop": No such file or directory . Here is my init file..
dcos said:
Hi All,
Workaround http://forum.xda-developers.com/showpost.php?p=37246757&postcount=11
I've put together aroma installer for installing Google Apps to NATIVESD Jelly bean ROM's.
Theoretically it should work for all rom's, but I haven't tested it yet
You can download it from: gapps-jb-20121011_NativeSD_v1.zip - 90.33 MB
Changelog:
v1: 20.01.2012 attempt to add suport for PAC
Old version:gapps-jb-20121011_NativeSD.zip - 90.33 MB
IF you want to say thanks to anyone, say thanks to Securecrt, Xylograph for giving us NATIVESD
HypoTurtle for providing code for universal installer His work
Click to expand...
Click to collapse
You can choose the programs ?
Could We Enable/Disable Magisk Module By Using Terminal Emulator?
Code:
touch /sbin/.core/img/<modulefolder>/disable
Didgeridoohan said:
Code:
touch /sbin/.core/img/<modulefolder>/disable
Click to expand...
Click to collapse
Thanks.
For Enabling The Module, Will It Be touch /sbin/.core/img/<modulefolder>/enable?
Dreamer(3MF) said:
Thanks.
For Enabling The Module, Will It Be touch /sbin/.core/img/<modulefolder>/enable?
Click to expand...
Click to collapse
Code:
rm -f /sbin/.core/img/<modulefolder>/disable
Could I Ask About The Wrong In This Code?
Code:
txt="Folder"
txt1=${txt/file/x} || ${txt/folder/x} || ${txt/Name/z} || "Deleted Folder"
Dreamer(3MF) said:
Could I Ask About The Wrong In This Code?
Code:
txt="Folder"
txt1=${txt/file/x} || ${txt/folder/x} || ${txt/Name/z} || "Deleted Folder"
Click to expand...
Click to collapse
I'm a proper scripting pleb, but I'll bite... What are you trying to do?
Right now it looks like you're doing:
Code:
Define the variable "txt1" as:
Replace the string "file" with the string "x" in the variable "txt"
OR
Replace the string "folder" with the string "x" in the variable "txt"
OR
Replace the string "Name" with the string "z" in the variable "txt"
OR
"Deleted folder"
But you're not doing any kind of test to see which OR to use.
Dreamer(3MF) said:
Could I Ask About The Wrong In This Code?
Code:
txt="Folder"
txt1=${txt/file/x} || ${txt/folder/x} || ${txt/Name/z} || "Deleted Folder"
Click to expand...
Click to collapse
You can't use || with variables, that should only be for commands... like
Code:
is_mounted /data || mount /data 2>/dev/null || is_mounted /cache || mount /cache 2>/dev/null || exit 1
If you could explain what you're trying to assign to txt1 and how, we could be able to help you script that.
JayminSuthar said:
You can't use || with variables, that should only be for commands... like
Code:
is_mounted /data || mount /data 2>/dev/null || is_mounted /cache || mount /cache 2>/dev/null || exit 1
If you could explain what you're trying to assign to txt1 and how, we could be able to help you script that.
Click to expand...
Click to collapse
Txt=$(getprop "ro.modversion")
Txt1=I Want To Replace The Word Of 'UNOFFICIAL' Or 'Unofficial' Or 'unofficial' With 'Official'
resetprop ro.modversion "$Txt1"
Didgeridoohan said:
Code:
rm -f /sbin/.core/img/<modulefolder>/disable
Click to expand...
Click to collapse
Is There A Command To Get This Path '/sbin/.core/img' Something Like ${0%/*}?
Dreamer(3MF) said:
Txt=$(getprop "ro.modversion")
Txt1=I Want To Replace The Word Of 'UNOFFICIAL' Or 'Unofficial' Or 'unofficial' With 'Official'
resetprop ro.modversion "$Txt1"
Click to expand...
Click to collapse
Just converting the string to lower case and then using a sed replace command sounds like the easiest way to do it. There are probably better ways though...
Dreamer(3MF) said:
Is There A Command To Get This Path /sbin/.core/img/ Something Like ${0%/*}?
Click to expand...
Click to collapse
The dirname command should work on that.
Didgeridoohan said:
Just converting the string to lower case and then using a sed replace command sounds like the easiest way to do it. There are probably better ways though...
The dirname command should work on that.
Click to expand...
Click to collapse
Thanks A Lot For Your Interesting. For 'dirname', Could You Give Me An Example?
Dreamer(3MF) said:
Thanks A Lot For Your Interesting. For 'dirname', Could You Give Me An Example?
Click to expand...
Click to collapse
https://duckduckgo.com/?q=dirname+command+syntax
Dreamer(3MF) said:
Txt=$(getprop "ro.modversion")
Txt1=I Want To Replace The Word Of 'UNOFFICIAL' Or 'Unofficial' Or 'unofficial' With 'Official'
resetprop ro.modversion "$Txt1"
Click to expand...
Click to collapse
Yes, sed does that, but for the purpose I'd recommend tr should be better. Something like...
Code:
ALL_LOWER_CASE=$(echo "$YOUR_STRING_HERE" | tr [:upper:] [:lower:]);
Dreamer(3MF) said:
Is There A Command To Get This Path '/sbin/.core/img' Something Like ${0%/*}?
Click to expand...
Click to collapse
Where are you gonna put that, a terminal or a boot script or in any Magic Mounted script ??
The method @Didgeridoohan said should work for boot scripts, for terminal, there is a way, but too complicated, for Magic Mounted scripts, do something like...
Code:
LOOP_DEVICE=$(cat /proc/mounts | grep " $0 " | cut -d= -f1);
MOUNT_POINT=$(cat /proc/mounts | grep $LOOP_DEVICE | cut -d' ' -f2 | grep -v "^/system\|^/vendor");
and then use $MOUNT_POINT for /sbin/.core/img.
EDIT: Fixed a little flaw.
What Is The Output Of ${0%/*}?
Dreamer(3MF) said:
What Is The Output Of ${0%/*}?
Click to expand...
Click to collapse
Well,
$0 is a shell internal variable which points to the current file path (or function if some modern shell). The curly braces there implement variable manipulation. You can get further details from mksh manpages regarding variable manipulation. In the case you asked, ${0%/*} will give remove the trailing one slash and then any string. So if $0 for service.sh is /sbin/.core/img/modid/service.sh, then ${0%/*} will be /sbin/.core/img/modid. The same logic applies to post-fs-data.sh script.
But, if you are Magic Mounting a script, and you want to get MOUNT_POINT from script than those boot scripts, the best practice would be to implement:
Code:
LOOP_DEV=$(cat /proc/mounts | grep ' PATH/TO/MAGIC/MOUNTED/SCRIPT/IN/REAL/SYSTEM ' | cut -d' ' -f1)
MOUNT_POINT=$(cat /proc/mounts | grep "^$LOOP_DEV" | cut -d' ' -f2 | grep -Ev '^/system|^/vendor')
## MOUNT_POINT now has /sbin/.core/img
Happy coding from JayminSuthar
JayminSuthar said:
Well,
Happy coding from JayminSuthar
Click to expand...
Click to collapse
Thanks JayminSuthar
JayminSuthar said:
Well,
Happy coding from JayminSuthar
Click to expand...
Click to collapse
@JayminSuthar
Kindly Send Your Reply For The Following
- How To Create A Symlink Between /system/bin/su & /sbin/su?
- What About The Required Permissions-Owner-Group For Files & Directories?
- Is There A Command To Get This Path '/sbin/su' Something Like ${0%/*}?
Dreamer(3MF) said:
@JayminSuthar
Kindly Send Your Reply For The Following
- How To Create A Symlink Between /system/bin/su & /sbin/su?
- What About The Required Permissions-Owner-Group For Files & Directories?
- Is There A Command To Get This Path '/sbin/su' Something Like ${0%/*}?
Click to expand...
Click to collapse
Sure,
- Use ln with the [-s] flag, assuming /sbin/su is the origin, do
Code:
ln -s /sbin/su /system/bin/su
I assume you're rooted with Magisk, otherwise checking for target's existence and acting accordingly will be necessary.
- I should really leave that up to where they are located, and how they're used. If in /system/*bin, I'd give 0 2000 0755, if in /system/etc/init.d, I'd give 0 0 0755, I could suggest if you told me the actual location. Just keep in mind, only give those which are necessary for proper performance as long as the Android kernel/selinux is intelligent.
- If MagiskHide is not running, you can use either of which su or command -v su, both do the same. The only thing that differs, which is external while command is a shell built-in. I wouldn't handle the case when MagiskHide is running.
Regards.
What Are The Required Commands To Block Yahoo.Com With Its Sub-Domains?
Dreamer(3MF) said:
What Are The Required Commands To Block Yahoo.Com With Its Sub-Domains?
Click to expand...
Click to collapse
You can apply the regex .*\.yahoo\.com into your blocklist.
I have Magisk v18.1 installed on my OG Pixel running PixelDust ROM and noticed every so often it loses root access. When entering the Magisk Manager app it also shows Magisk Not Installed. I did some investigating and found that magiskd (magisk daemon) gets terminated at some point randomly. Further testing revealed I could restart it manually by issuing "magisk --daemon" via SSH/ADB root shell.
I wrote a simple module to keep the daemon running and haven't noticed the "Magisk Not Found" error since. The module is just a simple bash script executed as service on boot that checks every minute for the daemon and runs the "magisk --daemon" command as root if not running. I am just posting it here to see if it can help anyone else who's root access disappears randomly on v17-19.3.
Please be aware that this is my first module ever. It was also originally started via an init.d script instead of the service hook in magisk, though it should work exactly the same. I have also noticed it is not possible for my module to restart magiskd yet if it was killed manually by the user.
GIt Repo:
https://github.com/Geofferey/mgkdhelper
Magisk Repo Submission:
https://github.com/Magisk-Modules-Repo/submission/issues/404
Release:
UNINSTALL INITIAL v1.0.0 RELEASE BEFORE INSTALL!!!
If you fail to do so you will have the old version and current version running at same time.
Download:
Current Release v2.1.0
Major thanks to @jcmm11 & @char101 whose contributions are now officially included in this module.
I just wanna say God bless you for this module, my man. I was frustratingly having my Magisk daemon getting killed 2-3 times a day On my LG V20. Since installing your module for the past 4 days ive yet to encounter such an issue. I greatly appreciate you coming up w/a solution to a problem that was frustrating me to the max
Geofferey said:
I wrote a simple module to keep the daemon running and haven't noticed the "Magisk Not Found" error since.
Click to expand...
Click to collapse
Thanks for that module. Very good idea and it's working perfectly fine. :good:
Hi,
There is no /data/local/run directory by default on my phone (OP6 Pie). So I suggest that either you create it first or simply uses /data/local/tmp to store the pid. Also creating the directory first might be a good idea. If you add -q to the grep command there is no need to redirect the output.
Code:
#!/system/xbin/bash
PIDFILE=/data/local/tmp/magiskd-helper.pid
LOGFILE=/data/local/tmp/magiskd-helper.log
is_magisk_running() {
ps -a | grep -q [m]agiskd
}
if [ ! -d /data/local/tmp ]; then
mkdir -p /data/local/tmp
fi
if [ -f $PIDFILE ]; then
kill -9 `cat $PIDFILE`
fi
echo $$ > $PIDFILE
RETRIES=0
while true; do
sleep 60
if ! is_magisk_running; then
echo `date` >> $LOGFILE
echo 'Magisk daemon appears to have crashed' >> $LOGFILE
echo 'Restarting magiskd...' >> $LOGFILE
/sbin/magisk --daemon
if is_magisk_running; then
echo 'Success!' >> $LOGFILE
RETRIES=0
else
echo 'Failure!' >> $LOGFILE
((++RETRIES))
if (( $RETRIES > 10 )); then
echo 'Giving up' >> $LOGFILE
break
fi
fi
echo >> $LOGFILE
fi
done
When first run, /system/bin/ps is linked to magisk builtin busybox, which don't have the -u option
Code:
ps: invalid option -- u
BusyBox v1.30.1-topjohnwu (2019-04-30 01:01:15 EDT) multi-call binary.
Usage: ps [-o COL1,COL2=HEADER] [-T]
Show list of processes
-o COL1,COL2=HEADER Select columns for display
-T Show threads
char101 said:
When first run, /system/bin/ps is linked to magisk builtin busybox, which don't have the -u option
Code:
ps: invalid option -- u
BusyBox v1.30.1-topjohnwu (2019-04-30 01:01:15 EDT) multi-call binary.
Usage: ps [-o COL1,COL2=HEADER] [-T]
Show list of processes
-o COL1,COL2=HEADER Select columns for display
-T Show threads
Click to expand...
Click to collapse
Try again after having install the 'Busybox for NDK' Magisk module (from osm0sis), maybe that the -u arg for ps command will works i ddon't remember me having testing it recently so idk if it will works but i think yeah
I have the GNU coreutils module installed so it is not the problem.
Also the original module redirect stderr to /dev/null so unless you modify it you won't see the error like I posted before.
My modifications
service.sh
Code:
#!/system/bin/sh
# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script
# and module is placed.
# This will make sure your module will still work
# if Magisk change its mount point in the future
MODDIR=${0%/*}
# This script will be executed in late_start service mode
$MODDIR/common/magisk-monitor > /data/local/tmp/magisk-monitor.log 2>&1 &
magisk-monitor
Code:
#!/system/bin/sh
is_magisk_running() {
ps -A | grep -q [m]agiskd
}
sleep 300
echo `date`
echo 'magisk-monitor running'
echo
RETRIES=0
while true; do
sleep 60
if ! is_magisk_running; then
echo `date`
echo 'Magisk daemon appears to have crashed'
echo 'Restarting magiskd...'
/sbin/magisk --daemon
if is_magisk_running; then
echo 'Success!'
RETRIES=0
else
echo 'Failure!'
((++RETRIES))
if (( $RETRIES > 10 )); then
echo 'Giving up'
break
fi
fi
echo
fi
done
Rom said:
Try again after having install the 'Busybox for NDK' Magisk module (from osm0sis), maybe that the -u arg for ps command will works i ddon't remember me having testing it recently so idk if it will works but i think yeah
Click to expand...
Click to collapse
I doubt it... From busybox.net:
ps
Report process status
Options:
-o col1,col2=header Select columns for display
-T Show threads
Click to expand...
Click to collapse
It is better to just use 'ps -A' which will work on busybox ps and coreutils ps.
Didgeridoohan said:
I doubt it... From busybox.net:
Click to expand...
Click to collapse
I'm agree with u, but it was already happen for me that some other args works too, i had never know why.
I came across your module while looking for the same issue affecting many users on different devices (although it seems to be affecting Pie only). Magisk GitHub is also full of reports by people losing root and solving with a reboot. I don't know how impactful it is on the battery since it checks for Magisk every 60 seconds (I have just installed it) but so far your module is the only blessing we can get to avoid rebooting once/twice per day. I think you should definitely submit your module to the official repository!
P.s i had to create /data/local/run first for the pid
@Geoffrey another quick correction: in my case on MIUI 10 based on Pie, ps -a does not show the same output as ps -A. So I had to replace the -a in your script with an upper case A.
char101 said:
It is better to just use 'ps -A' which will work on busybox ps and coreutils ps.
Click to expand...
Click to collapse
Coreutils doesn't have a ps applet. If you want to use -u just use the full path /system/bin/ps to force the toybox applet.
@Geoffrey
First of all nice workaround. I did some cleanup and a few modifications if you want to post it to the Magisk repository (and I think you should).
Changed over to the current template.
Removed all the PID stuff, it's really not needed.
Replaced ps -a -u with pgrep. That eliminates any busybox vs toybox issues (at least the way it's being used here)
Removed bash. There's nothing here that requires a bash shell as opposed to the default shell.
Moved the script to it's own directory instead of xbin. Not all phones have xbin, and trying to use it on those that don't is problematic. Plus there's no reason the script needs to be in the PATH.
Added nohup to the script startup command in service.sh
Also always create the log file, with a "started on" line in it. That at least gives an indication that the script started.
So what we're left with.
mgkd-helper (in a script directory)
Code:
#!/system/bin/sh
LOGFILE=/data/local/tmp/magiskd-helper.log
rm -f $LOGFILE
echo "Started " $(date) >> $LOGFILE
echo "-----------------------------" >> $LOGFILE
echo >> $LOGFILE
while true; do
sleep 60
if ! pgrep magiskd >/dev/null; then
echo $(date) >> $LOGFILE
echo "Magisk daemon appears to have crashed" >> $LOGFILE
echo "Restarting magiskd..." >> $LOGFILE
if magisk --daemon; then
echo "success!" >> $LOGFILE
else
echo "failure!" >> $LOGFILE
fi
echo >> $LOGFILE
fi
done
service.sh
Code:
#!/system/bin/sh
# Do NOT assume where your module will be located.
# ALWAYS use $MODDIR if you need to know where this script
# and module is placed.
# This will make sure your module will still work
# if Magisk change its mount point in the future
MODDIR=${0%/*}
# This script will be executed in late_start service mode
#Magisk Daemon Helper
# Copyright (C) 2019 Geofferey @ XDA
# License: GPL V3+
nohup $MODDIR/script/mgkd-helper > /dev/null &
If you do decide to place it in the repository you need to do something with README.md
You should also replace META-INF/com/google/android/update-binary with the attached version. The included version is for standalone installs. Repository versions should use the alternate one. (Remove the ".txt")
Last note: tested this and it does work. I killed the running magiskd and a new one was started, with the appropriate log entry created
I wasn't able to start magiskd with "magisk -- daemon" via adb. It always says "No daemon found" instead of starting it. I seem to have lost root with the original script and I had to restart again. Any idea? I just enabled root via adb in Magisk. Not sure if that was the issue that I couldn't restart it.
And it seems like magiskd is killed in OxygenOS 9.0.5 on my OnePlus 6. Not sure if it is due to out of memory reasons but I can't get any logcat as I don't have root. Super annoying.
Will this be added to the magisk module repository? If it is there I couldn't find it. I do know there are links and a revision at the end of the thread by @jcmm11. I don't need the module, just curious if the revision will be put there eventually. I have had others with that problem that I have helped.
Thanks
martyfender said:
Will this be added to the magisk module repository? If it is there I couldn't find it. I do know there are links and a revision at the end of the thread by @jcmm11. I don't need the module, just curious if the revision will be put there eventually. I have had others with that problem that I have helped.
Thanks
Click to expand...
Click to collapse
I think it should be but it's up to @Geoffrey. It's his module. I cleaned it up a bit that's all. Most of the work is done. Biggest thing left to do is modify README.md
jcmm11 said:
@Geoffrey
First of all nice workaround. I did some cleanup and a few modifications if you want to post it to the Magisk repository (and I think you should).
Changed over to the current template.
Removed all the PID stuff, it's really not needed.
Replaced ps -a -u with pgrep. That eliminates any busybox vs toybox issues (at least the way it's being used here)
Removed bash. There's nothing here that requires a bash shell as opposed to the default shell.
Moved the script to it's own directory instead of xbin. Not all phones have xbin, and trying to use it on those that don't is problematic. Plus there's no reason the script needs to be in the PATH.
Added nohup to the script startup command in service.sh
Also always create the log file, with a "started on" line in it. That at least gives an indication that the script started.
So what we're left with.
mgkd-helper (in a script directory)
service.sh
If you do decide to place it in the repository you need to do something with README.md
You should also replace META-INF/com/google/android/update-binary with the attached version. The included version is for standalone installs. Repository versions should use the alternate one. (Remove the ".txt")
Last note: tested this and it does work. I killed the running magiskd and a new one was started, with the appropriate log entry created
Click to expand...
Click to collapse
Should we directly flash zip in twrp recovery
kryshnakishore said:
Should we directly flash zip in twrp recovery
Click to expand...
Click to collapse
You can flash it in recovery or via Magisk Manager, modules section, big + button at bottom of screen.
I've been looking for a solution to this since v17 ... started happening on 17, kept happening on 18, is even worse now on v19 ... :-/