Skip to content

Commit

Permalink
**v2021.11.13-beta (202111130)**
Browse files Browse the repository at this point in the history
- Ability to specify the emulated storage path prefix to use (details in readme > config syntax)
- Android 11 testing kit in the flashable zip
- General enhancements
  • Loading branch information
VR-25 committed Nov 13, 2021
1 parent 0f418f0 commit 4121902
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 43 deletions.
24 changes: 11 additions & 13 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ <h2 id="config-syntax">CONFIG SYNTAX</h2>
<hr>
<p><code>permissive</code> Set SELinux mode to permissive.</p>
<hr>
<p><code>prefix=&lt;path&gt;</code> Sets emulated storage path prefix (excluding emulated/*).</p>
<p>e.g., prefix=/mnt/runtime/full</p>
<p>An alternative to modifying the config is running <code>prefix=/mnt/runtime/full fbind --remount</code></p>
<hr>
<p><code>remove &lt;target&gt;</code>&gt;Auto-remove stubborn/unwanted file/folder from $intsd &amp; $extsd.</p>
<p>e.g, remove Android/data/com.facebook.orca</p>
<p>e.g., remove Android/data/com.facebook.orca</p>
<hr>
<p><code>target &lt;path&gt;</code> Wrapper for <code>bind_mount &lt;$extsd/[path]&gt; &lt;$intsd/[same path]&gt;</code></p>
<p>e.g., target Android/data/com.google.android.youtube</p>
Expand Down Expand Up @@ -264,18 +268,6 @@ <h2 id="links">LINKS</h2>
</ul>
<hr>
<h2 id="latest-changes">LATEST CHANGES</h2>
<p><strong>v2020.8.5 (202008050)</strong></p>
<ul>
<li>Better compatibility with different root solutions and init methods</li>
<li>Built upon fbind's framework and Hooin Kyoma's fixes</li>
<li>Enhanced <code>mount</code> wrapper</li>
<li>Flashable uninstaller</li>
<li>Major cleanup and optimizations</li>
<li>Removed fstype (toybox) binaries</li>
<li>Updated readme</li>
<li>Upgrader (fbind -U)</li>
<li>Uninstaller (fbind -x)</li>
</ul>
<p><strong>v2021.3.4 (202103040)</strong></p>
<ul>
<li>Better logs</li>
Expand All @@ -297,6 +289,12 @@ <h2 id="latest-changes">LATEST CHANGES</h2>
<li>Experimental support for recent Android versions</li>
<li>General fixes</li>
<li>Major optimizations</li>
</ul>
<p><strong>v2021.11.13-beta (202111130)</strong></p>
<ul>
<li>Ability to specify the emulated storage path prefix to use (details in readme &gt; config syntax)</li>
<li>Android 11 testing kit in the flashable zip</li>
<li>General enhancements</li>
</ul>

</body>
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,17 @@ The defaut mount options are `rw` and `noatime`.
---
`permissive` Set SELinux mode to permissive.

---
`prefix=<path>` Sets emulated storage path prefix (excluding emulated/*).

e.g., prefix=/mnt/runtime/full

An alternative to modifying the config is running `prefix=/mnt/runtime/full fbind --remount`

---
`remove <target>`>Auto-remove stubborn/unwanted file/folder from $intsd & $extsd.

e.g, remove Android/data/com.facebook.orca
e.g., remove Android/data/com.facebook.orca

---
`target <path>` Wrapper for `bind_mount <$extsd/[path]> <$intsd/[same path]>`
Expand Down Expand Up @@ -269,17 +276,6 @@ If`/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr2
---
## LATEST CHANGES

**v2020.8.5 (202008050)**
- Better compatibility with different root solutions and init methods
- Built upon fbind's framework and Hooin Kyoma's fixes
- Enhanced `mount` wrapper
- Flashable uninstaller
- Major cleanup and optimizations
- Removed fstype (toybox) binaries
- Updated readme
- Upgrader (fbind -U)
- Uninstaller (fbind -x)

**v2021.3.4 (202103040)**
- Better logs
- Cryptsetup is no longer bundled, but it's still supported. Download link and very simple installation instructions are provided.
Expand All @@ -299,3 +295,8 @@ If`/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr2
- Experimental support for recent Android versions
- General fixes
- Major optimizations

**v2021.11.13-beta (202111130)**
- Ability to specify the emulated storage path prefix to use (details in readme > config syntax)
- Android 11 testing kit in the flashable zip
- General enhancements
48 changes: 48 additions & 0 deletions androi 11 test/README.html

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions androi 11 test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Android uses runtime "views" to manage storage access permissions.

Android 11 introduced new paths and we need to test those.

This directory contains a test config file for fbind and a standalone script to replicate what fbind does with that config.
Pick one.

The default prefix used by fbind and that script is /mnt/runtime/write.
It works on Android 6.0.1-10.

The standalone script should be placed in `/data/adb/service.d` with read and execute permissions.
For now, a reboot is required after changing the prefix value.
13 changes: 13 additions & 0 deletions androi 11 test/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# /data/adb/vr25/fbind-data/config.txt

# do not modify the next 3 lines
part /dev/block/mmcblk1p1 /mnt/extsd
extsd_path /mnt/extsd
bind_mount $extsd $intsd/.extsd

# your customization goes below
#prefix=/mnt/runtime/write
prefix=/mnt/runtime/full
#prefix=/mnt/pass_through/0
#from_to WhatsApp .fbind/WhatsApp
#from_to Download .fbind/Download
39 changes: 39 additions & 0 deletions androi 11 test/mountsd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/system/bin/sh
# this is a bind mount test script
# vr25

: ${sd_partition:=/dev/block/mmcblk1p1}
: ${mnt_opts_fat:=nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0,uid=0,gid=9997,fmask=0117,dmask=0006}
: ${prefix:=/mnt/runtime/write}
#: ${prefix:=/mnt/runtime/full}
#: ${prefix:=/mnt/pass_through/0}
: ${internal:=$prefix/emulated/0}
: ${external:=/mnt/extsd}

# replace "each" space character with --
: ${bonds:=#$external/.WhatsApp==$internal/WhatsApp
#$external/.random--dir==$internal/random--dir}

bind() {
mkdir -p "$@"
mount -o bind "$@"
}

mount() {
su -Mc /system/bin/mount "$@"
}

while [ ! -b $sd_partition ]; do sleep 2; done
fs=$(blkid $sd_partition | sed 's/.*TYPE=\"\(.*\)\".*/\1/')
echo "$fs" | grep -q 'fat$' || exit

mkdir -p $external
! mountpoint -q $external && mount -t $fs -o $mnt_opts_fat $sd_partition $external || exit

bonds="$(echo "$bonds" | grep -Ev '^$|^#')"
for i in $external==$internal/.extsd $bonds; do
i1="$(echo $i | sed -e 's/==.*//' -e 's/--/ /g')"
i2="$(echo $i | sed -e 's/.*==//' -e 's/--/ /g')"
umount -f "$i2" 2>/dev/null
bind "$i1" "$i2"
done
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.11-beta
versionCode=202111110
version=v2021.11.13-beta
versionCode=202111130
author=VR25 @ xda-developers
description=fbind is a versatile mounting utility for folders, disk images, LUKS/LUKS2 encrypted volumes, regular partitions and more.
34 changes: 19 additions & 15 deletions system/bin/fbind
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ apply_config() {
[ -f $config ] || touch $config
grep -iq '^permissive' $config && setenforce 0

# intsd in SDcardFS mode?
if grep -iq '/storage/emulated sdcardfs' /proc/mounts; then
intsd=$prefix/emulated/0
# intsd in FUSE mode?
if grep -q '/storage/emulated fuse' /proc/mounts; then
intsd=/data/media/0
obb=$intsd/Android/obb
fi

Expand All @@ -22,13 +22,12 @@ apply_config() {
. $tmpf
rm $tmpf

# extsd in SDcardFS mode?
if grep -iq '/storage/emulated sdcardfs' /proc/mounts && is_mounted "$prefix/${extsd##*/}"; then
# extsd in FUSE mode?
if grep -q "/mnt/media_rw/${extsd##*/} fuse" /proc/mounts; then
extsd0=$extsd
extobb0=$extobb
extsd=$prefix/${extsd##*/}
extsd=/mnt/media_rw/${extsd##*/}
extobb=$extsd/Android/obb
mount -o remount,mask=0 $extsd
fi
}

Expand Down Expand Up @@ -88,7 +87,7 @@ bind_mount_wrapper() {
rm $tmpf
if $interactiveMode; then
echo
echo "- End"
echo "- Done"
fi
}

Expand All @@ -115,7 +114,11 @@ default_extsd() {
fi
done
fi
is_mounted $extsd && extobb=$extsd/Android/obb || exit 1
! is_mounted $extsd && exit 1 || {
extsd=$prefix/${extsd##*/}
extobb=$extsd/Android/obb
mount -o remount,mask=0 $extsd 2>/dev/null
}
}


Expand Down Expand Up @@ -322,7 +325,7 @@ mv_data_wrapper() {
. $tmpf
rm $tmpf
echo
echo "- End"
echo "- Done"
}


Expand Down Expand Up @@ -528,7 +531,7 @@ unmount_wrapper() {
. $tmpf
rm $tmpf
echo
echo "- End"
echo "- Done"
}


Expand Down Expand Up @@ -695,12 +698,13 @@ altExtsd=false
TMPDIR=/dev/.vr25/fbind
tmpf=$TMPDIR/tmpf
interactiveMode=true
intsd=/data/media/0
prefix=/mnt/runtime/write
obb=/data/media/0/Android/obb
modDir=/data/adb/modules/vr25.fbind
dataDir=/data/adb/vr25/fbind-data
config=$dataDir/config.txt
: ${prefix:=$(sed -n 's/^prefix=//p' $config 2>/dev/null)}
: ${prefix:=/mnt/runtime/write}
intsd=$prefix/emulated/0
obb=$intsd/Android/obb
modDir=/data/adb/modules/vr25.fbind

case "$1" in
-s|--service) service=true;;
Expand Down
10 changes: 9 additions & 1 deletion zip.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env sh

echo
trap 'e=$?; echo; exit $e' EXIT
cd "${0%/*}" 2>/dev/null
zip -r9 fbind-$(date +%Y%m%d%H%M%S).zip * .git* -x \*.zip -x .git/\* -x _misc/\*

sh -n system/bin/fbind && {
filename=fbind-$(date +%Y.%m.%d.%H.%M.%S).zip
echo $filename
mkdir -p _builds
zip -r9 _builds/$filename * .git* -x \*.zip -x .git/\* -x _misc/\*
}

0 comments on commit 4121902

Please sign in to comment.