`
quanminchaoren
  • 浏览: 912101 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Android SystemProperties简介

阅读更多

Systemproperties类在android.os下,但这个类是隐藏的, 上层程序开发无法直接使用。其实用java的反射机制是可以使用这个类。何谓java反射机制,请自行研究学习,在此不做介绍,放到后续文章中。用JNI 的方式,可以绕过Systemproperties这个类,直接本地调用来实现创建、获取及修改系统属性。在此也不做介绍,也放到后续文章中。

这篇文章主要介绍android系统属性的命名方式:

创建与修改android属性用Systemproperties.set(name, value),获取android属性用Systemproperties.get(name),需要注意的是android属性的名称是有一定的格式要求的,如下: 前缀必须用system\core\init\property_service.c中定义的前缀 ,进行系统属性设置的程序也必须有system或root权限,

如何将android程序的权限提升到system权限?方法是这样的:

1、在AndroidManifest.xml中,在manifest加入android:sharedUserId="android.uid.system "。

2、在Android.mk中,將LOCAL_CERTIFICATE := XXX修改成LOCAL_CERTIFICATE := platform

经过以上两步就可以把ap的权限提升到system权限了。 但是用这种方法提升权限有两个弊端,如下:

1、程序的拥有都必须有程序的源码;

2、程序的拥有都还必须有android开发环境,就是说自己能make整个android系统。

一般能做这两点的,基本上都是开发人员!

分享到:
评论

相关推荐

    Android高版本源码编译提示error: cannot find symbol import android.os.SystemProperties

    cannot find symbol import android.os.SystemProperties 前言   最近在搞Android高版本的9和10开发,正在敲着代码唱着歌,发现在Android源码目录的app下面导入import android.os.SystemProperties这个包老是不行...

    layoutlib.jar

    Systemproperties类在android.os下,但这个类是隐藏的,设置系统属性调用 SystemProperties可以通过添加jar,得到相关调用

    android属性详解

    android属性详解 android:layout_above 将该控件的底部置于给定ID的控件之上; android:layout_below 将该控件的底部置于给定ID的控件之下; android:layout_toLeftOf 将该控件的右边缘与给定ID的控件左边缘对齐;

    SystemProperties:Adobe Air本机扩展系统属性

    SystemProperties类可以提供一些Adobe无法获得的缺少的属性。 还可以检查IOS是否可以与其他程序一起打开URL。 setNetworkActivityIndi​​catorVisibility 用法(徽章): if(SystemProperties.isBadgeSupported...

    获取Android手机或平板唯一识别号(imei或meid).rar

    获取Android手机或平板当前系统版本号、型号、厂商、唯一识别号(imei或meid)等

    android系统中调用shell脚本

    网上看了好多android下调用脚本的例子,在没有root的情况下,大多只能执行一些简单的脚本命令,经验证,总结出一种还算比较有用的方法,可以较多数脚本,算是比较靠谱,共享下

    Android 应用获取SystmeProperity的两种方式

    非系统应用通过两种方式获取系统SystemProperity的属性。Java层和Native层

    Gradle for Android

    About This Book, Create custom Gradle tasks and plugins for your Android projects, Configure different build variants, each with their own dependencies and properties, Manage multi-module projects, ...

    一个简单的开源Android工具类库

    Set your project properties, then add a android project library, and select AndroidCommon Usage Gradle: compile 'com.wx.android.common:common:1.0.1' Author venshine venshine.cn@gmail.com License ...

    用System.Properties实现的隐藏状态栏

    Android5.1 比较适合屏蔽状态栏不动态开启的情况。

    Gradle.for.Android.1783986824

    If you are an experienced Android developer wanting to enhance your skills with the Gradle Android build system, then this book is for you. As a prerequisite, you will need some knowledge of the ...

    java 环境配置(2024超全教程)-学习Android第一步就是配置Java的开发环境-供大家学习研究参考

    安装完JDK以后,需要配置Java的系统的全局变量。一共需要加三个: JAVA_HOME:JDK的安装路径 Path:JAVA的二进制文件路径,就是JDK的安装...在System Properties的Advanced选项卡里,点击Environment Variables按键。

    Magisk-v20.3.1.zip

    Modify or delete any system properties, including read-only props. Online Module Repo: Install Magisk Modules from the community driven Magisk Module Repo. Android Version Support Android 4.2+: ...

    FFMPEG For Android

    While working as a system integrator, I have come upon more than few Android ports of FFmpeg library. All of them have some non-features in common: - It is not possible to use configure script to ...

    Android NDK 获取手机部分信息 build.prop

    以下是 Android 手机 build.prop 信息,可同时在java 和 NDK获取到 下面是通过 adb shell cat /system/build.prop 获取到的信息 # begin build properties开始设置系统性能 # autogenerated by buildinfo.sh{通过...

    Android中判断当前API的版本号方法

    Android中由于不同版本API会有一些变化,导致一些较早版本可能不支持新的方法,或者某些功能处理过程不太一样,需要判断当前版本然后进行适当的处理。...public static final int SDK_INT = SystemProperties.getInt

    system-properties:生成包含有关Android系统属性信息的JSON

    钥匙 ...config.disable_systemui config.disable_telephony config.override_forced_orient ctl.restart service:arg1 arg2 arg3(例如:“恢复前”,“错误报告”,“媒体”,“ zygote”,“ bo

Global site tag (gtag.js) - Google Analytics