如何访问另一个Android应用

发布于 2025-01-27 17:47:10 字数 850 浏览 2 评论 0原文

我有一个已经在Play Store上使用的应用程序,该应用程序的全数据存储在EncryptedSharedPreferences中。我正在使用androidx.security.crypto sharedPreferences。现在,我将在带有不同包装名称的Play Store上拥有一个新应用。因此,我想访问该应用程序的整个数据并转移到新应用中。我尝试使用shareSID,但它总是返回给我。下面我提到我在现有应用中使用的自定义共享首选项类。

class SharedPrefUtils(context: Context) {
private val keyGenParameterSpec = MasterKeys.AES256_GCM_SPEC
private val masterKeyAlias = MasterKeys.getOrCreate(keyGenParameterSpec)
private val PASS_KEY = context.getString(R.string.pass_key)
private val sharedPrefs = EncryptedSharedPreferences.create(
    PASS_KEY,
    masterKeyAlias,
    context,
    EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
    EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)

因此,我想知道是否可以访问此类型的数据。如果没有,那么我可以有什么选择。

谢谢。

I'm having an app which is already live on play store and whole data of that app is stored in EncryptedSharedPreferences. I'm using androidx.security.crypto for the SharedPreferences. Now I'm going to have a new app on play store with different package name. So I want to access whole data of that app and transfer into new app. I tried using sharedId but it always returns null to me. Below I'm mentioning the custom shared preferences class what I'm using in an existing app.

class SharedPrefUtils(context: Context) {
private val keyGenParameterSpec = MasterKeys.AES256_GCM_SPEC
private val masterKeyAlias = MasterKeys.getOrCreate(keyGenParameterSpec)
private val PASS_KEY = context.getString(R.string.pass_key)
private val sharedPrefs = EncryptedSharedPreferences.create(
    PASS_KEY,
    masterKeyAlias,
    context,
    EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
    EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
)

So I want to know whether it's possible to access this type of data or not. If not, then what alternatives I can have.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文