diff --git a/.github/workflows/update_fp.yml b/.github/workflows/update_fp.yml deleted file mode 100644 index f37cd94..0000000 --- a/.github/workflows/update_fp.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: check fp update - -on: - schedule: - - cron: '0 7 * * 2,5' - workflow_dispatch: - -jobs: - update: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Install dependencies - run: bash universal7885-common/host-tools/update_fp.sh diff --git a/a10/BoardConfig.mk b/a10/BoardConfig.mk index c3f9858..b146f0c 100644 --- a/a10/BoardConfig.mk +++ b/a10/BoardConfig.mk @@ -15,6 +15,9 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3556769792 # 3.31GB BOARD_CACHEIMAGE_PARTITION_SIZE := 157286400 BOARD_VENDORIMAGE_PARTITION_SIZE := 394264576 +# SPL +VENDOR_SECURITY_PATCH := 2021-12-01 + # Inherit common board flags include device/samsung/universal7885-common/BoardConfigCommon.mk diff --git a/a10/common.mk b/a10/common.mk index a89dbbe..f4aaa08 100644 --- a/a10/common.mk +++ b/a10/common.mk @@ -18,3 +18,7 @@ TARGET_SCREEN_WIDTH := 720 PRODUCT_PACKAGES += \ fstab.exynos7884B +BUILD_FINGERPRINT := "samsung/a10kx/a10:11/RP1A.200720.012/A105NKOU5CUL4:user/release-keys" + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="a10kx-user 11 RP1A.200720.012 A105NKOU5CUL4 release-keys" diff --git a/a20/BoardConfig.mk b/a20/BoardConfig.mk index 67d621d..33a29f3 100644 --- a/a20/BoardConfig.mk +++ b/a20/BoardConfig.mk @@ -18,4 +18,7 @@ BOARD_VENDORIMAGE_PARTITION_SIZE := 452984832 # Inherit common board flags include device/samsung/universal7885-common/BoardConfigCommon.mk +# SPL +VENDOR_SECURITY_PATCH := 2021-06-01 + TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop diff --git a/a20/device.mk b/a20/device.mk index de7b6f6..f6cf36a 100644 --- a/a20/device.mk +++ b/a20/device.mk @@ -9,9 +9,6 @@ $(call inherit-product, vendor/samsung/a20/a20-vendor.mk) $(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) -# Derp -DERP_BUILDTYPE := Official - # USB PRODUCT_PACKAGES += \ android.hardware.usb-service.samsung @@ -27,3 +24,8 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service + +BUILD_FINGERPRINT := "samsung/a20ub/a20:11/RP1A.200720.012/A205GUBU9CUF4:user/release-keys" + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="a20ub-user 11 RP1A.200720.012 A205GUBU9CUF4 release-keys" diff --git a/a20e/BoardConfig.mk b/a20e/BoardConfig.mk index 216907a..9483b0d 100644 --- a/a20e/BoardConfig.mk +++ b/a20e/BoardConfig.mk @@ -18,4 +18,7 @@ BOARD_VENDORIMAGE_PARTITION_SIZE := 452984832 # Inherit common board flags include device/samsung/universal7885-common/BoardConfigCommon.mk +# SPL +VENDOR_SECURITY_PATCH := 2022-01-01 + TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop diff --git a/a30/BoardConfig.mk b/a30/BoardConfig.mk index cf6f426..689e0f9 100644 --- a/a30/BoardConfig.mk +++ b/a30/BoardConfig.mk @@ -18,4 +18,7 @@ BOARD_VENDORIMAGE_PARTITION_SIZE := 452984832 # Inherit common board flags include device/samsung/universal7885-common/BoardConfigCommon.mk +# SPL +VENDOR_SECURITY_PATCH := 2022-10-01 + TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop diff --git a/a30/device.mk b/a30/device.mk index 0828a9a..4fbd8a9 100644 --- a/a30/device.mk +++ b/a30/device.mk @@ -26,3 +26,8 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service + +BUILD_FINGERPRINT := "samsung/a30cis/a30:11/RP1A.200720.012/A305FNXXU6CUI2:user/release-keys" + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="a30cis-user 11 RP1A.200720.012 A305FNXXU6CUI2 release-keys" diff --git a/a30s/BoardConfig.mk b/a30s/BoardConfig.mk index 012cdad..3767edb 100644 --- a/a30s/BoardConfig.mk +++ b/a30s/BoardConfig.mk @@ -24,4 +24,7 @@ TARGET_SURFACEFLINGER_UDFPS_LIB := //$(DEVICE_PATH):libudfps_extension.a30s # Inherit common board flags include device/samsung/universal7885-common/BoardConfigCommon.mk +# SPL +VENDOR_SECURITY_PATCH := 2021-11-01 + TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop diff --git a/a30s/device.mk b/a30s/device.mk index d588d3e..97c363d 100644 --- a/a30s/device.mk +++ b/a30s/device.mk @@ -28,3 +28,8 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service + +BUILD_FINGERPRINT := "samsung/a30sub/a30s:11/RP1A.200720.012/A307GUBS4CUJ1:user/release-keys" + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="a30sub-user 11 RP1A.200720.012 A307GUBS4CUJ1 release-keys" diff --git a/a40/BoardConfig.mk b/a40/BoardConfig.mk index dda34dd..3f6e1cc 100644 --- a/a40/BoardConfig.mk +++ b/a40/BoardConfig.mk @@ -18,4 +18,7 @@ BOARD_VENDORIMAGE_PARTITION_SIZE := 452984832 # Inherit common board flags include device/samsung/universal7885-common/BoardConfigCommon.mk +# SPL +VENDOR_SECURITY_PATCH := 2022-02-01 + TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop diff --git a/a40/device.mk b/a40/device.mk index 6828027..c2ef6ae 100644 --- a/a40/device.mk +++ b/a40/device.mk @@ -26,3 +26,8 @@ PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-service + +BUILD_FINGERPRINT := "samsung/a40skt/a40:11/RP1A.200720.012/A405SKSU5CVB1:user/release-keys" + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="a40skt-user 11 RP1A.200720.012 A405SKSU5CVB1 release-keys" diff --git a/universal7885-common/BoardConfigCommon.mk b/universal7885-common/BoardConfigCommon.mk index 1063f7f..79bcd53 100644 --- a/universal7885-common/BoardConfigCommon.mk +++ b/universal7885-common/BoardConfigCommon.mk @@ -132,7 +132,6 @@ SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \ # Vendor TARGET_COPY_OUT_VENDOR := vendor -VENDOR_SECURITY_PATCH := 2023-02-05 # Wifi BOARD_WLAN_DEVICE := slsi diff --git a/universal7885-common/fingerprint.mk b/universal7885-common/fingerprint.mk deleted file mode 100644 index 961d579..0000000 --- a/universal7885-common/fingerprint.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Autogenerated by BuildFpUpdater.cc -PRODUCT_GMS_CLIENTID_BASE := android-google - -BUILD_FINGERPRINT := "google/cheetah/cheetah:13/TQ3A.230901.001/10750268:user/release-keys" - -PRODUCT_BUILD_PROP_OVERRIDES += \ - PRIVATE_BUILD_DESC="cheetah-user 13 TQ3A.230901.001 10750268 release-keys" diff --git a/universal7885-common/host-tools/.gitignore b/universal7885-common/host-tools/.gitignore deleted file mode 100644 index 7e65a78..0000000 --- a/universal7885-common/host-tools/.gitignore +++ /dev/null @@ -1 +0,0 @@ -updater diff --git a/universal7885-common/host-tools/BuildFpUpdater.cc b/universal7885-common/host-tools/BuildFpUpdater.cc deleted file mode 100644 index 38c4b9a..0000000 --- a/universal7885-common/host-tools/BuildFpUpdater.cc +++ /dev/null @@ -1,190 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include - -// Tracking Evolution-X's PixelPropsUtils -constexpr const char *UPSTREAM_URL = "https://raw.githubusercontent.com/Evolution-X/frameworks_base/tiramisu/core/java/com/android/internal/util/evolution/PixelPropsUtils.java"; - -// Use Pixel 7's fingerprint -constexpr const char *DEVICE_CODENAME = "cheetah"; -constexpr const char *DEVICE_VENDOR = "google"; - -constexpr bool STD_STRING_CONTAINS(const std::string& str, const std::string& search) { - return str.find(search) != std::string::npos; -} - -struct __attribute__((aligned(64))) result { - bool vaild = false; - std::string data; -}; - -using result_t = struct result; - -struct __attribute__((aligned(128))) build_data { - std::string vendor; - std::string codename; - int android_version = -1; - std::string buildid; - std::string vendordata; -}; - -static auto WriteCallback(void *contents, size_t size, size_t nmemb, - void *userp) { - static_cast(userp)->append(static_cast(contents), size * nmemb); - return size * nmemb; -} - -static auto splitNewLines (const std::string& buffer) -{ - auto result = std::vector{}; - auto sstream = std::stringstream{buffer}; - - for (std::string line; std::getline(sstream, line, '\n');) { - result.push_back(line); - } - - return result; -} - -static auto checkIfVaild(const std::string& line) -{ - auto res = std::make_unique(); - - // Is it related to ? - if (!STD_STRING_CONTAINS(line, DEVICE_CODENAME)) { - return res; - } - - // Remove non-fingerprint stuff. - // It should be //.. format - if (!STD_STRING_CONTAINS(line, DEVICE_VENDOR)) { - return res; - } - - res->vaild = true; - res->data = line; - return res; -} - -static auto parseJavaFile(const std::string& buffer) -{ - auto kLines = splitNewLines(buffer); - for (const auto &line : kLines) { - auto res = checkIfVaild(line); - if (!res->vaild) { - res.reset(); - } else { - std::string data = res->data; - res->data = data.substr(data.find(DEVICE_VENDOR)); - data = res->data; - res->data = data.substr(0, data.find_last_of('"')); - return res; - } - } - // We failed to find the line. return nothing. - return std::make_unique(); -} - -static auto dirname(const std::string& arg) -{ - auto idx = arg.find_last_of("/\\"); - return arg.substr(0, idx); -} - -static auto fromBuildDataToFP(struct build_data *data) -{ - const char *fmt = "%s/%s/%s:%d/%s/%s:user/release-keys"; - const int size = std::snprintf(nullptr, 0, fmt, data->vendor.c_str(), data->codename.c_str(), data->codename.c_str(), data->android_version, data->buildid.c_str(), data->vendordata.c_str()); - std::vector buf(size + 1); - (void) std::snprintf(buf.data(), buf.size(), fmt, data->vendor.c_str(), data->codename.c_str(), data->codename.c_str(), data->android_version, data->buildid.c_str(), data->vendordata.c_str()); - - return std::string(buf.begin(), buf.end()); -} - -static auto fromBuildDataToDesc(struct build_data *data) -{ - const char *fmt = "%s-user %d %s %s release-keys"; - const int size = std::snprintf(nullptr, 0, fmt, data->codename.c_str(), data->android_version, data->buildid.c_str(), data->vendordata.c_str()); - std::vector buf(size + 1); - (void) std::snprintf(buf.data(), buf.size(), fmt, data->codename.c_str(), data->android_version, data->buildid.c_str(), data->vendordata.c_str()); - - return std::string(buf.begin(), buf.end()); -} - -static auto serialize(const std::string& fpdata) -{ - auto split = std::vector{}; - auto ss = std::stringstream{fpdata}; - auto data = std::make_unique(); - for (std::string line; std::getline(ss, line, '/');) { - split.push_back(line); - } - - // Fingerprint: "//://:user/release-keys" - data->vendor = split[0]; - std::string mixed = split[2]; - auto idx = mixed.find(':'); - data->codename = mixed.substr(0, idx); - data->android_version = stoi(mixed.substr(idx + 1)); - data->buildid = split[3]; - mixed = split[4]; - idx = mixed.find(':'); - data->vendordata = mixed.substr(0, idx); - return data; -} - -static void apply(const std::string& path, const std::unique_ptr data) -{ - (void) std::remove(path.c_str()); - std::ofstream file(path); - if (file.is_open()) { - std::string str; - file << "# Autogenerated by " << __FILE__ << std::endl; - file << "PRODUCT_GMS_CLIENTID_BASE := android-google" << std::endl; - file << std::endl; - str = fromBuildDataToFP(data.get()); - str.resize(str.find('\0')); - file << "BUILD_FINGERPRINT := \"" << str << "\"" << std::endl; - file << std::endl; - file << "PRODUCT_BUILD_PROP_OVERRIDES += \\" << std::endl; - str = fromBuildDataToDesc(data.get()); - str.resize(str.find('\0')); - file << "\tPRIVATE_BUILD_DESC=\"" << str << "\"" << std::endl; - file.close(); - } -} - -int main(int argc, const char **argv) { - CURL *curl = nullptr; - CURLcode res; - std::string readBuffer; - const std::string execDir = dirname(argv[0]); - - curl = curl_easy_init(); - if (curl != nullptr) { - curl_easy_setopt(curl, CURLOPT_URL, UPSTREAM_URL); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); - res = curl_easy_perform(curl); - curl_easy_cleanup(curl); - if (res != 0u) { - return res; - } - } - - auto parseRes = parseJavaFile(readBuffer); - if (!parseRes->vaild) { - parseRes.reset(); - return 1; - } - - auto build = std::move(serialize(parseRes->data)); - parseRes.reset(); - apply(execDir + "/../fingerprint.mk", std::move(build)); - return 0; -} diff --git a/universal7885-common/host-tools/update_fp.sh b/universal7885-common/host-tools/update_fp.sh deleted file mode 100755 index e79932a..0000000 --- a/universal7885-common/host-tools/update_fp.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" -git config --local user.name "github-actions[bot]" - -sudo apt update -sudo apt install -y libcurl4-openssl-dev clang -cd universal7885-common/host-tools/ -clang++ BuildFpUpdater.cc -o updater -lcurl -./updater -git add .. -git commit -m "universal7885: Update fp [`date`]" -git push diff --git a/universal7885-common/universal7885-common.mk b/universal7885-common/universal7885-common.mk index ca65cc5..2544b12 100644 --- a/universal7885-common/universal7885-common.mk +++ b/universal7885-common/universal7885-common.mk @@ -3,15 +3,12 @@ ifeq ($(TARGET_LOCAL_ARCH),arm64) $(call inherit-product, vendor/samsung/universal7885-common/universal7885-common-vendor.mk) endif -# Build Fingerprints -$(call inherit-product, $(LOCAL_PATH)/fingerprint.mk) +# Client Id base +PRODUCT_GMS_CLIENTID_BASE := android-samsung # Allow Copying of apks. PRODUCT_BROKEN_VERIFY_USES_LIBRARIES := true -# Derp -USE_LEGACY_BOOTANIMATION := true - # Disable Postrender Cleanup TARGET_DISABLE_POSTRENDER_CLEANUP := true