anestisb / android-prepare-vendor

Set of scripts to automate AOSP compatible vendor blobs generation from factory images
348 stars 155 forks source link

Image download failes #126

Closed jotasi closed 6 years ago

jotasi commented 6 years ago

I'm experiencing some problems with the scripts. After accepting the Terms and Conditions, I get the following error message:

[-] Image URL not found
[-] Images download failed

Enabling the debug option, I get the following output:

+++ dirname vendor/android-prepare-vendor/execute-all.sh
++ cd vendor/android-prepare-vendor
++ pwd
+ readonly SCRIPTS_ROOT=/tmp/vendor/android-prepare-vendor
+ SCRIPTS_ROOT=/tmp/vendor/android-prepare-vendor
++ mktemp -d /tmp/android_prepare_vendor.XXXXXX
+ readonly TMP_WORK_DIR=/tmp/android_prepare_vendor.kPnTek
+ TMP_WORK_DIR=/tmp/android_prepare_vendor.kPnTek
+ SYS_TOOLS=("mkdir" "dirname" "wget" "mount" "shasum")
+ declare -a SYS_TOOLS
++ uname -s
+ readonly HOST_OS=Linux
+ HOST_OS=Linux
+ readonly REALPATH_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/realpath.sh
+ REALPATH_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/realpath.sh
+ readonly CONSTS_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/constants.sh
+ CONSTS_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/constants.sh
+ readonly COMMON_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/common.sh
+ COMMON_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/common.sh
+ readonly DOWNLOAD_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/download-nexus-image.sh
+ DOWNLOAD_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/download-nexus-image.sh
+ readonly EXTRACT_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/extract-factory-images.sh
+ EXTRACT_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/extract-factory-images.sh
+ readonly GEN_BLOBS_LIST_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/gen-prop-blobs-list.sh
+ GEN_BLOBS_LIST_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/gen-prop-blobs-list.sh
+ readonly REPAIR_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/system-img-repair.sh
+ REPAIR_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/system-img-repair.sh
+ readonly VGEN_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/generate-vendor.sh
+ VGEN_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/generate-vendor.sh
+ readonly LC_BIN=/tmp/vendor/android-prepare-vendor/hostTools/Linux/bin
+ LC_BIN=/tmp/vendor/android-prepare-vendor/hostTools/Linux/bin
+ trap 'abort 1' SIGINT SIGTERM
+ . /tmp/vendor/android-prepare-vendor/scripts/realpath.sh
++ set -e
+ . /tmp/vendor/android-prepare-vendor/scripts/constants.sh
++ [[ /tmp/vendor/android-prepare-vendor/scripts/constants.sh == \v\e\n\d\o\r\/\a\n\d\r\o\i\d\-\p\r\e\p\a\r\e\-\v\e\n\d\o\r\/\e\x\e\c\u\t\e\-\a\l\l\.\s\h ]]
++ SUPPORTED_DEVICES=("bullhead" "flounder" "angler" "sailfish" "marlin" "walleye" "taimen")
++ declare -ra SUPPORTED_DEVICES
++ readonly NID_URL=https://google.com
++ NID_URL=https://google.com
++ readonly GURL=https://developers.google.com/android/nexus/images
++ GURL=https://developers.google.com/android/nexus/images
++ readonly TOSURL=https://developers.google.com/profile/acknowledgeNotification
++ TOSURL=https://developers.google.com/profile/acknowledgeNotification
++ readonly 'L_OATDUMP_URL_API23=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21490&authkey=ACA4f4Zvs3Tb_SY'
++ L_OATDUMP_URL_API23='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21490&authkey=ACA4f4Zvs3Tb_SY'
++ readonly 'D_OATDUMP_URL_API23=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21493&authkey=AJ0rWu5Ci8tQNLY'
++ D_OATDUMP_URL_API23='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21493&authkey=AJ0rWu5Ci8tQNLY'
++ readonly 'L_OATDUMP_URL_API24=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21492&authkey=AE4uqwH-THvvkSQ'
++ L_OATDUMP_URL_API24='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21492&authkey=AE4uqwH-THvvkSQ'
++ readonly 'D_OATDUMP_URL_API24=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21491&authkey=AHvCaYwFBPYD4Fs'
++ D_OATDUMP_URL_API24='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21491&authkey=AHvCaYwFBPYD4Fs'
++ readonly 'L_OATDUMP_URL_API25=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21503&authkey=AKDpBAzhzum6d7w'
++ L_OATDUMP_URL_API25='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21503&authkey=AKDpBAzhzum6d7w'
++ readonly 'D_OATDUMP_URL_API25=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21504&authkey=AC5YFNSAZ31-W3o'
++ D_OATDUMP_URL_API25='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21504&authkey=AC5YFNSAZ31-W3o'
++ readonly 'L_OATDUMP_URL_API26=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21557&authkey=AG47qhXu164sYwc'
++ L_OATDUMP_URL_API26='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21557&authkey=AG47qhXu164sYwc'
++ readonly 'D_OATDUMP_URL_API26=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21561&authkey=ABu-oqJbQDwQ-ZQ'
++ D_OATDUMP_URL_API26='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21561&authkey=ABu-oqJbQDwQ-ZQ'
++ readonly 'L_OATDUMP_URL_API26_2=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21569&authkey=AG5PlexJR0YMLr0'
++ L_OATDUMP_URL_API26_2='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21569&authkey=AG5PlexJR0YMLr0'
++ readonly 'D_OATDUMP_URL_API26_2=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21570&authkey=AJrlrh0v2GUvxow'
++ D_OATDUMP_URL_API26_2='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21570&authkey=AJrlrh0v2GUvxow'
++ readonly 'L_OATDUMP_URL_API27=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21566&authkey=AKWYYxBfd7NMW_k'
++ L_OATDUMP_URL_API27='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21566&authkey=AKWYYxBfd7NMW_k'
++ readonly 'D_OATDUMP_URL_API27=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21567&authkey=AF-cDubRkZdjRxY'
++ D_OATDUMP_URL_API27='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21567&authkey=AF-cDubRkZdjRxY'
++ readonly L_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ L_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ readonly D_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ D_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ readonly L_OATDUMP_API24_SIG=1f99e7d0f2894cfe52fb7f2a24d5076f217977cbb1a46fafdf5ea38b0a11adce
++ L_OATDUMP_API24_SIG=1f99e7d0f2894cfe52fb7f2a24d5076f217977cbb1a46fafdf5ea38b0a11adce
++ readonly D_OATDUMP_API24_SIG=4a7f5614eb04d9bea85bfa05853523843f9cc80a64eab4c98efed2f70ed3d90e
++ D_OATDUMP_API24_SIG=4a7f5614eb04d9bea85bfa05853523843f9cc80a64eab4c98efed2f70ed3d90e
++ readonly L_OATDUMP_API25_SIG=8b8cd18f08afd00fc6bf33d5b7f5be4faab9f39849b258bade5d15c3e5f33ce8
++ L_OATDUMP_API25_SIG=8b8cd18f08afd00fc6bf33d5b7f5be4faab9f39849b258bade5d15c3e5f33ce8
++ readonly D_OATDUMP_API25_SIG=97f26b40cdc1fb2b5e5babe7ff8c63b70e7d3a3ab8dee19b035bbb0fdfa5477e
++ D_OATDUMP_API25_SIG=97f26b40cdc1fb2b5e5babe7ff8c63b70e7d3a3ab8dee19b035bbb0fdfa5477e
++ readonly L_OATDUMP_API26_SIG=d8c08fe0de637412086f8433b41808d7b58e92e7b7341fb9b4da44868d4b311b
++ L_OATDUMP_API26_SIG=d8c08fe0de637412086f8433b41808d7b58e92e7b7341fb9b4da44868d4b311b
++ readonly D_OATDUMP_API26_SIG=6fd75110e85f0cc0316c5e7345ea4271d527aae2570552dc3c565177a4d6b743
++ D_OATDUMP_API26_SIG=6fd75110e85f0cc0316c5e7345ea4271d527aae2570552dc3c565177a4d6b743
++ readonly L_OATDUMP_API26_2_SIG=22ab2469d32fbb1a4010528695c0c71ed1a3f7f5e956971b7f933e2df9b4f44a
++ L_OATDUMP_API26_2_SIG=22ab2469d32fbb1a4010528695c0c71ed1a3f7f5e956971b7f933e2df9b4f44a
++ readonly D_OATDUMP_API26_2_SIG=03b603c09c1dfbdffa0518d39f5d7e5fcf04eac2e8b11bec27f2e4c36b162689
++ D_OATDUMP_API26_2_SIG=03b603c09c1dfbdffa0518d39f5d7e5fcf04eac2e8b11bec27f2e4c36b162689
++ readonly L_OATDUMP_API27_SIG=e8363ecbd6bc6bd4d3e86e5a59adfa77f62c3f765f4bb8d32706a538831357ac
++ L_OATDUMP_API27_SIG=e8363ecbd6bc6bd4d3e86e5a59adfa77f62c3f765f4bb8d32706a538831357ac
++ readonly D_OATDUMP_API27_SIG=2aaab14d1178845bf9d08b06b7afd3dfd845e882c9bf2c403593940a39ff3449
++ D_OATDUMP_API27_SIG=2aaab14d1178845bf9d08b06b7afd3dfd845e882c9bf2c403593940a39ff3449
++ SUBDIRS_WITH_BC=("app" "framework" "priv-app" "overlay/Pixel")
++ declare -ra SUBDIRS_WITH_BC
++ ART_FILE_EXTS=("odex" "oat" "art" "vdex")
++ declare -ra ART_FILE_EXTS
++ VENDOR_SKIP_FILES=("build.prop" "compatibility_matrix.xml" "default.prop" "etc/NOTICE.xml.gz" "etc/wifi/wpa_supplicant.conf" "manifest.xml")
++ declare -ra VENDOR_SKIP_FILES
++ VENDOR_SKIP_FILES_NAKED=("etc/selinux/nonplat_file_contexts" "etc/selinux/nonplat_hwservice_contexts" "etc/selinux/nonplat_mac_permissions.xml" "etc/selinux/nonplat_property_contexts" "etc/selinux/nonplat_seapp_contexts" "etc/selinux/nonplat_sepolicy.cil" "etc/selinux/nonplat_service_contexts" "etc/selinux/plat_sepolicy_vers.txt" "etc/selinux/precompiled_sepolicy" "etc/selinux/precompiled_sepolicy.plat_and_mapping.sha256" "etc/selinux/vndservice_contexts")
++ declare -ra VENDOR_SKIP_FILES_NAKED
+ . /tmp/vendor/android-prepare-vendor/scripts/common.sh
++ [[ /tmp/vendor/android-prepare-vendor/scripts/common.sh == \v\e\n\d\o\r\/\a\n\d\r\o\i\d\-\p\r\e\p\a\r\e\-\v\e\n\d\o\r\/\e\x\e\c\u\t\e\-\a\l\l\.\s\h ]]
+ export PATH=PATH_EXTENDED_BY_ANDROID_PREPARE_VENDOR
+ PATH=PATH_EXTENDED_BY_ANDROID_PREPARE_VENDOR
+ DEVICE=
+ BUILDID=
+ OUTPUT_DIR=
+ INPUT_IMG=
+ KEEP_DATA=false
+ DEV_ALIAS=
+ API_LEVEL=
+ SKIP_SYSDEOPT=false
+ _UMOUNT=
+ FACTORY_IMGS_DATA=
+ CONFIG_TYPE=naked
+ CONFIG_FILE=
+ USER_JAVA_PATH=
+ AUTO_TOS_ACCEPT=false
+ FORCE_PREOPT=false
+ FORCE_SMALI=false
+ FORCE_OATDUMP=false
+ FORCE_SMALIEX=false
+ BYTECODE_REPAIR_METHOD=
+ DEODEX_ALL=false
+ AOSP_ROOT=
+ USE_DEBUGFS=false
+ FORCE_VIMG=false
+ JAVA_FOUND=false
+ check_bash_version
+ '[' 4 -lt 4 ']'
+ check_compatible_system
+ local hostOS
++ uname -s
+ hostOS=Linux
+ [[ Linux != \L\i\n\u\x ]]
+ isDarwin
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ return 1
+ USE_DEBUGFS=true
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists mkdir
+ type mkdir
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists dirname
+ type dirname
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists wget
+ type wget
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists mount
+ type mount
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists shasum
+ type shasum
+ [[ 6 -gt 0 ]]
+ arg=-d
+ case $arg in
++ echo marlin
++ tr '[:upper:]' '[:lower:]'
+ DEVICE=marlin
+ shift
+ shift
+ [[ 4 -gt 0 ]]
+ arg=-b
+ case $arg in
++ echo OPM4.171019.016.B1
++ tr '[:upper:]' '[:lower:]'
+ BUILDID=opm4.171019.016.b1
+ shift
+ shift
+ [[ 2 -gt 0 ]]
+ arg=-o
+ case $arg in
++ _realpath vendor/android-prepare-vendor
+++ _resolve_symlinks vendor/android-prepare-vendor
+++ __resolve_symlinks vendor/android-prepare-vendor
+++ __assert_no_path_cycles vendor/android-prepare-vendor
+++ local target path
+++ target=vendor/android-prepare-vendor
+++ shift
+++ local dir_context path
++++ readlink -- vendor/android-prepare-vendor
+++ path=
+++ '[' 1 -eq 0 ']'
+++ printf '%s\n' vendor/android-prepare-vendor
++ _canonicalize_path vendor/android-prepare-vendor
++ '[' -d vendor/android-prepare-vendor ']'
++ __canonicalize_dir_path vendor/android-prepare-vendor
++ cd vendor/android-prepare-vendor
++ pwd -P
+ OUTPUT_DIR=/tmp/vendor/android-prepare-vendor
+ shift
+ shift
+ [[ 0 -gt 0 ]]
+ check_input_args
+ [[ marlin == '' ]]
+ [[ opm4.171019.016.b1 == '' ]]
+ [[ /tmp/vendor/android-prepare-vendor == '' ]]
+ [[ ! -d /tmp/vendor/android-prepare-vendor ]]
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ [[ false = true ]]
+ is_aosp_root /tmp/vendor/android-prepare-vendor
+ local targetDir=/tmp/vendor/android-prepare-vendor
+ '[' -f /tmp/vendor/android-prepare-vendor/.repo/project.list ']'
+ return 1
+ update_java_path
+ local __javapath=
+ local __javadir=
+ local __javahome=
+ [[ '' != '' ]]
++ which java
+ readonly __JAVALINK=/usr/bin/java
+ __JAVALINK=/usr/bin/java
+ [[ /usr/bin/java == '' ]]
+ [[ Linux == \D\a\r\w\i\n ]]
++ _realpath /usr/bin/java
+++ _resolve_symlinks /usr/bin/java
+++ __resolve_symlinks /usr/bin/java
+++ __assert_no_path_cycles /usr/bin/java
+++ local target path
+++ target=/usr/bin/java
+++ shift
+++ local dir_context path
++++ readlink -- /usr/bin/java
+++ path=/etc/alternatives/java
+++ '[' 0 -eq 0 ']'
++++ dirname -- /usr/bin/java
+++ dir_context=/usr/bin
++++ __prepend_dir_context_if_necessary /usr/bin /etc/alternatives/java
++++ '[' /usr/bin = . ']'
++++ __prepend_path_if_relative /usr/bin /etc/alternatives/java
++++ case "$2" in
++++ printf '%s\n' /etc/alternatives/java
+++ __resolve_symlinks /etc/alternatives/java /usr/bin/java
+++ __assert_no_path_cycles /etc/alternatives/java /usr/bin/java
+++ local target path
+++ target=/etc/alternatives/java
+++ shift
+++ for path in '"$@"'
+++ '[' /usr/bin/java = /etc/alternatives/java ']'
+++ local dir_context path
++++ readlink -- /etc/alternatives/java
+++ path=/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
+++ '[' 0 -eq 0 ']'
++++ dirname -- /etc/alternatives/java
+++ dir_context=/etc/alternatives
++++ __prepend_dir_context_if_necessary /etc/alternatives /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++++ '[' /etc/alternatives = . ']'
++++ __prepend_path_if_relative /etc/alternatives /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++++ case "$2" in
++++ printf '%s\n' /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
+++ __resolve_symlinks /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java /etc/alternatives/java /usr/bin/java
+++ __assert_no_path_cycles /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java /etc/alternatives/java /usr/bin/java
+++ local target path
+++ target=/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
+++ shift
+++ for path in '"$@"'
+++ '[' /etc/alternatives/java = /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java ']'
+++ for path in '"$@"'
+++ '[' /usr/bin/java = /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java ']'
+++ local dir_context path
++++ readlink -- /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
+++ path=
+++ '[' 1 -eq 0 ']'
+++ printf '%s\n' /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++ _canonicalize_path /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++ '[' -d /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java ']'
++ __canonicalize_file_path /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++ local dir file
+++ dirname -- /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++ dir=/usr/lib64/jvm/jre-1.8.0-openjdk/bin
+++ basename -- /usr/lib64/jvm/jre-1.8.0-openjdk/bin/java
++ file=java
++ cd /usr/lib64/jvm/jre-1.8.0-openjdk/bin
+++ pwd -P
++ printf '%s/%s\n' /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin java
+ __javapath=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
++ dirname /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
+ __javadir=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin
+ __javahome=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
+ JAVA_FOUND=true
+ '[' true = true ']'
+ export JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
+ JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java
+ export PATH=PATH_EXTENDED_BY_JAVA
+ PATH=PATH_EXTENDED_BY_JAVA
+ check_supported_device
+ local deviceOK=false
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ bullhead == \m\a\r\l\i\n ]]
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ flounder == \m\a\r\l\i\n ]]
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ angler == \m\a\r\l\i\n ]]
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ sailfish == \m\a\r\l\i\n ]]
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ marlin == \m\a\r\l\i\n ]]
+ deviceOK=true
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ walleye == \m\a\r\l\i\n ]]
+ for devNm in '"${SUPPORTED_DEVICES[@]}"'
+ [[ taimen == \m\a\r\l\i\n ]]
+ '[' true = false ']'
+ CONFIG_FILE=/tmp/vendor/android-prepare-vendor/marlin/config.json
+ OUT_BASE=/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1
+ '[' '!' -d /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1 ']'
+ FACTORY_IMGS_DATA=/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data
+ FACTORY_IMGS_R_DATA=/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_repaired_data
+ echo '[*] Setting output base to '\''/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1'\'''
[*] Setting output base to '/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1'
+ factoryImgArchive=
+ [[ '' == '' ]]
+ [[ marlin == \f\l\o\u\n\d\e\r ]]
+ [[ '' == '' ]]
+ DEV_ALIAS=marlin
+ __extraArgs=
+ '[' false = true ']'
+ /tmp/vendor/android-prepare-vendor/scripts/download-nexus-image.sh --device marlin --alias marlin --buildID opm4.171019.016.b1 --output /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1
+++ dirname /tmp/vendor/android-prepare-vendor/scripts/download-nexus-image.sh
++ cd /tmp/vendor/android-prepare-vendor/scripts
++ pwd
+ readonly SCRIPTS_DIR=/tmp/vendor/android-prepare-vendor/scripts
+ SCRIPTS_DIR=/tmp/vendor/android-prepare-vendor/scripts
+ readonly CONSTS_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/constants.sh
+ CONSTS_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/constants.sh
+ readonly COMMON_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/common.sh
+ COMMON_SCRIPT=/tmp/vendor/android-prepare-vendor/scripts/common.sh
++ mktemp -d /tmp/android_img_download.XXXXXX
+ readonly TMP_WORK_DIR=/tmp/android_img_download.xkvBXN
+ TMP_WORK_DIR=/tmp/android_img_download.xkvBXN
+ SYS_TOOLS=("curl" "wget")
+ declare -a SYS_TOOLS
+ trap 'abort 1' SIGINT SIGTERM
+ . /tmp/vendor/android-prepare-vendor/scripts/constants.sh
++ [[ /tmp/vendor/android-prepare-vendor/scripts/constants.sh == \/\t\m\p\/\v\e\n\d\o\r\/\a\n\d\r\o\i\d\-\p\r\e\p\a\r\e\-\v\e\n\d\o\r\/\s\c\r\i\p\t\s\/\d\o\w\n\l\o\a\d\-\n\e\x\u\s\-\i\m\a\g\e\.\s\h ]]
++ SUPPORTED_DEVICES=("bullhead" "flounder" "angler" "sailfish" "marlin" "walleye" "taimen")
++ declare -ra SUPPORTED_DEVICES
++ readonly NID_URL=https://google.com
++ NID_URL=https://google.com
++ readonly GURL=https://developers.google.com/android/nexus/images
++ GURL=https://developers.google.com/android/nexus/images
++ readonly TOSURL=https://developers.google.com/profile/acknowledgeNotification
++ TOSURL=https://developers.google.com/profile/acknowledgeNotification
++ readonly 'L_OATDUMP_URL_API23=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21490&authkey=ACA4f4Zvs3Tb_SY'
++ L_OATDUMP_URL_API23='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21490&authkey=ACA4f4Zvs3Tb_SY'
++ readonly 'D_OATDUMP_URL_API23=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21493&authkey=AJ0rWu5Ci8tQNLY'
++ D_OATDUMP_URL_API23='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21493&authkey=AJ0rWu5Ci8tQNLY'
++ readonly 'L_OATDUMP_URL_API24=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21492&authkey=AE4uqwH-THvvkSQ'
++ L_OATDUMP_URL_API24='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21492&authkey=AE4uqwH-THvvkSQ'
++ readonly 'D_OATDUMP_URL_API24=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21491&authkey=AHvCaYwFBPYD4Fs'
++ D_OATDUMP_URL_API24='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21491&authkey=AHvCaYwFBPYD4Fs'
++ readonly 'L_OATDUMP_URL_API25=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21503&authkey=AKDpBAzhzum6d7w'
++ L_OATDUMP_URL_API25='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21503&authkey=AKDpBAzhzum6d7w'
++ readonly 'D_OATDUMP_URL_API25=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21504&authkey=AC5YFNSAZ31-W3o'
++ D_OATDUMP_URL_API25='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21504&authkey=AC5YFNSAZ31-W3o'
++ readonly 'L_OATDUMP_URL_API26=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21557&authkey=AG47qhXu164sYwc'
++ L_OATDUMP_URL_API26='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21557&authkey=AG47qhXu164sYwc'
++ readonly 'D_OATDUMP_URL_API26=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21561&authkey=ABu-oqJbQDwQ-ZQ'
++ D_OATDUMP_URL_API26='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21561&authkey=ABu-oqJbQDwQ-ZQ'
++ readonly 'L_OATDUMP_URL_API26_2=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21569&authkey=AG5PlexJR0YMLr0'
++ L_OATDUMP_URL_API26_2='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21569&authkey=AG5PlexJR0YMLr0'
++ readonly 'D_OATDUMP_URL_API26_2=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21570&authkey=AJrlrh0v2GUvxow'
++ D_OATDUMP_URL_API26_2='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21570&authkey=AJrlrh0v2GUvxow'
++ readonly 'L_OATDUMP_URL_API27=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21566&authkey=AKWYYxBfd7NMW_k'
++ L_OATDUMP_URL_API27='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21566&authkey=AKWYYxBfd7NMW_k'
++ readonly 'D_OATDUMP_URL_API27=https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21567&authkey=AF-cDubRkZdjRxY'
++ D_OATDUMP_URL_API27='https://onedrive.live.com/download?cid=D1FAC8CC6BE2C2B0&resid=D1FAC8CC6BE2C2B0%21567&authkey=AF-cDubRkZdjRxY'
++ readonly L_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ L_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ readonly D_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ D_OATDUMP_API23_SIG=688f1c1f97e3b9eb32702c60ca05abbf313bc98a25334aa3ed4a108095162244
++ readonly L_OATDUMP_API24_SIG=1f99e7d0f2894cfe52fb7f2a24d5076f217977cbb1a46fafdf5ea38b0a11adce
++ L_OATDUMP_API24_SIG=1f99e7d0f2894cfe52fb7f2a24d5076f217977cbb1a46fafdf5ea38b0a11adce
++ readonly D_OATDUMP_API24_SIG=4a7f5614eb04d9bea85bfa05853523843f9cc80a64eab4c98efed2f70ed3d90e
++ D_OATDUMP_API24_SIG=4a7f5614eb04d9bea85bfa05853523843f9cc80a64eab4c98efed2f70ed3d90e
++ readonly L_OATDUMP_API25_SIG=8b8cd18f08afd00fc6bf33d5b7f5be4faab9f39849b258bade5d15c3e5f33ce8
++ L_OATDUMP_API25_SIG=8b8cd18f08afd00fc6bf33d5b7f5be4faab9f39849b258bade5d15c3e5f33ce8
++ readonly D_OATDUMP_API25_SIG=97f26b40cdc1fb2b5e5babe7ff8c63b70e7d3a3ab8dee19b035bbb0fdfa5477e
++ D_OATDUMP_API25_SIG=97f26b40cdc1fb2b5e5babe7ff8c63b70e7d3a3ab8dee19b035bbb0fdfa5477e
++ readonly L_OATDUMP_API26_SIG=d8c08fe0de637412086f8433b41808d7b58e92e7b7341fb9b4da44868d4b311b
++ L_OATDUMP_API26_SIG=d8c08fe0de637412086f8433b41808d7b58e92e7b7341fb9b4da44868d4b311b
++ readonly D_OATDUMP_API26_SIG=6fd75110e85f0cc0316c5e7345ea4271d527aae2570552dc3c565177a4d6b743
++ D_OATDUMP_API26_SIG=6fd75110e85f0cc0316c5e7345ea4271d527aae2570552dc3c565177a4d6b743
++ readonly L_OATDUMP_API26_2_SIG=22ab2469d32fbb1a4010528695c0c71ed1a3f7f5e956971b7f933e2df9b4f44a
++ L_OATDUMP_API26_2_SIG=22ab2469d32fbb1a4010528695c0c71ed1a3f7f5e956971b7f933e2df9b4f44a
++ readonly D_OATDUMP_API26_2_SIG=03b603c09c1dfbdffa0518d39f5d7e5fcf04eac2e8b11bec27f2e4c36b162689
++ D_OATDUMP_API26_2_SIG=03b603c09c1dfbdffa0518d39f5d7e5fcf04eac2e8b11bec27f2e4c36b162689
++ readonly L_OATDUMP_API27_SIG=e8363ecbd6bc6bd4d3e86e5a59adfa77f62c3f765f4bb8d32706a538831357ac
++ L_OATDUMP_API27_SIG=e8363ecbd6bc6bd4d3e86e5a59adfa77f62c3f765f4bb8d32706a538831357ac
++ readonly D_OATDUMP_API27_SIG=2aaab14d1178845bf9d08b06b7afd3dfd845e882c9bf2c403593940a39ff3449
++ D_OATDUMP_API27_SIG=2aaab14d1178845bf9d08b06b7afd3dfd845e882c9bf2c403593940a39ff3449
++ SUBDIRS_WITH_BC=("app" "framework" "priv-app" "overlay/Pixel")
++ declare -ra SUBDIRS_WITH_BC
++ ART_FILE_EXTS=("odex" "oat" "art" "vdex")
++ declare -ra ART_FILE_EXTS
++ VENDOR_SKIP_FILES=("build.prop" "compatibility_matrix.xml" "default.prop" "etc/NOTICE.xml.gz" "etc/wifi/wpa_supplicant.conf" "manifest.xml")
++ declare -ra VENDOR_SKIP_FILES
++ VENDOR_SKIP_FILES_NAKED=("etc/selinux/nonplat_file_contexts" "etc/selinux/nonplat_hwservice_contexts" "etc/selinux/nonplat_mac_permissions.xml" "etc/selinux/nonplat_property_contexts" "etc/selinux/nonplat_seapp_contexts" "etc/selinux/nonplat_sepolicy.cil" "etc/selinux/nonplat_service_contexts" "etc/selinux/plat_sepolicy_vers.txt" "etc/selinux/precompiled_sepolicy" "etc/selinux/precompiled_sepolicy.plat_and_mapping.sha256" "etc/selinux/vndservice_contexts")
++ declare -ra VENDOR_SKIP_FILES_NAKED
+ . /tmp/vendor/android-prepare-vendor/scripts/common.sh
++ [[ /tmp/vendor/android-prepare-vendor/scripts/common.sh == \/\t\m\p\/\v\e\n\d\o\r\/\a\n\d\r\o\i\d\-\p\r\e\p\a\r\e\-\v\e\n\d\o\r\/\s\c\r\i\p\t\s\/\d\o\w\n\l\o\a\d\-\n\e\x\u\s\-\i\m\a\g\e\.\s\h ]]
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists curl
+ type curl
+ for i in '"${SYS_TOOLS[@]}"'
+ command_exists wget
+ type wget
+ DEVICE=
+ DEV_ALIAS=
+ BUILDID=
+ OUTPUT_DIR=
+ AUTO_TOS_ACCEPT=false
+ [[ 8 -gt 0 ]]
+ arg=--device
+ case $arg in
++ echo marlin
++ tr '[:upper:]' '[:lower:]'
+ DEVICE=marlin
+ shift
+ shift
+ [[ 6 -gt 0 ]]
+ arg=--alias
+ case $arg in
++ echo marlin
++ tr '[:upper:]' '[:lower:]'
+ DEV_ALIAS=marlin
+ shift
+ shift
+ [[ 4 -gt 0 ]]
+ arg=--buildID
+ case $arg in
++ echo opm4.171019.016.b1
++ tr '[:upper:]' '[:lower:]'
+ BUILDID=opm4.171019.016.b1
+ shift
+ shift
+ [[ 2 -gt 0 ]]
+ arg=--output
+ case $arg in
++ echo /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1
++ sed 's:/*$::'
+ OUTPUT_DIR=/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1
+ shift
+ shift
+ [[ 0 -gt 0 ]]
+ [[ marlin == '' ]]
+ [[ opm4.171019.016.b1 == '' ]]
+ [[ /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1 == '' ]]
+ [[ ! -d /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1 ]]
+ [[ marlin == '' ]]
+ COOKIE_FILE=/tmp/android_img_download.xkvBXN/g_cookies.txt
+ curl --silent -c /tmp/android_img_download.xkvBXN/g_cookies.txt -L https://google.com
+ grep -io 'google.[[:alpha:]]\+[[:blank:]]' /tmp/android_img_download.xkvBXN/g_cookies.txt
+ sort -u
+ sed -e 's/[[:space:]]\+//g'
+ read -r domain
+ sed -i.bak s/google.com/google.com/g /tmp/android_img_download.xkvBXN/g_cookies.txt
+ read -r domain
+ accept_tos
+ local userRes userResFmt
+ cat

