Android - sharedpreferences 数据正在与 apk 一起上传到 play store
Android - sharedpreferences data is getting uploaded with the apk to play store
你没看错,我没开玩笑。我尽量解释的很详细:
该应用程序正在检查 sharedpreferences 中的 userid
,如果有,则 API 正在要求用户提供此 userid
的数据
现在我清除应用程序 data/cache 并卸载它
然后我创建一个应用程序版本并将其上传到 google 播放
然后我下载这个应用程序,当它启动时,它以某种方式将我用于测试的用户 ID 存储为共享首选项,并从服务器请求用户数据以获得此 ID,我不是在开玩笑。
这怎么可能? android OS 是否只是被窃听并且没有真正正确地清除 sharedpreferences 数据?
我也重复了这些步骤并创建了一个新版本,以确保我没有犯任何愚蠢的错误。
我使用了 google 开发者聊天室,但他们对编程一无所知,只负责评论等。
提前致谢!
这种 Android 行为很不寻常,因为每当您将 Android 项目设置为目标版本 >= 23 时,就会启用自动备份功能。你可以在 Back up user data with Auto Backup 看到它。摘录如下:
Auto Backup for Apps automatically backs up a user's data from apps
that target and run on Android 6.0 (API level 23) or later. Android
preserves app data by uploading it to the user's Google Drive—where
it's protected by the user's Google Account credentials. The amount of
data is limited to 25MB per user of your app and there's no charge for
storing backup data. Your app can customize the backup process or opt
out by disabling backups.
每当您使用 Android Studio 创建新项目时,AndroidManifest.xml
总是在启用自动备份的情况下创建。具有 android:allowBackup="true"
属性:
<manifest ... >
...
<application android:allowBackup="true" ... >
...
</application>
</manifest>
您需要使用 android:allowBackup="false"
将其设置为 false 以禁用备份。开发时,应将其关闭。仅当您在 Play 商店中发布应用程序时启用它。
你没看错,我没开玩笑。我尽量解释的很详细:
该应用程序正在检查 sharedpreferences 中的 userid
,如果有,则 API 正在要求用户提供此 userid
现在我清除应用程序 data/cache 并卸载它
然后我创建一个应用程序版本并将其上传到 google 播放
然后我下载这个应用程序,当它启动时,它以某种方式将我用于测试的用户 ID 存储为共享首选项,并从服务器请求用户数据以获得此 ID,我不是在开玩笑。
这怎么可能? android OS 是否只是被窃听并且没有真正正确地清除 sharedpreferences 数据?
我也重复了这些步骤并创建了一个新版本,以确保我没有犯任何愚蠢的错误。
我使用了 google 开发者聊天室,但他们对编程一无所知,只负责评论等。
提前致谢!
这种 Android 行为很不寻常,因为每当您将 Android 项目设置为目标版本 >= 23 时,就会启用自动备份功能。你可以在 Back up user data with Auto Backup 看到它。摘录如下:
Auto Backup for Apps automatically backs up a user's data from apps that target and run on Android 6.0 (API level 23) or later. Android preserves app data by uploading it to the user's Google Drive—where it's protected by the user's Google Account credentials. The amount of data is limited to 25MB per user of your app and there's no charge for storing backup data. Your app can customize the backup process or opt out by disabling backups.
每当您使用 Android Studio 创建新项目时,AndroidManifest.xml
总是在启用自动备份的情况下创建。具有 android:allowBackup="true"
属性:
<manifest ... >
...
<application android:allowBackup="true" ... >
...
</application>
</manifest>
您需要使用 android:allowBackup="false"
将其设置为 false 以禁用备份。开发时,应将其关闭。仅当您在 Play 商店中发布应用程序时启用它。