agamemnus / cordova-plugin-xapkreader

Easily access Google Play APK expansion file data.
32 stars 55 forks source link

Permission denied #21

Closed marcoturi closed 8 years ago

marcoturi commented 9 years ago

Hi, I have a permission problem accessing the obb after the upload on the playstore. I followed the instructions from here -> https://github.com/agamemnus/cordova-plugin-xapkreader/blob/gh-pages/test-project-instructions-and-test-obb/instructions.txt

In console log i have this result:

W/ActivityManager( 405): Permission denied: checkComponentPermission() owningUi d=10075 W/ActivityManager( 405): Permission denied: checkComponentPermission() owningUi d=10075 D/ ( 119): openContentUri(content://it.companyname.appname/expansion/ audio/file.mp3) caught exception -1 E/MediaPlayerService( 119): Couldn't open fd for content://it.companyname.appname/expansion/audio/file.mp3 E/MediaPlayer( 4071): Unable to to create media player E/HTML5Audio( 4071): couldn't load the resource: content://it.companyname.appname/expansion/audio/file.mp3 exc: java.io.IOException: setDataSource failed.: status=0x80000000 W/ActivityManager( 405): Permission Denial: opening provider com.flyingsoftgame s.xapkreader.XAPKProvider from (null) (pid=119, uid=1013) that is not exported from uid 10075 I/libuTorrent-jni( 1580): Array with 1 files returned.

Where could be the problem ?

Thanks in advance, Marco

agamemnus commented 9 years ago

main.10000.it.companyname.appname.obb? I'm not sure that is what you actually have..

content://it.companyname.appname/expansion/ audio/file.mp3: This has a space after the "expansion/" that shouldn't be there.

marcoturi commented 9 years ago

Ok i've found the problem. The plugin is compatible only with android >= 4.3 API level 18. I tried using genymotion with different android versions, installing the playstore and downloading the app from it, like a normal user. The app works perfectly on android >= 4.3, if is lower i get the behaviour of the first post (that cames from a real galaxy tab 2 with CM and android 4.2.2).

Any idea on how to solve this?

PS The space from the log cames from my copy & paste, the original code doesn't have it.

agamemnus commented 9 years ago

Try this. In the provider, change android:exported="false" to true.

agamemnus commented 9 years ago

If that doesn't work, http://stackoverflow.com/a/19699192.

marcoturi commented 9 years ago

here myapp\platforms\android\AndroidManifest.xml?

agamemnus commented 9 years ago

Either there or in AndroidManifest.xml. If that doesn't work, try adding that to your main activity in AndroidManifest.xml. Either way it is just a shot in the dark, but worth trying.

For the record, I never had a problem with Android 4.2 or lower, as far as I know. I am using Crosswalk, though.

marcoturi commented 9 years ago

Thank you! That worked for Android 4.2, still not working on 4.1. I'm thinking to switch to Crosswalk, but the new system (https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview) is only compatible with Cordova Android 4.0.0 that uses Gradle, that actually doesen't work with this plugin. Any ETA for the bugfix ?

agamemnus commented 9 years ago

I am using Gradle, this plugin, and Crosswalk just fine. I think. I did not try the webview plugin yet. I just use the old method of replacing and rebuilding CordovaLib (the migrate option).

marcoturi commented 9 years ago

How do you use gradle without this error https://github.com/agamemnus/cordova-plugin-xapkreader/issues/18 ?

agamemnus commented 9 years ago

I think it's a cordova 5 issue, not a gradle issue specifically... I was able to build with the normal cordova build command using cordova 4, which is when it switched to gradle. But, I'm not sure.

agamemnus commented 8 years ago

I am closing this issue. Please posts any further comments in https://github.com/agamemnus/cordova-plugin-xapkreader/issues/22.