欢迎访问本站,希望站内信息可以帮助到您! 博主个人微信:xituxiaoshutong100

Android系统中的build.prop

Android 迷途小书童 0评论

软硬件环境

build.prop干什么的

android系统中,build.prop是一个类似于windows系统注册表的文件。这个文件内定义了系统初始的一些参数属性。通过修改、增加相应参数可以达到调整系统配置属性的作用。

build.prop如何生成

build.prop文件的生成过程就是收集系统配置属性,然后合并到build.prop文件

  • 执行build/tools/buildinfo.sh
  • system.prop中的内容添加到$(OUT_TARGET_DEVICE)/system/build.prop
  • ADDITIONAL_BUILD_PROPERTIES的值也添加到$(OUT_TARGET_DEVICE)/system/build.prop
  • 在执行make后,build.prop会重新生成,因此不能仅仅修改$(OUT_TARGET_DEVICE)/system/build.prop,需要找到源码树中具体的配置位置进行修改,这个每个厂家的做法也是不一样的

build.prop文件示例

cat /system/build.prop

# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=N2G48H
ro.build.display.id=zx2800_general-userdebug 7.1.2 N2G48H eng.root.20201229.113133 dev-keys
ro.build.version.incremental=eng.root.20201229.113133
ro.build.version.sdk=25
ro.build.version.preview_sdk=0
ro.build.version.codename=REL
ro.build.version.all_codenames=REL
ro.build.version.release=7.1.2
ro.build.version.security_patch=2017-10-05
ro.build.version.base_os=
ro.build.date=Tue Dec 29 11:31:33 CST 2020
ro.build.date.utc=1609212693
ro.build.type=userdebug
ro.build.user=root
ro.build.host=server96
ro.build.tags=dev-keys
ro.build.flavor=zx2800_general-userdebug
ro.product.model=zx2100
ro.product.brand=Android
ro.product.name=zx2800_general
ro.product.device=zx2800_general
ro.product.board=zx2100
# ro.product.cpu.abi and ro.product.cpu.abi2 are obsolete,
# use ro.product.cpu.abilist instead.
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.cpu.abilist=armeabi-v7a,armeabi
ro.product.cpu.abilist32=armeabi-v7a,armeabi
ro.product.cpu.abilist64=
ro.product.manufacturer=ZHAOXIN
ro.product.locale=zh-Hans-CN
ro.wifi.channels=
ro.board.platform=zx2100
# ro.build.product is obsolete; use ro.product.device
ro.build.product=zx2800_general
# Do not try to parse description, fingerprint, or thumbprint
ro.build.description=zx2800_general-userdebug 7.1.2 N2G48H eng.root.20201229.113133 dev-keys
ro.build.fingerprint=Android/zx2800_general/zx2800_general:7.1.2/N2G48H/root12291131:userdebug/dev-keys
ro.build.characteristics=tablet
# end build properties
S3G_MODE_HDMI=1920x1080@5000@0@2
S3G_MODE_DVI=1920x1080@5000@0@0
S3G_MODE_DP=3840x2160@3000@0@0
SCREEN_SIZE_PRIMARY=1920x1080
SCREEN_SIZE_EXTERNAL=1920x1080
DIU_COMPRESS=1
GRALLOC_COMPRESS=1
LOSSY_COMPRESS=0
hwc.hotplug_mode=0

#
# ADDITIONAL_BUILD_PROPERTIES
#
keyguard.no_require_sim=true
ro.com.android.dataroaming=true
ro.config.ringtone=Ring_Synth_04.ogg
ro.config.notification_sound=pixiedust.ogg
ro.carrier=unknown
ro.config.alarm_alert=Alarm_Classic.ogg
ro.telephony.default_network=12
telephony.lteOnCdmaDevice=1
wifi.interface=wlan0
qemu.hw.mainkeys=0
ro.sf.lcd_density=240
ro.opengles.version=196609
persist.sys.timezone=Asia/Shanghai
ro.logd.size=4M
ro.zygote.disable_gl_preload=true
ro.gfx.driver.0=zxgfx
ro.lockscreen.disable.default=true
dalvik.vm.heapstartsize=16m
dalvik.vm.heapgrowthlimit=192m
dalvik.vm.heapsize=512m
dalvik.vm.heaptargetutilization=0.75
dalvik.vm.heapminfree=512k
dalvik.vm.heapmaxfree=8m
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
s3g.hwc.enable_hdr=1
ysum.enable=1
persist.demo.hdmirotates=true
p2p.interface=p2p0
persist.sys.dalvik.vm.lib.2=libart.so
dalvik.vm.isa.arm.variant=cortex-a7
dalvik.vm.isa.arm.features=default
dalvik.vm.lockprof.threshold=500
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
ro.expect.recovery_id=0x189f055d095559bce7e46e38548c458922df5677000000000000000000000000

如何修改build.prop

启动root模式

adb connect $设备IP地址
adb root

重新挂载文件系统

adb remount

将本地修改后的build.prop文件pushandroid系统中

adb push build.prop /system/build.prop

重启系统后生效。

喜欢 (0)
发表我的评论
取消评论

表情