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.
Related
I wrote a small script with a wget command:
wget https://xxxxxxxlain.html?url=&meth=plain&action=login&time=480&uid=xxx&pswd=xxxx&submit=1
the script is called sesame
Put in on root of sd
terminal emulator:
Code:
$ su
# chmod 777 sesame
# ./sesame
: permission denied
How can that be?
Because the G1 uses ash, not bash, as its shell/CLI.
Rather than "./", use "sh ./"
IConrad01 said:
Because the G1 uses ash, not bash, as its shell/CLI.
Rather than "./", use "sh ./"
Click to expand...
Click to collapse
also, unless you had previously cd'ed to sdcard you must add the path so
Code:
sh /sdcard/sesame
should work
That's implicit when you understand the "." to mean "current directory".
I.e.; "find . -print" will print out every file in your current directory in a list. Going a step fancier you could also use "find . | grep .apk" to find all .apk's in your active directory.
Fun with commands!
Hey guys,
I had a nasty issue with Bi-Winning a couple weeks ago where I pushed custom framework and totally forgot about permissions. Apparently when you don't set the proper permissions it can really slow things down.
So I figured this could easily be avoided. So because of that and our CWM "Fix Permissions" option doesn't really do anything, I wrote this script to fix it!
Upon every boot, it will scan /system/app, /system/framework/, and /data/app and set the proper permissions for all the files in there.
Users
note if you're on Trigger 2.9.1+ or Bi-Winning V1+ you do NOT have to do this. It's built into your ROM already.
Flash the attached zip named "CWM_Flash_Permissions_Script.zip"
Ironically, it may not have the correct permissions after you flash it, so then do either of the following
1) Do these commands in ADB to set the correct permissions
Code:
adb shell
mount -o rw,remount /dev/block/stl9 /system
busybox chmod 777 /system/etc/init.d/*
or
2) Open up Root Explorer (or something similar)
navigate to /system/etc/init.d/
in there find the new file S30edt_perms
long press, and set the permissions
make it look like this
Code:
x x x
x x x
x x x
Here's the init.d script, it's really simple, but also effective
Code:
#!/system/bin/sh
# Permission script
# Written by Einherjar Dev Team
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
mount -o rw,remount /dev/block/stl9 /system
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo " setting permissions (644) for $file" >> $logFile
chmod 644 $file
done
echo "chmodding init.d folder"
chmod 777 /system/etc/init.d
for file in /system/etc/init.d/*; do
echo " setting permissions (777) for $file" >> $logFile
chmod 777 $file
done
echo "Permissions set" >> $logFile
Very cool, thanks roman.
Very cool to post the code too... lets us linux newbs get our learn on!
Poser said:
Very cool, thanks roman.
Very cool to post the code too... lets us linux newbs get our learn on!
Click to expand...
Click to collapse
I'm a Linux noobie myself!
birgertime said:
I'm a Linux noobie myself!
Click to expand...
Click to collapse
[slight OT] Just getting wifi working on an old ideapad y510 in slackware was an epic struggle... (wicd my arse)
[back on topic] I wish more devs would post script contents (though we can easily download and look in vi or notepad)... it helps the learning curve immensely
grateful for all the work EDT and rest of dev community does. We all are.
Question: What does the fix permissions CWM do then?
Poser said:
[slight OT] Just getting wifi working on an old ideapad y510 in slackware was an epic struggle... (wicd my arse)
[back on topic] I wish more devs would post script contents (though we can easily download and look in vi or notepad)... it helps the learning curve immensely
grateful for all the work EDT and rest of dev community does. We all are.
Question: What does the fix permissions CWM do then?
Click to expand...
Click to collapse
I have no clue, lol. Never bothered looking at it
edit: I hate vi.
roman im gonna add S30edt_perms.zip to my rom ..ill add you to credits
birgertime said:
I have no clue, lol. Never bothered looking at it
edit: I hate vi.
Click to expand...
Click to collapse
lol.
Vi is about as stripped down as you can get when it comes to text based editors... (I know its blasphemous... but I dig notepad++, shhh... dont tell)
I get "Bad Mode"
gamefreakgcb said:
I get "Bad Mode"
Click to expand...
Click to collapse
Hmm, ok you might need super user permissions do this and let me knkow if it works:
1) type in "adb shell"
2) type in su (don't press enter yet)
3) turn your screen on & unlock it
4) press enter on the su prompt, then his yes on the screen
then try that chmod command again.
birgertime said:
Hmm, ok you might need super user permissions do this and let me knkow if it works:
1) type in "adb shell"
2) type in su (don't press enter yet)
3) turn your screen on & unlock it
4) press enter on the su prompt, then his yes on the screen
then try that chmod command again.
Click to expand...
Click to collapse
Gave permission, still "Bad Mode"
gamefreakgcb said:
Gave permission, still "Bad Mode"
Click to expand...
Click to collapse
bad mode in the command line? gotta give me something more here
if it' s when you run chmod +x try this one:
Code:
busybox chmod 777 /system/etc/init.d/*
birgertime said:
bad mode in the command line? gotta give me something more here
if it' s when you run chmod +x try this one:
Code:
busybox chmod 777 /system/etc/init.d/*
Click to expand...
Click to collapse
When I do that, I get
chmod: /system/etc/init.d/S01edt_systcl: Read-only file system
chmod: /system/etc/init.d/S20edt_gps: Read-only file system
chmod: /system/etc/init.d/S30edt_perms: Read-only file system
chmod: /system/etc/init.d/S50edt_zipalign: Read-only file system
chmod: /system/etc/init.d/S98edt_tweaks: Read-only file system
chmod: /system/etc/init.d/S99edt_complete: Read-only file system
gamefreakgcb said:
When I do that, I get
chmod: /system/etc/init.d/S01edt_systcl: Read-only file system
chmod: /system/etc/init.d/S20edt_gps: Read-only file system
chmod: /system/etc/init.d/S30edt_perms: Read-only file system
chmod: /system/etc/init.d/S50edt_zipalign: Read-only file system
chmod: /system/etc/init.d/S98edt_tweaks: Read-only file system
chmod: /system/etc/init.d/S99edt_complete: Read-only file system
Click to expand...
Click to collapse
Oh crap, thanks for pointing that out man. Easy fix
do this
Code:
mount -o rw,remount /dev/block/stl9 /system
busybox chmod 777 /system/etc/init.d/*
should work like a charm
by the way, next time you flash a newer edt rom, they already have this fix built in. since you overwrote the file, you'll need to run the above commands to set the correct permissions as they get messed up sometimes when modifying them.
That did the trick, thanks.
The script in the .zip says
Code:
# Permission script
# Written by Roman (birgertime)
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo "setting permissions for $file" >> $logFile
chmod 0644 $file
done
echo "Permissions set" >> $logFile
Which is different than the OP. I'm confused.
MikeyMike01 said:
The script in the .zip says
Code:
# Permission script
# Written by Roman (birgertime)
# www.edtdev.com
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo "setting permissions for $file" >> $logFile
chmod 0644 $file
done
echo "Permissions set" >> $logFile
Which is different than the OP. I'm confused.
Click to expand...
Click to collapse
I notice that before... but got side tracked and forgot to mention something... I just pulled the one from in Bi-Winning V2 and have been ADB Push'ing that.
EDIT: Also noticed that the one that's in Dan_Brutal "Metrik Part 1- Pepperkake" is the wrong one.
Does this works on hd2 android? i really need this..
haysnamrip said:
Does this works on hd2 android? i really need this..
Click to expand...
Click to collapse
Should work on any Android that can run scripts
i flashed and its working.. no more changing permission after run fix_permissins on terminal emulator..
Hey Roman, thanks for yet another improvement for this phone!
Simple question: can I just download and push the S30edt_perms.zip to etc/int.d? And is this any good for CM7 based ROMs? I just checked and that file isn't in my init.d folder on Trigger Redux.
Thanks!
Sent from my rough sketch of a Vibrant on a brick.
Hey, I wonder if anyone is good with BASH is around here, what I want is simple, but for some reason it didn't work for me
So here is what I want, a .sh (or any other linux executable) file that executes the following code if the user input was the character 'm'
Code:
sudo mkdir /media/mp3
sudo chmod 775 /media/mp3
sudo mtpfs -o allow_other /media/mp3
and this if the input was 'u'
Code:
sudo umount /media/mp3
sudo rmdir /media/mp3
anything else: exit
thanks in advance
are you looking for something like this?
Code:
#!/bin/bash
if [ `whoami` != "root" ]; then
echo "you must execute this script with root priveleges!"
exit
fi
clear
echo
echo "enter m to mount /media/mp3 or enter u to unmount it"
echo
read moru
if [ "$moru" = "m" ]; then
mkdir -p /media/mp3
chmod 775 /media/mp3
mtpfs -o allow_other /media/mp3
elif [ "$moru" = "u" ]; then
umount /media/mp3
rmdir /media/mp3
fi
exit
HTH
the code seems ok, but still not working, the is the output in kate when I pipe it to terminal
(not that I was root when before I pipe it using su)
Code:
Dash-Netbook Desktop # #!/bin/bash
Dash-Netbook Desktop #
Dash-Netbook Desktop # if [ `whoami` != "root" ]; then
> echo "you must execute this script with root priveleges!"
echo "you must execute this script with root priveleges"]; then
bash: syntax error near unexpected token `then'
Dash-Netbook Desktop # exit
exit
[email protected] ~/Desktop $ fi
bash: syntax error near unexpected token `fi'
[email protected] ~/Desktop $
[email protected] ~/Desktop $ clear
[email protected] ~/Desktop $ echo
[email protected] ~/Desktop $ echo "enter m to mount /media/mp3 or enter u to unmount it"
enter m to mount /media/mp3 or enter u to unmount it
[email protected] ~/Desktop $ echo
[email protected] ~/Desktop $ read moru
[email protected] ~/Desktop $
[email protected] ~/Desktop $ if [ "$moru" = "m" ]; then
> mkdir -p /media/mp3
> chmod 775 /media/mp3
> mtpfs -o allow_other /media/mp3
> elif [ "$moru" = "u" ]; then
> umount /media/mp3
> rmdir /media/mp3
> fi
[email protected] ~/Desktop $
[email protected] ~/Desktop $ exit
husam666 said:
Hey, I wonder if anyone is good with BASH is around here, what I want is simple, but for some reason it didn't work for me
So here is what I want, a .sh (or any other linux executable) file that executes the following code if the user input was the character 'm'
Code:
sudo mkdir /media/mp3
sudo chmod 775 /media/mp3
sudo mtpfs -o allow_other /media/mp3
and this if the input was 'u'
Code:
sudo umount /media/mp3
sudo rmdir /media/mp3
anything else: exit
thanks in advance
Click to expand...
Click to collapse
I know it sounds stuff, but I don't know my way around Linux. What does that script actually do?
Sent from my HTC Wildfire S A510e using XDA
Bad-Wolf said:
I know it sounds stuff, but I don't know my way around Linux. What does that script actually do?
Sent from my HTC Wildfire S A510e using XDA
Click to expand...
Click to collapse
the first part mounts my mp3 player (MTP device) on the /media/mp3 directory
The other part unmounts it and deletes the directory
Sent from the brick
What distribution are you using?
Also, what errors do you get when you save that text to a text file (do this in linux, not windows), e.g. mountmp3.sh, make it executable (chmod +x mountmp3.sh) and run it (./mountmp3.sh)?
It seems to run the commands fine here (running Porteus, which is based on Slackware) but I don't have mtpfs installed, so I'm not testing every element...
use this one Husam!
on a terminal:
Code:
sudo -s
chmod +x husam.sh
sh husam.sh
I tweaked the code a bit and added extra functionality
You might wanna try that script without root...
.Ahau said:
What distribution are you using?
Also, what errors do you get when you save that text to a text file (do this in linux, not windows), e.g. mountmp3.sh, make it executable (chmod +x mountmp3.sh) and run it (./mountmp3.sh)?
It seems to run the commands fine here (running Porteus, which is based on Slackware) but I don't have mtpfs installed, so I'm not testing every element...
Click to expand...
Click to collapse
ok, I'm using linux mint kde 12.1, and I use kate for a text editor, I didn't do the chmod thing, I only used sh file.sh
@dex, ok..
.Ahau said:
What distribution are you using?
Also, what errors do you get when you save that text to a text file (do this in linux, not windows), e.g. mountmp3.sh, make it executable (chmod +x mountmp3.sh) and run it (./mountmp3.sh)?
It seems to run the commands fine here (running Porteus, which is based on Slackware) but I don't have mtpfs installed, so I'm not testing every element...
Click to expand...
Click to collapse
ok, it worked
thx
@dex, what kind of idiot do you think I am -_-
I always check executables before executing
husam666 said:
ok, it worked
thx
@dex, what kind of idiot do you think I am -_-
I always check executables before executing
Click to expand...
Click to collapse
oh come on
I know you liked my modifications
dexter93 said:
oh come on
I know you liked my modifications
Click to expand...
Click to collapse
btw, should I check the link you gave me?
husam666 said:
btw, should I check the link you gave me?
Click to expand...
Click to collapse
the "surprise" one? depends.. if you are brave enough
(you already know what it is though)
but the download link in my post is legit, it works
dexter93 said:
the "surprise" one? depends.. if you are brave enough
(you already know what it is though)
but the download link in my post is legit, it works
Click to expand...
Click to collapse
lmao, check my latest fb status then
husam666 said:
lmao, check my latest fb status then
Click to expand...
Click to collapse
that's where i got the idea from
glad it's working for you!
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 ?
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: