From a8608a7f7cee388192780f8988b5dc5966423eef Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 23 Jul 2013 11:51:04 -0700 Subject: [PATCH] distinguish signed and unsigned user builds in UI Add "dev-keys" or "test-keys" to the value of ro.build.display.id for user builds. (This is the property that is displayed under "Build number" in the Settings UI.) Modify the signing script to remove the keys tag from this value when signing. Change-Id: I3d9d92056f8567d7f84b1be047619be7c6e4c419 --- core/Makefile | 9 +++++---- tools/releasetools/sign_target_files_apks | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/Makefile b/core/Makefile index 55ab6a512d..d610867b5e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -96,10 +96,11 @@ endif # Both of these tags will be removed and replaced with "release-keys" # when the target-files is signed in a post-build step. ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/testkey) -BUILD_VERSION_TAGS += test-keys +BUILD_KEYS := test-keys else -BUILD_VERSION_TAGS += dev-keys +BUILD_KEYS := dev-keys endif +BUILD_VERSION_TAGS += $(BUILD_KEYS) BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS))) # A human-readable string that descibes this build in detail. @@ -121,9 +122,9 @@ ifeq ($(TARGET_BUILD_VARIANT),user) # Dev. branches should have DISPLAY_BUILD_NUMBER set ifeq "true" "$(DISPLAY_BUILD_NUMBER)" - BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER) + BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER) $(BUILD_KEYS) else - BUILD_DISPLAY_ID := $(BUILD_ID) + BUILD_DISPLAY_ID := $(BUILD_ID) $(BUILD_KEYS) endif else # Non-user builds should show detailed build information diff --git a/tools/releasetools/sign_target_files_apks b/tools/releasetools/sign_target_files_apks index 9fb1008938..5556573c06 100755 --- a/tools/releasetools/sign_target_files_apks +++ b/tools/releasetools/sign_target_files_apks @@ -196,6 +196,11 @@ def RewriteProps(data): value = " ".join(pieces) elif key == "ro.build.tags": value = EditTags(value) + elif key == "ro.build.display.id": + # change, eg, "JWR66N dev-keys" to "JWR66N" + value = value.split() + if len(value) == 2 and value[1].endswith("-keys"): + value = value[0] line = key + "=" + value if line != original_line: print " replace: ", original_line