Skip to content

Commit

Permalink
**v2021.11.17-beta (202111170)**
Browse files Browse the repository at this point in the history
- Enhanced storage paths fallbacks logic
- `fbind -v|--version` prints version code (integer)
- Fixed auto-mount
- Full Android 11 support (XDA Recognized Contributor, @Jimbo77 tirelessly tested fbind on Android 11, kernel 5.4. Worship this man and get him drunk!)
- General fixes & optimizations
- Increased loop timeout to 5 minutes to accommodate long boot times
- Updated documentation
  • Loading branch information
VR-25 committed Nov 17, 2021
1 parent 93bfc69 commit acab429
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 107 deletions.
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: VR25 # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://paypal.me/vr25xda/ # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

custom: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=iprj25@gmail.com&lc=US&item_name=VR25+is+creating+free+and+open+source+software.+Donate+to+suppport+their+work.&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
54 changes: 20 additions & 34 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ <h2 id="terminal-commands">TERMINAL COMMANDS</h2>
-um|--remount [egrep regex]
Remount matched or all (no arg).
e.g., fbind -um &quot;Download|obb&quot;

-v|--version
Print version code (integer)
</div></code></code></pre>
<hr>
<h2 id="notes">NOTES</h2>
Expand Down Expand Up @@ -250,53 +253,25 @@ <h2 id="notes">NOTES</h2>
</li>
<li>
<p>Rebooting is not required after installing/upgrading.
If<code>/sbin</code> is missing (many Android 11 based systems lack it), use the <code>/dev/.vr25/fbind/fbind</code> executable until you reboot - e.g., <code>/dev/.vr25/fbind/fbind -m</code>.</p>
If <code>/sbin</code> is missing (many Android 11 based systems lack it), use the <code>/dev/.vr25/fbind/fbind</code> executable until you reboot - e.g., <code>/dev/.vr25/fbind/fbind -m</code>.</p>
</li>
</ul>
<hr>
<h2 id="links">LINKS</h2>
<ul>
<li><a href="https://app.airtm.com/send-or-request/send">Airtm, username: ivandro863auzqg</a></li>
<li><a href="https://app.airtm.com/send-or-request/send">Donate - Airtm, username: ivandro863auzqg</a></li>
<li><a href="https://liberapay.com/vr25/">Donate - Liberapay</a></li>
<li><a href="https://patreon.com/vr25/">Donate - Patreon</a></li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=iprj25@gmail.com&amp;lc=US&amp;item_name=VR25+is+creating+free+and+open+source+software.+Donate+to+suppport+their+work.&amp;no_note=0&amp;cn=&amp;currency_code=USD&amp;bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">Donate - PayPal or Credit/Debit Card</a></li>
<li><a href="https://fb.me/vr25xda/">Facebook page</a></li>
<li><a href="https://github.com/vr-25/fbind/">Git repository</a></li>
<li><a href="https://liberapay.com/vr25/">Liberapay</a></li>
<li><a href="https://patreon.com/vr25/">Patreon</a></li>
<li><a href="https://paypal.me/vr25xda/">PayPal</a></li>
<li><a href="https://t.me/vr25_xda/">Telegram channel</a></li>
<li><a href="https://t.me/vr25xda/">Telegram profile</a></li>
<li><a href="https://t.me/fbind_group/">Telegram group</a></li>
<li><a href="https://t.me/vr25xda/">Telegram profile</a></li>
<li><a href="https://forum.xda-developers.com/apps/magisk/module-magic-folder-binder-t3621814/">XDA thread</a></li>
</ul>
<hr>
<h2 id="latest-changes">LATEST CHANGES</h2>
<p><strong>v2021.3.4 (202103040)</strong></p>
<ul>
<li>Better logs</li>
<li>Cryptsetup is no longer bundled, but it's still supported. Download link and very simple installation instructions are provided.</li>
<li>Enhanced wizard.</li>
<li>fbind --move shows progress.</li>
<li>Fixed auto-mount</li>
<li>Fixed unmount issues</li>
<li>For now, Magisk is a strict requirement.</li>
<li>Other major fixes &amp; optimizations</li>
<li>Rebooting is not required after installing/upgrading.
If<code>/sbin</code> is missing (many Android 11 based systems lack it), use the <code>/dev/.vr25/fbind/fbind</code> executable until you reboot - e.g., <code>/dev/.vr25/fbind/fbind -m</code>.</li>
<li>Simplified down to the core to minimize overheard, compatibility and ease maintenance.</li>
<li>The order of default text editors is now vim|vi|nano.</li>
<li>Updated documentation</li>
</ul>
<p><strong>v2021.11.11-beta (202111110)</strong></p>
<ul>
<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>
<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>
Expand All @@ -308,9 +283,20 @@ <h2 id="latest-changes">LATEST CHANGES</h2>
<ul>
<li>Added several fallback paths for intsd and extsd for greater out of the box experience</li>
<li>Enhanced unmount function</li>
<li>Fixed: fbind hangs when sdcard is unavailable</li>
<li>General fixes &amp; optimizations</li>
<li>More Android 11+ specific changes; already working at least on a handful of Android 11 devices</li>
<li>[Wizard] Rename existing destination directories instead of removing them</li>
</ul>
<p><strong>v2021.11.17-beta (202111170)</strong></p>
<ul>
<li>Enhanced storage paths fallbacks logic</li>
<li><code>fbind -v|--version</code> prints version code (integer)</li>
<li>Fixed auto-mount</li>
<li>Full Android 11 support (XDA Recognized Contributor, @jimbo77 tirelessly tested fbind on Android 11, kernel 5.4. Worship this man and get him drunk!)</li>
<li>General fixes &amp; optimizations</li>
<li>Increased loop timeout to 5 minutes to accommodate long boot times</li>
<li>Updated documentation</li>
</ul>

