yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] Oswald Boelcke:
Moderator Announcement

I see that the respective post has already been edited by the author, and I'm very grateful for this. I appreciate to see how our members suppost each other even in terms to keep this forum clean and within the left and right arcs of the forum rules. Thank you all very much indeed. I hope nobody minds that I've now also removed connected post in order to clean this thread. If you mind please feel free to contact me directly.

Therefore the following information just as a reminder:

4pda.ru is not only another phone related website (and absolutely not affiliated with XDA-Developers) but also well known for the distribution of malware and warez. As such, references to 4pda are not welcome and accepted on XDA.

XDA Forum Rules (excerpt):
[Android Apps and Games] Unreal_Hawkz:
In a nutshell u can follow these steps:

Description of the use of Apps2SD on Xiaomi phones

1. We have a Rooted Xiaomi Redmi Note 5 Pro phone with Magisk installed and custom recovery (for example Orange Fox 10.1) and MIUI 10.3.1.0 firmware Android 9 stable. How to organize full Android access to a flashcard is not discussed here. BusyBox must be installed on the system.

2. Since we will use the 2nd partition with the f2fs file system on the flashcard, we need to install a custom kernel with support for this file system (I don’t know if the stock kernel supports this file system, I don’t use it!). I am using the Ancient-EAS kernel which can be downloaded from the link Click here!... Install the kernel in the usual way as a zip archive through custom recovery. After installation, you need to boot into the system and reinstall Magisk, then reboot, this will increase the overall stability of the system!

3. Next, you need to install a Magisk module called Init.d Injector from the Magisk repository.

4. After that, we reduce the size of the first partition of the flashcard and create a primary second partition there and format it for the f2fs file system. I am using a 128 GB flash drive, the second partition is 32 GB.

5. Boot with the repartitioned flashcard, launch Apps2SD and mount the second section of the flashcard. The section should mount perfectly!

6. In the Apps2SD settings, in the "Set path su.d ..." parameter, set the path data / adb / post-fs-data.d

7. Check the box for "Get sleep ban"

8. Check the box "Use CP instead of RSync" ...

9. Check the "Backup Apps2SD database" checkbox.

10. The "Restart Apps2SD service" checkbox should be ticked.

11. After that, go to "Bind applications to SD card" and select "Recreate mount script". Select the f2fs file system and select the item "My device supports init.d" and create a script. To be honest, I didn’t create any scripts until I ran the mounts, I don’t know where, when and what scripts are created, so you can go through all the points for reliability, but you should create everything when you select init.d.

12. Find and save the scripts 00000000apps2sd-main.sh, 01apps2sdinit, apps2sh-mountscript.sh in the data / adb / post-fs-data.d and data / adb / service.d folders, and then give these files permission 755. Trace to give apps2sd permission 777 in the data / adb folder.

13. That's it, you can reboot the phone, the 2nd section of the sd card will be mounted at boot, you can go to Apps2SD and move custom applications to the 2nd section of the sd card!

NB: this was translated so caution is advised
[Android Apps and Games] Unreal_Hawkz:
That would be really awesome... u may try the steps i mentioned above
[Android Apps and Games] dimstrdan:
Hello! Why is it not possible anymore to read/write into /data/data (internal data) on Android 11? Also foldermount can't read internal root of Android 11? Anyone has a way to fix this?
[Android Apps and Games] :
EXCELLENT APPLICATION !!! WELL DONE THANK YOU FOR UPLOADING IT!!! :)
[Android Apps and Games] Xitee_:
Great App, i am using it for a long time now but i have a problem when rebooting.

Everytime I reboot my device, SWAP gets reenabled and all my folder mounts are off. It's really a pain to always manually change these settings after a reboot.

I already tried it with scripts that disable SWAP on boot, but somehow they won't get executed (if i trigger it manually it just works fine). And even if that would work, there are still the folder mounts.

Is there a way to fix that??
[Android Apps and Games] juandante:
I think those pseudo tutorials are complete bullsh*t. They explain how to activate the app but not how to recover from the many problems that the app will cause later like force closing apps, losing apps, etc.

I moved 10+ apps from a very old phone a very old Galaxy Note 4 with Android 6.0 and gosh, App2SD was creating complete mess with constant app crash. I removed all bits of Apps2SD and phone was working great again.

