adb uninstall keeping sharedpreference android 10

adb uninstall keeping sharedpreference android 10

我正在使用以下命令使用 adb 卸载应用程序,但保留 sharedpreference 数据。这样在重新安装应用程序后我可以取回数据。

adb uninstall -k [package.name]

这适用于我 android 9.0。对于 android 10 台设备,sharedpreference 数据得到 deleted.After 重新安装,sharedpreference 数据未显示。有解决办法吗?

将此代码添加到 AndroidMenifest.xml

文件

    <application
        android:allowBackup="false"
     >
  </application>