My device doesn't have an xbin folder which is why it gets installed to bin.Why do not install BB in a usual way in Magisk Manager?
My BB is installed in /system/xbin instead of /system/bin at your device (see Picture).
My device doesn't have an xbin folder which is why it gets installed to bin.Why do not install BB in a usual way in Magisk Manager?
My BB is installed in /system/xbin instead of /system/bin at your device (see Picture).
My version of coreutils doesn't replace most existing symlinks. I have boot scripts that resolve any discrepancies between coreutils, busybox, and native bin. I do replace things like find, awk, sed - things that are precompiled binaries rather than symlinks. Hmm - one exception to that, I'll have to try something.I'm thinking you probably shouldn't have both coreutils and busybox installed simultaneously..
And maybe coreutils shouldn't be replacing things, maybe if it's in bin it should do what mine does in bin and only add symlinks for new utilities. Pretty clearly sounds like it's breaking the shell environment.
Ok, apparently you're doing something that makes GNU grep unhappy, or something. If I revert to the default grep module everything's fine (both versions are precompiled binaries). Attaching GNU grep in case you want to take a look.I'm thinking you probably shouldn't have both coreutils and busybox installed simultaneously..
And maybe coreutils shouldn't be replacing things, maybe if it's in bin it should do what mine does in bin and only add symlinks for new utilities. Pretty clearly sounds like it's breaking the shell environment.
if you just replace it, then you probably do not replace the symlink, instead you replace the busybox binary where the symlink points. so you can not "replace", you must "unlink" firstI do replace things like find, awk, sed - things that are precompiled binaries rather than symlinks.
1) yes you can replace. Or overlay to be exact. If you have a symlink defined in a Magisk Module that overlays an existing symlink the Magisk Module link will prevail.if you just replace it, then you probably do not replace the symlink, instead you replace the busybox binary where the symlink points. so you can not "replace", you must "unlink" first
thx (i didn't notice that you are talking about bind mounts) but "default" probably depends on what you use. gnu's behaviour
/* coreutils 6.9 compat:
* by default, "cp" derefs symlinks (creates regular dest files),
* but "cp -R" does not. We switch off deref if -r or -R (see above).
* However, "cp -RL" must still deref symlinks: */
mint@debian ~/test $ echo file1 > file1
mint@debian ~/test $ echo file3 > file3
mint@debian ~/test $ ln -s file1 file2
mint@debian ~/test $ ls -l
total 8
-rw-r--r-- 1 mint mint 6 Jun 5 20:56 file1
lrwxrwxrwx 1 mint mint 5 Jun 5 20:56 file2 -> file1
-rw-r--r-- 1 mint mint 6 Jun 5 20:56 file3
mint@debian ~/test $ cat file1
file1
mint@debian ~/test $ cp file3 file2
mint@debian ~/test $ cat file1
file3
mint@debian ~/test $
+ // Passing a null pointer and a size of 0 is a legitimate way to ask
+ // how large a buffer we would need for the error message.
Ok, apparently you're doing something that makes GNU grep unhappy, or something. If I revert to the default grep module everything's fine (both versions are precompiled binaries). Attaching GNU grep in case you want to take a look.
My bad. It's not grep. (In any case you're forcing BusyBox grep). For whatever reason it's coreutils test command, which also doesn't really make sense because test is a shell builtin, so it shouldn't even be looking at the version in bin. But that's definitely it, and this time I'm sure.It works in recovery with toybox grep and busybox grep. Magisk installs should always have Magisk's busybox at the front of path, so I'm honestly not sure how you having GNU grep installed in some way would have any effect.
IMO there's only one root file explorer worth having if you want stability.
It's been about for years and is a serious app used by many a developer and does what a root file manager is meant to do without all the silly bells and whistles. It's well worth it's small price and that's ROOT EXPLORER.
My bad. It's not grep. (In any case you're forcing BusyBox grep). For whatever reason it's coreutils test command, which also doesn't really make sense because test is a shell builtin, so it shouldn't even be looking at the version in bin. But that's definitely it, and this time I'm sure.
I'd expect TWRP to always work since it doesn't have access to any Magisk Module overrides.
Thing I'll modify my scripts to get rid of any shell built-ins and reserved words.
It's also disturbing that the shell builtin was bypassed. Anyway the only built-ins/reserved words are test, [, and [[ so I just deleted them from both coreutils and busybox. If I ever really want them I can still explicitly call them.That's disturbing that the coreutils test could be so far off of what we're used to on Android with mksh, toybox and busybox that it breaks things.. But yeah, good looking out!
It's also disturbing that the shell builtin was bypassed. Anyway the only built-ins/reserved words are test, [, and [[ so I just deleted them from both coreutils and busybox. If I ever really want them I can still explicitly call them.
Read the top of page 240. Removing the test applet prevents that from happening. I have no clue why the test applet is even involved.Interesting. So I have symlinks made for each coreutils applet if a binary with the same name doesn't already exist (so it'll overwrite symlinks - backup existing too). Since test is a builtin, coreutils symlink was made. What's the problem with the test applet?
Read the top of page 240. Removing the test applet prevents that from happening. I have no clue why the test applet is even involved.
Hi, thanks for all the hard work. Just curious how you actually build the adb and fastboot static binaries. I figured you could get aosp and run "lunch" but how did you make it static?
Hi @osm0sis
Does your latest busybox still support systemless SuperSU ?
I get an error: 1 when flash it.
SuperSU 2.82 SR5
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;