Toukea Tatsi
Toukea Tatsi

Reputation: 199

From Android how to check if app was installed from App bundle or from APK

please, from Android native; does someone has an idea of how to check if the running app was installed from Android app bundle or directly from APK?

I have an app that allows itself to be shared to others as APK However, when the app was installed from app-bundle, the resulting shared APK can not be run on all devices. therefore, I am trying to make a checkup to determine if the app was installed directly from APK before displaying this specific feature (and remove it if installed from app bundle) I will appreciate any help or weblink or clues. The PackageManager.class seems to not have a method about it.

Upvotes: 2

Views: 1308

Answers (2)

Gregory Nowik
Gregory Nowik

Reputation: 176

You can check the installerPackageName on the PackageManager to know if the app was installed from the Play Store or sideloaded.

Upvotes: 1

snachmsm
snachmsm

Reputation: 19273

maybe try to fetch APK file of target app (like in HERE), unpack it and check resource folder for presence of multiple density buckets or native libs for more than one ABI

Upvotes: 2

Related Questions