I download the apk file from the Internet and save it in Context.getCacheDir (). I upload the file via HttpURLConnection - I am not actually asking about the code (it works completely), so I am not posting it here. I am successfully starting the download. The file is downloaded to the cache, and then the installation is requested - but the system cannot open my APK and record an analysis error.
Therefore, the task is as follows:
03-31 16:48:43.740: INFO/ActivityManager(59): Start proc com.android.packageinstaller for activity com.android.packageinstaller/.PackageInstallerActivity: pid=620 uid=10026 gids={} 03-31 16:48:44.749: WARN/zipro(620): Unable to open zip '/data/data/com.my.app/cache/myApp.apk': Permission denied 03-31 16:48:44.749: DEBUG/asset(620): failed to open Zip archive '/data/data/com.my.app/cache/myApp.apk' 03-31 16:48:44.930: WARN/PackageParser(620): Unable to read AndroidManifest.xml of /data/data/com.my.app/cache/myApp.apk 03-31 16:48:44.930: WARN/PackageParser(620): java.io.FileNotFoundException: AndroidManifest.xml
Problem: I do not have access to software / cache. Is there any way to solve this problem? I donβt want to use external storage as a download directory (the installation process works when I upload a file to external storage), the cache is large because the file will not be accessible to the average user from the file manager and what I want. Thanks for your thoughts.
This problem has been unsolvable for me for more than a month ...
Edit: There is still no solution, I'm trying to think I found 1st place, which is impossible with Android
Edit2: I must have looked poorly - my downloaded apk is in the cache ... Still there is no permission to allow installation from this directory?
Waypoint
source share