If an app behaves differently on a higher or lower Android version, then it uses code like that (before the app has been compiled):
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M){
// do something on Android 6+
} else {
// do something on Android before version 6
}
Such code structures will be present in multiple classes of the app. If you want to forge the Android version in the original app you have to decompile the APK using apktool modify every occurrence of such a structure e.g. by replacing the access to android.os.Build.VERSION.SDK_INT
which queries the device's Android ADK version and replace it by a constant like 29
for Android 10 and the rebuild the APK using apktool, zipalign
and sign (apksigner
) it and then you are ready to install the app.
Unfortunately apktool does only generate Smali code and not Java code, which makes the whole task much more difficult as Smali is very low level and not easy to read.
There may be existing programs/apps that already do such modifications in an automated way, unfortunately I don't know or use such apps.