SmartPack / PackageManager

Source code of Package Manager, an Application to Manage your Apps.
https://smartpack.github.io/PackageManager/
GNU General Public License v3.0
448 stars 59 forks source link

Installing .xapk does not copy resources #80

Open VA1DER opened 2 years ago

VA1DER commented 2 years ago

When installing an .xapk, the installer is supposed to:

  1. Install (or offer to install) all contained .apk's
  2. Copy (or offer to copy) bulk files contained in the xapk's Android/* to the device's Android/ folder

Package Manage does #1 but does not even offer to do #2. This makes Package Manage unable to correctly process most xapk's

sunilpaulmathew commented 2 years ago

@VA1DER Thank you. In fact, I was not even aware about the second point. Is it really important? I believed that the necessary resources should be inside the "base.apk" itself. Also, I doubt, a user app (like Package manager) is't allowed to copy files into some other apps external data folder (/sdcard/Android/data/*).

VA1DER commented 2 years ago

Is it really important? I believed that the necessary resources should be inside the "base.apk" itself

Yes. Some apps don't come with the data they need. You would install the app and the app would download its data and store it, usually in sdcard/android/obb/*. There are or were(don't know if they still exist) restrictions on where an .apk could drop data to, so when those apps stop being able to download their data they can't get repacked into new .apks that include it because Android won't unpack an apk there. So .xapk was developed to hold the app (all the apks needed) plus the previously download data.

Most xapks were for that purpose.

I doubt, a user app (like Package manager) is't allowed

No, you need root. But your app already asks for root. For unrooted systems, you could analyze the xapk/zip and if there is an android/ tree then at least inform the user it can't be installed without root.

I've never encountered apkm or apks so don't know if they are supposed to do the same thing as xapk or not.

sunilpaulmathew commented 2 years ago

@VA1DER Personally, I'm against adding more root-only features (I'm slowly going away from root). Moreover, if apps are capable to download its resources (as you mentioned), I really don't think its a matter.

VA1DER commented 2 years ago

Moreover, if apps are capable to download

.xapk's are generally used when the download resource for an app are no longer available, so the app doesn't just die. There are many other reasons why .xapk's were built - to distribute apps that are larger than .apk's can handle, for example, so it's not just the "old apps where you can't download the resources any more". That was just one example of why .xapk's were made. To my knowledge, you won't often find an .xapk that doesn't have extra /sdcard/android/* resources in it, so .xapk itself is basically a root-only format.

If you don't want to support the use of root to copy resources over, then perhaps you can drop support for .xapk. The fact that the app asks for root and offers to install .xapk's makes people think they are being installed correctly but that the app just doesn't work.

At the very least, please add support for warning the user that there are resources in the .xapk that your installer won't install so they know they need to try another avenue to install the .xapk (or do it manually)

sunilpaulmathew commented 2 years ago

Moreover, if apps are capable to download

.xapk's are generally used when the download resource for an app are no longer available, so the app doesn't just die. There are many other reasons why .xapk's were built - to distribute apps that are larger than .apk's can handle, for example, so it's not just the "old apps where you can't download the resources any more". That was just one example of why .xapk's were made. To my knowledge, you won't often find an .xapk that doesn't have extra /sdcard/android/* resources in it, so .xapk itself is basically a root-only format.

If you don't want to support the use of root to copy resources over, then perhaps you can drop support for .xapk. The fact that the app asks for root and offers to install .xapk's makes people think they are being installed correctly but that the app just doesn't work.

At the very least, please add support for warning the user that there are resources in the .xapk that your installer won't install so they know they need to try another avenue to install the .xapk (or do it manually)

I'll think about your suggestions.However, just to clarify, app is not using root access for installation. Root access is only using for very few things, such as managing AppOps etc.

VA1DER commented 2 years ago

just to clarify...

On my Android 12 tablet is asks for root as soon as I tap on the menu button. Interestingly on my Android 10 phone it doesn't seem to ask for it then.

I'll think about your suggestions.

Fair enough. All I ask. And thanks.