yashsingh1/xdaforums huggingface dataset:
[Magisk] TechnoSparks:
Hm, please use 1.1 since that is the version that I am trying to push to the masses.

Please also read this very important page for more understanding: https://www.technosparks.net/pages/product-documentation/ts-binds?q=bind . Afterwards we can continue troubleshooting the matter.

Note that we are starting back to square one since I need to understand any problems that stem from the usage of the module.

——————————————————

First uninstall the tsbinds module

Delete /data/ts-binds

Delete ts-binds-folderlist.txt in internal storage

Reboot device

Open terminal. Run "su" first and then run this by copy and pasting:

mount > /tmp/ts-mounts-pre; getprop > /tmp/ts-props-pre

Copy the files from directory /tmp and save it in a temporay folder

Install the bleeding version

Setup your WhatsApp folder in the folderlist

Open terminal and run "su" and then "tsbinds reinit". This will bind the folder pair

Still in a terminal, run this:

mount > /tmp/ts-mounts-post; getprop > /tmp/ts-props-post

Copy the files from directory /tmp and save it in a temporay folder as earlier

Check if ts-binds work

If not, please package the temporary folder containing the requested media and then upload here so I could have a look.

Disable module in the meantime to prevent any errors
[Magisk] benlm72:
Hi,

Thanks for the quick answer.

I've already tried the 1.1 release, foloowing your advice about uninstalling previous version, rebooting...

I will try the steps you describe and let you know if it fix my pb.

To be sure of the cmd, I understand that the first folder is the one in which I want the app to store pictures, the second one is the folder in which the app normally store them : am I right ?
[Magisk] TechnoSparks:
Yes you are correct :D
[Magisk] TheMDJ:
Great work dear but your guide is confusing for me

1. why Syntax for your obb example is different. $int is first and $sd is second in that example

2.do I need to move/copy obb file from internal to sd card before mirroring it ?

sorry I am ultra noob :(
[Magisk] benlm72:
Hi,

I've tried these steps, here is my result :

- all is OK up to the first mount cmd.

- terminal says me that I can't create files in tmp because no rights to do that : so I change your cmd to use /sdcard after creating folder with ES File explorer

- then I reboot and flash 1.1 from recovery, then reboot

- at this point, my phone became extremly slow, quite freezed. After three reboots I just manage to remove module and reboot one more tome

- now my phone is back to previous behaviour but I haven't test the module.

If it can help, pre files are attached. Let me know if I can do some more tests.
[Magisk] TechnoSparks:
I don't think that you are confused with the guide. Your understanding is correct. The $sd needs to be on the left handside and $int on the right. I was wrong on the "Troubleshooting" section of the page and have promptly fixed my error. Sorry for the confusion caused. I have also updated the page to reflect your post.

As for the second point, yes.

——————————————————

Great, thank you. But I really need the files for post-operation as it may indicate the issue. For your second point though, have you executed "su"? If your terminal is elevated (root), it should have permission to write on /tmp. But if you already did that, then I guess it couldve been something else. Dang, Android is weird isn't it.

Okay, I know your device becomes problematic after installation of the 1.1. Since the information required for the second phase is important, are you willing to further help me? As for the extreme slowness, that should not be an issue as we have adb on our side.

If you are willing, may I know if you have technical knowledge with the command prompt?
[Magisk] benlm72:
Yes, my terminal has granted root rights with magiskSU.

I don't exactly know what knowledge you need, but I can execute cmds you tell me.

It will be difficult to execute the second step as I have almost no control on my phone after module installation !
[Magisk] TechnoSparks:
Pardon me. I confused /tmp on PC Linux and Android :silly:

Just basic knowledge, because I would just like to minimise the need on my end to explain some rather small things.

It is difficult if you are using the device to execute the terminal commands. Thus we need to use a PC and adb to execute the commands from the PC. Spontaneous tip: use adb shell because it is always easier to write terminal commands, copy and pasting, etc from a PC than from a terminal emulator on a touch device.

Before we start, we need to have a computer and adb installed on said computer. If not, and you are using Windows, I suggest for you to use this: https://xdaforums.com/showthread.php?t=2317790 . If on Linux, you can find them pretty easily by searching for "adb" in your respective package management tool.

After installing, please turn on USB debugging on your device. Connect USB and type in "adb devices" in the ADB command prompt window in order to start the adb daemon. A dialog will appear on your device to authorise debugging. Make sure to tick the checkbox which I dont remember exact words but it has something to do with remembering your computer for debug :D

Now, let us resume:

Enter "adb shell" in cmd (command prompt) to enter the shell on the device

Enter "su" in order to elevate adb to root. You will need to allow root access if you haven't done so. Please allow it to have indefinite root access too.

Completely clean your device from any traces of ts-binds previous version! Run this in the cmd:

rm -rf /data/ts-binds

You can leave the folderlist file in internal storage as is to minimise hassle on your end! :)

