falzonv / discreet-launcher

Enjoy a clean home screen while accessing everything in an instant! (Profitez d'un écran d'accueil épuré tout en accédant à tout en un instant !)
https://vincent-falzon.com
GNU General Public License v3.0
224 stars 42 forks source link

Crash while using Export feature #317

Closed lesar8 closed 1 year ago

lesar8 commented 1 year ago

Hi Vincent, i've been using your launcher for a few days now and really like it! Most of things works well except for the "Export" feature when it crashed the launcher. I believe the reason is because I debloated some preinstalled system apps on my phone via ADB shell. Already tried to re-install the two default file manager (Samsung My Files and DocumentsUI) but no luck as the crash still happens.

My phone is Samsung Galaxy A10s running Android 10. What bugs me the most is my Dialer and Messaging app are still able to backup settings file normally!? I am not sure what dependency is causing this.. Hope for your helps. Thank you!

falzonv commented 1 year ago

Hello,

Thank you for the report! Unfortunately, I am not sure to be able to solve this issue from my side :-/ I tried to reproduce it on an Android 10 emulator but the export worked as expected (that is, the export was completed successfully and the resulting file contained the values for all the settings).

Here is a summary of the export process in Discreet Launcher:

  1. The user clicks the "Export" button
  2. The Android file picker is displayed so that the user can select the export location, the filename is pre-filled with the current date (in the format "2023-10-22_discreetlauncher.txt") but can be modified by the user
  3. The user clicks the "Save" button of the file picker (if the user cancels, the process stops here)
  4. A plain text file is generated, containing the values for all the settings, and saved at the selected location
  5. A message is displayed, informing the user that the export has been completed

At which point in this process do you observe the crash? I believe this is between step 1 and 2 since you didn't mentioned the file picker (that is, you clicked the "Export" button but Discreet Launcher crashed before any file picker was displayed?).

The file picker displayed in step 2 is managed by the Android system (Discreet Launcher only requests the system to display a file picker with the pre-filled filename and lets it handle the next steps until it sends back the result after step 3). On every phone or emulator where I tested it, the system handled this using the interface of the default file manager (whose name may vary across Android versions and manufacturers) even when custom file managers were installed.

I am not familiar with the ADB shell but maybe when removing apps manually it could break some kind of internal links which are not automatically re-established when the apps are reinstalled?

This is indeed interesting that the Dialer and Messaging apps do not face this issue, but if they are system apps they may have more rights than Discreet Launcher and/or use their own built-in file pickers (the reason for going though the standard Android file picker process is that in recent Android versions, apps cannot directly write outside of their own directory anymore).

A possible workaround, if the ADB shell allows it (no idea of its exact power but if it allowed you to remove pre-installed apps I guess it is rather extended), would be to make a backup (manual copy) of the internal storage files of Discreet Launcher where everything is stored as plain text files (the export mostly aggregates all of this in a text file saved at a user-selected location). I am not sure where these internal app files are located in the filesystem though...

Best regards

falzonv commented 1 year ago

PS: I will check if there is a way to at least prevent the crashing so that Discreet Launcher stays opened, this would not restore the export feature in your case though, only display an error message instead of crashing...

lesar8 commented 1 year ago

Hi. I managed to got it working by re-install the built in DOCUMENTS app (documentsui.apk) and restart the phone! My Dialer and Messaging app is actually not the stock app but an alternatives one. So well, i guess maybe there is a way to Export setting file without the need of that DOCUMENTS app (it had terrible interface and was a pain to use..).

abc

falzonv commented 1 year ago

Hello,

Ok thank you for your feedback, I will close this ticket then.

Yes the default file manager is often not that great, however using this method where the Android system manages the file picker offers the best compatibility across Android versions (as Discreet Launcher supports Android 5 to 13). Personally I just take note of the folder where the exported file lands (usually "Documents" or "Downloads"), and then if I want to change it I use a more convenient file manager such as Ghost Commander.

Best regards

lesar8 commented 1 year ago

PS: I will check if there is a way to at least prevent the crashing so that Discreet Launcher stays opened

It's a nice idea to implement in the next build!

Anyway I figured out that both of my Dialer and Messaging app, the backup/restore feature automatically selects a fixed path to write and read a setting file, so even if the phone did not have any file manager app, it still works!