And there is no sort of help in the app, with parameters that doesn't mean anything (like SD Fix, what does it do ? or even again what I put in bold in your translated post) and there is no integrated troubleshooting.

And on Android 7+, it seems to have a lot of problems too. To sum up, this app is a magnet to trouble. I think it can be made better if it was not so opaque and had some real help and explanations in the app.
[Android Apps and Games] AnonVendetta:
I just did a short test of Apps2SD on Android 11. Linking apps works, mostly. For me, they don't disappear after reboot, and I don't get a soft reboot error.

Specs:

Galaxy Tab S7+

Latest stock Android 11

Rooted with Magisk v23

When creating the mount script, it fails if I try the Advanced option. But if I set the mount script path to /data/adb/service.d, it works. I also told it not to modify system partition.

As for the actual linking of apps, everything works except linking obb. With that I just get an error. My workaround is to use Riru, LSPosed, and XInternalSD. Then I can move obbs to 1st partition of MicroSD (not 2nd, which Apps2SD uses), apps still load fine. You need a root file manager to do this, I use Root Explorer.

My 2 cents...
[Android Apps and Games] Numatu:
"Device stuck in bootloop after creating mount script using the "Advanced method""

I've this problem with my note 8 Android PIE. I apply The solution e the phone restart. After I try to recreate the script with normal but after the phone go to bootloop and if i try the same solution it say no such file or directory!!!
[Android Apps and Games] Mikirok:
Its posible work without root?
[Android Apps and Games] AnonVendetta:
No, definitely not. Root is an absolute requirement. You might want to consider using adoptable storage instead.
[Android Apps and Games] Numatu:
Good morning, no one can help me?

Please
[Android Apps and Games] AnonVendetta:
Maybe i can help. But you didnt explain clearly enough, your English isn't that good. Try taking screenshots of the problem, post them here.
[Android Apps and Games] Numatu:
Sorry I'll try to explain better. My Samsung note 8 (android pie), have a partition, with many app linked. I had some problem with them, so I try to recreate the script, with "Advanced method" that worked fine untill than. But Device stuck in bootloop after creating mount script using the "Advanced method". So i tried to resolv the problem with a solution finded in the site "https://www.apps2sd.info/kedb.html" a the title " Device stuck in bootloop after creating mount script using the "Advanced method" ". So the device restarted and this time i try to recreate the script with "Normal method" but device go again in bootloop but this time i tried again the solution but it didn't work and terminal says so.....
[Android Apps and Games] AnonVendetta:
It looks like you're trying to unset the immutable and append attributes on vold. And then copy vold_apps2sd, but with the name of vold. But it's not letting you, because the file doesnt exist.

In TWRP, mount system partition, open file manager, go to /system/bin/, do you see more than one vold file? And what are their names?

Are you able to boot into Android? Or just TWRP?
[Android Apps and Games] Numatu:
just TWRP
[Android Apps and Games] AnonVendetta:
Rename vold to voldbak (actually it doesnt matter if it is bak or anything else), then rename vold.original to vold. Then try booting into Android. If it works, you can delete voldbak. Apps2SD possibly replaced your vold file with something that isnt compatible. The vold.original should be the one your Android had before the app made any changes.

Before you rename the files, run this in a terminal:

sha1sum /system/bin/vold

sha1sum /system/bin/vold.original

Is the same value reported for both files? Or different? Same values means the files are identical, different values means the opposite.
[Android Apps and Games] Numatu:
Can i copy that file somewhere, for security?

I don't find the size, but if i order the files by size they are in different position
[Android Apps and Games] AnonVendetta:
You can make a copy if you want to. Were you able to get Android to boot?
[Android Apps and Games] Numatu:
NO i wasn't able to get android to boot. now i try with your solution
[Android Apps and Games] Numatu:
GREAT!!!!!

It restarted!!!

Thank you, Thank you, Thank you very much.

May i ask you another help. i would repair the partion and the applications linked.

How can i do this?
[Android Apps and Games] AnonVendetta:
I have no idea how to repair the partition and get the apps relinked.

If you are rooted with Magisk, I suggest you try mounting 2nd partition with a service.d script instead of advanced option. No chance of messing up system files that way. And dont allow it to modify system partition when creating mount script.

