carriersettings-extractor: Remove unnecessary files, update README
Change-Id: I4d0fe81dda9fb81a72e4e6149aed6a7882f0a17f
This commit is contained in:
committed by
Michael Bestas
parent
37fa6fe56c
commit
42c8ecf88b
@@ -8,22 +8,12 @@ For a description of each APN and carrier setting, refer to the doc comments in
|
|||||||
|
|
||||||
## Dependencies
|
## 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
|
* protobuf-compiler (protoc) - optional, see below
|
||||||
* python3-protobuf - required
|
* python3-protobuf - required
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Download the [carrier ID database](https://source.android.com/devices/tech/config/carrierid) from AOSP.
|
Download a [Pixel factory image](https://developers.google.com/android/images) and extract the CarrierSettings protobuf files.
|
||||||
|
|
||||||
./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
|
|
||||||
|
|
||||||
Convert `CarrierSettings/*.pb` to `apns-full-conf.xml` and `vendor.xml`.
|
Convert `CarrierSettings/*.pb` to `apns-full-conf.xml` and `vendor.xml`.
|
||||||
|
|
||||||
./carriersettings_extractor.py CarrierSettings
|
./carriersettings_extractor.py CarrierSettings
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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)")" .
|
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user