Install the bleeding version

If you already deleted the folderlist.txt in internal storage, please open it again and setup the whatsapp folderpair.

Run "tsbinds reinit" in the cmd to initiate the binding process. Your phone will start to slow down.

I changed tmp to cache this time, should work hopefully. Run this in cmd by copy and pasting:

mount > /cache/ts-mounts-post; getprop > /cache/ts-props-post

Delete ts-binds module by copy and pasting the following line:

rm -rf /sbin/.core/img/ts-binds; rm -rf /data/ts-binds

Type in "reboot" and your device will reboot normally.

Upload the files from /cache for inspection

Thank you so much for your time! :)
[Magisk] Kigung:
Hi TechnoSparks, I'm reporting the new bleeding version is working, I'm very happy to able use this module again ?
[Magisk] TechnoSparks:
Awesome! This is what I was waiting for, a confirmation of compatibility for Pie. Thank you so much for revisiting the thread! :D

A push to release will be done soon after I deal with some issues reported by benlm72. :)
[Magisk] benlm72:
Here are my post files. The whatsapp bind was not OK because my phone was already slow after 1.1 install flashed in recovery.

Hope this can help, or tell me how to install your module without using recovery mode.

EDIT : I think I've found how to install 1.1 without recovery, it's probably by adding the zip module from the Module menu of MagiskManager ? But after that I can't execute the tsbinds command, it is unknown :(
[Magisk] Kiriak:
Hello, TechnoSparks! I have Xiaomi Redmi Note 5, MIUI 10, Android 8.0, Magisk 17.1. I tested the new bleeding version 1.1. And this is the only option that really works!!! :good: No foldermount magisk, no magic binder - does not work! Ts-binds saves me! :D But there is one drawback. The new version must be installed over the version 0.9. If you perform a clean install, the /data/ts-binder folder is not created, and the terminal gives a "No such file or directory" error
[Magisk] TechnoSparks:
Sorry for the long delay. I have been busy.

Upon inspection i think I have found the anomaly.

/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid)

Post:

/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)

Notice the lack of "gid" for the post and the difference in "mask"

This is too strange. ts-binds does not remount internal and external storages at all. In the new sdcardfs implementation, it only remount the binded path. As per to source:

function folderbind {
if supass mountpoint -q \""$3"\"; then
echo "$1 is already binded" | $log
elif [ ! -d "$2" ] && [ ! -f "$2" ]; then
echo "Bind aborted: Folder '$2' as source doesn't exist!" | $log
exit 1
elif [ ! -d "$3" ] && [ ! -f "$3" ]; then
echo "Bind aborted: Folder '$3' as target doesn't exist!" | $log
exit 1
else
echo "Binding $1" | $log
if /sbin/su -M -c mount --rbind \""$2"\" \""$3"\" 2>> $logfile; then
intr="$(echo $3 | sed 's/default/read/g')"
intw="$(echo $3 | sed 's/default/write/g')"
if [ $legacy != "1" ]; then
(supass mount -o remount,gid=9997,mask=6 \""$intr"\") || gexit
(supass mount -o remount,gid=9997,mask=6 \""$intw"\") || gexit
fi
echo "Bind successful" | $log
else
echo "Bind failed" | $log
fi
fi
}

To be honest, I just don't know. This is outside of the expected behaviour, Android's pesky vold should always mount it correctly with the correct mask and gid.

Since this is a single extraction from your device, I really hope that this might be the true cause of the issue you are having. Would you like to test an experimental version of ts-binds of which would also remount the "/storage/emulated" to proper gid and mask?

This may or may not fix the issue. Only "try" could tell. Also it would be helpful if you could tell me if your LineageOS ROM (i got this info from prop) you are using is official or unofficial?
[Magisk] benlm72:
OK for me for an additional test.

I don't know if the ROM I use is official or not, it's not tagged as unofficial : https://xdaforums.com/galaxy-s4/i9505-orig-develop/jdcteam-optimized-lineageos-15-0-builds-t3708586

And just explain me please how to install your test module without rebooting :)
[Magisk] TechnoSparks:
Thank you for the bug report. Squashed that pretty quickly. Sorry for the inconvenience, that is my bad for directly moving the folder from the module directory. Now it is back to the old way of storing the data files in the module dir. :)

