androidbuildclassstringuser手机
在frameworks/base/core/java/android/os/Build.java中定义了class Build类,这个类定义了所有关于产品的参数,例如固件版本号,product 名字,板子名字等等,有些参数会在设置->关于手机中显示。
[html] view plaincopy
01.public class Build {
02. /** Value used for when a build property is unknown. /
03. public static final String UNKNOWN = "unknown";
04.
05. /* Either a changelist number, or a label like "M4-rc20". /
06. public static final String ID = getString("ro.build.id");
07.
08. /* A build ID string meant for displaying to the user /
09. public static final String DISPLAY = getString("ro.build.display.id");
10.
11. /*a firmware realse /
12. public static final String FIRMWARE = getString("ro.product.firmware");
13.
14. /* The name of the overall product. /
15. public static final String PRODUCT = getString("ro.product.name");
16.
17. /* The name of the industrial design. /
18. public static final String DEVICE = getString("ro.product.device");
19.
20. /* The name of the underlying board, like "goldfish". /
21. public static final String BOARD = getString("ro.product.board");
22.
23. /* The name of the instruction set (CPU type + ABI convention) of native code. /
24. public static final String CPU_ABI = getString("ro.product.cpu.abi");
25.
26. /* The name of the second instruction set (CPU type + ABI convention) of native code. /
27. public static final String CPU_ABI2 = getString("ro.product.cpu.abi2");
28.
29. /* The manufacturer of the product/hardware. /
30. public static final String MANUFACTURER = getString("ro.product.manufacturer");
31.
32. /* The brand (e.g., carrier) the software is customized for, if any. */
33. public static final String BRAND = getString("ro.product.brand");
因此,如果想修改这些参数,只要在修改相关的参数就可以了。例如,如果想修改固件版本号,那么找到定义ro.product.firmware的文件(在我做的项目里,是./device/softwinner/crane-gm-g9/crane_gm_g9.mk),修改成想要的版本号,就可以了。
要注意的是,在重新编译的时候,首先要先删掉./out/target/product/crane-gm-g9/recovery/root/default.prop和./out/target/product/crane-gm-g9/system/build.prop再编译才能生效。否则,这个build不一定能重新编译,因为改的是mk文件本身,而不是.java。