Advanced option works on my Marshmallow phone, but it doesnt work on my tablet that runs Android 11. Magisk script works fine.
[Android Apps and Games] Numatu:
Marvellous

Thank you, thank you, thank you very much.

i set the script like you say to me and everything gone gooood.

The second partion is visible. the apllications in 2nd partition reappeared.

I must flag the option remount second partition at the start?
[Android Apps and Games] AnonVendetta:
I would say no, you dont need to. Unless the linked apps disappear or are gone after reboot, then you should flag it.
[Android Apps and Games] Numatu:
I've a little problem. the device see the partition with the apps linked but don't see the normal partition with the data, but in recovery twrp it's present and i see all files
[Android Apps and Games] AnonVendetta:
You will have to explain better. That made no sense to me.
[Android Apps and Games] Numatu:
In my sdcard i ' ve 2 partition. 1 for the applications linked and 1 for data.

With Your help now the Partition with applications work and is visible by android system, while the second is not visible by android. If i open file manager of twrp, it see the partition with the data, files, everýthing. But if i start phone normally the partition of data is invisible, like it Was not inserted
[Android Apps and Games] AnonVendetta:
Maybe the 1st partition is what you have your apps linked to, and the 2nd is where your data is. In that case, stock Android ROMs wouldnt be able to access the data partition.

Go to Play Store, install Aparted. Open it and take a screenshot.
[Android Apps and Games] Numatu:
I think there is a problem in the script.

My phone has 64gb of intern memory.

Have AN sdcard of 256gb partitioned in one partition of 56gb for applications and one of 200 for data.

But if i look in android, it Was like intern memory of 28gb.

I can' t install anything and i can't make screenshot, because it says there isn't enough space
[Android Apps and Games] AnonVendetta:
Can you take a picture of it with another phone?
[Android Apps and Games] AnonVendetta:
You may need to reflash your firmware or do a factory reset to fix this. But first, we need to see if your SD card is partitioned correctly.

Your data partition should be the 1st partition, and partition for linking should be 2nd. If they are in reverse order, stock Android firmwares wont be able to access the 1st partition.
[Android Apps and Games] Numatu:
I have simply rooted my phone with magisk, no stock firmware. It seems i have only the system memory and the free intern memory, and in the sdcard the parttion of applications.But before sdcard worked good with both this partitions
[Android Apps and Games] Numatu:
I tried to start device without sdcard and after this is memory of the phone...

And if I try the sdcard in other phone without root, the only partitions readed is the partition of data
[Android Apps and Games] AnonVendetta:
So you are out of space even without the SD card? If that's the case, then only a firmware/ROM reflash or factory data reset will fix it.
[Android Apps and Games] Numatu:
There isn't any solution
[Android Apps and Games] Zealdes:
Great app. It continues to work even now after its last update in 2018. It's sad that it's discontinued.

I have some issues, likely due to android system change over the years. App cache is now located in the app's internal data folder, so linking data will also link cache, but linking cache will reduce performance heavily. I think it's possible to work around this by moving cache elsewhere in /data, then move and link only the internal data (without cache) to sdcard, then link the moved cache to that moved data. So cache will still be in internal memory, linked to data folder in sdcard, then linked back to internal memory inside data folder. The 2nd partition might have to be ext fs, idk.

Does the author have or plan to have the source available publicly, maybe in github?

Edit:

This is achievable "manually" with folder mount option. I linked data to sdext, then I "manually" mounted the cache folder in sdext to a folder I created in /data. I tried this for Facebook app but it turns out it's just as slow as having both data and cache in sdext. I've tried both with Symlink and with Bind, but they're equally bad. It took ages for the app to load. I guess Facebook is heavy on the data folder.
[Android Apps and Games] YK RAJ:
Hi,

Can we increase the partition size of SDcard(1st Partition) and reduce the size of sdext2(2nd Partition) without formatting using pc app "Disk Management Tool"? The way we can shrink and expand the pc drive size without formatting, In the same way, Can we change the size of SDcard partition too?
[Android Apps and Games] AnonVendetta:
@YK RAJ: The "SDcard" partition is first, and sdext2 is 2nd. So, assuming your MicroSD is formatted this way (and it should be this way, due to how stock Android firmwares only natively mounts the 1st primary partition that has a compatible filesystem), then you will need to delete 2nd partition, increase size of 1st partition, then recreate 2nd partition as something being smaller than what it is now.

If you currently have apps linked to sdext2, you should unlink or uninstall them before proceeding.

You can do this in Windows with something like MiniTool free edition. Or in Linux, it has numerous partitioning programs. You can also do it on the phone with Apps2SD or AParted (although I think Apps2SD's inbuilt partitioner isn't so flexible, and will force you to format the entire card). I personally recommend AParted for this, just be careful not to delete what you wish to keep.
[Android Apps and Games] YK RAJ:
Thanks, Will try Aparted!
[Android Apps and Games] AnonVendetta:
I just upgraded my Samsung tab to Android 12, and decided to test Apps2SD again. Unfortunately my results are the same as before. You can link an app's internal data just fine, linked apps continue working. However, linking obb files to 2nd partition fails. I can link them to the SD's 1st partition, Apps2SD claims linking is successful. But when I check the /Android/obb/ folder on SD, nothing has been moved, and the respective app fails to launch normally.

In short, for Android 11/12, you shouldn't trust Apps2SD to link anything in /sdcard/Android/data or /sdcard/Android/obb, due to the Scoped Storage restrictions. The locations listed above may also/or be located at /storage/emulated/0 on some firmwares. However, linking an app's internal data (located in the data partition, not including internal/external storage) seems to be safe. It's a long shot that Apps2SD will ever be updated, but we can hope.

Most Apps2SD users will be rooted with Magisk these days, so be sure to use /data/adb/service.d for the mount script location (configure it in Apps2SD settings before creating mount script). Also, it's best to not let Apps2SD modify system partition. Using the advanced mount option will likely result in a failure to create the script, or an inability to boot.

Here are some alternatives you can try to address these shortcomings:

XInternalSD:

Requires EdXposed or LSPosed

Can't link internal data

Can select which apps it should be enabled/disabled for

Doesn't require 2nd partition on SD

Obb On SD:

Requires EdXposed or LSPosed

Can't link internal data

Can't select which apps to enable it for

The app will claim it's not enabled in Xposed, you can just ignore this by tapping outside the dialog, it will still work

Doesn't require 2nd partition on SD

Fbind:

Requires Magisk/root

Can't link internal data

Requires usage of a terminal emulator app, it has no GUI

Doesn't require 2nd partition on SD

Not all of these will work with all apps, try more than one if you have issues.

Even with these issues, I think that Apps2SD still remains somewhat useful, but not as much as it was before on older Android versions. If you're willing to root your phone and try EdXposed/LSPosed, you will find that these limitations are tolerable.

An alternative for non rooted users would be adoptable storage.
[Android Apps and Games] RootedLee:
@AnonVendetta awesome write-up - thank you!
[Android Apps and Games] RootedLee:
@AnonVendetta have you also tried and compared AppMgr III (updated as of March 24, 2022)?
[Android Apps and Games] AnonVendetta:
Yes, I have, and it's nowhere near as powerful as Apps2SD. AppMgr III is better for not rooted, Apps2SD is better for rooted.
[Android Apps and Games] RootedLee:
Gotcha, thank you.

BTW, are you still sure that Fbind (even latest 2021-12-07) can't link internal data?
[Android Apps and Games] AnonVendetta:
I meant linking the internal data (located in the userdata partition of the device). To my knowledge fbind can't do that. But even if it's possible to bind mount an entire user, it's not something I would recommend doing. Too much opportunity for weird bugs, crashes, etc to occur. I don't know that much about fbind beyond using it to link some stuff from internal storage to external storage. So if you have questions about it, I'd ask in that thread. @VR25 also has Telegram chat channels you can join.
[Android Apps and Games] RootedLee:
Ok (y)
[Android Apps and Games] RootedLee:
Never mind, found it under "Set su.d.."
[Android Apps and Games] AnonVendetta:
Su.d was originally a function of SuperSU. But it's basically nothing more than a function of auto running scripts on boot. Init.d has been able to do that for a long time, and Magisk also. I'm using /data/adb/service.d. if you're using Apps2SD on Android 11/12 in particular, I would also enable the setting to not let the app modify system partition. Too much chance of a bootloop/inability to boot on newer Android versions. It happened to me once on 11, I had to go through a somewhat complicated process to undo Apps2SD's changes and get back into Android. Setting the su.d path works fine though, since it doesn't modify Android's system files.
[Android Apps and Games] RootedLee:
Great, thanks for all the tips. I had already heeded your advice to choose not to have the app modify the sys partition when it asked me.

