Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NoName-exe committed Jan 19, 2024
2 parents e0c81fb + a0eb9e9 commit 79da0a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app"
uptodown-dlurl = "https://spotify.en.uptodown.com/android"
apkmonk-dlurl = "https://www.apkmonk.com/app/com.app.app/"
module-prop-name = "some-app-magisk" # magisk module prop name.
merge-integrations = false # set false to never merge even when needed. default: true
apkmirror-dpi = "360-480dpi" # used to select apk variant from apkmirror. default: nodpi
arch = "arm64-v8a" # 'arm64-v8a', 'arm-v7a', 'all', 'both'. 'both' downloads both arm64-v8a and arm-v7a. default: all
```
19 changes: 3 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ COMPRESSION_LEVEL=$(toml_get "$main_config_t" compression-level) || COMPRESSION_
if ! PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs); then
if [ "$OS" = Android ]; then PARALLEL_JOBS=1; else PARALLEL_JOBS=$(nproc); fi
fi
LOGGING_F=$(toml_get "$main_config_t" logging-to-file) && vtf "$LOGGING_F" "logging-to-file" || LOGGING_F=false
DEF_PATCHES_VER=$(toml_get "$main_config_t" patches-version) || DEF_PATCHES_VER=""
DEF_INTEGRATIONS_VER=$(toml_get "$main_config_t" integrations-version) || DEF_INTEGRATIONS_VER=""
DEF_CLI_VER=$(toml_get "$main_config_t" cli-version) || DEF_CLI_VER=""
Expand All @@ -43,7 +42,6 @@ fi
# -----------------

if ((COMPRESSION_LEVEL > 9)) || ((COMPRESSION_LEVEL < 0)); then abort "compression-level must be within 0-9"; fi
if [ "$LOGGING_F" = true ]; then mkdir -p logs; fi

# -- check_deps --
jq --version >/dev/null || abort "\`jq\` is not installed. install it with 'apt install jq' or equivalent"
Expand All @@ -66,16 +64,6 @@ set_prebuilts() {
app_args[ptjs]=$(find "${TEMP_DIR}/${patches_dir,,}-rv" -name "patches-${patches_ver:-*}.json" -type f -print -quit 2>/dev/null) && [ "${app_args[ptjs]}" ] || return 1
}

build_rv_w() {
if [ "$LOGGING_F" = true ]; then
logf=logs/"${table_name,,}.log"
: >"$logf"
{ build_rv 2>&1 "$(declare -p app_args)" | tee "$logf"; } &
else
build_rv "$(declare -p app_args)" &
fi
}

declare -A cliriplib
idx=0
for table_name in $(toml_get_table_names); do
Expand Down Expand Up @@ -152,7 +140,6 @@ for table_name in $(toml_get_table_names); do
fi

app_args[include_stock]=$(toml_get "$t" include-stock) || app_args[include_stock]=true && vtf "${app_args[include_stock]}" "include-stock"
app_args[merge_integrations]=$(toml_get "$t" merge-integrations) || app_args[merge_integrations]=true && vtf "${app_args[merge_integrations]}" "merge-integrations"
app_args[dpi]=$(toml_get "$t" apkmirror-dpi) || app_args[dpi]="nodpi"
table_name_f=${table_name,,}
table_name_f=${table_name_f// /-}
Expand All @@ -163,16 +150,16 @@ for table_name in $(toml_get_table_names); do
app_args[module_prop_name]="${app_args[module_prop_name]}-arm64"
app_args[arch]="arm64-v8a"
idx=$((idx + 1))
build_rv_w
build_rv "$(declare -p app_args)" &
app_args[table]="$table_name (arm-v7a)"
app_args[module_prop_name]="${app_args[module_prop_name]}-arm"
app_args[arch]="arm-v7a"
if ((idx >= PARALLEL_JOBS)); then wait -n; fi
idx=$((idx + 1))
build_rv_w
build_rv "$(declare -p app_args)" &
else
idx=$((idx + 1))
build_rv_w
build_rv "$(declare -p app_args)" &
fi
done
wait
Expand Down
1 change: 0 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
logging-to-file = true # enables logging of every patch process to a seperate file
enable-magisk-update = true # set this to false if you do not want to receive updates for the module in magisk app
patches-source = "inotia00/revanced-patches"
integrations-source = "inotia00/revanced-integrations"
Expand Down
4 changes: 2 additions & 2 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ patch_apk() {
local stock_input=$1 patched_apk=$2 patcher_args=$3 rv_cli_jar=$4 rv_patches_jar=$5
declare -r tdir=$(mktemp -d -p $TEMP_DIR)
local cmd="java -jar $rv_cli_jar patch $stock_input -r $tdir -p -o $patched_apk -b $rv_patches_jar \
--keystore=ks.keystore --keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --alias=jhc $patcher_args"
--keystore=ks.keystore --keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --alias=jhc $patcher_args --options=options.json"
if [ "$OS" = Android ]; then cmd+=" --custom-aapt2-binary=${TEMP_DIR}/aapt2"; fi
pr "$cmd"
if [ "${DRYRUN:-}" = true ]; then
Expand Down Expand Up @@ -409,7 +409,7 @@ build_rv() {
fi
log "${table}: ${version}"

if [ "${args[merge_integrations]}" = true ]; then p_patcher_args+=("-m ${args[integ]}"); fi
p_patcher_args+=("-m ${args[integ]}")
local microg_patch
microg_patch=$(jq -r ".[] | select(.compatiblePackages // [] | .[] | .name==\"${pkg_name}\") | .name" "${args[ptjs]}" | grep -i "gmscore\|microg" || :)
if [ -n "$microg_patch" ] && [[ ${p_patcher_args[*]} =~ $microg_patch ]]; then
Expand Down

0 comments on commit 79da0a4

Please sign in to comment.