Installing an external C++ program in Android
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?
add a comment |
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?
1
I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users).
– yhyrcanus
Nov 26 '18 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.
– Tom
Nov 26 '18 at 22:10
What's your deployment strategy? How will root be able to run the code?
– yhyrcanus
Nov 28 '18 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/…
– Tom
Nov 28 '18 at 18:02
add a comment |
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?
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?
asked Nov 26 '18 at 18:31
TomTom
4261731
4261731
1
I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users).
– yhyrcanus
Nov 26 '18 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.
– Tom
Nov 26 '18 at 22:10
What's your deployment strategy? How will root be able to run the code?
– yhyrcanus
Nov 28 '18 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/…
– Tom
Nov 28 '18 at 18:02
add a comment |
1
I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users).
– yhyrcanus
Nov 26 '18 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.
– Tom
Nov 26 '18 at 22:10
What's your deployment strategy? How will root be able to run the code?
– yhyrcanus
Nov 28 '18 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/…
– Tom
Nov 28 '18 at 18:02
1
1
I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users).
– yhyrcanus
Nov 26 '18 at 21:55
I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users).
– yhyrcanus
Nov 26 '18 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.
– Tom
Nov 26 '18 at 22:10
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.
– Tom
Nov 26 '18 at 22:10
What's your deployment strategy? How will root be able to run the code?
– yhyrcanus
Nov 28 '18 at 15:53
What's your deployment strategy? How will root be able to run the code?
– yhyrcanus
Nov 28 '18 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/…
– Tom
Nov 28 '18 at 18:02
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/…
– Tom
Nov 28 '18 at 18:02
add a comment |
1 Answer
1
active
oldest
votes
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
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.
– Tom
Dec 3 '18 at 18:53
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 ;)
– Tom
Dec 3 '18 at 19:24
1
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53487049%2finstalling-an-external-c-program-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
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.
– Tom
Dec 3 '18 at 18:53
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 ;)
– Tom
Dec 3 '18 at 19:24
1
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
add a comment |
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
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.
– Tom
Dec 3 '18 at 18:53
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 ;)
– Tom
Dec 3 '18 at 19:24
1
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
add a comment |
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
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
edited Dec 3 '18 at 19:31
answered Dec 2 '18 at 19:18
Nima MohammadiNima Mohammadi
29927
29927
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.
– Tom
Dec 3 '18 at 18:53
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 ;)
– Tom
Dec 3 '18 at 19:24
1
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
add a comment |
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.
– Tom
Dec 3 '18 at 18:53
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 ;)
– Tom
Dec 3 '18 at 19:24
1
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
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.
– Tom
Dec 3 '18 at 18:53
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.
– Tom
Dec 3 '18 at 18:53
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 ;)
– Tom
Dec 3 '18 at 19:24
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 ;)
– Tom
Dec 3 '18 at 19:24
1
1
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
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.
– Nima Mohammadi
Dec 3 '18 at 19:29
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
That's what I was afraid of, hence the question
– Tom
Dec 3 '18 at 19:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53487049%2finstalling-an-external-c-program-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I think they explicitly mean installing an APK. JNI/NDK is ok (you don't need to tell users).
– yhyrcanus
Nov 26 '18 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.
– Tom
Nov 26 '18 at 22:10
What's your deployment strategy? How will root be able to run the code?
– yhyrcanus
Nov 28 '18 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/…
– Tom
Nov 28 '18 at 18:02