johanw666 / Signal-Android

Fork from a private messenger for Android with extra options added: full backup and (partial, ony text) xml backup of messages. Restore can happen at any time, not only after a fresh install. Import SMS database. Import of (unencrypted) WhatsApp databases. Removed apk expire. Choose between passphrase protection and the Android screenlock. Choice for the backup location (internal or removable storage on Android < 11 (on 11 and higher this is already possible)). Set the maptype in the place picker. Option to treat view-once media as normal media. Option to ignore remote deletion. Choose between FCM or websocket notification delivery.
https://johanw.home.xs4all.nl/Signal/signal-jw.html
GNU Affero General Public License v3.0
250 stars 16 forks source link

Request: add option in settings to move data to internal storage for compatibility with XInternalSD #8

Closed LeeBinder closed 4 years ago

LeeBinder commented 4 years ago

hey @johanw666, thank you for your Signal-JW fork!

As you know Signal does not store its data in internal storage but for security in /data/data/org.thoughtcrime.securesms/. The problem with that is that XInternalSD can only map/ re-route data (and obb etc.) to SD if an app's data path points to somewhere on internal storage.

For those of us who've rooted their Android + have installed XPosed + XInternalSD, it is not necessary to format our SD cards as internal (Linux filesystem) or to add a 2nd partition formatted with a Linux ext2/3/4 fs to allow symlinks.

Signal is now the first app which would make that necessary right now because all other options do not work. And the devs don't care. That sucks bigtime.

So my idea is this toggle option in Settings/ Storage:

◉ Store data in /data/data (default, secure) ◎❗ATTENTION: requires root: Store data in internal storage: Android/data for compatibility with the XPosed module XInternalSD (less secure)

After selecting option 2, this would happen:

  1. a little alert window would pop up: Signal needs to restart for the change to take effect. Restart now? YES / Later
  2. On closing Signal, a script included in your mod moves the data folder from /data to internal storage Android/data/
  3. The script re-launches Signal

What do you think?

johanw666 commented 4 years ago

I would have to study how to do that without rebuilding too much of Signal, which is something that falls out of scope of this project. I can try to make a test version with https://github.com/signalapp/Signal-Android/pull/9015/commits/b9e453be07ba4ccab5d992b1831404339343d79c and see if that works. From what Iunderstand it only moves the apk, not the data.

In the meantime, I succeded in remapping folders from /data/data/[app id] to /sdcard/Android/data with Foldermount (https://play.google.com/store/apps/details?id=com.devasque.fmount), but AFAIK this might or might not work witgh your device. I also use it to remap WhatsApp from internal to removable storage, something XinternalSD also failed to do. Unfortunately it is not free, but of course there are solutions for that.

LeeBinder commented 4 years ago

dank jij Johan for replying to swiftly!

Correct, the apk + lib dependencies only make up 59MB = neglectable.

Wow, so you did manage to have Folder Mount perform the "/data/data/[app id] to /sdcard/Android/data" magic .. ;) Which Android are you running? I had it running well with 4.x then 6.x, but ran into oddities with my current 7.1.1. Don't remember anymore what exactly (great, my brain's/ mind's crap filter is working LOL) and then got lucky with XInternalSD.

So were you actually able to remap /data/data/org.thoughtcrime.securesms/ (or at least the size-prone folder app_parts and - if it exists - app_captures) with Folder Mount, and have Signal still perform just fine?

johanw666 commented 4 years ago

I didn't use it for Signal but for a game that dumped large downloads from an add network in /data/data. I use it on Android 6.0.1, I'm trying to get an Samsung A50 with Android 9 properly rooted (it now usually results in a bootloop when I boot with Magisk) but that one has sufficient internal memory so I won't need it on that device anymore.

LeeBinder commented 4 years ago

ah OK - bummer, but I had already thought you were not running Android 7.+

So for now I'll wait and see if there will be any development anywhere - maybe even some Magisk or Xposed module. I doubt the Signal devs will change anything.

LeeBinder commented 4 years ago

@johanw666 I figured it out - I'm sure you'll like it :)

LeeBinder commented 4 years ago

I now close this issue because I treat my 21+ steps work-around as a fix for now.

LeeBinder commented 2 years ago

Hi @johanw666 Long time no talk ;)

Can you please share a simple thing: which version of Android are you running these days?

johanw666 commented 2 years ago

Today my daily driver runs Android 11. Which is important because, with the manage storage permission, I now can store backups almost anywhere.

LeeBinder commented 2 years ago

Yes, I can second that on my new Nokia 6.1 with LineageOS 18.1, also Android 11.

I'm now in the process of figuring out this issue. Even though your fork does have WRITE_EXTERNAL_STORAGE set to true, that only applies to the backup function. Needless to say it would be awesome if that would also apply to data/data/org.thoughtcrime.securesms, or even just the app_parts sub-folder. Not sure how this could be achieved.