extract-files.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2016 The CyanogenMod Project
  4. # Copyright (C) 2017-2021 The LineageOS 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. set -e
  19. export GAPPS_COMMON=common
  20. export VENDOR=gapps
  21. # Load extract_utils and do some sanity checks
  22. MY_DIR="${BASH_SOURCE%/*}"
  23. if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
  24. ANDROID_ROOT="$MY_DIR/../.."
  25. export TARGET_ENABLE_CHECKELF=true
  26. HELPER="$ANDROID_ROOT/tools/extract-utils/extract_utils.sh"
  27. if [ ! -f "$HELPER" ]; then
  28. echo "Unable to find helper script at $HELPER"
  29. exit 1
  30. fi
  31. . "$HELPER"
  32. SRC=$1
  33. if [ -z "$SRC" ]; then
  34. echo "Path to system dump not specified! Specify one with --path"
  35. exit 1
  36. fi
  37. # Initialize the helper for common gapps
  38. setup_vendor "$GAPPS_COMMON" "$VENDOR" "$ANDROID_ROOT"
  39. extract "$MY_DIR"/proprietary-files-common.txt "$SRC"
  40. extract "$MY_DIR"/proprietary-files-common-nongrouper.txt "$SRC"
  41. "$MY_DIR"/setup-makefiles.sh