Skip to content

Commit

Permalink
**v2021.11.22-beta (202111220)**
Browse files Browse the repository at this point in the history
- `-t|--test-prefixes`: test internal storage prefixes (views) and automatically update the config.
- Changed the priorities of emulated storage views to better accommodate Android 11+.
- General optimizations
  • Loading branch information
VR-25 committed Nov 22, 2021
1 parent acab429 commit 9b29d07
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 146 deletions.
16 changes: 9 additions & 7 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ <h2 id="terminal-commands">TERMINAL COMMANDS</h2>
By default, all &quot;remove&quot; lines from config are included.
e.g., fbind -R Android/data/com.facebook.orca

-t|--test-prefixes
Test internal storage prefixes (views) and automatically update the config.

-u|--unmount [mount point or egrep regex]
Unmount matched or all (no arg).
This works for regular bind-mounts, SDcardFS bind-mounts, regular partitions, loop devices and LUKS/LUKS2 encrypted volumes.
Expand Down Expand Up @@ -272,13 +275,6 @@ <h2 id="links">LINKS</h2>
</ul>
<hr>
<h2 id="latest-changes">LATEST CHANGES</h2>
<p><strong>v2021.11.14-beta (202111140)</strong></p>
<ul>
<li><code>bindfs</code> binaries (ARM, ARM64, X86 and X86_64) are included and prioritized over <code>mount -o bind</code></li>
<li>Fixed <code>umount</code> issues</li>
<li>General enhancements</li>
<li>Updated flashable zip generator</li>
</ul>
<p><strong>v2021.11.15-beta (202111150)</strong></p>
<ul>
<li>Added several fallback paths for intsd and extsd for greater out of the box experience</li>
Expand All @@ -297,6 +293,12 @@ <h2 id="latest-changes">LATEST CHANGES</h2>
<li>General fixes &amp; optimizations</li>
<li>Increased loop timeout to 5 minutes to accommodate long boot times</li>
<li>Updated documentation</li>
</ul>
<p><strong>v2021.11.22-beta (202111220)</strong></p>
<ul>
<li><code>-t|--test-prefixes</code>: test internal storage prefixes (views) and automatically update the config.</li>
<li>Changed the priorities of emulated storage views to better accommodate Android 11+.</li>
<li>General optimizations</li>
</ul>

</body>
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ Remove stubborn/unwanted file/folder from \$intsd and \$extsd.
By default, all "remove" lines from config are included.
e.g., fbind -R Android/data/com.facebook.orca
-t|--test-prefixes
Test internal storage prefixes (views) and automatically update the config.
-u|--unmount [mount point or egrep regex]
Unmount matched or all (no arg).
This works for regular bind-mounts, SDcardFS bind-mounts, regular partitions, loop devices and LUKS/LUKS2 encrypted volumes.
Expand Down Expand Up @@ -280,12 +283,6 @@ If `/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr
---
## LATEST CHANGES

**v2021.11.14-beta (202111140)**
- `bindfs` binaries (ARM, ARM64, X86 and X86_64) are included and prioritized over `mount -o bind`
- Fixed `umount` issues
- General enhancements
- Updated flashable zip generator

**v2021.11.15-beta (202111150)**
- Added several fallback paths for intsd and extsd for greater out of the box experience
- Enhanced unmount function
Expand All @@ -302,3 +299,8 @@ If `/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr
- General fixes & optimizations
- Increased loop timeout to 5 minutes to accommodate long boot times
- Updated documentation

**v2021.11.22-beta (202111220)**
- `-t|--test-prefixes`: test internal storage prefixes (views) and automatically update the config.
- Changed the priorities of emulated storage views to better accommodate Android 11+.
- General optimizations
48 changes: 0 additions & 48 deletions android 11 test/README.html

This file was deleted.

12 changes: 0 additions & 12 deletions android 11 test/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions android 11 test/config.txt

This file was deleted.

39 changes: 0 additions & 39 deletions android 11 test/mountsd.sh

This file was deleted.

