Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Googleplay don‘t filter x86 device

I generated a .so file which is builded by using ndk-build command. And in the Application.mk file,i writed these: APP_ABI := armeabi. Then, I used this .so file in another app, but I figured it out that the app is visible in Google play with an x86 device.

From the docs (http://developer.android.com/google/play/filters.html): By including native libraries built with the Android NDK that target a specific CPU architecture (ARM EABI v7 or x86, for example).

Now I'm confused, what should i do to make my app invisible to x86 device in GooglePlay?

We have an application published in GooglePlay,the application will crash in x86 device. So we want to make the application invisible for x86 device in GooglePlay. Now we have our .so file in armeabi directory under jniLibs directory, but x86 device still can find the application in GooglePlay.

like image 608
lqynydyxf Avatar asked Nov 22 '25 17:11

lqynydyxf


1 Answers

Google Play may be depending on the fact that x86 has a translation layer which will take armeabi code and translate to x86. See: How does native android code written for ARM run on x86?

While I don't know why your particular app won't work on x86, one way to handle it is to check the CPU/Architecture when you app starts up via the old

Build.CPU_ABI

or on API 21 and up

Build.SUPPORTED_ABI

http://developer.android.com/reference/android/os/Build.html#CPU_ABI

and prevent the user from running your app if a condition isn't met like CPU architecture. So on launch you would check and if the device isn't correct degrade with a dialog and/or prevent the user from accessing the feature which would crash.

EDIT

If you are required to block devices from even seeing your app, you'll have to use the Google Play Developer console to select what devices can see your app.

See: How to restrict android app to specific device make?

and https://support.google.com/googleplay/android-developer/answer/1286017?hl=en

Of course as new x86 devices come online you'll have to remove them as well.

like image 97
Morrison Chang Avatar answered Nov 25 '25 07:11

Morrison Chang