1

I was looking for an answer whether Google allows to install externall C++ applications together with Android Apps on Google Play. I found some information on this site: Developer Policy Center - Malicious Behavior.

They say, that the following sentence is explicitly prohibited:

Apps that install other apps on a device without the user's prior consent.

Now my question is, what exactly does mean other apps? It is about other apps in Google play or any apps like my external C++ program that I want to execute in Android app? Does I have to inform users that some C++ app will be installed in the device?

4
  • 1
    I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users). Commented Nov 26, 2018 at 21:55
  • Yeah but in my case I don't want to use JNI, I just want to run an executable (as root user). I could use JNI and use my external C++ program as library, but the problem is, that I need to run it as root user, and with JNI I don't think it is possible. Commented Nov 26, 2018 at 22:10
  • What's your deployment strategy? How will root be able to run the code? Commented Nov 28, 2018 at 15:53
  • I was thinking to put my executable file to assets directory, then when my app starts the executable will be copied from assets directory to /data/data/app-package-name/myexecutable. Then adding the executable permission to my file as root user (Runtime.getRuntime().exec("su"); outputStream.write("chmod +x myexecutable");) and then running it - outputStream.write("/data/data/app-package-name/myexecutable params"); Here is description: gimite.net/en/… Commented Nov 28, 2018 at 18:02

1 Answer 1

1
+50

first i you want to execute an c/c++ application in android , the only right and best way is to convert that app to a static or shared library using android NDK and after that you can use it by Java Native Interface (JNI).

second , "other apps" in the sentence that you mentioned in your question , some application can install some applications in system without user permission. for example in a rooted device we can simply install application without showing any windows or getting permission. in android old release because of some security issue in non-root device we was able to install an application without asking permission.

see this link for more information : https://paulononaka.wordpress.com/2011/07/02/how-to-install-a-application-in-background-on-android/

Update

google wont allow developers to do that because android system cannot track this executive and it could be virus or dangerous tool that may harm android system

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your response. So compiling the C++ with NDK into executable instead of library is not an option? The reason I need in to be executable is that I want to use the executable as a root user. With library I suppose I'm not able to do that.
Yes I know it, but the main question is, does Google allow it? My account has already 2 suspension, I can not allow any more ;)
google won't allow developer to do that because in android system , executive files could be a virus or harm the system because in android architecture in root-mode , you will skip the art or dalvik rules and it will have access to some files in data directory and will be able to manipulate some of the main files.
That's what I was afraid of, hence the question

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.