diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..7ec2279a1cd21bf8df575059425288951aa549d1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,7 @@ +stages: + - update-from-upstream + +include: + - project: 'e/priv/os/build' + ref: master + file: '/templates/.gitlab-ci-update-from-upstream.yml' diff --git a/LICENSE b/LICENSE index cdec959c8d679837df7ffb7bc79839189a661c38..2dc7d6a9742017c4e807a1d8c87be5834cedf7ba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ Copyright 2011-15 The CyanogenMod Project 2017 The LineageOS Project + 2018 e Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/addonsu/mount-system.sh b/addonsu/mount-system.sh index 5886f153defe2685e8311d8a195adf6fb9ed58c7..dc86edaeccc112b4f75c9e56766a18ae400fd573 100644 --- a/addonsu/mount-system.sh +++ b/addonsu/mount-system.sh @@ -19,8 +19,7 @@ if [ "$system_as_root" == "true" ]; then else block=/dev/block/bootdevice/by-name/system fi - mkdir -p /system_root - if mount -o rw $block /system_root && mount /system_root/system /system; then + if mount -o rw $block /system_root && mount /system_root /system; then exit 0 fi fi diff --git a/bootanimation/Android.mk b/bootanimation/Android.mk index a608035ffb9e9ac7298698ccd32740d580cda656..7eaf96c445faf89e49d119ced769a2bf20b2b58e 100644 --- a/bootanimation/Android.mk +++ b/bootanimation/Android.mk @@ -25,7 +25,8 @@ ifeq ($(TARGET_SCREEN_HEIGHT),) endif define build-bootanimation - sh vendor/lineage/bootanimation/generate-bootanimation.sh \ + $(shell) vendor/lineage/bootanimation/generate-bootanimation.sh \ + $(PRODUCT_OUT) \ $(TARGET_SCREEN_WIDTH) \ $(TARGET_SCREEN_HEIGHT) \ $(TARGET_BOOTANIMATION_HALF_RES) diff --git a/bootanimation/RGBAtoRGB.sh b/bootanimation/RGBAtoRGB.sh new file mode 100644 index 0000000000000000000000000000000000000000..1f4250f47cf2ec9c60b90c1b1598da8e62f4f280 --- /dev/null +++ b/bootanimation/RGBAtoRGB.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Gaël Duval for e Foundation +# Note: needs imagemagick convert utility + +for i in `ls .` +do echo $i + convert ./$i -define png:color-type=2 -flatten +matte ./$i +done \ No newline at end of file diff --git a/bootanimation/RGBtoRGBA.sh b/bootanimation/RGBtoRGBA.sh new file mode 100644 index 0000000000000000000000000000000000000000..6c7790a3ef68a073b9efbad5065a2e4e69e39eec --- /dev/null +++ b/bootanimation/RGBtoRGBA.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Gaël Duval for e Foundation +# Note: needs imagemagick convert utility + +for i in `ls .` +do echo $i + convert ./$i png32:$i +done diff --git a/bootanimation/bootanimation.tar b/bootanimation/bootanimation.tar index 7e4b0dc98e84e6dfe9dc6b843465ff25aae51ebc..60b99131f161a70b5f0fb2d9e646ce9da1fc8d1f 100644 Binary files a/bootanimation/bootanimation.tar and b/bootanimation/bootanimation.tar differ diff --git a/bootanimation/generate-bootanimation.sh b/bootanimation/generate-bootanimation.sh index 3bcb272551f220d7fe64d5fa466b3fec1637a5bb..41d8c022cb4bc950dbb738614d1b5f71e0ba6b48 100755 --- a/bootanimation/generate-bootanimation.sh +++ b/bootanimation/generate-bootanimation.sh @@ -1,9 +1,11 @@ #!/bin/bash -WIDTH="$1" -HEIGHT="$2" -HALF_RES="$3" -OUT="$ANDROID_PRODUCT_OUT/obj/BOOTANIMATION" +PRODUCT_OUT="$1" +WIDTH="$2" +HEIGHT="$3" +HALF_RES="$4" + +OUT="$PRODUCT_OUT/obj/BOOTANIMATION" if [ "$HEIGHT" -lt "$WIDTH" ]; then IMAGEWIDTH="$HEIGHT" @@ -24,7 +26,7 @@ RESOLUTION=""$IMAGEWIDTH"x"$IMAGEHEIGHT"" for part_cnt in 0 1 2 3 4 do - mkdir -p $ANDROID_PRODUCT_OUT/obj/BOOTANIMATION/bootanimation/part$part_cnt + mkdir -p "$OUT/bootanimation/part$part_cnt" done tar xfp "vendor/lineage/bootanimation/bootanimation.tar" -C "$OUT/bootanimation/" mogrify -resize $RESOLUTION -colors 250 "$OUT/bootanimation/"*"/"*".png" diff --git a/build/core/main_version.mk b/build/core/main_version.mk index 96213b08e76cc0e01f4e4bcae671aafde74b9207..4cbb76667ce23ebb607c7ff805ef48e35c2dd82f 100644 --- a/build/core/main_version.mk +++ b/build/core/main_version.mk @@ -4,7 +4,18 @@ ADDITIONAL_BUILD_PROPERTIES += \ ro.lineage.releasetype=$(LINEAGE_BUILDTYPE) \ ro.lineage.build.version=$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR) \ ro.modversion=$(LINEAGE_VERSION) \ - ro.lineagelegal.url=https://lineageos.org/legal + ro.lineagelegal.url=https://lineageos.org/legal \ + ro.elegal.url=https://e.foundation/legal + +ifdef CI_PIPELINE_ID + ADDITIONAL_BUILD_PROPERTIES += \ + ro.cm.build.pipeline.id=$(CI_PIPELINE_ID) +endif + +ifdef CI_PIPELINE_IID + ADDITIONAL_BUILD_PROPERTIES += \ + ro.cm.build.pipeline.iid=$(CI_PIPELINE_IID) +endif # LineageOS Platform Display Version ADDITIONAL_BUILD_PROPERTIES += \ diff --git a/build/core/mtk_utils.mk b/build/core/mtk_utils.mk old mode 100755 new mode 100644 diff --git a/build/core/qcom_target.mk b/build/core/qcom_target.mk index 3502ed8f513036fdd4a63bf899d0822c8e9387ea..964d06a7e25d527abd002602060f9110e07a3c42 100644 --- a/build/core/qcom_target.mk +++ b/build/core/qcom_target.mk @@ -26,7 +26,7 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true) BR_FAMILY := msm8909 msm8916 UM_3_18_FAMILY := msm8937 msm8953 msm8996 UM_4_4_FAMILY := msm8998 sdm660 - UM_4_9_FAMILY := sdm845 + UM_4_9_FAMILY := sdm710 sdm845 UM_PLATFORMS := $(UM_3_18_FAMILY) $(UM_4_4_FAMILY) $(UM_4_9_FAMILY) BOARD_USES_ADRENO := true @@ -64,7 +64,7 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true) endif # List of targets that use master side content protection - MASTER_SIDE_CP_TARGET_LIST := msm8996 msm8998 sdm660 sdm845 + MASTER_SIDE_CP_TARGET_LIST := msm8996 msm8998 sdm660 sdm710 sdm845 ifeq ($(call is-board-platform-in-list, $(B_FAMILY)),true) MSM_VIDC_TARGET_LIST := $(B_FAMILY) diff --git a/build/core/qcom_utils.mk b/build/core/qcom_utils.mk index f36ecaa042fe75a9f7f5c0b5660ef542373c584c..f7cc39e3a499d32859272683d64d635548102b70 100755 --- a/build/core/qcom_utils.mk +++ b/build/core/qcom_utils.mk @@ -32,6 +32,7 @@ QCOM_BOARD_PLATFORMS += msm8996 QCOM_BOARD_PLATFORMS += msm8998 QCOM_BOARD_PLATFORMS += sdm660 +QCOM_BOARD_PLATFORMS += sdm710 QCOM_BOARD_PLATFORMS += sdm845 # MSM7000 Family diff --git a/build/soong/android/variable.go b/build/soong/android/variable.go index c2bb782a85b8b9fe67cb9b9abcde228e1e894ae2..d92ae929f113180583aba69a6c6f5012f55926da 100644 --- a/build/soong/android/variable.go +++ b/build/soong/android/variable.go @@ -3,6 +3,9 @@ type Product_variables struct { Has_legacy_camera_hal1 struct { Cflags []string } + Needs_legacy_camera_hal1_dyn_native_handle struct { + Cppflags []string + } Needs_text_relocations struct { Cppflags []string } @@ -26,6 +29,7 @@ type Product_variables struct { type ProductVariables struct { Has_legacy_camera_hal1 *bool `json:",omitempty"` + Needs_legacy_camera_hal1_dyn_native_handle *bool `json:",omitempty"` Needs_text_relocations *bool `json:",omitempty"` Specific_camera_parameter_library *string `json:",omitempty"` Target_shim_libs *string `json:",omitempty"` diff --git a/build/soong/soong_config.mk b/build/soong/soong_config.mk index fdc0869a37f478c10396084f8671d3496e883526..0c98c89c16adbeb88b462ca0d0388847f7a1aef2 100644 --- a/build/soong/soong_config.mk +++ b/build/soong/soong_config.mk @@ -5,6 +5,7 @@ lineage_soong: echo '{'; \ echo '"Lineage": {'; \ echo ' "Has_legacy_camera_hal1": $(if $(filter true,$(TARGET_HAS_LEGACY_CAMERA_HAL1)),true,false),'; \ + echo ' "Needs_legacy_camera_hal1_dyn_native_handle": $(if $(filter true,$(TARGET_NEEDS_LEGACY_CAMERA_HAL1_DYN_NATIVE_HANDLE)),true,false),'; \ echo ' "Needs_text_relocations": $(if $(filter true,$(TARGET_NEEDS_PLATFORM_TEXT_RELOCATIONS)),true,false),'; \ echo ' "Specific_camera_parameter_library": "$(TARGET_SPECIFIC_CAMERA_PARAMETER_LIBRARY)",'; \ echo ' "Target_shim_libs": "$(subst $(space),:,$(TARGET_LD_SHIM_LIBS))",'; \ diff --git a/build/tasks/bacon.mk b/build/tasks/bacon.mk index f01844007ebfca79f7922e7c6fdc2af312e4118c..b0e5db7fe43ecb8e9d141364a49d910484011ddc 100644 --- a/build/tasks/bacon.mk +++ b/build/tasks/bacon.mk @@ -16,7 +16,7 @@ # ----------------------------------------------------------------- # Lineage OTA update package -LINEAGE_TARGET_PACKAGE := $(PRODUCT_OUT)/lineage-$(LINEAGE_VERSION).zip +LINEAGE_TARGET_PACKAGE := $(PRODUCT_OUT)/e-$(LINEAGE_VERSION).zip .PHONY: bacon bacon: $(INTERNAL_OTA_PACKAGE_TARGET) diff --git a/build/tasks/dtbo.mk b/build/tasks/dtbo.mk new file mode 100644 index 0000000000000000000000000000000000000000..dc3a98ac79cb7c447a1502bcecff79a46972daaa --- /dev/null +++ b/build/tasks/dtbo.mk @@ -0,0 +1,37 @@ +ifneq ($(TARGET_NO_KERNEL),true) +ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DTBO)),true) + +MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX) + +INSTALLED_DTBOIMAGE_TARGET := $(PRODUCT_OUT)/dtbo.img + +# Most specific paths must come first in possible_dtbo_dirs +possible_dtbo_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts $(KERNEL_OUT)/arch/arm/boot/dts + +define build-dtboimage-target + $(call pretty,"Target dtbo image: $(INSTALLED_DTBOIMAGE_TARGET)") + $(hide) for dir in $(possible_dtbo_dirs); do \ + if [ -d "$$dir" ]; then \ + dtbo_dir="$$dir"; \ + break; \ + fi; \ + done; \ + $(MKDTIMG) create $@ --page_size=$(BOARD_KERNEL_PAGESIZE) $$(find "$$dtbo_dir" -name '*.dtbo') + $(hide) chmod a+r $@ +endef + +ifeq ($(BOARD_AVB_ENABLE),true) +$(INSTALLED_DTBOIMAGE_TARGET): $(AVBTOOL) $(BOARD_AVB_DTBO_KEY_PATH) $(MKDTIMG) $(INSTALLED_KERNEL_TARGET) + $(build-dtboimage-target) + $(AVBTOOL) add_hash_footer \ + --image $@ \ + --partition_size $(BOARD_DTBOIMG_PARTITION_SIZE) \ + --partition_name dtbo $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \ + $(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS) +else +$(INSTALLED_DTBOIMAGE_TARGET): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET) + $(build-dtboimage-target) +endif + +endif # BOARD_KERNEL_SEPARATED_DTBO +endif # TARGET_NO_KERNEL diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk index 8965b1c1c72c8bd1bc6a29b7527492828191097a..7d6cebef9b07339cba887b84bfa84435e016aeeb 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -69,6 +69,14 @@ # modules in root instead of vendor # NEED_KERNEL_MODULE_SYSTEM = Optional, if true, install kernel # modules in system instead of vendor +# +# TARGET_DTBO_IMAGE_NAME = Device Tree Binary Overlay (DTBO) image name +# Should be 'dtbo' for most devices +# Some MediaTek devices use 'odmdtbo' +# TARGET_DTBO_IMAGE_TARGET = Similar to TARGET_DTBO_IMAGE_NAME, but the full file name +# Should be 'dtbo.img' for most devices +# Some MediaTek devices use 'odmdtboimage' +# TARGET_DTBO_IMAGE_PATH = Path to generated DTBO image in inline kernel build tree ifneq ($(TARGET_NO_KERNEL),true) @@ -77,6 +85,9 @@ TARGET_AUTO_KDIR := $(shell echo $(TARGET_DEVICE_DIR) | sed -e 's/^device/kernel ## Externally influenced variables # kernel location - optional, defaults to kernel// TARGET_KERNEL_SOURCE ?= $(TARGET_AUTO_KDIR) +ifneq ($(TARGET_PREBUILT_KERNEL),) +TARGET_KERNEL_SOURCE := +endif KERNEL_SRC := $(TARGET_KERNEL_SOURCE) # kernel configuration - mandatory KERNEL_DEFCONFIG := $(TARGET_KERNEL_CONFIG) @@ -111,6 +122,14 @@ ifneq ($(TARGET_KERNEL_APPEND_DTB),) $(error TARGET_KERNEL_APPEND_DTB is deprecated.) endif TARGET_PREBUILT_INT_KERNEL := $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(BOARD_KERNEL_IMAGE_NAME) +TARGET_DTBO_IMAGE_NAME ?= dtbo +TARGET_DTBO_IMAGE_TARGET ?= dtbo.img +TARGET_DTBO_IMAGE_PATH ?= dtbo/arch/$(KERNEL_ARCH)/boot/$(TARGET_DTBO_IMAGE_NAME).img + +dtbo_avbtool_signing_enabled := +ifeq ($(BOARD_AVB_ENABLE), true) + dtbo_avbtool_signing_enabled := true +endif # Clear this first to prevent accidental poisoning from env MAKE_FLAGS := @@ -416,16 +435,18 @@ alldefconfig: endif # FULL_KERNEL_BUILD -TARGET_PREBUILT_DTBO = $(PRODUCT_OUT)/dtbo/arch/$(KERNEL_ARCH)/boot/dtbo.img +TARGET_PREBUILT_DTBO = $(PRODUCT_OUT)/$(TARGET_DTBO_IMAGE_PATH) $(TARGET_PREBUILT_DTBO): $(AVBTOOL) - echo -e ${CL_GRN}"Building DTBO.img"${CL_RST} + echo -e ${CL_GRN}"Building $(TARGET_DTBO_IMAGE_NAME).img"${CL_RST} $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(PRODUCT_OUT)/dtbo ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) $(KERNEL_DEFCONFIG) - $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(PRODUCT_OUT)/dtbo ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) dtbo.img + $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(PRODUCT_OUT)/dtbo ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) $(TARGET_DTBO_IMAGE_TARGET) +ifdef dtbo_avbtool_signing_enabled $(AVBTOOL) add_hash_footer \ --image $@ \ --partition_size $(BOARD_DTBOIMG_PARTITION_SIZE) \ - --partition_name dtbo $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \ + --partition_name $(TARGET_DTBO_IMAGE_NAME) $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \ $(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS) +endif ## Install it diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh index e9fff896588915f7ab9dfa33fe81b59983692835..2e509ed5db80633339f9aa0490526fd4ac3d3bc2 100644 --- a/build/tools/extract_utils.sh +++ b/build/tools/extract_utils.sh @@ -1009,7 +1009,7 @@ function extract() { mkdir -p $(dirname "${VENDOR_REPO_FILE}") # Check pinned files - local HASH="${HASHLIST[$i-1]}" + local HASH="$(echo ${HASHLIST[$i-1]} | awk '{ print tolower($0); }')" local KEEP="" if [ "$DISABLE_PINNING" != "1" ] && [ ! -z "$HASH" ] && [ "$HASH" != "x" ]; then if [ -f "${VENDOR_REPO_FILE}" ]; then diff --git a/build/tools/repopick.py b/build/tools/repopick.py index 9aded9ddc46e99a2304e440995dda11cf181bcce..7c6bf1531f947db57e40daaefbc4454c930621e0 100755 --- a/build/tools/repopick.py +++ b/build/tools/repopick.py @@ -448,19 +448,26 @@ if __name__ == '__main__': sys.exit(result) # Perform the cherry-pick if not args.pull: - cmd = ['git cherry-pick FETCH_HEAD'] + cmd = ['git cherry-pick --ff FETCH_HEAD'] if args.quiet: cmd_out = open(os.devnull, 'wb') else: cmd_out = None result = subprocess.call(cmd, cwd=project_path, shell=True, stdout=cmd_out, stderr=cmd_out) if result != 0: - if args.reset: + cmd = ['git diff-index --quiet HEAD --'] + result = subprocess.call(cmd, cwd=project_path, shell=True, stdout=cmd_out, stderr=cmd_out) + if result == 0: + print('WARNING: git command resulted with an empty commit, aborting cherry-pick') + cmd = ['git cherry-pick --abort'] + subprocess.call(cmd, cwd=project_path, shell=True, stdout=cmd_out, stderr=cmd_out) + elif args.reset: print('ERROR: git command failed, aborting cherry-pick') cmd = ['git cherry-pick --abort'] subprocess.call(cmd, cwd=project_path, shell=True, stdout=cmd_out, stderr=cmd_out) + sys.exit(result) else: print('ERROR: git command failed') - sys.exit(result) + sys.exit(result) if not args.quiet: print('') diff --git a/build/tools/roomservice.py b/build/tools/roomservice.py index 813d0b77d18596659da5f90044ab1ea499885d9e..bf502a531f60bd9bf25ab3bf5fe153b9cce865a0 100755 --- a/build/tools/roomservice.py +++ b/build/tools/roomservice.py @@ -110,8 +110,21 @@ def indent(elem, level=0): if level and (not elem.tail or not elem.tail.strip()): elem.tail = i -def get_default_revision(): +def get_manifest_path(): + '''Find the current manifest path + In old versions of repo this is at .repo/manifest.xml + In new versions, .repo/manifest.xml includes an include + to some arbitrary file in .repo/manifests''' + m = ElementTree.parse(".repo/manifest.xml") + try: + m.findall('default')[0] + return '.repo/manifest.xml' + except IndexError: + return ".repo/manifests/{}".format(m.find("include").get("name")) + +def get_default_revision(): + m = ElementTree.parse(get_manifest_path()) d = m.findall('default')[0] r = d.get('revision') return r.replace('refs/heads/', '').replace('refs/tags/', '') @@ -142,7 +155,7 @@ def is_in_manifest(projectpath): # Search in main manifest, too try: - lm = ElementTree.parse(".repo/manifest.xml") + lm = ElementTree.parse(get_manifest_path()) lm = lm.getroot() except: lm = ElementTree.Element("manifest") diff --git a/charger/images/420dpi b/charger/images/420dpi new file mode 120000 index 0000000000000000000000000000000000000000..17ef829d2c5b2650c34eed6cc68eafcc37f08590 --- /dev/null +++ b/charger/images/420dpi @@ -0,0 +1 @@ +xxhdpi \ No newline at end of file diff --git a/config/common.mk b/config/common.mk index f6bb4d1c896d45fcb3c8aa94cb1952fe1a3afd44..8fbe82fa01067f98d70edd5cda79b8998aae7fa7 100644 --- a/config/common.mk +++ b/config/common.mk @@ -1,3 +1,6 @@ +# Allow vendor/extra to override any property by setting it first +$(call inherit-product-if-exists, vendor/extra/product.mk) + PRODUCT_BRAND ?= LineageOS PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0 @@ -18,8 +21,8 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ # Default notification/alarm sounds PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ - ro.config.notification_sound=Argon.ogg \ - ro.config.alarm_alert=Hassium.ogg + ro.config.notification_sound=Selenium.ogg \ + ro.config.alarm_alert=Promethium.ogg ifneq ($(TARGET_BUILD_VARIANT),user) # Thank you, please drive thru! @@ -93,6 +96,10 @@ PRODUCT_COPY_FILES += \ vendor/lineage/config/permissions/org.lineageos.android.xml:system/etc/permissions/org.lineageos.android.xml \ vendor/lineage/config/permissions/privapp-permissions-lineage.xml:system/etc/permissions/privapp-permissions-lineage.xml +# Pre-granted permissions +PRODUCT_COPY_FILES += \ + vendor/lineage/config/permissions/eos-permissions.xml:system/etc/default-permissions/eos-permissions.xml + # Include Lineage audio files include vendor/lineage/config/lineage_audio.mk @@ -106,10 +113,48 @@ ifeq ($(WITH_TWRP),true) include vendor/lineage/config/twrp.mk endif +# Do not include art debug targets +PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false + +# Strip the local variable table and the local variable type table to reduce +# the size of the system image. This has no bearing on stack traces, but will +# leave less information available via JDWP. +PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true + # Bootanimation PRODUCT_PACKAGES += \ bootanimation.zip +# Required /e/ packages +PRODUCT_PACKAGES += \ + GmsCore \ + GsfProxy \ + FakeStore \ + com.google.android.maps.jar \ + Mail \ + BlissLauncher \ + BlissIconPack \ + MozillaNlpBackend \ + OpenWeatherMapWeatherProvider \ + AccountManager \ + MagicEarth \ + PdfViewer \ + Camera \ + eDrive \ + Weather \ + Notes \ + Tasks \ + NominatimNlpBackend \ + DroidGuard \ + LibreOfficeViewer \ + OpenKeychain \ + Message \ + Browser \ + BrowserWebView \ + Apps \ + ESmsSync \ + PwaPlayer + # Required Lineage packages PRODUCT_PACKAGES += \ LineageParts \ @@ -118,19 +163,12 @@ PRODUCT_PACKAGES += \ # Optional packages PRODUCT_PACKAGES += \ - libemoji \ LiveWallpapersPicker \ PhotoTable \ Terminal -# Include explicitly to work around GMS issues -PRODUCT_PACKAGES += \ - libprotobuf-cpp-full \ - librsjni - # Custom Lineage packages PRODUCT_PACKAGES += \ - AudioFX \ LineageSettingsProvider \ LineageSetupWizard \ Eleven \ @@ -168,22 +206,22 @@ PRODUCT_PACKAGES += \ bash \ bzip2 \ curl \ - gdbserver \ htop \ lib7z \ libsepol \ - micro_bench \ - oprofiled \ pigz \ powertop \ - sqlite3 \ - strace \ unrar \ unzip \ vim \ wget \ zip +# Custom packages +ifdef CUSTOM_PACKAGES +PRODUCT_PACKAGES += $(CUSTOM_PACKAGES) +endif + # Charger PRODUCT_PACKAGES += \ charger_res_images @@ -228,23 +266,27 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ media.recorder.show_manufacturer_and_model=true # These packages are excluded from user builds -ifneq ($(TARGET_BUILD_VARIANT),user) -PRODUCT_PACKAGES += \ +PRODUCT_PACKAGES_DEBUG += \ + micro_bench \ procmem \ - procrank + procrank \ + strace # Conditionally build in su +ifneq ($(TARGET_BUILD_VARIANT),user) ifeq ($(WITH_SU),true) PRODUCT_PACKAGES += \ su endif endif +PRODUCT_PACKAGE_OVERLAYS := vendor/lineage/overlay/microg + DEVICE_PACKAGE_OVERLAYS += vendor/lineage/overlay/common -PRODUCT_VERSION_MAJOR = 15 -PRODUCT_VERSION_MINOR = 1 -PRODUCT_VERSION_MAINTENANCE := 0 +PRODUCT_VERSION_MAJOR = 0 +PRODUCT_VERSION_MINOR = 9 +PRODUCT_VERSION_MAINTENANCE := 2 ifeq ($(TARGET_VENDOR_SHOW_MAINTENANCE_VERSION),true) LINEAGE_VERSION_MAINTENANCE := $(PRODUCT_VERSION_MAINTENANCE) @@ -262,11 +304,6 @@ ifndef LINEAGE_BUILDTYPE endif endif -# Filter out random types, so it'll reset to UNOFFICIAL -ifeq ($(filter RELEASE NIGHTLY SNAPSHOT EXPERIMENTAL,$(LINEAGE_BUILDTYPE)),) - LINEAGE_BUILDTYPE := -endif - ifdef LINEAGE_BUILDTYPE ifneq ($(LINEAGE_BUILDTYPE), SNAPSHOT) ifdef LINEAGE_EXTRAVERSION @@ -300,6 +337,24 @@ ifeq ($(LINEAGE_BUILDTYPE), UNOFFICIAL) endif endif +ifdef PLATFORM_SDK_VERSION + ifeq ($(PLATFORM_SDK_VERSION), 24) + ANDROID_LETTER := n + endif + ifeq ($(PLATFORM_SDK_VERSION), 25) + ANDROID_LETTER := n + endif + ifeq ($(PLATFORM_SDK_VERSION), 26) + ANDROID_LETTER := o + endif + ifeq ($(PLATFORM_SDK_VERSION), 27) + ANDROID_LETTER := o + endif + ifeq ($(PLATFORM_SDK_VERSION), 28) + ANDROID_LETTER := p + endif +endif + ifeq ($(LINEAGE_BUILDTYPE), RELEASE) ifndef TARGET_VENDOR_RELEASE_BUILD_ID LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(LINEAGE_BUILD) @@ -317,15 +372,15 @@ ifeq ($(LINEAGE_BUILDTYPE), RELEASE) else ifeq ($(LINEAGE_VERSION_MAINTENANCE),0) ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true) - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d_%H%M%S)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) else - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(shell date -u +%Y%m%d)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) endif else ifeq ($(LINEAGE_VERSION_APPEND_TIME_OF_DAY),true) - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d_%H%M%S)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d_%H%M%S)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) else - LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(shell date -u +%Y%m%d)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) + LINEAGE_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(ANDROID_LETTER)-$(shell date -u +%Y%m%d)$(CI_PIPELINE_ID)-$(LINEAGE_BUILDTYPE)$(LINEAGE_EXTRAVERSION)-$(LINEAGE_BUILD) endif endif endif @@ -352,9 +407,9 @@ ifneq ($(PRODUCT_DEFAULT_DEV_CERTIFICATE),build/target/product/security/testkey) TARGET_VENDOR_RELEASE_BUILD_ID := $(TARGET_VENDOR_RELEASE_BUILD_ID) endif ifeq ($(LINEAGE_VERSION_MAINTENANCE),0) - LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD) + LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID) else - LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)-$(LINEAGE_BUILD) + LINEAGE_DISPLAY_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(LINEAGE_VERSION_MAINTENANCE)-$(TARGET_VENDOR_RELEASE_BUILD_ID)$(CI_PIPELINE_ID)-$(LINEAGE_BUILD) endif endif endif @@ -362,5 +417,3 @@ endif -include $(WORKSPACE)/build_env/image-auto-bits.mk -include vendor/lineage/config/partner_gms.mk - -$(call prepend-product-if-exists, vendor/extra/product.mk) diff --git a/config/partner_gms.mk b/config/partner_gms.mk index 5be7551065bafb6284881d2c366644b6ff00ae99..edec815a45cfc593b2b3e2c68523d1e9dafa7079 100644 --- a/config/partner_gms.mk +++ b/config/partner_gms.mk @@ -1,3 +1,7 @@ ifeq ($(WITH_GMS),true) +ifeq ($(PRODUCT_IS_ATV),true) +$(call inherit-product-if-exists, vendor/partner_gms-tv/products/gms.mk) +else $(call inherit-product-if-exists, vendor/partner_gms/products/gms.mk) endif +endif diff --git a/config/permissions/eos-permissions.xml b/config/permissions/eos-permissions.xml new file mode 100644 index 0000000000000000000000000000000000000000..bab1f396152779cffc56fac5976bfa401c794102 --- /dev/null +++ b/config/permissions/eos-permissions.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/permissions/privapp-permissions-lineage.xml b/config/permissions/privapp-permissions-lineage.xml index 1d494e18c35c4fbefead32b2814144a19949d627..5daf7a05aa8cad7698b27796855c2ee458aa58ac 100644 --- a/config/permissions/privapp-permissions-lineage.xml +++ b/config/permissions/privapp-permissions-lineage.xml @@ -101,4 +101,8 @@ + + + + diff --git a/config/telephony.mk b/config/telephony.mk index 5f23cc48d4b5cc6fd58db80bb44ebfab14e202e9..211f37b8db2000de4df0f7f3fdb05d55fbf6f36e 100644 --- a/config/telephony.mk +++ b/config/telephony.mk @@ -14,7 +14,7 @@ PRODUCT_PACKAGES += \ # Default ringtone PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ - ro.config.ringtone=Orion.ogg + ro.config.ringtone=Dione.ogg # Tethering - allow without requiring a provisioning app # (for devices that check this) diff --git a/overlay/common/frameworks/base/core/res/res/drawable-hdpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-hdpi/default_wallpaper.png index dd46358e4da383e1b3223bf8e0b9eb2de6235134..cda3d97b78c2680524bfafef654d360259d949fb 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-hdpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-hdpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.png index bbfe94023b645ae7525a0c2ad48fb0c55208da91..cda3d97b78c2680524bfafef654d360259d949fb 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.png index 43c10a1beb4c3d7cbb9df6d9a7e0952171bdac76..cda3d97b78c2680524bfafef654d360259d949fb 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-sw600dp-nodpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/drawable-sw720dp-nodpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-sw720dp-nodpi/default_wallpaper.png index 388f8e591e83c0b5c5d6d5b5c27b48f67f60c5cc..cda3d97b78c2680524bfafef654d360259d949fb 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-sw720dp-nodpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-sw720dp-nodpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/drawable-xhdpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-xhdpi/default_wallpaper.png index 66826f2ac49c3da1168e88284e080996e7ca3525..cda3d97b78c2680524bfafef654d360259d949fb 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-xhdpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-xhdpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/drawable-xxhdpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-xxhdpi/default_wallpaper.png index 09e53d0002f3454b1f37992a01ad16090dc55dbe..522b60c5f7ca063e8711f6a412f6815dd3b56f76 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-xxhdpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-xxhdpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/drawable-xxxhdpi/default_wallpaper.png b/overlay/common/frameworks/base/core/res/res/drawable-xxxhdpi/default_wallpaper.png index 88ff9bdab2242c5774a7bc2df911d9d86538632d..522b60c5f7ca063e8711f6a412f6815dd3b56f76 100644 Binary files a/overlay/common/frameworks/base/core/res/res/drawable-xxxhdpi/default_wallpaper.png and b/overlay/common/frameworks/base/core/res/res/drawable-xxxhdpi/default_wallpaper.png differ diff --git a/overlay/common/frameworks/base/core/res/res/values-mcc460/config.xml b/overlay/common/frameworks/base/core/res/res/values-mcc460/config.xml index 17e191e56ab688c5bb5b7e23d3ee59f5450705b6..6a9b20889e3bcf71b1f62315f7db0d36ef0d01f6 100644 --- a/overlay/common/frameworks/base/core/res/res/values-mcc460/config.xml +++ b/overlay/common/frameworks/base/core/res/res/values-mcc460/config.xml @@ -2,6 +2,7 @@ - 2.android.pool.ntp.org + ntp.ntsc.ac.cn diff --git a/overlay/common/frameworks/base/core/res/res/values/colors.xml b/overlay/common/frameworks/base/core/res/res/values/colors.xml index 27fd690ce6c94a69779b094615391173302705d5..cba6521af7faddd0a94af9dae2889179b3afac78 100644 --- a/overlay/common/frameworks/base/core/res/res/values/colors.xml +++ b/overlay/common/frameworks/base/core/res/res/values/colors.xml @@ -15,9 +15,10 @@ limitations under the License. --> - #167C80 - #167C80 - #167C80 - #167C80 - #167C80 + #ffd2e6ff + #ffa5cdff + #ff7bb6ff + #ff57a2ff + #ff077fff + #ff1059b3 diff --git a/overlay/common/frameworks/base/core/res/res/values/config.xml b/overlay/common/frameworks/base/core/res/res/values/config.xml index a3797b01a13882003d6734d4952af79239dc50e6..a918a4dc22c038ea0d3befd16bf80426132d32e0 100644 --- a/overlay/common/frameworks/base/core/res/res/values/config.xml +++ b/overlay/common/frameworks/base/core/res/res/values/config.xml @@ -91,4 +91,6 @@ --> 1 + + true diff --git a/overlay/dictionaries/packages/inputmethods/LatinIME/java/res/raw/main_pl.dict b/overlay/dictionaries/packages/inputmethods/LatinIME/java/res/raw/main_pl.dict new file mode 100644 index 0000000000000000000000000000000000000000..f55af662c9c57b83bbcf9bdfa5b1b5167d59a155 Binary files /dev/null and b/overlay/dictionaries/packages/inputmethods/LatinIME/java/res/raw/main_pl.dict differ diff --git a/overlay/microg/frameworks/base/core/res/res/values/config.xml b/overlay/microg/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000000000000000000000000000000000000..59252771c7f23dbc651e5244fa7a42a41c82797b --- /dev/null +++ b/overlay/microg/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,25 @@ + + + + + + + true + true + + diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh index e552fd7434e16a56984947656786dda09589343a..c93d46ee124880df77b65327790698c17a302e8b 100755 --- a/prebuilt/common/bin/backuptool.sh +++ b/prebuilt/common/bin/backuptool.sh @@ -5,7 +5,7 @@ export C=/tmp/backupdir export S=/system -export V=15.1 +export V=8.1 export ADDOND_VERSION=1 @@ -48,7 +48,7 @@ check_prereq() { if [ ! -r /system/build.prop ]; then return 0 fi -if ! grep -q "^ro.lineage.version=$V.*" /system/build.prop; then +if ! grep -q "^ro.build.version.release=$V.*" /system/build.prop; then echo "Not backing up files from incompatible version: $V" return 0 fi diff --git a/prebuilt/common/bin/backuptool_ab.sh b/prebuilt/common/bin/backuptool_ab.sh index 1eeab2c4125f3bb5fd89b553dd5762df28f4c892..099b11f63f303f879bb36a750120b80dd70183d3 100755 --- a/prebuilt/common/bin/backuptool_ab.sh +++ b/prebuilt/common/bin/backuptool_ab.sh @@ -5,7 +5,7 @@ export S=/system export C=/postinstall/tmp/backupdir -export V=15.1 +export V=8.1 export ADDOND_VERSION=2 diff --git a/prebuilt/common/etc/apns-conf.xml b/prebuilt/common/etc/apns-conf.xml index 918fc9909e14122f9ad373c1d74e1603c1f6c567..77d1129c46ebc1c96d82789a0ac7460f77cb242d 100644 --- a/prebuilt/common/etc/apns-conf.xml +++ b/prebuilt/common/etc/apns-conf.xml @@ -119,7 +119,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -267,6 +267,7 @@ + @@ -309,6 +310,7 @@ + @@ -662,6 +664,7 @@ + @@ -1052,87 +1055,34 @@ - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -1361,7 +1311,7 @@ - + @@ -1386,17 +1336,17 @@ - + - + - + @@ -1608,6 +1558,7 @@ + @@ -1882,51 +1833,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3347,23 +3298,17 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/prebuilt/common/etc/sensitive_pn.xml b/prebuilt/common/etc/sensitive_pn.xml index 43a3913bd931077d5a1ab9e8315c8d05333134e9..ee19edf535d413e6ad687492a801d778fa2fc389 100644 --- a/prebuilt/common/etc/sensitive_pn.xml +++ b/prebuilt/common/etc/sensitive_pn.xml @@ -2,7 +2,7 @@ 116006 + 116111 116123 08000432 08002000 @@ -94,6 +95,10 @@ 116111 116123 + + + 080050305 + 116006 @@ -101,15 +106,21 @@ + 116111 2645328 3192782 3626006 0800100600 0800123456 + + + 080011112 + 1522 + 19696 @@ -118,6 +129,7 @@ + 147 116000 116111 @@ -147,6 +159,7 @@ + 147 116006 116123 0800222555 @@ -156,7 +169,43 @@ 116111 116123 08001111 + 0800555111 + 01179045999 + 01179250680 + 01642683045 + 01708765200 + 02070080151 + 02072516577 + 02072518887 + 02073830700 + 02073957700 + 02074907689 + 02076081137 + 02077042040 + 02078235430 + 02085710800 + 02085719595 + 02380338080 + 02920496920 + 03003300630 + 08000149084 + 08000271234 + 08005999247 + 08008010327 + 08009995428 08082000247 + 08088005000 + 08088010331 + 08088010456 + 08088010464 + 08088010800 + 08088020300 + 08088021414 + 08088029999 + 08088081111 + 08088088141 + 08453030900 + 08454582914 @@ -170,6 +219,7 @@ + 116111 22424202 22444050 23227930 @@ -193,13 +243,27 @@ 116111 + + + 88002000122 + 88002500015 + 386 772 + 116111 0800500225 0800500335 + + + 88011001611 + + + + 116111 + 116111 @@ -229,8 +293,13 @@ 116111 116123 + + + 1717 + + 179 116111 116123 @@ -239,12 +308,225 @@ 116111 116123 + + + 116111 + + + + 240160 + 116111 + 028130250 + 028223510 + 029204238 + 029339010 + 029339011 + 029360011 + 029360535 + 029361026 + 029569529 + 029635357 029817686 + 029835205 + 029835305 + 029835405 + 030181771 + 030412049 + 030454240 + 030712038 + 030728824 + 031182290 + 031348618 + 031452059 + 031822316 + 032207253 + 032260708 + 032512989 + 032622322 + 032658150 + 032660530 + 032814072 + 032943444 + 033127352 + 033555771 + 033762547 + 034447530 + 035172233 + 035762023 + 035950344 + 036328858 + 036417274 + 036417275 + 036514145 + 037049991 + 037391076 + 038620392 + 038624685 + 038662138 + 039126095 + 041695554 + 042641111 + 042660328 + 043162866 + 044667257 + 046622056 + 047616468 + 051843021 + 052609677 + 052613830 + 052820693 + 052919779 + 053432050 + 053725343 + 054833124 + 054850777 + 054869958 + 055022125 + 055513072 + 055513074 + 055922113 + 056530405 + 056815618 + 056825205 + 056825601 + 058601088 + 058605472 + 059632435 + 060161142 + 060161144 + 060161146 + 060161148 + 060161632 + 060162889 + 060167025 + 061052712 + 061132620 + 061416934 + 061613713 + 061822181 + 061922187 + 062602604 + 063140086 + 064824156 + 064846713 + 065093117 + 065522034 + 066805419 + 066805770 + 066809818 + 067052014 + 067532790 + 067675574 + 068602928 + 070019559 + 070150441 + 071722085 + 072093336 + 072166663 + 072695038 + 074422316 + 075161157 + 076601010 + 076603360 + 076695005 + 077313010 + 077787488 + 078529171 + 078939608 + 080011977 + 080018017 080018676 080020100 + 081222033 + 082813380 + 082826770 + 084660283 + 084772560 + 084872020 + 086732268 + 086820487 + 086821495 + 091232064 + 092620063 + 092620484 + 094600606 + 095380116 + 096300134 + 096300491 + 096303270 + 097380953 + 0876244006 + 0876400660 + 0876552572 + 0877330225 + 0877622665 + 0877655353 + 0877966850 + 0878121910 + 0878238102 + 0878324320 + 0878394250 + 0878567620 + 0878567659 + 0878628756 + 0879260101 + 0879387620 + 0879453503 + 0879530460 + 0879532892 + 0879535905 + 0879606855 + 0879612223 + 0879816911 + 0879819195 + 0879993859 + 0882071603 + 0882165368 + 0882290920 + 0882290980 + 0882330008 + 0882384587 + 0882420038 + 0883256622 + 0884029213 + 0884199173 + 0884301016 + 0884843400 + 0884877595 + 0884940688 + 0884959367 + 0884977296 + 0885546493 + 0885584855 + 0886203742 + 0886207985 + 0886785906 + 0887302241 + 0887900324 + 0888111703 + 0888628146 + 0888818510 + 0888885909 + 0889040412 + 0889111848 + 0889393132 + 0889667600 + 0889799855 + 0893328940 + 0893455930 + 0893474238 + 0894412380 + 0894420941 + 0894438106 + 0895514923 + 0895140600 + 0896662766 + 0897013236 + 0898575963 + 0899846850 @@ -252,12 +534,24 @@ 183 05493810183 05494412144 + 08504550070 116111 116123 + + + 192 + 193 + 194 + 080012222 + + + + 080081550 + 6455195 @@ -399,6 +693,25 @@ 18663852699 18666894357 + + + 8004357 + + + + 4614444 + + + + 131 + + + + 0124802280 + 0506802280 + 0518801180 + 0884802280 + 1090 diff --git a/verity_tool/include/verity_tool.h b/verity_tool/include/verity_tool.h index 25a6a7c2625ec9327cdb6ee2a030e426c54ef47f..b81eda1a9e1f13df915c1d355799ebfc694f887b 100644 --- a/verity_tool/include/verity_tool.h +++ b/verity_tool/include/verity_tool.h @@ -18,6 +18,14 @@ #include +typedef enum { + VERITY_STATE_UNKNOWN, + VERITY_STATE_NO_DEVICE, + VERITY_STATE_DISABLED, + VERITY_STATE_ENABLED, + VERITY_STATE_MAX = VERITY_STATE_ENABLED +} verity_state_t; + /* * Return codes: * @@ -27,6 +35,13 @@ bool set_block_device_verity_enabled(const std::string& block_device, bool enable); +/* + * Return codes: + * + * verity state (unknown, disabled, enabled) + */ +verity_state_t get_verity_state(); + /* * Return codes: * diff --git a/verity_tool/main.cpp b/verity_tool/main.cpp index f5f026aab34d1caf11a994e7815633941d873461..befdafacdb9de77384cca4107bb55279c0e74f31 100644 --- a/verity_tool/main.cpp +++ b/verity_tool/main.cpp @@ -24,20 +24,23 @@ static void print_usage() { printf("veritytool - toggle block device verification\n" " --help show this help\n" " --enable enable dm-verity\n" - " --disable disable dm-verity\n"); + " --disable disable dm-verity\n" + " --show show current dm-verity state\n"); } int main(int argc, char** argv) { int c, rc; int enable = 0; + int show = 0; bool flag_set = false; struct option long_opts[] = { {"disable", no_argument, &enable, 0}, {"enable", no_argument, &enable, 1}, + {"show", no_argument, &show, 1}, {NULL, 0, NULL, 0}, }; - while ((c = getopt_long(argc, argv, "de", long_opts, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "des", long_opts, NULL)) != -1) { switch (c) { case 0: flag_set = true; @@ -53,6 +56,26 @@ int main(int argc, char** argv) { exit(0); } + if (show) { + printf("dm-verity state: "); + switch (get_verity_state()) { + case VERITY_STATE_NO_DEVICE: + printf("NO DEVICE"); + break; + case VERITY_STATE_DISABLED: + printf("DISABLED"); + break; + case VERITY_STATE_ENABLED: + printf("ENABLED"); + break; + default: + printf("UNKNOWN"); + break; + } + printf("\n"); + return 0; + } + if (!set_verity_enabled(enable)) { printf("Error occurred in set_verity_enable\n"); exit(EXIT_FAILURE); diff --git a/verity_tool/verity_tool.cpp b/verity_tool/verity_tool.cpp index 9575c4c1442d4f816e5abe95987c6351bbe63537..48e95b676537e98baba49b6c9d1bcd421b2ba27c 100644 --- a/verity_tool/verity_tool.cpp +++ b/verity_tool/verity_tool.cpp @@ -108,6 +108,69 @@ static std::string get_ab_suffix() { return ab_suffix; } +verity_state_t get_verity_state() { + verity_state_t rc = VERITY_STATE_NO_DEVICE; + std::string ab_suffix = get_ab_suffix(); + + // Figure out if we're using VB1.0 or VB2.0 (aka AVB) - by + // contract, androidboot.vbmeta.digest is set by the bootloader + // when using AVB). + bool using_avb = !android::base::GetProperty("ro.boot.vbmeta.digest", "").empty(); + + if (using_avb) { + // Yep, the system is using AVB. + AvbOps* ops = avb_ops_user_new(); + if (ops == nullptr) { + LOG(ERROR) << "Error getting AVB ops"; + avb_ops_user_free(ops); + return VERITY_STATE_UNKNOWN; + } + bool verity_enabled; + if (!avb_user_verity_get(ops, ab_suffix.c_str(), &verity_enabled)) { + LOG(ERROR) << "Error getting verity state"; + avb_ops_user_free(ops); + return VERITY_STATE_UNKNOWN; + } + rc = verity_enabled ? VERITY_STATE_ENABLED : VERITY_STATE_DISABLED; + avb_ops_user_free(ops); + } else { + // Not using AVB - assume VB1.0. + + // read all fstab entries at once from all sources + struct fstab* fstab = fs_mgr_read_fstab_default(); + if (!fstab) { + LOG(ERROR) << "Failed to read fstab"; + fs_mgr_free_fstab(fstab); + return VERITY_STATE_UNKNOWN; + } + + // Loop through entries looking for ones that vold manages. + for (int i = 0; i < fstab->num_entries; i++) { + if (fs_mgr_is_verified(&fstab->recs[i])) { + std::string block_device = fstab->recs[i].blk_device; + fec::io fh(block_device, O_RDONLY); + if (!fh) { + PLOG(ERROR) << "Could not open block device " << block_device; + rc = VERITY_STATE_UNKNOWN; + break; + } + + fec_verity_metadata metadata; + if (!fh.get_verity_metadata(metadata)) { + LOG(ERROR) << "Couldn't find verity metadata!"; + rc = VERITY_STATE_UNKNOWN; + break; + } + + rc = metadata.disabled ? VERITY_STATE_DISABLED : VERITY_STATE_ENABLED; + } + } + fs_mgr_free_fstab(fstab); + } + + return rc; +} + /* Use AVB to turn verity on/off */ static bool set_avb_verity_enabled_state(AvbOps* ops, bool enable_verity) { std::string ab_suffix = get_ab_suffix();