Extra gratitude for the report of support on 8.0 :highfive:

Foldermount magisk's development is currently in hiatus. ts-binds before 1.1 used what Magic Folder Binder do, which is enforcing the use of props. This is preferable, but some devices may shipped with forced SDCardFS that simply do not respect the modified props at all (especially Android Pie). This is also what motivates me to find the trick for SDCardFS so that it would work on Pie!
[Magisk] TechnoSparks:
The reboot to activate a module is by Magisk design. We cannot change that. I think we have a misunderstanding here. Let me clarify — this module can automatically bind everything in the folderlist without a reboot. This is documented by running "tsbinds reinit" in the shell terminal. "reinit" invokes the "service.sh" file in Magisk module folder.

I should come up with a customised version by Saturday. I have a test tomorrow so I would like to dedicate the night for study :p
[Magisk] benlm72:
That's what I have understood but I get an error in shell when running tsbinds, Terminal tells me that tsbinds is unknown.

No problem for me, I would probably test that on monday then. And don't miss studying for your test, don't matter for us at this moment ;)
[Magisk] TrippyEngine:
Hi! I am an android pie user. I installed version 1.1 of the module inside magisk manager. After rebooting, all magisk modules are disabled, as if it were at a "safe mode". After a second reboot, the phone can't boot, so I restored a twrp backup.

Later, I tried your module again by installing it through recovery. The results were the same. This is kinda weird I think. Could the cause be that magisk image needs to resize? Could an extra line solve this?
[Magisk] TechnoSparks:
Hello, thank you for testing the bleeding version and reporting issues!

I am not so sure myself. But on my end the issue is that the "data" folder is not extracted by the Magisk installer along with some other personally "stupid" mistakes on my end.

I conclude that the latest bleeding build is faulty and therefore removed the latest version from Google Drive. You may redownload from the same link. Apologies for my error. If you are going to test that one, do let me know the outcome :)

As of now I think i will hold back the release of bleeding version as public beta. benlm72's issue has quite of an importance as it is a bug that is not expected by the design of the module, but appears anyway as caused by the module.
[Magisk] TrippyEngine:
I'll definitely try the new build! I'll edit this post after testing! Thanks for answering so quickly!

EDIT: This time, the device booted, but every app force stopped. So, I guess the module isn't meant for my device after all :P
[Magisk] TechnoSparks:
Alright this is the true bug, unlike the previous one which was my sloppy coding.

About compatibility, it is always a tricky thing. But i am willing to try and squash this one. Yours seems to have the similar issue with benlm72. I would like to have some valuable resources in order to analyse this issue further.

If you are willing to help, I need to know if you have experience using "adb shell" on a computer. Do you?
[Magisk] TrippyEngine:
I'm afraid I'm not that experienced :/ Besides, I'm kinda drowning due to many assignments at university that are due too soon :p However, I'm willing to try any builds you make and report back whenever I find some free time!
[Magisk] TechnoSparks:
Unfortunately, I only have 1 person that reports ts-binds not working. I managed to find out why, but I don't know if it is a random occurrence or if it really is ts-binds at fault. In essence, the more users with problems, the better I could trace the issue. Since I am kind of in need of the debug files, I think I will create a simple debug script for you (and for the public later). I will mention your username when I have done so.

Of course, you can always take your time too. I am busy as well as it is a test and quizzes season right now so there is no urgency here :good:
[Magisk] TrippyEngine:
Alright, that's a perfect idea!
[Magisk] TechnoSparks:
I really appreciate your cooperation! ?
[Magisk] TrippyEngine:
I realized that my problems until now (not booting, force closes etc) were happening because my system partition was full. I've successfully rebooted with the module enabled. Right now, I'm trying to figure out how to bind an internal Download folder to the external Download folder.
[Magisk] benlm72:
Hi,

