Good day, stumbled on your page and maybe you can help me (maybe others) I run a s5 rom for some odd this rom and some others disable Logging. when using catlog (and other logs app) and xposed logs it does not show up. I googled around and people said to use Kernel adiutor to manually enable logging but the rom disables it right back.
till now, i think there's no way you can disable xposed log except delete the original log file and create a same-named dictionary, if you're not sure just check it at /data/data/de.robv.android.xposed.installer/log
@osmosis please what's the benefits of using the xposed toggler ?
Looks like 2016 will hold a lot of script breakage and rewrites:
https://plus.google.com/+OpengappsOrg/posts/FJ2v1kNxzHV
I'm already noticing some weirdness with sed not working at all like it should on my N7 2013.
Update: http://xdaforums.com/android/software/pa-gapps-continuation-t3098071/post64901718
We'll just have to tough it out until N, I guess.
@osmosis I m unable to mount my filesystem in rw mode, I have used so many scripts in order to remount it rw, terminal emulator displays that's its in rw mode but when I chmod a file in xbin or try to to create a folder it displays read-only filesystem. I flashed your cwm-sdfixpermission script but it failed in recovery. I m using s3 Verizon with the latest safestrap recovery. Please help !!!
@osm0sisIn this installer, do you clean up /tmp at the end of the script? Because after flashing this, I'm missing a large portion of my recovery log . I'm wondering if the SuperSU installer does the same thing . . .
ui_print("Installing Busybox..."); ui_print(" ");
package_extract_dir("busybox", "/tmp/busybox");
run_program("/sbin/busybox", "unzip", "/tmp/busybox/UPDATE-Busybox.Installer.v1.24.1-ALL-signed.zip", "META-INF/com/google/android/*", "-d", "/tmp/busybox");
run_program("/sbin/busybox", "sh", "/tmp/busybox/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/busybox/UPDATE-Busybox.Installer.v1.24.1-ALL-signed.zip");
@osm0sis
So when flashing the Busybox zip as part of a ROM install, the method used is similar to how SuperSU is bundled in a ROM install - the zip is added to its own folder, and the shell script is unzip and run directly from the updater-script, like this:
It's only when yours and the SuperSU zip are run using this method that the log gets truncated, due to the issue explained by @_that in the SuperSU thread.Code:ui_print("Installing Busybox..."); ui_print(" "); package_extract_dir("busybox", "/tmp/busybox"); run_program("/sbin/busybox", "unzip", "/tmp/busybox/UPDATE-Busybox.Installer.v1.24.1-ALL-signed.zip", "META-INF/com/google/android/*", "-d", "/tmp/busybox"); run_program("/sbin/busybox", "sh", "/tmp/busybox/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/busybox/UPDATE-Busybox.Installer.v1.24.1-ALL-signed.zip");
Not sure what you mean by abnormal - this method was provided by Chainfire himself, including the syntax for the commands, here: http://su.chainfire.eu/#embed-romAh okay now I'm following you. Okay, since you're really using the zips in an abnormal way here, what's the problem with switching the 1 to 0?
Not sure what you mean by abnormal - this method was provided by Chainfire himself, including the syntax for the commands, here: http://su.chainfire.eu/#embed-rom
I can change the 1 to a 0 and I'm sure it'll work fine, but thought you'd want it to work universally, since most people are using the instructions he provided for flashing similar zips. No worries - just wanted to bring it to your attention.
I was able to modify your script and have it working using Chainfire's method. This is what I used (the readlink portion is a direct copy/paste from his updated shell script):Ah I see, I didn't realize that was a thing! Cool. Thanks.
Hmm, well it seems like it was just a typo in his instructions and should be stdout, not stdin, so I'll wait and see what Chainfire does about it.
Edit: @Captain_Throwback, I'm still mulling over Chainfire's method for finding the correct FD to the parent ROM zip because it's kind of.. intense, would just the >> fix be acceptable?
OUTFD=[B]$2[/B];
ZIP="$3";
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in `ls /proc/$$/fd`; do
readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
if [ "$?" -eq "0" ]; then
ps | grep " 3 $FD " | grep -v grep >/dev/null
if [ "$?" -eq "0" ]; then
OUTFD=$FD
break
fi
fi
done
fi
ui_print() { echo -e "ui_print $1\nui_print" [B]>> /proc/self/fd/$OUTFD[/B]; }
set_perm() {
files=$(echo $* | awk '{ print substr($0, index($0,$4)) }');
for i in $files; do
chown $1.$2 $i; chown $1:$2 $i;
chmod $3 $i;
done;
}
show_progress() { echo "progress $1 $2" > [B]/proc/self/fd/$OUTFD[/B]; }
set_progress() { echo "set_progress $1" > [B]/proc/self/fd/$OUTFD[/B]; }
For many Qualcomm based Xiaomi ROMs, the original gen_pif.custom.sh script that reads prints from build.prop (/system/build.prop) and product-build.prop (/product/build.prop), results with strange custom.pif.json files, eg:So... I'll just leave this over here...
/sdcard/Download/gen_pif_custom.sh:
<snip>
Edit: Latest updated for my own PlayIntegrityFork builds, now supporting custom.pif.json, proper API naming of fields, and separate system properties by default.
Please see my general how-to/explainer for tips on finding a working fingerprint and ideas on where to find the required build.prop files: https://xdaforums.com/t/module-play-integrity-fix-safetynet-fix.4607985/page-177#post-89189572
{
"MANUFACTURER": "Xiaomi",
"MODEL": "missi",
"FINGERPRINT": "Xiaomi/missi_phone_global/missi:13/TP1A.220624.014/V14.0.5.0.TLOMIXM:user/release-keys",
"BRAND": "Xiaomi",
"PRODUCT": "missi_phone_global",
"DEVICE": "missi",
"SECURITY_PATCH": "2023-07-01",
"FIRST_API_LEVEL": "31"
}
{
"MANUFACTURER": "Xiaomi",
"MODEL": "xaga",
"FINGERPRINT": "POCO/xaga_global/xaga:12/SP1A.210812.016/V14.0.5.0.TLOMIXM:user/release-keys",
"BRAND": "POCO",
"PRODUCT": "xaga_global",
"DEVICE": "xaga",
"SECURITY_PATCH": "2023-07-01",
"DEVICE_INITIAL_SDK_INT": "31"
}
{
"PRODUCT": "qssi",
"DEVICE": "qssi",
"MANUFACTURER": "QUALCOMM",
"BRAND": "qti",
"MODEL": "qssi system image for arm64",
"FINGERPRINT": "qti/qssi/qssi:12/SKQ1.211019.001/13.5.332_220407:user/release-keys",
"SECURITY_PATCH": "2022-02-01",
"FIRST_API_LEVEL": "30"
}
{
"PRODUCT": "doom",
"DEVICE": "doom",
"MANUFACTURER": "Lenovo",
"BRAND": "Lenovo",
"MODEL": "Lenovo L70081",
"FINGERPRINT": "Lenovo/doom/doom:12/SKQ1.211019.001/13.5.332_220407:user/release-keys",
"SECURITY_PATCH": "2022-02-01",
"DEVICE_INITIAL_SDK_INT": "30"
}
I've processed all poco, redmi, qssi, xiaomi prints from dedyn and tested the pif.vendor.json created by my pif-gen-vendor-json-files.sh and gen_pif_vendor.sh script (observe that I slightly updated the gen_pif_vendor.sh script) and the method pays offFor many Qualcomm based Xiaomi ROMs, the original gen_pif.custom.sh script that reads prints from build.prop (/system/build.prop) and product-build.prop (/product/build.prop), results with strange custom.pif.json files, eg:
Code:{ "MANUFACTURER": "Xiaomi", "MODEL": "missi", "FINGERPRINT": "Xiaomi/missi_phone_global/missi:13/TP1A.220624.014/V14.0.5.0.TLOMIXM:user/release-keys", "BRAND": "Xiaomi", "PRODUCT": "missi_phone_global", "DEVICE": "missi", "SECURITY_PATCH": "2023-07-01", "FIRST_API_LEVEL": "31" }
However, if reading the prints from vendor-build.prop (/vendor/build.prop) instead (and some of them under the slightly different prop names there), you will obtain the meaningful prints:
Code:{ "MANUFACTURER": "Xiaomi", "MODEL": "xaga", "FINGERPRINT": "POCO/xaga_global/xaga:12/SP1A.210812.016/V14.0.5.0.TLOMIXM:user/release-keys", "BRAND": "POCO", "PRODUCT": "xaga_global", "DEVICE": "xaga", "SECURITY_PATCH": "2023-07-01", "DEVICE_INITIAL_SDK_INT": "31" }
Snip...
Below is attached my modified gen_pif_vendor.sh script, tailored to Xiaomi/Redmi/Poco ROMs (but from the Lenovo example it seems that it could apply to the more phones with Qualcomm chipsets), that:
- reads from vendor-build.prop file (see in the source for which props)
- creates vendor.pif.json custom files (you can later rename as you wish but I wanted to have different name to be able to compare and test them in parallel)
- moreover, script can be called with the path argument where to read the vendor-build.prop file (and to create the resulted vendor.pif.json)
Attached is also an outer script pif-gen-vendor-json-files.sh that crawls through the folders, looks for the downloaded vendor-build.prop files, calls the inner script gen_pif_vendor.sh to create vendor.pif.json files, and prints the results with how many vendor-build.props were found and how many vendor.pif.json have been created (cannot create the JSON if MANUFACTURER or FINGERPRINT were not found from the vendor-build.prop)
For the testing I used in parallel both the custom.pif.json (created by the original gen_pif_custom.sh script, from build.prop and product-build.prop) and vendor.pif.json (created by this 'new' gen_pif.vendor.sh script, reading from vendor-build.prop), and then used my pif-test-json-files.sh (new version) to crawl through the folders, and for each JSON file to call first migrate.sh script (osm0sis) and then to test them with his PI Fork v8, and retests with the downgraded API level if needed
Snip....
Edit
gen_pif.vendor.sh script updated on Apr 16, 2024
pif.custom.json =
{
"MANUFACTURER": "QUALCOMM",
"MODEL": "missi system image for arm64",
"FINGERPRINT": "qti/missi_phone_global/missi:13/TKQ1.220829.002/V14.0.6.0.TKOMIXM:user/release-keys",
"BRAND": "qti",
"PRODUCT": "missi",
"DEVICE": "missi",
"SECURITY_PATCH": "2023-09-01",
"FIRST_API_LEVEL": "30"
}
SN Basic: Pass, CTS BASIC: Fail
pif.vendor.json =
{
"MANUFACTURER": "Xiaomi",
"MODEL": "2109119DG",
"FINGERPRINT": "Xiaomi/lisa_global/lisa:13/RKQ1.211001.001/V14.0.6.0.TKOMIXM:user/release-keys",
"BRAND": "Xiaomi",
"PRODUCT": "lisa_global",
"DEVICE": "lisa",
"SECURITY_PATCH": "2023-09-01",
"DEVICE_INITIAL_SDK_INT": "30"
}
SN Basic: Pass, CTS BASIC: Pass
PI MEETS_BASIC_INTEGRITY
Exactly, you can still download.But new commits can be seen, like on the screenshot and I just successfully downloaded manually that /vendor/build.prop.
#!/bin/bash
# also this
# bbox-bundle.sh
#
# osm0sis @ xda-developers
#
# requires (in addition to the default basic Ubuntu WSL packages):
# zip, default-jre
#
# ~/aik-build.sh for basic busybox compiles, and ~/ndk-box-kitchen for selinux busybox compiles
MAGISK=$HOME/magisk-modules;
bold() { echo -e "\033[1m"$@"\033[0m"; }
reset() {
bold "--- Removing busybox-ndk module ...";
rm -rfv $MAGISK/UPDATE-Busybox.Installer* zipsigner-*.jar Busybox-*-ALL*.zip UPDATE-Busybox.Installer.*-ALL-signed.zip;
rmdir $MAGISK 2>/dev/null;
}
init() {
local zipsigner;
reset;
bold "--- Initializing busybox-ndk module ...";
# busybox-ndk build environment is initialized by aik-build.sh and ndk-box-kitchen/run.sh
bold "- Cloning busybox-ndk installer git repository ...";
mkdir -p $MAGISK;
git clone https://github.com/Magisk-Modules-Repo/busybox-ndk $MAGISK/UPDATE-Busybox.Installer-ALL;
bold "- Downloading zipsigner ...";
zipsigner=$(wget -qO- https://github.com/opengapps/opengapps/tree/master/scripts/zipsigner-resources | grep -o 'opengapps/.*jar' | cut -d\" -f1 | sed 's/blob/raw/');
wget -O $HOME/$(basename $zipsigner) https://github.com/$zipsigner;
}
main() {
local zipflag stdout copy ver i out modver modcode newmodver newmodcode iteration skipmodprop curdir;
zipflag=-q;
stdout=/dev/null;
copy=1;
until [ ! "$1" ]; do
case $1 in
help) echo "bbox-bundle.sh reset, init, [verbose] [nocopy]"; exit 1;;
reset|init) $1; return;;
verbose) stdout=/dev/stdout; unset zipflag; shift;;
nocopy) unset copy; shift;;
*) echo "unknown option: $1"; exit 1;;
esac;
done;
ver=$(ls | grep ^busybox- | cut -d- -f2);
if [ ! "$ver" ]; then
echo "bbox-bundle: busybox repo not found, run aik-build.sh 'init' option";
exit 1;
fi;
bold "--- Bundling ...";
rm -f Busybox-*-ALL*.zip UPDATE-Busybox.Installer.*-ALL-signed.zip 2>/dev/null;
if [ -f AIK-build/mobile/arm/busybox -a "$copy" ]; then
bold "- Copying new Busybox $ver builds ...";
cd AIK-build/mobile;
for i in *; do
cp -fp $i/busybox $MAGISK/UPDATE-Busybox.Installer*-ALL/busybox-$i;
done;
cd $HOME;
fi;
if [ -f ndk-box-kitchen/libs/armeabi-v7a/busybox -a "$copy" ]; then
bold "- Copying new Busybox $ver SELinux builds ...";
cd ndk-box-kitchen/libs;
for i in *; do
case $i in
armeabi-v7a) out=arm;;
arm64-v8a) out=arm64;;
*) out=$i;;
esac;
cp -fp $i/busybox $MAGISK/UPDATE-Busybox.Installer*-ALL/busybox-$out-selinux;
done;
cd $HOME;
fi;
modver=$(grep -o "^version=.*$" $MAGISK/UPDATE-Busybox.Installer*-ALL/module.prop | cut -d= -f2);
modcode=$(grep -o "^versionCode=.*$" $MAGISK/UPDATE-Busybox.Installer*-ALL/module.prop | cut -d= -f2);
if [ "$ver" == "$modver" ]; then
newmodver="$modver";
newmodcode="$((modcode + 1))";
iteration=1;
else
newmodver="$ver";
newmodcode="${ver//.}0";
fi;
if [ "$iteration" ]; then
echo -ne "\033[1m\n*** Update Magisk module version code ($modcode -> $newmodcode) (y/n)? \033[0m";
read n; echo;
case $n in
Y|y) ;;
*) skipmodprop=1;;
esac;
fi;
if [ ! "$skipmodprop" ]; then
sed -i -e "s/version=.*/version=$newmodver/" -e "s/versionCode=.*/versionCode=$newmodcode/" $MAGISK/UPDATE-Busybox.Installer*-ALL/module.prop;
sed -i -e "s/version\".*/version\": \"$newmodver\",/" -e "s/versionCode\".*/versionCode\": \"$newmodcode\",/" $MAGISK/UPDATE-Busybox.Installer*-ALL/update.json;
fi;
bold "- Packing \"Busybox-$ver-ALL.zip\" ...";
cd $MAGISK/UPDATE-Busybox.Installer*-ALL;
zip -9 -x .git -x .github -x update.json -r $zipflag $HOME/Busybox-$ver-ALL.zip *;
curdir=$(basename $PWD);
cd ..;
if [ "$curdir" != "UPDATE-Busybox.Installer.v$ver-ALL" ]; then
mv UPDATE-Busybox.Installer*-ALL UPDATE-Busybox.Installer.v$ver-ALL;
fi;
cd $HOME;
bold "- Signing as \"UPDATE-Busybox.Installer.v$ver-ALL-signed.zip\" ...";
java -jar zipsigner-*.jar Busybox-$ver-ALL.zip Busybox-$ver-ALL-signed.zip;
mv -f Busybox-$ver-ALL-signed.zip UPDATE-Busybox.Installer.v$ver-ALL-signed.zip 2>/dev/null;
rm -f Busybox-*-ALL.zip /tmp/signAPK*.tmp 2>/dev/null;
}
cd $HOME;
main "$@";
exit 0;