As I have studied about the security issues in Android, one good practice is to check if the allowBackup
and backupAgent
has been set in the AndroidManifest.xml
.
How to check android:allowBackup
value of an app programmatically?
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
if ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_ALLOW_BACKUP) != 0) {
// enabled
} else {
// disabled
}