Copy/share configurations between paid/free versions of Android app?

后端 未结 3 1159
感情败类
感情败类 2021-02-03 13:32

My Android app comes both as a free and paid version. I have created a library project and two additional Application projects, one \'Free\' and one \'Paid\' version (signed wit

3条回答
  •  北海茫月
    2021-02-03 13:59

    1. Implement a ContentProvider to expose the stored data in your free version.
    2. Ensure the provider is exported (android:exported="true")
    3. Declare a permission in your client application. The protection level should be "signature".
    4. Require the permission declared in (3) as a readPermission for the provider.
    5. In your paid app, add a uses-permission for the permission declared in your free app.
    6. Check for the presence of the provider & load the data into your paid app.

    This, of course, only works if you are signing the free and paid apps with the same cert (which most sane people do).

提交回复
热议问题