Access ro.serialno from native in Android 8?Is there a way to run Python on Android?How to save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Stop EditText from gaining focus at Activity startupIs there a unique Android device ID?What is 'Context' on Android?Can't start Eclipse - Java was started but returned exit code=13Proper use cases for Android UserManager.isUserAGoat()?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?
Is it right to use the ideas of non-winning designers in a design contest?
What is the extent of the commands a Cambion can issue through Fiendish Charm?
When does order matter in probability?
How many attacks exactly do I get combining Dual Wielder feat with Two-Weapon Fighting style?
How can I hint that my character isn't real?
Why does 8 bit truecolor use only 2 bits for blue?
Where on Earth is it easiest to survive in the wilderness?
Why is Sojdlg123aljg a common password?
How do you say "to hell with everything" in French?
What quests do you need to stop at before you make an enemy of a faction for each faction?
Should I tip on the Amtrak train?
Can you pop microwave popcorn on a stove?
Relationship between speed and cadence?
At what point does a land become controlled?
Short story: Interstellar inspector senses "off" nature of planet hiding aggressive culture
Constant integers and constant evaluation
Can taking my 1-week-old on a 6-7 hours journey in the car lead to medical complications?
Is every sentence we write or utter either true or false?
Can the Spell Alter Self allow a Kenku to Speak Normally?
Professor refuses to write a recommendation letter to students who haven't written a research paper with him
Template default argument loses its reference type
I won a car in a poker game. How is that taxed in Canada?
Is there some sort of French saying for "a person's signature move"?
Word for something that used to be popular but not anymore
Access ro.serialno from native in Android 8?
Is there a way to run Python on Android?How to save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Stop EditText from gaining focus at Activity startupIs there a unique Android device ID?What is 'Context' on Android?Can't start Eclipse - Java was started but returned exit code=13Proper use cases for Android UserManager.isUserAGoat()?Does anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need some help. I have an app that is mostly written in native C code. I use the __system_property_get(const char * name, char * value)
method to read the serial nr. of the device at various points in my native code. With Android 8 I always get a "Access denied" message now.
libc: Access denied finding property "ro.serialno"
Is there a way for me to still be able to read the serial nr. in Android 8? I tried switching to targetSDKversion < 26 but it still gives me a "Access denied" message. I do get the correct values if I use Java with Build.SERIAL
(regardless of SDK version) and Build.getSerial()
in SDK version 26 if I grant the READ_PHONE_STATE
permission. But I cannot read these values in Java and pass them to the native code without a huge rewrite of the native code.
Any help?
android c permissions native
add a comment |
I need some help. I have an app that is mostly written in native C code. I use the __system_property_get(const char * name, char * value)
method to read the serial nr. of the device at various points in my native code. With Android 8 I always get a "Access denied" message now.
libc: Access denied finding property "ro.serialno"
Is there a way for me to still be able to read the serial nr. in Android 8? I tried switching to targetSDKversion < 26 but it still gives me a "Access denied" message. I do get the correct values if I use Java with Build.SERIAL
(regardless of SDK version) and Build.getSerial()
in SDK version 26 if I grant the READ_PHONE_STATE
permission. But I cannot read these values in Java and pass them to the native code without a huge rewrite of the native code.
Any help?
android c permissions native
add a comment |
I need some help. I have an app that is mostly written in native C code. I use the __system_property_get(const char * name, char * value)
method to read the serial nr. of the device at various points in my native code. With Android 8 I always get a "Access denied" message now.
libc: Access denied finding property "ro.serialno"
Is there a way for me to still be able to read the serial nr. in Android 8? I tried switching to targetSDKversion < 26 but it still gives me a "Access denied" message. I do get the correct values if I use Java with Build.SERIAL
(regardless of SDK version) and Build.getSerial()
in SDK version 26 if I grant the READ_PHONE_STATE
permission. But I cannot read these values in Java and pass them to the native code without a huge rewrite of the native code.
Any help?
android c permissions native
I need some help. I have an app that is mostly written in native C code. I use the __system_property_get(const char * name, char * value)
method to read the serial nr. of the device at various points in my native code. With Android 8 I always get a "Access denied" message now.
libc: Access denied finding property "ro.serialno"
Is there a way for me to still be able to read the serial nr. in Android 8? I tried switching to targetSDKversion < 26 but it still gives me a "Access denied" message. I do get the correct values if I use Java with Build.SERIAL
(regardless of SDK version) and Build.getSerial()
in SDK version 26 if I grant the READ_PHONE_STATE
permission. But I cannot read these values in Java and pass them to the native code without a huge rewrite of the native code.
Any help?
android c permissions native
android c permissions native
edited Oct 19 '17 at 13:46
Delimitry
2,7254 gold badges21 silver badges36 bronze badges
2,7254 gold badges21 silver badges36 bronze badges
asked Oct 19 '17 at 8:03
carlaharriscarlaharris
261 silver badge3 bronze badges
261 silver badge3 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I met this problem too. Finally I find the root cause of the problem. In Android O, SELinux sets a lot of limitations in system property. In this case, There is a neverallow to limit read serial number except some domain in whitelist.
For more specific information, you can read code in system/sepolicy/public/domain.te
:
neverallow
domain
-adbd
-dumpstate
-hal_drm
-init
-mediadrmserver
-recovery
-shell
-system_server
serialno_prop:file r_file_perms;
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
add a comment |
If you have the hand on AOSP:
- Put
android:sharedUserId="android.uid.system"
toAdnroidMainfest
- Run app like
system_app
. - Change in
Android.mk
.LOCAL_MODULE_PATH := $(TARGET_OUT)/app
.
Or you can duplicate the property.
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/4.0/"u003ecc by-sa 4.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%2f46825230%2faccess-ro-serialno-from-native-in-android-8%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I met this problem too. Finally I find the root cause of the problem. In Android O, SELinux sets a lot of limitations in system property. In this case, There is a neverallow to limit read serial number except some domain in whitelist.
For more specific information, you can read code in system/sepolicy/public/domain.te
:
neverallow
domain
-adbd
-dumpstate
-hal_drm
-init
-mediadrmserver
-recovery
-shell
-system_server
serialno_prop:file r_file_perms;
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
add a comment |
I met this problem too. Finally I find the root cause of the problem. In Android O, SELinux sets a lot of limitations in system property. In this case, There is a neverallow to limit read serial number except some domain in whitelist.
For more specific information, you can read code in system/sepolicy/public/domain.te
:
neverallow
domain
-adbd
-dumpstate
-hal_drm
-init
-mediadrmserver
-recovery
-shell
-system_server
serialno_prop:file r_file_perms;
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
add a comment |
I met this problem too. Finally I find the root cause of the problem. In Android O, SELinux sets a lot of limitations in system property. In this case, There is a neverallow to limit read serial number except some domain in whitelist.
For more specific information, you can read code in system/sepolicy/public/domain.te
:
neverallow
domain
-adbd
-dumpstate
-hal_drm
-init
-mediadrmserver
-recovery
-shell
-system_server
serialno_prop:file r_file_perms;
I met this problem too. Finally I find the root cause of the problem. In Android O, SELinux sets a lot of limitations in system property. In this case, There is a neverallow to limit read serial number except some domain in whitelist.
For more specific information, you can read code in system/sepolicy/public/domain.te
:
neverallow
domain
-adbd
-dumpstate
-hal_drm
-init
-mediadrmserver
-recovery
-shell
-system_server
serialno_prop:file r_file_perms;
edited Dec 8 '17 at 2:54
Stephen Rauch
33.1k15 gold badges44 silver badges69 bronze badges
33.1k15 gold badges44 silver badges69 bronze badges
answered Dec 8 '17 at 2:35
simowcesimowce
798 bronze badges
798 bronze badges
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
add a comment |
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
Thank you very much!
– carlaharris
Dec 15 '17 at 6:56
add a comment |
If you have the hand on AOSP:
- Put
android:sharedUserId="android.uid.system"
toAdnroidMainfest
- Run app like
system_app
. - Change in
Android.mk
.LOCAL_MODULE_PATH := $(TARGET_OUT)/app
.
Or you can duplicate the property.
add a comment |
If you have the hand on AOSP:
- Put
android:sharedUserId="android.uid.system"
toAdnroidMainfest
- Run app like
system_app
. - Change in
Android.mk
.LOCAL_MODULE_PATH := $(TARGET_OUT)/app
.
Or you can duplicate the property.
add a comment |
If you have the hand on AOSP:
- Put
android:sharedUserId="android.uid.system"
toAdnroidMainfest
- Run app like
system_app
. - Change in
Android.mk
.LOCAL_MODULE_PATH := $(TARGET_OUT)/app
.
Or you can duplicate the property.
If you have the hand on AOSP:
- Put
android:sharedUserId="android.uid.system"
toAdnroidMainfest
- Run app like
system_app
. - Change in
Android.mk
.LOCAL_MODULE_PATH := $(TARGET_OUT)/app
.
Or you can duplicate the property.
edited Mar 28 at 6:15
Community♦
11 silver badge
11 silver badge
answered Mar 21 at 4:07
Thinh DinhThinh Dinh
92 bronze badges
92 bronze badges
add a comment |
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%2f46825230%2faccess-ro-serialno-from-native-in-android-8%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