当前位置:   article > 正文

Android Q 修改Fingerprint_framework platform_min_supported_target_sdk_versio

framework platform_min_supported_target_sdk_version

Android 系统中fingerprint 在 build/make/core/Makefile 

  1. # The string used to uniquely identify the combined build and product; used by the OTA server.
  2. ifeq (,$(strip $(BUILD_FINGERPRINT)))
  3. ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
  4. BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
  5. else
  6. BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
  7. endif
  8. BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
  9. endif

格式就是按照这样

$(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)

这个地方定义的BUILD_FINGERPRINT 用于

  1. [ro.bootimage.build.fingerprint]: [xxx/xxx/xxx:10/QKQ1.xxx/20201025.105558:userdebug/release-keys]
  2. [ro.odm.build.fingerprint]: [xxx/xxx/xxx:10/QKQ1.xxx/20201025.105558:userdebug/release-keys]
  3. [ro.product.build.fingerprint]: [xxx/xxx/xxx:10/QKQ1xxx/20201025.105558:userdebug/release-keys]
  4. [ro.system.build.fingerprint]: [xxx/xxx/xxx:10/QKQ1xxx/20201025.105558:userdebug/release-keys]
  5. [ro.vendor.build.fingerprint]: [xxx/xxx/xxx:10/QKQ1xxx/20201025.105558:userdebug/release-keys]

还有个ro.build.fingerprint 是在system/core/init/property_service.cpp 定义的

  1. // If the ro.build.fingerprint property has not been set, derive it from constituent pieces
  2. static void property_derive_build_fingerprint() {
  3. std::string build_fingerprint = GetProperty("ro.build.fingerprint", "");
  4. if (!build_fingerprint.empty()) {
  5. return;
  6. }
  7. const std::string UNKNOWN = "unknown";
  8. build_fingerprint = GetProperty("ro.product.brand", UNKNOWN);
  9. build_fingerprint += '/';
  10. build_fingerprint += GetProperty("ro.product.name", UNKNOWN);
  11. build_fingerprint += '/';
  12. build_fingerprint += GetProperty("ro.product.device", UNKNOWN);
  13. build_fingerprint += ':';
  14. build_fingerprint += GetProperty("ro.build.version.release", UNKNOWN);
  15. build_fingerprint += '/';
  16. build_fingerprint += GetProperty("ro.build.id", UNKNOWN);
  17. build_fingerprint += '/';
  18. build_fingerprint += GetProperty("ro.build.version.incremental", UNKNOWN);
  19. build_fingerprint += ':';
  20. build_fingerprint += GetProperty("ro.build.type", UNKNOWN);
  21. build_fingerprint += '/';
  22. build_fingerprint += GetProperty("ro.build.tags", UNKNOWN);
  23. LOG(INFO) << "Setting property 'ro.build.fingerprint' to '" << build_fingerprint << "'";
  24. std::string error;
  25. uint32_t res = PropertySet("ro.build.fingerprint", build_fingerprint, &error);
  26. if (res != PROP_SUCCESS) {
  27. LOG(ERROR) << "Error setting property 'ro.build.fingerprint': err=" << res << " (" << error
  28. << ")";
  29. }
  30. }

其中ro.build.version.incremental 看build/tools/buildinfo.sh 是从$BUILD_NUMBER 获取的

  1. ...
  2. echo "ro.build.version.incremental=$BUILD_NUMBER"
  3. ...

看build/make/core/version_defaults.mk  BUILD_NUMBER是在这边赋值的,HAS_BUILD_NUMBER  默认为true

如果事先没有定义BUILD_NUMBER的话 就会用默认格式BUILD_NUMBER := eng.$(shell echo $${BUILD_USERNAME:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S)

  1. # Everything should be using BUILD_DATETIME_FROM_FILE instead.
  2. # BUILD_DATETIME and DATE can be removed once BUILD_NUMBER moves
  3. # to soong_ui.
  4. $(KATI_obsolete_var BUILD_DATETIME,Use BUILD_DATETIME_FROM_FILE)
  5. HAS_BUILD_NUMBER := true
  6. ifndef BUILD_NUMBER
  7. # BUILD_NUMBER should be set to the source control value that
  8. # represents the current state of the source code. E.g., a
  9. # perforce changelist number or a git hash. Can be an arbitrary string
  10. # (to allow for source control that uses something other than numbers),
  11. # but must be a single word and a valid file name.
  12. #
  13. # If no BUILD_NUMBER is set, create a useful "I am an engineering build
  14. # from this date/time" value. Make it start with a non-digit so that
  15. # anyone trying to parse it as an integer will probably get "0".
  16. BUILD_NUMBER := eng.$(shell echo $${BUILD_USERNAME:0:6}).$(shell $(DATE) +%Y%m%d.%H%M%S)
  17. HAS_BUILD_NUMBER := false
  18. endif
  19. .KATI_READONLY := BUILD_NUMBER HAS_BUILD_NUMBER
  20. ifndef PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION
  21. # Used to set minimum supported target sdk version. Apps targeting sdk
  22. # version lower than the set value will result in a warning being shown
  23. # when any activity from the app is started.
  24. PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION := 23
  25. endif
  26. .KATI_READONLY := PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION

看build/make/core/Makefile  如果HAS_BUILD_NUMBER = true 会用BUILD_NUMBER_FILE 的值

  1. ifeq ($(strip $(HAS_BUILD_NUMBER)),false)
  2. BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)
  3. else
  4. BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
  5. endif

BUILD_NUMBER_FILE 在build/make/core/main.mk   是从BUILD_NUMBER 获取的

  1. # Write the build number to a file so it can be read back in
  2. # without changing the command line every time. Avoids rebuilds
  3. # when using ninja.
  4. $(shell mkdir -p $(OUT_DIR) && \
  5. echo -n $(BUILD_NUMBER) > $(OUT_DIR)/build_number.txt)
  6. BUILD_NUMBER_FILE := $(OUT_DIR)/build_number.txt

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/326827
推荐阅读
相关标签
  

闽ICP备14008679号