Accessing assets of other Android app on Jelly Bean

前端 未结 1 2030
北海茫月
北海茫月 2021-01-03 05:13

I have a pair of Android apps. One is a free \'reader\' app and the other is a paid for \'Data\' app with a text file in a sub directory of its assets.

The reader ap

相关标签:
1条回答
  • 2021-01-03 05:48

    Paid apps on JB devices are 'forward locked'. This means that the APK is split in two parts -- one with public resources, and one with private ones and code, which is not readable by other apps. Some details here: http://nelenkov.blogspot.com/2012/07/using-app-encryption-in-jelly-bean.html

    I haven't looked into how files are split in detail, but the problem you are seeing suggests that assets are part of the private APK, which makes sense, since you typically stick API keys, etc in assets.

    So you need to use a more indirect method to share info between the two apps such as a ContentProvider or remote service. Make sure you require signature permissions to access those, to make sure only your own apps can use them.

    0 讨论(0)
提交回复
热议问题