diff --git a/a20/setup.sh b/a20/setup.sh new file mode 100755 index 0000000..fd9473e --- /dev/null +++ b/a20/setup.sh @@ -0,0 +1,20 @@ +VENDOR=$(cat device/samsung/universal7885-common/vendor_name) + +# Generate AndroidProducts.mk +echo "# Auto-Generated by device/samsung/a20/setup.sh" > device/samsung/a20/AndroidProducts.mk +echo "PRODUCT_MAKEFILES += \$(LOCAL_DIR)/"$VENDOR"_a20.mk" >> device/samsung/a20/AndroidProducts.mk + +# Generate _a20.mk +echo "# Auto-Generated by device/samsung/a20/setup.sh" > device/samsung/a20/"$VENDOR"_a20.mk +echo "\$(call inherit-product, device/samsung/a20/full_a20.mk)" >> device/samsung/a20/"$VENDOR"_a20.mk +if test -f vendor/"$VENDOR"/config/common_full_phone.mk && echo "common_full_phone"; then + echo "\$(call inherit-product, vendor/"$VENDOR"/config/common_full_phone.mk)" >> device/samsung/a20/"$VENDOR"_a20.mk +elif test -f vendor/"$VENDOR"/config/common.mk && echo "common"; then + echo "\$(call inherit-product, vendor/"$VENDOR"/config/common.mk)" >> device/samsung/a20/"$VENDOR"_a20.mk +fi +echo "PRODUCT_NAME := "$VENDOR"_a20" >> device/samsung/a20/"$VENDOR"_a20.mk +echo "" >> device/samsung/a20/"$VENDOR"_a20.mk +echo "# Additional Props" >> device/samsung/a20/"$VENDOR"_a20.mk +echo "TARGET_FACE_UNLOCK_SUPPORTED := true" >> device/samsung/a20/"$VENDOR"_a20.mk +echo "TARGET_BOOT_ANIMATION_RES := 720" >> device/samsung/a20/"$VENDOR"_a20.mk + diff --git a/a20e/setup.sh b/a20e/setup.sh new file mode 100755 index 0000000..a81ddb9 --- /dev/null +++ b/a20e/setup.sh @@ -0,0 +1,19 @@ +VENDOR=$(cat device/samsung/universal7885-common/vendor_name) + +# Generate AndroidProducts.mk +echo "# Auto-Generated by device/samsung/a20e/setup.sh" > device/samsung/a20e/AndroidProducts.mk +echo "PRODUCT_MAKEFILES += \$(LOCAL_DIR)/"$VENDOR"_a20e.mk" >> device/samsung/a20e/AndroidProducts.mk + +# Generate _a20e.mk +echo "# Auto-Generated by device/samsung/a20e/setup.sh" > device/samsung/a20e/"$VENDOR"_a20e.mk +echo "\$(call inherit-product, device/samsung/a20e/full_a20e.mk)" >> device/samsung/a20e/"$VENDOR"_a20e.mk +if test -f vendor/"$VENDOR"/config/common_full_phone.mk && echo "common_full_phone"; then + echo "\$(call inherit-product, vendor/"$VENDOR"/config/common_full_phone.mk)" >> device/samsung/a20e/"$VENDOR"_a20e.mk +elif test -f vendor/"$VENDOR"/config/common.mk && echo "common"; then + echo "\$(call inherit-product, vendor/"$VENDOR"/config/common.mk)" >> device/samsung/a20e/"$VENDOR"_a20e.mk +fi +echo "PRODUCT_NAME := "$VENDOR"_a20e" >> device/samsung/a20e/"$VENDOR"_a20e.mk +echo "" >> device/samsung/a20e/"$VENDOR"_a20e.mk +echo "# Additional Props" >> device/samsung/a20e/"$VENDOR"_a20e.mk +echo "TARGET_FACE_UNLOCK_SUPPORTED := true" >> device/samsung/a20e/"$VENDOR"_a20e.mk +echo "TARGET_BOOT_ANIMATION_RES := 720" >> device/samsung/a20e/"$VENDOR"_a20e.mk diff --git a/universal7885-common/vendor_detect/main.cpp b/universal7885-common/vendor_detect/main.cpp new file mode 100644 index 0000000..efc823f --- /dev/null +++ b/universal7885-common/vendor_detect/main.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +using namespace std; +std::vector get_directories(const std::string& s) +{ + std::vector r; + for(auto& p : std::filesystem::recursive_directory_iterator(s)) + if (p.is_directory()) + r.push_back(p.path().string()); + return r; +} +int main(){ + std::vector vendors = get_directories("vendor"); + for (int i = 0; i < vendors.size(); i++){ + std::string name = vendors[i].substr(7, vendors[i].length()); + name = name.substr(0, name.find('/')); + if (name != "qcom" && name != "nxp" && name != "samsung" + && name != "gapps" && name != "google" && + name != "gms" && name != "codeaurora"){ + ofstream output; + output.open("device/samsung/universal7885-common/vendor_name"); + output << name; + output.close(); + } + } + return 0; +} diff --git a/setup.sh b/universal7885-common/vendorsetup.sh old mode 100755 new mode 100644 similarity index 62% rename from setup.sh rename to universal7885-common/vendorsetup.sh index 850b500..7a78eab --- a/setup.sh +++ b/universal7885-common/vendorsetup.sh @@ -1,12 +1,21 @@ -cd ../.. git clone git@github.com:eurekadevelopment/android_vendor_samsung_a20_r.git vendor/samsung -b master #git clone git@github.com:eurekadevelopment/android_device_samsung_a20_r.git device/samsung +rm -rf hardware/samsung git clone git@github.com:eurekadevelopment/android_hardware_samsung.git hardware/samsung -b AOSP-11 -rm -rf hardware/custom -git clone git@github.com:eurekadevelopment/Eureka-Kernel-Exynos7885-Q-R.git kernel/samsung/exynos7885 --depth=1 -b R7.5_rom +git clone git@github.com:eurekadevelopment/Eureka-Kernel-Exynos7885-Q-R-S-private.git kernel/samsung/exynos7885 --depth=1 -b R8.0_rom git clone https://github.com/lineageos/android_hardware_samsung_nfc hardware/samsung/nfc git clone https://github.com/lineageos/android_hardware_samsung_slsi_libbt hardware/samsung_slsi/libbt git clone https://github.com/lineageos/android_hardware_samsung_slsi_scsc_wifibt_wifi_hal hardware/samsung_slsi/scsc_wifibt/wifi_hal git clone https://github.com/lineageos/android_hardware_samsung_slsi_scsc_wifibt_wpa_supplicant_lib hardware/samsung_slsi/scsc_wifibt/wpa_supplicant_lib -git clone https://github.com/lineageos/android_device_samsung_slsi_sepolicy device/samsung_slsi/sepolicy -git clone https://github.com/LineageOS/android_hardware_lineage_interfaces.git hardware/lineage/interfaces +if ! test -f vendor_detect; then +clang++ device/samsung/universal7885-common/vendor_detect/main.cpp -o vendor_detect -std=c++17 +fi +if ! test -f device/samsung/universal7885-common/vendor_name; then +touch device/samsung/universal7885-common/vendor_name +fi +./vendor_detect +echo "Generating A20 Makefiles" +./device/samsung/a20/setup.sh +echo "Generating A20e Makefiles" +./device/samsung/a20e/setup.sh +