如何访问另一个Android应用
我有一个已经在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论