move app dir to <private_dir>/app allowing for re-installation/upda…#852
Conversation
…tion to not delete the user data. This is only working for sdl2 bootstrap, stiil need to test with service and other bootstraps.
|
Great. I'll check it at the weekend if it can wait a couple more days. |
| private Bundle mMetaData = null; | ||
| private PowerManager.WakeLock mWakeLock = null; | ||
|
|
||
| public String getKivyRoot() { |
There was a problem hiding this comment.
Might be nice to use getAppRoot or something instead of Kivy, but it doesn't really matter.
|
Thank you! |
|
I solved this by putting the user data in a different folder. |
The default behavior should be to allow the user to delete the private data if he want's to. |
Yes, I agree, but I consider the p4a private files not to be user data, so I would put those in a different folder. |
So currently with this pr, Only the files/apps folder is deleted when we need to update the app. p4a app files are not with the data. |
|
I just tested it and everything in the private dir is deleted if the user presses the "Clear data" button. So my assumption was incorrect: I thought only the /files contents would be deleted by that. |
Yup, and that's how it should be, if the dev wants to prevent this behavior then they should choose a separate dir manually like /sdcard/ but issue with that would be it is not protected/private by the os the developer may have to manage that themselves.. |
| /* If we built our own python, set up the paths correctly */ | ||
| LOGP("Setting up python from ANDROID_PRIVATE"); | ||
| PyRun_SimpleString("private = posix.environ['ANDROID_PRIVATE']\n" | ||
| PyRun_SimpleString("private = posix.environ['ANDROID_PRIVATE'] + '/app'\n" |
There was a problem hiding this comment.
This should actually use ANDROID_APP_PATH rather than guessing /app, right? If that's right, just let me know and I'll make the change manually and merge.
…tion to not delete the user data.
This is only working for sdl2 bootstrap, still need to test with service and other bootstraps.
This is based on #350
We need to have the following fix in kivy with this pr. kivy/kivy#4490