diff --git a/carriersettings-extractor/README.md b/carriersettings-extractor/README.md index 37f8bf7..c556544 100644 --- a/carriersettings-extractor/README.md +++ b/carriersettings-extractor/README.md @@ -8,22 +8,12 @@ For a description of each APN and carrier setting, refer to the doc comments in ## Dependencies - * curl - required, for android-prepare-vendor - * e2fsprogs (debugfs) - required, for android-prepare-vendor - * git - required, for android-prepare-vendor * protobuf-compiler (protoc) - optional, see below * python3-protobuf - required ## Usage -Download the [carrier ID database](https://source.android.com/devices/tech/config/carrierid) from AOSP. - - ./download_carrier_list.sh - -Download a [Pixel factory image](https://developers.google.com/android/images) and extract the CarrierSettings protobuf files. This script will download android-prepare-vendor and copy the directory `CarrierSettings` containing the protobuf files. - - DEVICE=crosshatch BUILD=QQ3A.200605.001 ./download_factory_img.sh - +Download a [Pixel factory image](https://developers.google.com/android/images) and extract the CarrierSettings protobuf files. Convert `CarrierSettings/*.pb` to `apns-full-conf.xml` and `vendor.xml`. ./carriersettings_extractor.py CarrierSettings diff --git a/carriersettings-extractor/download_carrier_list.sh b/carriersettings-extractor/download_carrier_list.sh deleted file mode 100755 index fb07e95..0000000 --- a/carriersettings-extractor/download_carrier_list.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -curl -fS \ - 'https://android.googlesource.com/platform/packages/providers/TelephonyProvider/+/master/assets/latest_carrier_id/carrier_list.pb?format=TEXT' | \ - base64 --decode > carrier_list.pb diff --git a/carriersettings-extractor/download_factory_img.sh b/carriersettings-extractor/download_factory_img.sh deleted file mode 100755 index 767ba6b..0000000 --- a/carriersettings-extractor/download_factory_img.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -TMPDIR="$(mktemp -d "${TMPDIR:-tmp}.XXXXXX")" -trap "rm -rf '${TMPDIR}'" EXIT -export TMPDIR - -git clone https://github.com/GrapheneOS/android-prepare-vendor --branch=11 ${TMPDIR}/android-prepare-vendor-11 --depth=1 --single-branch -"${TMPDIR}/android-prepare-vendor-11/scripts/download-nexus-image.sh" \ - --device "$DEVICE" --buildID "$BUILD" --output "$TMPDIR" --yes -factory_image="$(find "$TMPDIR" -iname "*$DEVICE*$BUILD-factory*.tgz" -or \ - -iname "*$DEVICE*$BUILD-factory*.zip" | head -1)" -PATH="$PATH:/sbin:${TMPDIR}/android-prepare-vendor-11/hostTools/$(uname -s)/bin" \ - "${TMPDIR}/android-prepare-vendor-11/scripts/extract-factory-images.sh" \ - --input "$factory_image" --output "$TMPDIR" \ - --conf-file "${TMPDIR}/android-prepare-vendor-11/${DEVICE}/config.json" \ - --debugfs -mv "$(dirname "$(find "${TMPDIR}" -name carrier_list.pb | head -1)")" . diff --git a/carriersettings-extractor/utils/update_device_repos.sh b/carriersettings-extractor/utils/update_device_repos.sh deleted file mode 100755 index 71e3cdf..0000000 --- a/carriersettings-extractor/utils/update_device_repos.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -[ -f carrier_list.pb ] || ./download_carrier_list.sh - -for DEVICE in walleye taimen crosshatch bonito coral; do - if [ "$DEVICE" = sunfish ]; then - BUILD=RP1A.200720.011 - else - BUILD=RP1A.200720.009 - fi - - if [ "$DEVICE" = walleye ]; then - repo_dir="../device_google_muskie" - else - repo_dir="../device_google_${DEVICE}" - fi - [ -d "$repo_dir" ] - - DEVICE="$DEVICE" BUILD="$BUILD" ./download_factory_img.sh - ./carriersettings_extractor.py CarrierSettings - mv apns-full-conf.xml "${repo_dir}/apns-full-conf.xml" - rm -r CarrierSettings - rm vendor.xml - - ( - cd "$repo_dir" - git checkout -b apns 2> /dev/null || git checkout apns - git fetch origin - git reset origin/11 - git add apns-full-conf.xml '*.mk' - git commit -m "Include APNs from CarrierSettings - -Generated by carriersettings-extractor from ${DEVICE}-${BUILD}" - ) -done