diff --git a/extract-files.sh b/extract-files.sh index 1463e49fec4a9c79e359ef97fae5c09416797aed..cfca3100217a7ab58b35b1d1ff931201f0e9b6ea 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,60 +1,64 @@ #!/bin/bash # -# Copyright (C) 2018 The LineageOS Project +# Copyright (C) 2018-2020 The LineageOS Project # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# SPDX-License-Identifier: Apache-2.0 # -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. set -e -VENDOR=samsung DEVICE_COMMON=universal8890-common +VENDOR=samsung # Load extractutils and do some sanity checks MY_DIR="${BASH_SOURCE%/*}" if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi -LINEAGE_ROOT="$MY_DIR"/../../.. +ANDROID_ROOT="${MY_DIR}/../../.." -HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh -if [ ! -f "$HELPER" ]; then - echo "Unable to find helper script at $HELPER" +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" exit 1 fi -. "$HELPER" - -if [ $# -eq 0 ]; then - SRC=adb -else - if [ $# -eq 1 ]; then - SRC=$1 - else - echo "$0: bad number of arguments" - echo "" - echo "usage: $0 [PATH_TO_EXPANDED_ROM]" - echo "" - echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from" - echo "the device using adb pull." - exit 1 - fi +source "${HELPER}" + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +KANG= +SECTION= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" fi # Initialize the helper -setup_vendor "$DEVICE_COMMON" "$VENDOR" "$LINEAGE_ROOT" true +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" -extract "$MY_DIR"/proprietary-files.txt "$SRC" +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" # Fix proprietary blobs -BLOB_ROOT="$LINEAGE_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary +BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary sed -i -z "s/ seclabel u:r:gpsd:s0\n//" $BLOB_ROOT/vendor/etc/init/init.gps.rc sed -i -z "s/-g@android:wpa_wlan0\n class main\n/-g@android:wpa_wlan0\n interface android.hardware.wifi.supplicant@1.0::ISupplicant default\n interface android.hardware.wifi.supplicant@1.1::ISupplicant default\n interface android.hardware.wifi.supplicant@1.2::ISupplicant default\n class main\n/" $BLOB_ROOT/vendor/etc/init/wifi.rc @@ -73,4 +77,4 @@ sed -i "s|system/etc|vendor/etc|g" $BLOB_ROOT/vendor/lib/libsec-ril.so sed -i "s|system/etc|vendor/etc|g" $BLOB_ROOT/vendor/lib64/libsec-ril-dsds.so sed -i "s|system/etc|vendor/etc|g" $BLOB_ROOT/vendor/lib64/libsec-ril.so -"$MY_DIR"/setup-makefiles.sh +"${MY_DIR}/setup-makefiles.sh" diff --git a/proprietary-files.txt b/proprietary-files.txt index 3fdd5c6a115ee04fff0aff673af4c78a3c099a3c..be71eeccce8cc46543e313f6b1887f0287e2a90e 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1,5 +1,5 @@ -# Files are from N935FXXS7CTJ2 unless pinned -# Vendor security patch level 2020-11-01 +# Files are from N935FXXU8CVG2 unless pinned +# Vendor security patch level 2021-04-01 # AptX - from crosshatch - QP1A.190711.020 product/lib64/libaptX_encoder.so|df1c89d7af1bb35808d5fe3496b04ba066c10cbc diff --git a/recovery/recovery_updater.cpp b/recovery/recovery_updater.cpp index 3bfcdfa688e8dea3e3e9b78ccdb2877930778b41..19b4e04c1cc273eec9393665438f10163afb14ad 100644 --- a/recovery/recovery_updater.cpp +++ b/recovery/recovery_updater.cpp @@ -68,15 +68,15 @@ Value *VerifyBootloaderMin(const char *name, State *state, bool isHero2 = bootloader.substr(0, 4).compare("G935") == 0; if (bootloader.substr(4, 1).compare("F") == 0) { /* matches F and FD */ - ret = compareBootloader(bootloader, isHero2 ? "G935FXXU8ETI2" : "G930FXXU8ETI2"); + ret = compareBootloader(bootloader, isHero2 ? "G935FXXU8EVH3" : "G930FXXU8EVG3"); } else if(bootloader.substr(4, 1).compare("K") == 0) { - ret = compareBootloader(bootloader, isHero2 ? "G935KKKU3ETJ1" : "G930KKKU3ETJ1"); + ret = compareBootloader(bootloader, isHero2 ? "G935KKKU3EVG2" : "G930KKKU3EVG2"); } else if(bootloader.substr(4, 1).compare("L") == 0) { - ret = compareBootloader(bootloader, isHero2 ? "G935LKLU3ETJ1" : "G930LKLU3ETJ1"); + ret = compareBootloader(bootloader, isHero2 ? "G935LKLU3EVG2" : "G930LKLU3EVG2"); } else if(bootloader.substr(4, 1).compare("S") == 0) { - ret = compareBootloader(bootloader, isHero2 ? "G935SKSU3ETJ1" : "G930SKSU3ETJ1"); + ret = compareBootloader(bootloader, isHero2 ? "G935SKSU3EVG2" : "G930SKSU3EVG2"); } else if(bootloader.substr(4, 2).compare("W8") == 0) { - ret = compareBootloader(bootloader, isHero2 ? "G935W8VLS8CTI1" : "G930W8VLS8CTI1"); + ret = compareBootloader(bootloader, isHero2 ? "G935W8VLU8CVG1" : "G930W8VLU8CVG1"); } return StringValue(std::to_string(ret)); diff --git a/setup-makefiles.sh b/setup-makefiles.sh index b6d03ee9fcf633ac70eeb478962e0b88a7a0734d..3e5505e7ee66319aada4576affd2e1d83389d57c 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -1,51 +1,41 @@ #!/bin/bash -# Copyright (C) 2017-2019 The LineageOS Project # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright (C) 2017-2021 The LineageOS Project # -# http://www.apache.org/licenses/LICENSE-2.0 +# SPDX-License-Identifier: Apache-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +set -e -VENDOR=samsung DEVICE_COMMON=universal8890-common - -export INITIAL_COPYRIGHT_YEAR=2019 +VENDOR=samsung # Load extractutils and do some sanity checks MY_DIR="${BASH_SOURCE%/*}" if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi -LINEAGE_ROOT="$MY_DIR"/../../.. +ANDROID_ROOT="${MY_DIR}/../../.." -HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh -if [ ! -f "$HELPER" ]; then - echo "Unable to find helper script at $HELPER" +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" exit 1 fi -. "$HELPER" +source "${HELPER}" # Initialize the helper -setup_vendor "$DEVICE_COMMON" "$VENDOR" "$LINEAGE_ROOT" true +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true -# Copyright headers and guards +# Warning headers and guards write_headers "herolte hero2lte" -# The standard blobs -write_makefiles "$MY_DIR"/proprietary-files.txt true +write_makefiles "${MY_DIR}/proprietary-files.txt" true ################################################################################################### # CUSTOM PART START # ################################################################################################### OUTDIR=vendor/$VENDOR/$DEVICE_COMMON -(cat << EOF) >> $LINEAGE_ROOT/$OUTDIR/Android.mk +(cat << EOF) >> $ANDROID_ROOT/$OUTDIR/Android.mk include \$(CLEAR_VARS) EGL_LIBS := libGLES_mali.so libOpenCL.so libOpenCL.so.1 libOpenCL.so.1.1