I'm finishing setting up my new Nokia 6.1 with LineageOS 18.1 (Android 11), also running latest Magisk and latest LSPosed. I've formatted my SD card as internal aka "adoptable storage" for encryption. Above all what I want to do is move and bind 2 apps' data from #/data/data/app.path to adoptable storage. Before on my Samsung (SD as regular mobile) I achieved that via Symlinks with Root Explorer or FX Explorer [root], but this is not working anymore in my new setup. And XInternalSD isn't helping here.
[Android Apps and Games] AnonVendetta:
Can't advise much with adoptable storage and issues relates to linking/binding with it. I tried it once a few months ago and lost over 150GB of files that can't be recovered. Much of it wasn't critical, but some was. Still reeling a bit recovering from that. As a result, I won't use AS again unless I'm confronted with a scenario where there are no other viable options.

Oh, and since your using AS, you don't really need Apps2SD. The main point of this app is that it lets you link internal data and bind internal/external storage stuff. AS keeps entire apps and their internal data on the SD, including things like obb files. And your SD essentially becomes considered by Android as your device's internal storage. AS cancels out most of the point of using Apps2SD.

And if you have anything important stored on your device while AS is enabled, I very highly recommend backing that stuff up to a PC, the cloud, whatever. Anywhere besides the device itself. That would have saved my bacon had I been more careful. But I was overly confident and not knowledgeable enough about AS to get my stuff off it if/when it fails. Lesson learned, moving on. If you ever find that your adopted SD is no longer accessible, you will regret if you don't have a backup somewhere. If you're rooted or have TWRP, I would make a copy of the encryption keyfile in /data/misc/vold and keep it somewhere safe. It may help you recover your data when something bad happens, as long as the AS partitions on the SD remain intact. Although it wasnt much help for me since those partitions had been accidently destroyed.
[Android Apps and Games] RootedLee:
Sorry to hear about your data loss due to messing with AS. I know how that feels.

Thanks for your explanation of how AS works. Already having read many pros and cons about it, I'm still lamenting if how AS works is really what I want. Esp. because of the way migrating works - that I can't choose what is getting migrated but am forced to migrate everything. I initially had thought AS would only merge the SD card into Internal Storage, and not also move /data/apps and data/data hidden in the background. Esp. since hardly and app works if run from AS anyway and I had to enable a switch to install and keep apps on internal. I think much rather I'd prefer to have all apps and data on internal by default, and continue to choose willingly via XinternalSD and root Symlinks what exactly to move to SD card.

Re. backups: very good points - here's how I've been doing it:

backup via TWRP -> images to PC

phone booted into Android & connected to PC: manual copies of Internal and SD-card's folders/files -> PC

with SD formatted as AS: SD-card via adapter into PC then 1:1 RAW clone saved as compressed image

The path to folder with the encryption keyfile in /data/misc/vold is great to know - I just backed the entire folder up :cool:
[Android Apps and Games] RootedLee:
OH BTW, this might also be of interest, and should also work with other apps.
[Android Apps and Games] RootedLee:
Awesome. Thank you for all the vast guidance, tips and background info - I appreciate all very much!

With 32GB internal + 128GB SD I've decided to go with option 3 - back to portable etc. I'll start implementing tonite and hope to be done tomorrow nite. Will report back once I'm finished.

(how simple everything still was with my first Android 4.x phone, and even still with my 2nd w/ A. 7.1.1. - sigh)

Update 1:

- indeed, LOS 18.1 doesn't allow moving apps to SD formatted as portable even if that option is enabled in Developer Options.. adb shell > su > pm set-install-location 2 -> reboot doesn't change that, either..

- SymLinking [SD-card]/path/to/folder -> data/data/path/to/folder with any root file manager doesn't work anymore, either, despite of 'Namespace: global' activated in Magisk -> reboot.. (I guess because of scoped storage) - not even if I choose a folder on SD the app already does have r/w access to (in Android/data/path/to/AppsDataFolder).

Apps2SD Pro is next (tomorrow).