简体   繁体   English

是否可以在非 root android 手机上添加属性?

[英]Is it possible to add a property on a non-rooted android phone?

For my non-rooted device (which I am not allowed to root, so I need to find another way around), if I do对于我的非根设备(我不允许根,所以我需要找到另一种方法),如果我这样做

adb shell setprop MY_PROP 1

followed by其次是

adb shell getprop MY_PROP

I get a blank line.我得到一个空行。

How can I set a property?如何设置属性?

By default the shell user is not allowed to create properties: 默认情况下,不允许shell用户创建属性:

$ adb shell "setprop test.test 1; dmesg | grep test\.test"
[  271.706897,0] init: avc:  denied  { set } for property=test.test scontext=u:r:shell:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service
[  271.707157,0] init: sys_prop: permission denied uid:2000  name:test.test

Without root you can only add props that start with debug.如果没有 root,你只能添加以debug.

adb shell setprop debug.my.prop newProp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在非 root 的 android 手机上运行本机 arm 二进制文件? - Is it possible to run a native arm binary on a non-rooted android phone? Android:在非根目录设备上运行脚本 - Android: run a script on non-rooted device 在非root用户的Android上模拟主机文件 - Emulate hosts file on non-rooted Android 非root用户的Android手机用户可以查看/编辑存储在Realm DB中的数据吗? - Can a non-rooted phone android user see/edit the data stored in Realm DB? 安装错误:INSTALL_FAILED_UID_CHANGED非root用户Android手机 - Installation error: INSTALL_FAILED_UID_CHANGED Non-rooted Android Phone 从非root手机的内部存储中删除文件 - Deleting files from internal storage of a non-rooted phone Android : 使用非 root 的 android 设备捕获 HTTP 请求 - Android : Capturing HTTP Requests with non-rooted android device 非root用户设备上的Android用户空间文件系统驱动程序? - Android userspace filesystem driver on non-rooted device? 以编程方式在Android设备上创建Google帐户(非root用户设备) - Creating a google account on android programatically (non-rooted device) 外部指纹扫描仪,用于无根Android平板电脑 - External fingerprint scanner for non-rooted Android tablets
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM