File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ There exists an example below with all defaults shown and all the keys explicitl
1919parallel-jobs = 1 # amount of cores to use for parallel patching, if not set $(nproc) is used
2020compression-level = 9 # module zip compression level
2121remove-rv-integrations-checks = true # remove checks from the revanced integrations
22+ dpi = " nodpi anydpi 120-640dpi" # dpi packages to be searched in order. default: "nodpi anydpi"
2223
2324patches-source = " revanced/revanced-patches" # where to fetch patches bundle from. default: "revanced/revanced-patches"
2425cli-source = " j-hc/revanced-cli" # where to fetch cli from. default: "j-hc/revanced-cli"
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ DEF_CLI_VER=$(toml_get "$main_config_t" cli-version) || DEF_CLI_VER="latest"
3232DEF_PATCHES_SRC=$( toml_get " $main_config_t " patches-source) || DEF_PATCHES_SRC=" ReVanced/revanced-patches"
3333DEF_CLI_SRC=$( toml_get " $main_config_t " cli-source) || DEF_CLI_SRC=" j-hc/revanced-cli"
3434DEF_RV_BRAND=$( toml_get " $main_config_t " rv-brand) || DEF_RV_BRAND=" ReVanced"
35+ DEF_DPI_LIST=$( toml_get " $main_config_t " dpi) || DEF_DPI_LIST=" nodpi anydpi"
3536mkdir -p " $TEMP_DIR " " $BUILD_DIR "
3637
3738if [ " ${2-} " = " --config-update" ]; then
@@ -130,7 +131,8 @@ for table_name in $(toml_get_table_names); do
130131 fi
131132
132133 app_args[include_stock]=$( toml_get " $t " include-stock) || app_args[include_stock]=true && vtf " ${app_args[include_stock]} " " include-stock"
133- app_args[dpi]=$( toml_get " $t " dpi) || app_args[dpi]=" nodpi"
134+ app_args[dpi]=$( toml_get " $t " dpi) || app_args[dpi]=" $DEF_DPI_LIST "
135+ read -r -a DPI_CANDIDATES <<< " ${app_args[dpi]}"
134136 table_name_f=${table_name,,}
135137 table_name_f=${table_name_f// / -}
136138 app_args[module_prop_name]=$( toml_get " $t " module-prop-name) || app_args[module_prop_name]=" ${table_name_f} -peternmuller"
Original file line number Diff line number Diff line change @@ -326,11 +326,14 @@ dl_apkmirror() {
326326 resp=$( req " $url " -) || return 1
327327 node=$( $HTMLQ " div.table-row.headerFont:nth-last-child(1)" -r " span:nth-child(n+3)" <<< " $resp" )
328328 if [ " $node " ]; then
329- if ! dlurl=$( apk_mirror_search " $resp " " $dpi " " ${arch} " " APK" ) ; then
330- if ! dlurl=$( apk_mirror_search " $resp " " $dpi " " ${arch} " " BUNDLE" ) ; then
331- return 1
332- else is_bundle=true; fi
333- fi
329+ for current_dpi in " ${dpi[@]} " ; do
330+ for type in APK BUNDLE; do
331+ if dlurl=$( apk_mirror_search " $resp " " $current_dpi " " ${arch} " " $type " ) ; then
332+ [[ " $type " == " BUNDLE" ]] && is_bundle=true || is_bundle=false
333+ break 2
334+ fi
335+ done
336+ done
334337 [ -z " $dlurl " ] && return 1
335338 resp=$( req " $dlurl " -)
336339 fi
@@ -536,8 +539,8 @@ build_rv() {
536539 if [ -z " ${args[${dl_p}_dlurl]} " ]; then continue ; fi
537540 pr " Downloading '${table} ' from ${dl_p} "
538541 if ! isoneof $dl_p " ${tried_dl[@]} " ; then get_${dl_p} _resp " ${args[${dl_p}_dlurl]} " ; fi
539- if ! dl_${dl_p} " ${args[${dl_p}_dlurl]} " " $version " " $stock_apk " " $arch " " ${args[dpi]} " " $get_latest_ver " ; then
540- epr " ERROR: Could not download '${table} ' from ${dl_p} with version '${version} ', arch '${arch} ', dpi '${args[dpi ]} '"
542+ if ! dl_${dl_p} " ${args[${dl_p}_dlurl]} " " $version " " $stock_apk " " $arch " " $DPI_CANDIDATES " " $get_latest_ver " ; then
543+ epr " ERROR: Could not download '${table} ' from ${dl_p} with version '${version} ', arch '${arch} ', dpi '${DPI_CANDIDATES[* ]} '"
541544 continue
542545 fi
543546 break
You can’t perform that action at this time.
0 commit comments