以下是 Android 手机 build.prop 信息,可同时在java 和 NDK获取到
下面是通过 adb shell cat /system/build.prop 获取到的信息
# begin build properties开始设置系统性能
# autogenerated by buildinfo.sh{通过设置形成系统信息}
ro.build.id=MIUI(版本ID)
ro.build.display.id=oyang06_MIUI(版本号)
ro.build.version.incremental=2.2.1(版本增量)
ro.build.version.sdk=8(sdk版本)
ro.build.version.codename=REL版本代号
ro.build.version.release=2.2.1 Android 2.2.1系統无需修改,也可改为3.0装装B
ro.build.svn=04
ro.build.date=Thu Jan 13 15:04:26 CST 2011制作者制作的时间
ro.build.date.utc=1294902266
ro.build.type=user
ro.build.user=prodcm
ro.build.host=xinyudt
ro.build.tags=test-keys
ro.product.model=Milestone XT720内部手机代号也就是手机名
ro.product.brand=motorola手机品牌
ro.product.name=umts_sholes手机正式名称
ro.product.device=umts_sholes采用的设备
ro.product.board=sholes采用的处理器
ro.product.cpu.abi=armeabi-v7a cpu的版本
ro.product.cpu.abi2=armeabi cpu的品牌
ro.product.manufacturer=motorola手机制造商
ro.product.locale.language=zh手机默认语言
ro.product.locale.region=CN地区语言
ro.wifi.channels= WIFI连接的渠道
ro.board.platform=omap3主板平台
# ro.build.product is obsolete; use ro.product.device
ro.build.product=umts_sholes
# Do not try to parse ro.build.description or .fingerprint不要试图修改description和fingerprint
ro.build.description=libra_umts_sholes-userdebug 2.2.1 MIUI 1.5.26 test-keys用户的KEY
ro.build.fingerprint=motorola/libra_umts_sholes/umts_sholes/sholes:2.2.1/MIUI/1.3.11:userdebug/test-keys机身码
# end build properties性能代码完毕
#
# system.prop for UMTS Sholes系统技术支持由UMTS Shole提供
#
rild.libpath=/system/lib/libril-moto-umts-1.so
rild.libargs=-d /dev/ttyS0
ro.sf.lcd_density=240显示屏分辨率,数值越大分辨率越底
ro.default_usb_mode=4
# Density in DPI of the LCD of this board. This is used to scale the UI (高密度的液晶的DPI板。这是用来大规模UI的)
# appropriately. If this property is not defined, the default value is 160 dpi. (appropriately.如果这个属性没有定义,缺省值是160 dpi的分辨率)
ro.sf.lcd_density=120 (显示屏分辨率,数值越大分辨率越底)
# View configuration for QVGA. (屏幕的设置)
view.fading_edge_length=8
view.touch_slop=15 (触摸屏灵敏度,数值越大越灵敏)
view.minimum_fling_velocity=25 (滑动速度)
view.scroll_friction=0.008 (滑动误差)
# RIL specific configuration. (特定设置)
ro.ril.def.agps.mode=2 (打开AGPS服务支持,可改为ro.ril.def.agps.mode=0 改后能省电但GPS定位速度会变慢)
ro.ril.gprsclass=12 (GPRS设置)
# For HSDPA low throughput (HSDPA低输量)
ro.ril.disable.power.collapse=1 (关闭电源)
# Modify MMS APN retry timer from 5s to 2s. (修改短信的APN设置5秒为2秒)
ro.gsm.2nd_data_retry_config=max_retries=3, 2000, 2000, 2000
# Time between scans in seconds. Keep it high to minimize battery drain.(扫描在几秒之内,可降低用电量)
# This only affects the case in which there are remembered access points, (这个修改仅能影响此文件)
# but none are in range.(但是没有一项是在范围内的)
wifi.inte**ce=eth0 (WIFI界面)
wifi.supplicant_scan_interval=45 (WIFI扫描间隔时间,这里设置是45秒。把这个时间设置长点能省电)
# Mobile data inte**ces (移动数据的接口)
mobiledata.inte**ces=rmnet0,rmnet1,rmnet2
# Allow or deny tethering. (允许和拒绝绑定)
ro.tether.denied=false
# Default network type. (默认的网络类型)
# 0 => WCDMA Preferred. (0=WCDMA优先)
ro.telephony.default_network=0
# Enable Google-specific location features, (谷歌特定地点的设置)
# like NetworkLocationProvider and LocationCollector.(如网络服务器提供商和服务器位置)
ro.com.google.locationfeatures=1
# The OpenGL ES API level that is natively supported by this device. (开放式绘图介面)
# This is a 16.16 fixed point number. (界面有16个点,16个不动点数量)
ro.opengles.version=65536 (开放式绘图介面参数)
# Disable fs check on boot by default. (开机时默认禁用FS检查)
sys.checkfs.fat=false
# Performance settings. (性能设置)
dalvik.vm.execution-mode=int:jit
dalvik.vm.heapsize=24m (虚拟内存大小,可设置为16m或24m或32m或48m)
persist.sys.use_dithering=1
persist.sys.purgeable_assets=1
# Increase SKIA decode memory capability for progressive jpg file.
ro.media.dec.jpeg.memcap=20000000
#
# ADDITIONAL_BUILD_PROPERTIES (其他性能设置)
#
keyguard.no_require_sim=true (手机卡保护设置)
ro.rommanager.developerid=cyanogenmodnightly (固件管理器开发者是CM大神)
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html
ro.com.google.clientidbase=android-google (谷歌客户身份)
ro.com.android.wifi-watchlist=GoogleGuest (WIFI用户名单)
ro.setupwizard.enterprise_mode=1 (默认情景模式)
ro.com.android.dateformat=MM-dd-yyyy (默认时间格式,改为yyyy-MM-dd,显示效果就是XXXX年XX月XX日)
ro.com.android.dataroaming=false (漫游设置)
ro.config.ringtone=Playa.ogg (默认铃声设置,文件在/system/media/audio/ringtones 把喜欢的铃声放这里,比如123.MP3放入ringtones文件夹中,这里代码改为ro.config.ringtone=123.mp3)
ro.config.notification_sound=regulus.ogg (默认提示音,文件在/system/media/audio/notifications 修改方法同上)
ro.config.alarm_alert=Alarm_Beep_03.ogg (默认闹铃,文件在/system/media/audio/alarms 修改方法同上)
ro.modversion=0000000000000000000 (版本信息,改这个能让你大名出现系统关于中,改为ro.modversion=000大神-00000版)
ro.setupwizard.mode=OPTIONAL (安装向导模式)
net.bt.name=Android (系统名称)
dalvik.vm.stack-trace-file=/data/anr/traces.txt
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JB_MR1.1
ro.build.display.id=sdk-eng 4.2.2 JB_MR1.1 576024 test-keys
ro.build.version.incremental=576024
ro.build.version.sdk=17
ro.build.version.codename=REL
ro.build.version.release=4.2.2
ro.build.date=Wed Feb 13 15:20:53 UTC 2013
ro.build.date.utc=1360768853
ro.build.type=eng
ro.build.user=android-build
ro.build.host=wpee3.hot.corp.google.com
ro.build.tags=test-keys
ro.product.model=sdk
ro.product.brand=generic
ro.product.name=sdk
ro.product.device=generic
ro.product.board=
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=unknown
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=
# ro.build.product is obsolete; use ro.product.device
ro.build.product=generic
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=sdk-eng 4.2.2 JB_MR1.1 576024 test-keys
ro.build.fingerprint=generic/sdk/generic:4.2.2/JB_MR1.1/576024:eng/test-keys
ro.build.characteristics=default
# end build properties
#
# system.prop for generic sdk
#
rild.libpath=/system/lib/libreference-ril.so
rild.libargs=-d /dev/ttyS0
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.config.notification_sound=OnTheHunt.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
ro.kernel.android.checkjni=1
xmpp.auto-presence=true
ro.config.nocheckin=yes
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
如果在NDK 获取需要用到
int __system_property_get(constchar*name,char*value) 这里不再展开
//头文件
#include
#include
__system_property_get("ro.serialno",temp);
LOGE("serialno: %s", temp);
__system_property_get("ro.build.id", temp);
LOGE("id:%s",temp);
__system_property_get("ro.build.version.sdk", temp);
LOGE("version:%s",temp);
__system_property_get("ro.board.platform", temp);
LOGE("platform:%s",temp);
__system_property_get("ro.product.cpu.abi2", temp);
LOGE("abi2:%s",temp);
__system_property_get("ro.product.model", temp);
LOGE("model:%s",temp);
__system_property_get("ro.product.brand", temp);
LOGE("brand:%s",temp);
__system_property_get("ro.product.manufacturer", temp);
LOGE("manufacturer:%s",temp);
__system_property_get("ro.gpu", temp);
LOGE("gpu:%s",temp);
注意:可以先用 adb 查看 adb shell cat /system/build.prop 好像只有 root 过的手机才能执行;有些值是没有的;
java 获取:
Log.e("getPesudoUniqueID", "BOARD:"+Build.BOARD +
"BRAND:"+Build.BRAND +
"CPU_ABI:"+ Build.CPU_ABI +
"DEVICE:"+Build.DEVICE +
"DISPLAY:"+ Build.DISPLAY +
"HOST:"+ Build.HOST +
"ID:"+ Build.ID +
"MANUFACTURER:"+ Build.MANUFACTURER +
"MODEL:"+ Build.MODEL +
"PRODUCT:"+ Build.PRODUCT +
"TAGS:"+ Build.TAGS +
"TYPE:"+ Build.TYPE +
"USER:"+ Build.USER );
作者:恋恋西风