理解你的Android设备:探索build.prop文件中的手机设备信息
最编程
2024-01-29 15:36:39
...
手机设备信息与 Android build.prop 文件
手机设备信息与 Android build.prop 文件
什么是 build.prop 文件
路径: /system/build.prop
说明: build.prop
是 Android 系统中的一个重要的属性文件,记录了系统的设置和改变。
主要信息类型:ro.build.*
(编译信息),ro.product.*
(设备信息),ro.config.*
(默认设置信息),dalvik.vm.*
(虚拟机信息)等。
获取 Android 设备信息的命令
一种是通过访问 /system/build.prop
文件进行查看
# 打印 /system/build.prop 所有内容
adb shell cat /system/build.prop
# 通过 grep 筛选特定内容
adb shell cat /system/build.prop | grep ro.product
也可以用 ADB 的命令查看
# 显示所有信息
adb shell getprop
# 显示特定信息
adb shell getprop ro.product.model
# 筛选信息
adb shell getprop | grep product
部分 build.prop 信息说明
参数 | 说明 | 例子 |
---|---|---|
ro.build.display.full_id |
显示标识,标识显示设备的完整版本号 | ro.build.display.full_id=A31u_11_A.04_160613 |
ro.product.model |
机器型号 | ro.product.model=A31u |
ro.product.device |
设备名 | ro.product.device=A31u |
ro.product.name=A31u |
机器名 | ro.product.name=A31u |
ro.build.id=KTU84P |
编译标识 | ro.build.id=KTU84P |
ro.build.display.id |
显示标识 | ro.build.display.id=KTU84P release-keys |
ro.build.version.incremental |
版本增加说明 | ro.build.version.incremental=eng.root.20160613 |
ro.build.version.sdk |
编译时使用的 SDK 版本 | ro.build.version.sdk=19 |
ro.build.version.codename |
版本编码名称 | ro.build.version.codename=REL |
ro.build.version.release |
公布的版本(一般用于手机信息的系统版本) | ro.build.version.release=4.4.4 |
ro.build.date |
系统编译时间 | ro.build.date=Mon Jun 13 21:38:06 CST 2016 |
ro.build.date.utc |
系统编译时间(UTC版本) | ro.build.date.utc=1465825086 |
ro.build.type |
系统编译类型 | ro.build.type=user |
ro.build.user |
系统用户名 | ro.build.user=root |
ro.build.host |
系统主机名 | ro.build.host=ubuntu-121-114 |
ro.build.tags |
系统标记 | ro.build.tags=release-keys |
ro.product.model |
机器型号 | ro.product.model=msm8916_32 |
ro.product.brand |
机器品牌 | ro.product.brand=OPPO |
ro.product.name |
机器 | ro.product.name=msm8916_32 |
ro.product.device |
设备名 | ro.product.device=msm8916_32 |
ro.product.board |
主板名 | ro.product.board=msm8916 |
ro.product.cpu.abi |
CPU 支持的架构 | ro.product.cpu.abi=armeabi-v7a |
ro.product.cpu.abi2 |
CPU 支持的架构 | ro.product.cpu.abi2=armeabi |
ro.product.manufacturer |
制造商 | ro.product.manufacturer=OPPO |
ro.product.locale.language |
系统语言 | ro.product.locale.language=zh |
ro.product.locale.region |
系统所在区域 | ro.product.locale.region=CN |
ro.wifi.channels |
WiFi的网络信道(空表示自动识别) | ro.wifi.channels= |
ro.board.platform |
主板板卡型号 | ro.board.platform=msm8916 |
debug.sf.hw |
硬件 GPU 加速(1:开启,0:关闭) | debug.sf.hw=1 |
dalvik.vm.heapsize |
Dalvik 虚拟内存大小 | dalvik.vm.heapsize=36m |
dalvik.vm.heapstartsize |
Dalvik 虚拟内存初始堆栈大小 | dalvik.vm.heapstartsize=12m |
dalvik.vm.heapgrowthlimit |
Dalvik 虚拟内存堆栈增长极限 | dalvik.vm.heapgrowthlimit=128m |
dalvik.vm.heapsize |
Dalvik 虚拟内存最大堆栈大小 | dalvik.vm.heapsize=256m |
dalvik.vm.heaptargetutilization |
Dalvik 堆指标利用效率/堆内存利用百分比 | dalvik.vm.heaptargetutilization=0.75 |
net.bt.name |
蓝牙网络中显示的名字 | net.bt.name=Android |
ro.config.alarm_alert |
默认闹钟铃声 | ro.config.alarm_alert=alarm_005.ogg |
ro.config.ringtone |
默认响铃铃声 | ro.config.ringtone=ringtone_001.ogg |
ro.config.ringtone_sim2 |
默认响铃铃声(卡2) | ro.config.ringtone_sim2=ringtone_005.ogg |
ro.config.notification_sound |
默认通知铃声 | ro.config.notification_sound=notification_001.ogg |
ro.config.notification_sim2 |
默认通知铃声(卡2) | ro.config.notification_sim2=notification_009.ogg |
ro.com.android.dateformat |
默认时间格式 | ro.com.android.dateformat=MM-dd-yyyy |
JNI 获取设备信息
知道一些字段的信息,那么就可以通过 JNI 的一些接口访问部分信息了。
(不需要繁琐的用 JNI 调用 Java 接口提取设备信息)
#include <sys/system_properties.h>
...
{
char info[256];
__system_property_get("ro.build.version.sdk", info); // 获取 SDK 版本。提取的信息会存入 info 中。
...
__system_property_get("ro.product.model", info); // 获取机型。提取的信息会存入 info 中。
...
__system_property_get("ro.serialno", info); // 获取序列号。提取的信息会存入 info 中。
}
需要包含 <sys/system_properties.h>
头文件。
调用 __system_property_get
接口。【int __system_property_get(const char* __name, char* __value)
】
附录:一个设备的 build.prop 文件内容
# run command:
# `adb shell cat /system/build.prop`
#
#
# begin build oppo properties
# autogenerated by oppo_buildinfo.sh
ro.build.date.Ymd=160613
ro.build.date.ymd=160613
ro.build.date.YmdHM=201606132138
ro.build.display.full_id=A31u_11_A.04_160613
ro.common.soft=MSM_15006
ro.product.model=A31u
persist.sys.assert.panic=true
persist.sys.oppo.dump=1
persist.sys.cfu_auto=1
ro.product.device=A31u
ro.product.name=A31u
ro.build.product=A31u
ro.build.version.ota=A31u_11.A.04_004_201606131927
ro.build.soft.majorversion=
ro.build.display.id=A31u_11_160613
ro.build.soft.version=A.04
ro.xxversion=v0.5
ro.build.kernel.id=3.10.28-G201606131927
sys.foreground_process=android
ro.oppo.version=
persist.sys.timezone=Asia/Shanghai
persist.sys.oppo.region=CN
persist.power.useautobrightadj=true
persist.sys.modem=yes
persist.sys.net=yes
persist.sys.assert.state=true
persist.oppo.ctsversion=false
ro.build.fingerprint=OPPO/A31u/A31u:4.4.4/KTU84P/1390465867:user/release-keys
ro.build.oppofingerprint=
persist.radio.multisim.config=dsds
# end build oppo properties
ro.rf_version=W_G_L_15006
ro.telephony.default_network=9,1
persist.sys.autoclearsave=3
persist.sys.assert.state=false
persist.sys.assert.panic=false
persist.sys.oppo.dump=0
ro.build.release_type=true
persist.sys.oem_smooth=1
ro.qualcomm.svi=0
persist.radio.lte_vrte_ltd=1
persist.sys.savetosdcard=cache
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KTU84P
ro.build.display.id=KTU84P release-keys
ro.build.version.incremental=eng.root.20160613
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.4
ro.build.date=Mon Jun 13 21:38:06 CST 2016
ro.build.date.utc=1465825086
ro.build.type=user
ro.build.user=root
ro.build.host=ubuntu-121-114
ro.build.tags=release-keys
ro.product.model=msm8916_32
ro.product.brand=OPPO
ro.product.name=msm8916_32
ro.product.device=msm8916_32
ro.product.board=msm8916
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=OPPO
ro.product.locale.language=zh
ro.product.locale.region=CN
ro.wifi.channels=
ro.board.platform=msm8916
# ro.build.product is obsolete; use ro.product.device
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=msm8916_32-user 4.4.4 KTU84P eng.root.20160613 release-keys
ro.build.fingerprint=OPPO/msm8916_32/msm8916_32:4.4.4/KTU84P/eng.root.20160613:user/release-keys
ro.build.characteristics=default
ro.build.version.opporom=V2.0.1
ro.rom.different.version=ColorOS2.0.1
# end build properties
#
# from device/qcom/msm8916_32/system_cu.prop
#
#
# system.prop for msm8916
#
#rild.libpath=/system/lib/libreference-ril.so
rild.libpath=/system/vendor/lib/libril-qc-qmi-1.so
rild.libargs=-d /dev/smd0
persist.rild.nitz_plmn=
persist.rild.nitz_long_ons_0=
persist.rild.nitz_long_ons_1=
persist.rild.nitz_long_ons_2=
persist.rild.nitz_long_ons_3=
persist.rild.nitz_short_ons_0=
persist.rild.nitz_short_ons_1=
persist.rild.nitz_short_ons_2=
persist.rild.nitz_short_ons_3=
ril.subscription.types=NV,RUIM
DEVICE_PROVISIONED=1
# Start in cdma mode
ro.telephony.default_network=5
debug.sf.hw=1
debug.egl.hw=1
debug.composition.type=c2d
persist.hwc.mdpcomp.enable=true
debug.mdpcomp.logs=0
#Enable translucent status bar feature
persist.hwc.ptor.enable=true
dalvik.vm.heapsize=36m
dev.pm.dyn_samplingrate=1
persist.demo.hdmirotationlock=false
debug.sf.gpu_comp_tiling=1
#ro.hdmi.enable=true
#tunnel.decode=true
#tunnel.audiovideo.decode=true
#lpa.decode=false
#lpa.use-stagefright=true
#persist.speaker.prot.enable=false
#
# system props for the cne module
#
persist.cne.feature=1
#
# system props for the dpm module
#
#ifndef VENDOR_EDIT
#LinJie.Xu@Prd.Android.USB, 2014/10/27, Modify for Qcom chen yan provider modify
#wenhua.Leng@Prd.Android.USB, 2015/04/28, Modify for Qcom gaojiugang provider modify
#persist.dpm.feature=0
#else /* VENDOR_EDIT */
#persist.dpm.feature=4
persist.dpm.feature=7
#endif /* VENDOR_EDIT */
#system props for the MM modules
media.stagefright.enable-player=true
media.stagefright.enable-http=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
media.stagefright.enable-fma2dp=true
media.stagefright.enable-scan=true
media.swhevccodectype=0
media.hwhevccodectype=0
mmp.enable.3g2=true
mm.enable.smoothstreaming=true
mm.disable.sec_smoothstreaming=true
media.aac_51_output_enabled=true
#codecs:(PARSER_)AAC AC3 ASF AVI DTS 3G2 MP2TS QCP FLAC
mm.enable.qcom_parser=168563
#
# system props for the data modules
#
ro.use_data_netmgrd=true
persist.data.netmgrd.qos.enable=true
#system props for time-services
persist.timed.enable=true
#
# system prop for opengles version
#
# 196608 is decimal for 0x30000 to report version 3
ro.opengles.version=196608
# System property for cabl
#ifdnef VENDOR_EDIT
#Xiaori.Yuan@Mobile Phone Software Dept.Driver, 2014/09/02 shutdown cabl
#ro.qualcomm.cabl=2
#else
ro.qualcomm.cabl=0
#endif
#
# System props for telephony
# System prop to turn on CdmaLTEPhone always
telephony.lteOnCdmaDevice=1
persist.omh.enabled=false
#
# System props for bluetooh
# System prop to turn on hfp client
#ifdef VENDOR_EDIT
#HuiTao@Prd.BasicSrv.BT, 2014/08/06 Modify for Close HFP Client
bluetooth.hfp.client=0
bluetooth.a2dp.sink.enabled=false
#else
#bluetooth.hfp.client=1
#endif
#Simulate sdcard on /data/media
#
persist.fuse_sdcard=true
#
#snapdragon value add features
#
ro.qc.sdk.audio.ssr=false
##fluencetype can be "fluence" or "fluencepro" or "none"
ro.qc.sdk.audio.fluencetype=none
persist.audio.fluence.voicecall=true
persist.audio.fluence.voicerec=false
persist.audio.fluence.speaker=true
#Set for msm8916
tunnel.audio.encode = false
#Buffer size in kbytes for compress offload playback
audio.offload.buffer.size.kb=32
#use VERY_HIGH_QUALITY for audio resampler
af.resampler.quality=4
#Enable offload audio video playback by default
av.offload.enable=false
#enable voice path for PCM VoIP by default
use.voice.path.for.pcm.voip=true
#
#System property for FM transmitter
#
ro.fm.transmitter=false
#enable dsp gapless mode by default
audio.offload.gapless.enabled=true
#Audio voice concurrency related flags
voice.playback.conc.disabled=true
voice.record.conc.disabled=true
voice.voip.conc.disabled=true
#Set composition for USB
#ifndef VENDOR_EDIT
#LinJie.Xu@Prd.Android.USB, 2014/07/29, Remove for we don't need initialize persist.sys.usb.config
#persist.sys.usb.config=diag,serial_smd,rmnet_bam,adb
#endif /* VENDOR_EDIT */
# set max starting background services
ro.config.max_starting_bg=8
#property to enable user to access Google WFD settings
persist.debug.wfd.enable=1
#propery to enable VDS WFD solution
persist.hwc.enable_vds=1
#property to enable narrow search range for video encoding
vidc.enc.narrow.searchrange=1
#ifdef VENDOR_EDIT
#Xiaori.Yuan@Mobile Phone Software Dept.Driver, 2014/10/11 Add for 14005 performance
sys.hwc.gpu_perf_mode=1
#endif /* VENDOR_EDIT */
#hwui properties
#ro.hwui.texture_cache_size=72
ro.hwui.layer_cache_size=48
ro.hwui.r_buffer_cache_size=8
ro.hwui.path_cache_size=32
ro.hwui.gradient_cache_size=1
ro.hwui.drop_shadow_cache_size=6
ro.hwui.texture_cache_flushrate=0.4
ro.hwui.text_small_cache_width=1024
ro.hwui.text_small_cache_height=1024
ro.hwui.text_large_cache_width=2048
ro.hwui.text_large_cache_height=1024
#
# ADDITIONAL_BUILD_PROPERTIES
#
dalvik.vm.heapminfree=4m
dalvik.vm.heapstartsize=12m
keyguard.no_require_sim=true
ro.com.android.dataroaming=false
ro.com.android.dateformat=MM-dd-yyyy
ro.config.alarm_alert=alarm_005.ogg
ro.config.ringtone=ringtone_001.ogg
ro.config.ringtone_sim2=ringtone_005.ogg
ro.config.notification_sound=notification_001.ogg
ro.config.notification_sim2=notification_009.ogg
ro.carrier=unknown
ro.oppo.theme.version=701
ro.vendor.extension_library=/vendor/lib/libqc-opt.so
persist.radio.apm_sim_not_pwdn=1
dalvik.vm.heapgrowthlimit=128m
dalvik.vm.heapsize=256m
dalvik.vm.heaptargetutilization=0.75
dalvik.vm.heapmaxfree=8m
drm.service.enabled=true
persist.sys.dalvik.vm.lib=libdvm.so
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
persist.gps.qc_nlp_in_use=1
persist.loc.nlp_name=com.qualcomm.services.location
ro.gps.agps_provider=1
ro.pip.gated=0
©著作权归作者所有,转载或内容合作请联系作者
上一篇: 10X单细胞RNA测序的常规分析步骤解析
下一篇: 简化复杂的多边形光栅化方法
推荐阅读
-
全面扫描你的Android设备SD卡中的所有文件
-
三分钟带你了解手机内部硬件-主要影响手机性能的有以下几点 CPU - *处理器(手机中的大脑) CPU 是计算思考以及处理事物的。 比如:我们日常玩手机,什么最重要?毫无疑问是手机打开软件很流畅,使用各种功能不卡。 这就是CPU的性能,那什么影响 CPU 的因素有哪些? 架构 架构是 CPU 的基础,对于处理器的整体性能起到了决定性的作用,不同架构的处理器同主频下,性能差距可以达到2-5倍。可见架构的重要性。 那么什么是架构呢? 打个比方,架构就是一栋楼的框架。至于最终楼什么样子,就由处理器的厂商决定了,但是有一点,如果说这栋楼房的结构设计出来容纳多少人,那么最后建好的房子也要在这个范围内。同理,如果使用相同架构的处理器,那么本质上不会有太大的区别。 看一下主流手机的架构 处理器对比.jpg 从上图可见:高通 和 苹果都是自主设计,所以说它们牛还是有一定的道理的。不同的架构, 性能和功耗也是不同的。架构决定了 主频、核心数、带宽等和运算量直接相关的东西。目前很多手机打广告都是说 多少核的机器。但是并不是说核越多性能就越强,你没看见,苹果双核就能吊打高通和联发科吗? 制程 制程 专指:事物运作程序的处理过程。常指手机芯片框架的运算速度量。 简单的说就是电路板中电路与电路之间的距离,目前已经发展到纳米级别。 制程越小,可以向芯片中塞入更多的晶体管,随之而来的好处还有:降低电量和成本、散热。 制程数的确定 这里有人要问,为什么制程的数字是这些,而不是别的数字,比如有28nm,为什么没有29nm? 这其实是有一定规律的。根据早期国际半导体蓝图规划,由五个在相关领域较为发达的国家共同制定,约定下一代制程要在上一代基础上做到晶体管数量不变,芯片面积缩小一半。由这一关系可以算出前一代制程要比后一代大√2倍,所以能算出后一代大概数值。纵观整个处理器制程变化,除了少部分特殊的外,都遵循着这一规则。 近代制程的发展 2014 年底,三星宣布了世界首个 14nm FinFET 3D 晶体管进入量产,标志着半导体晶体管进入 3D 时代。发展到今天,三星拥有了四代 14nm 工艺,第一代是苹果 A9 上面的 FinFET LPE(Low Power Early),第二代则是用在猎户座 骁龙 820 和骁龙 625 上面的 FinFET LPP(Low Power Plus)。第三代是 FinFET LPC,第四代则是目前的 FinFET LPU。至于 10nm 工艺,三星则更新到了第三代(LPE/LPP/LPC)。 目前为止,三星已经将 70000 多颗第一代 LPE(低功耗早期)硅晶片交付给客户。三星自家的猎户座 8895,以及高通的骁龙 835,都采用这种工艺制造,而 10nm 第二代 LPP 版和第三代 LPU 版将分别在年底和明年进入批量生产。 手机芯片市场上已经进入了 10nm、7nm 处理器的白热化竞争阶段,而 14/16nm 制程的争夺也不过是一两年前的事。 总线位宽 总线位宽决定输入/输出设备之间一次数据传输的信息量,用位(bit)表示,如总线宽度为8位、16位、32位和64位。
-
理解你的Android设备:探索build.prop文件中的手机设备信息