--{ Google Terms and Conditions
Downloading of the system image and use of the device software is subject to the
Google Terms of Service [1]. By continuing, you agree to the Google Terms of
Service [1] and Privacy Policy [2]. Your downloading of the system image and use
of the device software may also be subject to certain third-party terms of
service, which can be found in Settings > About phone > Legal information, or as
otherwise provided.

[1] https://www.google.com/intl/en/policies/terms/
[2] https://www.google.com/intl/en/policies/privacy/

+ echo -n '[?] I have read and agree with the above terms and conditions - ACKNOWLEDGE [y|n]: '
[?] I have read and agree with the above terms and conditions - ACKNOWLEDGE [y|n]: + '[' false = true ']'
+ read userRes
y
++ echo y
++ tr '[:upper:]' '[:lower:]'
+ userResFmt=y
+ [[ y != \y\e\s ]]
+ [[ y != \y ]]
++ curl -L -b /tmp/android_img_download.xkvBXN/g_cookies.txt --silent https://developers.google.com/android/nexus/images
++ grep -io '<meta name="xsrf_token" content=".*" />'
++ cut -d '"' -f4
+ xsrf_token=zTCQMdK5CDA4Kb_Jkl8siXcEPC_62fXYCZDKJotsEcA6MTUyNjQ4MzY1NjU2NzQ1MA
++ curl -b /tmp/android_img_download.xkvBXN/g_cookies.txt -X POST -d notification_id=wall-nexus-image-tos -H 'X_XSRFToken: zTCQMdK5CDA4Kb_Jkl8siXcEPC_62fXYCZDKJotsEcA6MTUyNjQ4MzY1NjU2NzQ1MA' --write-out '%{http_code}' --output /dev/null --silent https://developers.google.com/profile/acknowledgeNotification
+ response=200
+ [[ 200 != \2\0\0 ]]
++ curl -L -b /tmp/android_img_download.xkvBXN/g_cookies.txt --silent -H 'X_XSRFToken: zTCQMdK5CDA4Kb_Jkl8siXcEPC_62fXYCZDKJotsEcA6MTUyNjQ4MzY1NjU2NzQ1MA' https://developers.google.com/android/nexus/images
++ grep -i '<a href=.*marlin-opm4.171019.016.b1'
++ cut -d '"' -f2
+ url=
+ '[' '' == '' ']'
+ echo '[-] Image URL not found'
[-] Image URL not found
+ abort 1
+ exit 1
+ echo '[-] Images download failed'
[-] Images download failed
+ abort 1
+ [[ 1 -ne 0 ]]
+ [[ /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data != '' ]]
+ unmount_raw_image /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data/system
+ local mount_point=/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data/system
+ [[ -d /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data/system ]]
+ unmount_raw_image /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data/vendor
+ local mount_point=/tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data/vendor
+ [[ -d /tmp/vendor/android-prepare-vendor/marlin/opm4.171019.016.b1/factory_imgs_data/vendor ]]
+ rm -rf /tmp/android_prepare_vendor.kPnTek
+ exit 1

Checking the output of

curl -L -b /tmp/android_img_download.xkvBXN/g_cookies.txt --silent -H 'X_XSRFToken: zTCQMdK5CDA4Kb_Jkl8siXcEPC_62fXYCZDKJotsEcA6MTUyNjQ4MzY1NjU2NzQ1MA' https://developers.google.com/android/nexus/images

I get an html page asking to accept the Terms and Conditions again. This happens on multiple different machines. Please let me know if I did any stupid mistake in applying the script or if you need any more information from me.

dan-v commented 6 years ago

As a workaround for now, I just removed cookies and xsrf token header from the equation and it seems to work:

url=$(curl -L --silent 'https://developers.google.com/android/images' | \
      grep -i "<a href=.*$DEV_ALIAS-$BUILDID" | cut -d '"' -f2)
jotasi commented 6 years ago

Thanks @dan-v that seems to work for me as well! Probably Google changed something with their site...

anestisb commented 6 years ago

@jotasi I cannot reproduce it from my setup. Everything appears to be working fine when running the following from both macOS & Linux:

./execute-all.sh -b OPM4.171019.016.B1 -d sailfish -o $(pwd) -y

Do you still have the issue when using the latest master (might have been a temp glitch with Google CDN)?

jotasi commented 6 years ago

@anestisb I double checked and it started working again. As it used to work, then stopped working a few days ago, and now works again without any changes to the code, the guess about a temp glitch with Google CDN seems plausible. I'll close this thus. Thanks for your reply!