module: check arch upon flashing

This commit is contained in:
j-hc 2023-02-03 19:57:47 +03:00
parent 1c0960fed3
commit 37e3a698ff
3 changed files with 30 additions and 9 deletions

11
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,11 @@
---
name: Bug report
about: Bug report
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
**DO NOT REPORT REVANCED BUGS IN THIS REPO**

View File

@ -2,9 +2,11 @@
ui_print ""
if [ $ARCH = "arm" ]; then
alias cmpr='$MODPATH/bin/arm/cmpr'
#arm
ARCH_LIB=armeabi-v7a
elif [ $ARCH = "arm64" ] || [ $ARCH = "x64" ]; then
alias cmpr='$MODPATH/bin/arm/cmpr'
elif [ $ARCH = "arm64" ]; then
#arm64
ARCH_LIB=arm64-v8a
alias cmpr='$MODPATH/bin/arm64/cmpr'
else
@ -12,10 +14,11 @@ else
fi
set_perm_recursive $MODPATH/bin 0 0 0755 0777
grep __PKGNAME /proc/self/mountinfo | while read -r line; do
grep __PKGNAME /proc/mounts | while read -r line; do
ui_print "* Un-mount"
mountpoint=$(echo "$line" | cut -d' ' -f5)
umount -l "${mountpoint%%\\*}"
mp=${line#* }
mp=${mp%% *}
umount -l ${mp%%\\*}
done
am force-stop __PKGNAME

View File

@ -156,7 +156,7 @@ dl_apkmirror() {
}
get_apkmirror_vers() {
local apkmirror_category=$1 allow_alpha_version=$2
local vers
local vers apkm_resp
apkm_resp=$(req "https://www.apkmirror.com/uploads/?appcategory=${apkmirror_category}" -)
# apkm_name=$(echo "$apkm_resp" | sed -n 's;.*Latest \(.*\) Uploads.*;\1;p')
vers=$(sed -n 's;.*Version:</span><span class="infoSlide-value">\(.*\) </span>.*;\1;p' <<<"$apkm_resp")
@ -180,6 +180,7 @@ get_uptodown_resp() { req "${1}/versions" -; }
get_uptodown_vers() { sed -n 's;\(^.*\) <span>.*</span>.*;\1;p' <<<"$1"; }
dl_uptodown() {
local uptwod_resp=$1 version=$2 output=$3
local url
url=$(echo "$uptwod_resp" | grep "${version} <span>" -B 1 | head -1 | sed -n 's;.*data-url="\(.*\)".*;\1;p')
url=$(req "$url" - | sed -n 's;.*data-url="\(.*\)".*;\1;p')
req "$url" "$output"
@ -305,7 +306,7 @@ build_rv() {
build_mode_arr=(apk module)
fi
local patcher_args patched_apk
local patcher_args patched_apk build_mode
for build_mode in "${build_mode_arr[@]}"; do
patcher_args=("${p_patcher_args[@]}")
pr "Building '${app_name}' (${arch}) in '$build_mode' mode"
@ -346,7 +347,7 @@ build_rv() {
uninstall_sh "$pkg_name" "$base_template"
service_sh "$pkg_name" "$version" "$base_template"
customize_sh "$pkg_name" "$version" "$base_template"
customize_sh "$pkg_name" "$version" "$arch" "$base_template"
module_prop \
"${args[module_prop_name]}" \
"${app_name} ${RV_BRAND}" \
@ -371,7 +372,13 @@ join_args() {
uninstall_sh() { echo "${UNINSTALL_SH//__PKGNAME/$1}" >"${2}/uninstall.sh"; }
customize_sh() {
local s="${CUSTOMIZE_SH//__PKGNAME/$1}"
echo "${s//__PKGVER/$2}" >"${3}/customize.sh"
# shellcheck disable=SC2016,SC2001
if [ "$3" = "arm64-v8a" ]; then
s=$(sed 's/#arm$/abort "ERROR: Wrong arch\nYour device: arm\nModule: arm64"/g' <<<"$s")
elif [ "$3" = "arm-v7a" ]; then
s=$(sed 's/#arm64$/abort "ERROR: Wrong arch\nYour device: arm64\nModule: arm"/g' <<<"$s")
fi
echo "${s//__PKGVER/$2}" >"${4}/customize.sh"
}
service_sh() {
local s="${SERVICE_SH//__PKGNAME/$1}"