</body>
Expand Down
49 changes: 18 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ e.g., fbind -u "loop|part|Downl"
-um|--remount [egrep regex]
Remount matched or all (no arg).
e.g., fbind -um "Download|obb"
-v|--version
Print version code (integer)
```

---
Expand Down Expand Up @@ -256,52 +259,27 @@ If you stumble across broken bind mounts, remove that file and remount all folde
To do that in one shot, run `rm /data/adb/vr25/fbind-data/.noWriteRemount; fbind -um`.

- Rebooting is not required after installing/upgrading.
If`/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr25/fbind/fbind` executable until you reboot - e.g., `/dev/.vr25/fbind/fbind -m`.
If `/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr25/fbind/fbind` executable until you reboot - e.g., `/dev/.vr25/fbind/fbind -m`.


---
## LINKS

- [Airtm, username: ivandro863auzqg](https://app.airtm.com/send-or-request/send)
- [Donate - Airtm, username: ivandro863auzqg](https://app.airtm.com/send-or-request/send)
- [Donate - Liberapay](https://liberapay.com/vr25/)
- [Donate - Patreon](https://patreon.com/vr25/)
- [Donate - PayPal or Credit/Debit Card](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=iprj25@gmail.com&lc=US&item_name=VR25+is+creating+free+and+open+source+software.+Donate+to+suppport+their+work.&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted)
- [Facebook page](https://fb.me/vr25xda/)
- [Git repository](https://github.com/vr-25/fbind/)
- [Liberapay](https://liberapay.com/vr25/)
- [Patreon](https://patreon.com/vr25/)
- [PayPal](https://paypal.me/vr25xda/)
- [Telegram channel](https://t.me/vr25_xda/)
- [Telegram profile](https://t.me/vr25xda/)
- [Telegram group](https://t.me/fbind_group/)
- [Telegram profile](https://t.me/vr25xda/)
- [XDA thread](https://forum.xda-developers.com/apps/magisk/module-magic-folder-binder-t3621814/)


---
## LATEST CHANGES

**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.
- Enhanced wizard.
- fbind --move shows progress.
- Fixed auto-mount
- Fixed unmount issues
- For now, Magisk is a strict requirement.
- Other major fixes & optimizations
- Rebooting is not required after installing/upgrading.
If`/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr25/fbind/fbind` executable until you reboot - e.g., `/dev/.vr25/fbind/fbind -m`.
- Simplified down to the core to minimize overheard, compatibility and ease maintenance.
- The order of default text editors is now vim|vi|nano.
- Updated documentation

**v2021.11.11-beta (202111110)**
- 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

**v2021.11.14-beta (202111140)**
- `bindfs` binaries (ARM, ARM64, X86 and X86_64) are included and prioritized over `mount -o bind`
- Fixed `umount` issues
Expand All @@ -315,3 +293,12 @@ If`/sbin` is missing (many Android 11 based systems lack it), use the `/dev/.vr2
- General fixes & optimizations
- More Android 11+ specific changes; already working at least on a handful of Android 11 devices
- [Wizard] Rename existing destination directories instead of removing them

**v2021.11.17-beta (202111170)**
- Enhanced storage paths fallbacks logic
- `fbind -v|--version` prints version code (integer)
- Fixed auto-mount
- Full Android 11 support (XDA Recognized Contributor, @jimbo77 tirelessly tested fbind on Android 11, kernel 5.4. Worship this man and get him drunk!)
- General fixes & optimizations
- Increased loop timeout to 5 minutes to accommodate long boot times
- Updated documentation
5 changes: 1 addition & 4 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
Daemon to remount folders periodically?

Android 11 storage isolation support
# bindfs -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u $(stat -c %u /sdcard/Android/data/com.termux) -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/[UUID]/Android/data/com.termux /mnt/runtime/write/emulated/0/Android/data/com.termux
App data 2 sd wizard
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.15-beta
versionCode=202111150
version=v2021.11.17-beta
versionCode=202111170
author=VR25 @ xda-developers
description=fbind is a versatile mounting utility for folders, disk images, LUKS/LUKS2 encrypted volumes, regular partitions and more.
57 changes: 23 additions & 34 deletions system/bin/fbind
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,22 @@

