blob: 7958897a48fbdfe42ca0e4277a7bd4b2df7840c0 [file] [log] [blame]
micky38718f07ac2019-06-10 00:40:50 +02001#!/bin/bash
2#
3# Copyright (C) 2016 The CyanogenMod Project
4# (C) 2018 The Omnirom Project
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19set -e
20
micky38717ab3b32021-05-11 07:52:45 +020021DEVICE=zenfone7
22VENDOR=asus
micky38718f07ac2019-06-10 00:40:50 +020023
micky38717ab3b32021-05-11 07:52:45 +020024# Load extractutils and do some sanity checks
25MY_DIR="${BASH_SOURCE%/*}"
26if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
micky38718f07ac2019-06-10 00:40:50 +020027
micky38717ab3b32021-05-11 07:52:45 +020028CM_ROOT="$MY_DIR"/../../..
29
30HELPER="$CM_ROOT"/vendor/omni/build/tools/extract_utils.sh
31if [ ! -f "$HELPER" ]; then
32 echo "Unable to find helper script at $HELPER"
33 exit 1
34fi
35. "$HELPER"
36
37# Default to sanitizing the vendor folder before extraction
38CLEAN_VENDOR=true
39
40while [ "$1" != "" ]; do
41 case $1 in
42 -p | --path ) shift
43 SRC=$1
44 ;;
45 -s | --section ) shift
46 SECTION=$1
47 CLEAN_VENDOR=false
48 ;;
49 -n | --no-cleanup ) CLEAN_VENDOR=false
50 ;;
51 esac
52 shift
53done
54
55if [ -z "$SRC" ]; then
56 SRC=adb
57fi
58
micky3878c0fd2e2021-06-13 02:52:51 +020059function blob_fixup() {
60 case "${1}" in
61 # Fix xml version
62 system_ext/etc/permissions/vendor.qti.hardware.data.connection-V1.0-java.xml | system_ext/etc/permissions/vendor.qti.hardware.data.connection-V1.1-java.xml)
micky3870dd9ce72021-08-29 16:43:33 +020063 sed -i 's|system/product|system_ext|g' "${2}"
micky3878c0fd2e2021-06-13 02:52:51 +020064 sed -i 's|xml version="2.0"|xml version="1.0"|g' "${2}"
65 ;;
LuK13378e7522b2022-03-24 11:17:21 +010066 vendor/lib64/vendor.qti.hardware.camera.postproc@1.0-service-impl.so)
67 "${SIGSCAN}" -p "13 0A 00 94" -P "1F 20 03 D5" -f "${2}"
68 ;;
micky3878c0fd2e2021-06-13 02:52:51 +020069 esac
70}
71
micky38717ab3b32021-05-11 07:52:45 +020072# Initialize the helper
73setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false "$CLEAN_VENDOR"
74
micky387b9e88d92022-10-27 12:12:50 +020075extract "$MY_DIR"/proprietary-files-vendor.txt "$SRC" "$SECTION"
micky38717ab3b32021-05-11 07:52:45 +020076extract "$MY_DIR"/proprietary-files-product.txt "$SRC" "$SECTION"
77extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
78
79"$MY_DIR"/setup-makefiles.sh