15 changes: 9 additions & 6 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ cd $MODPATH/bin/bindfs-* && {
esac
chmod +x ../bindfs
rm -rf $MODPATH/bin/bindfs-*

# workaround for bindfs < 1.14.2
for i in /system/etc/group /system/etc/passwd; do
[ -f $i ] || {
mkdir -p $MODPATH${i%/*}
touch $MODPATH$i
}
done
if [ $ARCH != arm64 ] && echo "$PWD" | grep -q '\-v1\.14\.1$'; then
for i in /system/etc/group /system/etc/passwd; do
[ -f $i ] || {
mkdir -p $MODPATH${i%/*}
touch $MODPATH$i
}
done
fi
}

cd $MODPATH
Expand Down
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=vr25.fbind
name=fbind
version=v2021.11.17-beta
versionCode=202111170
version=v2021.11.22-beta
versionCode=202111220
author=VR25 @ xda-developers
description=fbind is a versatile mounting utility for folders, disk images, LUKS/LUKS2 encrypted volumes, regular partitions and more.
65 changes: 52 additions & 13 deletions system/bin/fbind
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply_config() {
grep -q '^extsd_path ' $config || default_extsd

# storage paths fallbacks
for i in $prefix /mnt/runtime/write /mnt/pass_through/0; do
for i in $prefix /mnt/user/0 /mnt/runtime/write; do
is_mounted $i/emulated && prefix=$i && break || prefix=
done
[ -n "$prefix" ] && intsd=$prefix/emulated/0 || intsd=/data/media/0
Expand Down Expand Up @@ -409,6 +409,43 @@ remove_wrapper() {
}


test_prefixes() {

local a=
local i=

set -- $(/system/bin/mount | grep '/emulated type' | awk '{print $3}' \
| sed 's/\/emulated.*//' | grep -Ev '/mnt/androidwritable/0|/mnt/runtime/default')

_exxit() {
{ unmount $intsd/test-dir-i
rm -rf $extsd/test-dir-e; } >/dev/null 2>&1
exxit
}

trap _exxit EXIT

for i in $@; do
echo "(i) Testing $i"
unmount $intsd/test-dir-i >/dev/null 2>&1
intsd=$i/emulated/0
bind_mount $extsd/test-dir-e $intsd/test-dir-i >/dev/null 2>&1 || continue
sleep 2
is_mounted /storage/emulated/0/test-dir-i || continue
echo "(?) Can you write to /storage/emulated/0/test-dir-i/ WITHOUT root? (y/N)"
read a
case ".$a" in
.[yY]*) :;;
*) continue;;
esac
sed -i '/^prefix=/d' $config
sed -i "1iprefix=$i" $config
echo "(i) Added to config: prefix=$i"
break
done
}


to_external() {

local ans=no
Expand Down Expand Up @@ -481,7 +518,7 @@ unmount() {
local line=
local pattern="$(echo "$1" | sed "s|$prefix||")"
/system/bin/mount | grep "$pattern type " >/dev/null 2>&1 && {
echo "<${pattern#/}>"
echo "<...${pattern#/}>"
/system/bin/mount | grep "$pattern type " | sed -E -e 's|^.* on /|/|' -e "s|($pattern) type .*|\1|" | \
while IFS= read line; do
umount -f "$line" 2>/dev/null
Expand Down Expand Up @@ -593,6 +630,9 @@ Remove stubborn/unwanted file/folder from \$intsd and \$extsd.
By default, all "remove" lines from config are included.
e.g., fbind -R Android/data/com.facebook.orca
-t|--test-prefixes
Test internal storage prefixes (views) and automatically update the config.
-u|--unmount [mount point or egrep regex]
Unmount matched or all (no arg).
This works for regular bind-mounts, SDcardFS bind-mounts, regular partitions, loop devices and LUKS/LUKS2 encrypted volumes.
Expand Down Expand Up @@ -683,22 +723,22 @@ e) Exit wizard

# Prepare environment

modDir=/data/adb/modules/vr25.fbind
[ -f $modDir/update ] && {
modDir=${modDir%/*}_update/vr25.fbind
exec=$modDir/system/bin/fbind
[ $0 = $exec ] || exec $exec "$@"
}

echo

if : > /dev/.root_test 2>/dev/null; then
if touch /dev/.root_test 2>/dev/null; then
rm /dev/.root_test
else
echo "(!) Must run as root (su)"
exit 1
fi

modDir=/data/adb/modules/vr25.fbind
[ -f $modDir/update ] && {
modDir=${modDir%/*}_update/vr25.fbind
exec=$modDir/system/bin/fbind
[ $0 = $exec ] || exec $exec "$@"
}

busyboxDir=/dev/.vr25/busybox

if [ ! -x $busyboxDir/ls ]; then
Expand All @@ -718,7 +758,7 @@ interactiveMode=true
dataDir=/data/adb/vr25/fbind-data
config=$dataDir/config.txt
: ${prefix:=$(sed -n 's/^prefix=//p' $config 2>/dev/null)}
: ${prefix:=/mnt/runtime/write}
: ${prefix:=/mnt/user/0}
intsd=$prefix/emulated/0
obb=$intsd/Android/obb

Expand Down Expand Up @@ -769,7 +809,6 @@ case $1 in
-r|--readme) shift; edit $dataDir/README.md "${@:-more}";;
-R|--remove) shift; remove_wrapper "$@";;


-s|--service)

# wait until data is decrypted
Expand All @@ -796,7 +835,7 @@ case $1 in
done
;;


-t|--test-prefixes) test_prefixes;;
-u|--unmount) unmount_wrapper "$2";;
-um|--remount) fbind -u "$2"; fbind -m "$2";;
-v|--version) sed -n 's/versionCode=//p' $modDir/module.prop;;
Expand Down

0 comments on commit 9b29d07

Please sign in to comment.