I've not understood if you've posted an "new" 1.1 to test ?
[Magisk] TechnoSparks:
Hm i see. About figuring that one out, I suggest for you to read this section on the documentation

Currently, there isn't any modified version yet. When I am done, it will not be a new "1.1" build, it is a completely custom build tailored for you. Edit: well i just realise it is going to be a new 1.1 build

Thing is, earlier today, I realise that it would be more reasonable to add a new "deterministic" feature based on your issue (hence making it accessible to anyone else in the future if they face the same issue). Implementation will come tomorrow, but I cant really give an exact ETA at the moment. It is 4 a.m. currently and I was busy doing a lame thing called "assignment". :p

Very sorry if I made you waiting though..
[Magisk] benlm72:
No PB !

---------- Post added at 09:40 PM ---------- Previous post was at 08:58 PM ----------

No pb !
[Magisk] TechnoSparks:
Hello. I am still do not understand how something this weird can happen. Can you send me again, a new fresh file from /proc/mounts? Make sure ts-binds is not installed.

Just to be sure.

Because I go through your sent files and realised that my I understanding of it is in reverse. Your device is using the "incorrect"(?) mask and gid before ts-binds is installed.
[Magisk] TechnoSparks:
Here is the customised version, [MENTION=1591755]benlm72[/MENTION] . I still wish to have the new proc/mounts though

This is not recommended for other users so if you are not the mentioned person please do not use

https://drive.google.com/open?id=13lN7crPnwc1MWnqH6fqzRUX2kdJ2wGZw
[Magisk] TrippyEngine:
[MENTION=5765352]TechnoSparks[/MENTION] should the file ts-binds-folderlist.txt automatically appear in my internal memory after installing your module and rebooting? If yes, then that is not the case for me. I created one myself, inside it I had the line folderbind $sd/Downloads $int/Download. Then I went to my terminal emulator and typed su -c tsbinds reinit.

However, many errors appeared then. It looked like it didn't recognise that there was a folderlist line. I don't know if that is related to your module or it's just my phone with too little free memory at the system partition (around 30mb).

I didn't use the build you uploaded above, by the way.
[Magisk] TechnoSparks:
The free space for the system partition is not related. This could be something else at fault. Please delete /data/ts-binds folder if it exists, rename your current folderlist to something else and install a new version I have uploaded at the same bleeding link.

If the same anomaly appears, I would like to ask for the log file located at Internal/ts-binds.log. If it do not exist, fetch the one /data/ts-binds/ts-binds.log .

Of course, still on the defective module, I would also like for you to run this in a terminal emulator, just copy and paste. First write "su" to get root. Then:

mkdir -p /cache/debugtsbinds/; mount > /cache/debugtsbinds/mount-post.txt; getprop > /cache/debugtsbinds/props-post.txt

Disable/remove module from Magisk, and then reboot. After reboot, open terminal emulator again. Run "su" first to get root access, then:

mount > /cache/debugtsbinds/mount-pre.txt; getprop > /cache/debugtsbinds/props-pre.txt

You can close the terminal now, and then please zip the file from /cache/debugtsbinds and upload it here for me to analyse. Thanks for your time!
[Magisk] benlm72:
Hi,

Here are the files you ask + tsbinds folderlist + tsbinds log (with strange errors).

The WhatsApp bind doesn't work for me. My phone doesn't slow down. The tsbinds reinit cmd in terminal doesn't work so I reboot my phone to enable MagiskManager launch the module.

Hope it can help !

EDIT : I forgot to mention I'm on Magisk 17.3.
[Magisk] TechnoSparks:
I only entertain stable Magisk versions only as stated on the module description on my website. However, as for now, I assume that the issue is not related to 17.3.

Erm, I have inspected your folderlist.txt and noticed a very grave mistake.

folderbind whatsapp "/storage/DE98-9DC0/WhatsApp" "/storage/emulated/0/WhatsApp"