apply_config() {

local i=

[ -f $config ] || touch $config
grep -iq '^permissive' $config && setenforce 0

if ! is_mounted ${intsd%/*} && ! is_mounted $intsd; then
intsd=/mnt/pass_through/0/emulated/0
if ! is_mounted ${intsd%/*} && ! is_mounted $intsd; then
intsd=/data/media/0
fi
obb=$intsd/Android/obb
fi

# set default extsd if not defined in config so loop/part can use it
grep -q '^extsd_path ' $config || default_extsd

if ! is_mounted ${extsd%/*} && ! is_mounted $extsd; then
extsd=/mnt/media_rw/${extsd##*/}
if ! is_mounted ${extsd%/*} && ! is_mounted $extsd; then
extsd=/mnt/pass_through/0/${extsd##*/}
if ! is_mounted ${extsd%/*} && ! is_mounted $extsd; then
extsd=$intsd
fi
fi
extobb=$extsd/Android/obb
fi
# storage paths fallbacks
for i in $prefix /mnt/runtime/write /mnt/pass_through/0; do
is_mounted $i/emulated && prefix=$i && break || prefix=
done
[ -n "$prefix" ] && intsd=$prefix/emulated/0 || intsd=/data/media/0
! is_mounted $extsd && extsd=$intsd || mount -o remount,mask=0 $extsd 2>/dev/null
obb=$intsd/Android/obb
extobb=$extsd/Android/obb

grep -E '^extsd_path |^intsd_path |^part |^loop ' $config > $tmpf
. $tmpf
Expand Down Expand Up @@ -112,8 +104,8 @@ default_extsd() {
local dir=
local size=0
local newSize=0
$interactiveMode || wait_until_true grep -q /mnt/media_rw /proc/mounts
if grep -q /mnt/media_rw /proc/mounts; then
$interactiveMode || wait_until_true grep -q /mnt/media_rw/ /proc/mounts
if grep -q /mnt/media_rw/ /proc/mounts; then
for dir in /mnt/media_rw/* /mnt/media_rw/.*; do
if is_mounted $dir; then
df="$(df $dir | tail -n1)"
Expand All @@ -128,19 +120,14 @@ default_extsd() {
fi
done
fi
is_mounted $extsd && {
extsd=$prefix/${extsd##*/}
extobb=$extsd/Android/obb
mount -o remount,mask=0 $extsd 2>/dev/null ###
}
}


edit() {
local f=$1
shift
if [ -n "$1" ]; then
$* $f
"$@" $f
else
vim $f 2>/dev/null || vi $f 2>/dev/null || nano $f
fi
Expand All @@ -164,7 +151,6 @@ exit_wizard() {

# alternate extsd path
extsd_path() {
altExtsd=true
extsd="$1"
extobb="$extsd/Android/obb"
wait_until_true is_mounted "$1"
Expand Down Expand Up @@ -493,7 +479,7 @@ troubleshooting() {

unmount() {
local line=
local pattern="$(echo "$1" | sed -e "s|$prefix||" -e "s|$intsd||")"
local pattern="$(echo "$1" | sed "s|$prefix||")"
/system/bin/mount | grep "$pattern type " >/dev/null 2>&1 && {
echo "<${pattern#/}>"
/system/bin/mount | grep "$pattern type " | sed -E -e 's|^.* on /|/|' -e "s|($pattern) type .*|\1|" | \
Expand Down Expand Up @@ -618,6 +604,9 @@ e.g., fbind -u "loop|part|Downl"
-um|--remount [egrep regex]
Remount matched or all (no arg).
e.g., fbind -um "Download|obb"
-v|--version
Print version code (integer)
EOF
}

Expand All @@ -635,16 +624,16 @@ wait_storage() {
wait_until_true() {
(set +x

for _ in $(seq 30); do
grep -Eq ' /storage/emulated type (fuse|sdcardfs) ' /proc/mounts && break || {
for _ in $(seq 100); do
grep -Eq ' /storage/emulated (fuse|sdcardfs) ' /proc/mounts && break || {
$interactiveMode && return 1
sleep 3
}
done

if [ -n "$1" ]; then
for _ in $(seq 30); do
$* && break || {
for _ in $(seq 100); do
"$@" && break || {
$interactiveMode && return 1
sleep 3
}
Expand Down Expand Up @@ -723,7 +712,6 @@ case $PATH in
esac

service=false
altExtsd=false
TMPDIR=/dev/.vr25/fbind
tmpf=$TMPDIR/tmpf
interactiveMode=true
Expand Down Expand Up @@ -786,7 +774,7 @@ case $1 in

# wait until data is decrypted
(set +x
for _ in $(seq 30); do
for _ in $(seq 100); do
[ -d /storage/emulated/0/Documents ] && break || sleep 3
done)

Expand All @@ -811,6 +799,7 @@ case $1 in

-u|--unmount) unmount_wrapper "$2";;
-um|--remount) fbind -u "$2"; fbind -m "$2";;
-v|--version) sed -n 's/versionCode=//p' $modDir/module.prop;;
*) wizard;;
esac

Expand Down

0 comments on commit acab429

Please sign in to comment.