This particular forlderpair is wrong.. You need to use the same as the example! ts-binds uses the $sd and $int variable if the user wants to bind across storages. This is because special algorithms is needed in order to maintain support. Unless you are an advanced user, you will always want to use the variables! In the bleeding version to cater with sdcardfs, this proved extra important because of the remount procedure. Plus, the folderpair above is not valid even if 1.0.9 is used due to how Android only cares about /mnt/media_rw and /data/media for FUSE-based internal emulation.

Is this the same folderpair code ever since you reported the issue?

Please use the one supplied by the example by removing the hashtag and modifying it

folderbind whatsapp "$sd/WhatsApp" $int/WhatsApp

I wish I could prevent this misunderstanding earlier if I asked for the folderbind first. But that is my very bad mistake. I am very sorry. I will now elevate my to do list to finish a new debug script ASAP so I could prevent this kind of misunderstanding ahead of time whenever a user reports an issue.

Also, please download this new "tsbinds" file and then replace the one in "/sbin/.core/img/ts-binds/system/xbin". Reboot and see if WhatsApp folder is now properly binded.

https://drive.google.com/open?id=1_sLBK0mrXBnICz3qdpGJgbePSCc7pHjc

Hopefully this time it will work.
[Magisk] benlm72:
Hi !

Shortly : it works ! Many thanks !

In details :

- thanks for your support even with magisk 17.3. I've began with the stable version but changed to the beta one for suhide pbs

- the benlm72 bleeding version works with the binding you indicate above. With the example given in the folderlist I got an error, as mentioned in previous posts (no re-tested with the bleeding version). That's the reason why I've tried direct folders as I thought I understood on your website

- the benlm72 bleeding version gives me error in log, as in the one I upload in previous post

- the binds you give me to replace the benlm72 bleeding one doesn't work after reboot, the log tells permission denied
[Magisk] TechnoSparks:
Newer Magisk version is not prioritised for my module is that because I use the stable version on my device, and that this module is tested on my own main, everyday-use device. Technically, any new beta/canary Magisk doesnt matter. But there is a slight chance that topjohnwu may change the paths (ts-binds currently uses hardcoded paths, this should change later) and break the module. Broken ts-binds often leads to multiple app crash or slowdown of device.

This is great news. It turns out the default Android-way works on your ROM, despite your ROM initially mounting the internal with different mask and gid. Ah I see. And again sorry for the misunderstanding. Language barriers suck. I will improvise on the text to make things more clear, and hey I like to make my documentation as good as possible :p

The error found in the log is because of my sloppy coding yet again. I realised that the text searching algorithm i used is for "mount", not "/proc/mounts" which I promptly fix with a new "tsbinds" file for you to replace in the module directory.

However, it gives you permission error because I forgot to advise you to set the permission as executable. Man, i really look clumsy aren't I? Usually replacing a file preserves its permissions, but I guess it doesnt work universally.

As a final request, can you give me /proc/mounts just to make sure what i said in point no 2 is correct? :angel: Make sure ts-binds have successfully binded your WhatsApp folder

Sorry that I write a lot :eek:
[Magisk] benlm72:
No pb ! My mounts is attached, whatsapp binding is ok
[Magisk] TechnoSparks:
Alright, inspected and confirmed. Please also test if you can create a file in WhatsApp folder on internal and see if you got error. If there is no error, then you should be good to go! :)

Thanks for bearing with me.
[Magisk] benlm72:
Created in internal storage without error and simultaneously visible in SD card !
[Magisk] TechnoSparks:
Awesome, stable release will come soon! Thank you :D
[Magisk] benlm72:
You're welcome, I'm really happy to help you (a little ;)) making something running on our smartphones !
[Magisk] arinpsycho:
I'm unable to bind obb in Android P. Other folders like android/data and downloads works fine. Anyone could guide me?
[Magisk] TechnoSparks:
Unfortunately I do not have Android Pie.

Classically, the obb files are located in /data/media/obb. But also, due to SDCardFS, it is also treated the same like the internal storage. So it needs some special care to be taken like the internal and external storage.

Beware technical jargon: the obb files from the /mnt/runtime needs to be binded to the external storage, and the resulting bind mount also needs to be remounted with proper mask and gid, the same way internal binding is handled.

ts-binds-bleeding current version hasn't implement the support for obb files of SDCardFS. I am currently working on this.