Skip to content

Commit

Permalink
+ support Magisk module update2
Browse files Browse the repository at this point in the history
  • Loading branch information
eritpchy committed Dec 10, 2022
1 parent ae3de7c commit 092eaa7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
12 changes: 8 additions & 4 deletions riru/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ MODULE_GRALDE_TASK="$1"
MODULE_GRALDE_FILE="$2"
PLUGIN_TYPE_NAME="$3"
MODULE_TEMPLATE="./Riru-ModuleTemplate"
VERSION=$(cat ../app/build.gradle| grep versionName | sed -E 's/.+"(.+)".*/\1/g')
VERSION_NAME=$(cat ../app/build.gradle| grep versionName | sed -E 's/.+"(.+)".*/\1/g')
VERSION_CODE=$(cat ../app/build.gradle| grep versionCode | sed -E 's/.+versionCode +([0-9]+).*/\1/g')
APP_PRODUCT_TARGET=$(echo "$MODULE_GRALDE_FILE"|sed -E 's/.+\/(.+)\..+/\1/g')
MODULE_LIB_NAME="$(echo "$PLUGIN_TYPE_NAME" | tr '[:upper:]' '[:lower:]')-module-xfingerprint-pay-$APP_PRODUCT_TARGET"
echo VERSION: $VERSION
echo VERSION_NAME: $VERSION_NAME
echo VERSION_CODE: $VERSION_CODE
bash ./reset.sh
echo "updateJson=\${updateJson}" >> $MODULE_TEMPLATE/template/magisk_module/module.prop
perl -i -pe 's/(description: moduleDescription,)/$1 \nupdateJson: moduleUpdateJson,/g' $MODULE_TEMPLATE/module/build.gradle
Expand Down Expand Up @@ -36,12 +38,14 @@ perl -i -pe 's/(main\.cpp)/$1 fingerprint.cpp zygisk_main.cpp/g' $MODULE_TEMPL
echo 'add_definitions(-DMODULE_NAME="${MODULE_NAME}")' >> $MODULE_TEMPLATE/module/src/main/cpp/CMakeLists.txt
echo 'target_link_libraries(${MODULE_NAME})' >> $MODULE_TEMPLATE/module/src/main/cpp/CMakeLists.txt
$MODULE_TEMPLATE/gradlew -p $MODULE_TEMPLATE clean \
-PVERSION=$VERSION \
-PVERSION_NAME=$VERSION_NAME \
-PVERSION_CODE=$VERSION_CODE \
-PPLUGIN_TYPE_NAME=$PLUGIN_TYPE_NAME \
-PMODULE_LIB_NAME=$MODULE_LIB_NAME \

$MODULE_TEMPLATE/gradlew -p $MODULE_TEMPLATE $MODULE_GRALDE_TASK \
-PVERSION=$VERSION \
-PVERSION_NAME=$VERSION_NAME \
-PVERSION_CODE=$VERSION_CODE \
-PPLUGIN_TYPE_NAME=$PLUGIN_TYPE_NAME \
-PMODULE_LIB_NAME=$MODULE_LIB_NAME \

Expand Down
4 changes: 2 additions & 2 deletions riru/src/gradle/alipay.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ext {
moduleName = "${pluginTypeName.capitalize()} - 指纹支付 - 支付宝"
moduleAuthor = "Jason Eric"
moduleDescription = "让支付宝支持指纹支付 Fingerprint pay for Alipay."
moduleVersion = "v${project.property("VERSION")}"
moduleVersionCode = 3
moduleVersion = "v${project.property("VERSION_NAME")}"
moduleVersionCode = project.property("VERSION_CODE") as int
moduleUpdateJson = "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/release/update_${pluginTypeName.toLowerCase()}_alipay.json"
}
apply from: "$rootDir/fingerprint.gradle"
4 changes: 2 additions & 2 deletions riru/src/gradle/qq.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ext {
moduleName = "${pluginTypeName.capitalize()} - 指纹支付 - QQ"
moduleAuthor = "Jason Eric"
moduleDescription = "让QQ支持指纹支付 Fingerprint pay for QQ."
moduleVersion = "v${project.property("VERSION")}"
moduleVersionCode = 3
moduleVersion = "v${project.property("VERSION_NAME")}"
moduleVersionCode = project.property("VERSION_CODE") as int
moduleUpdateJson = "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/release/update_${pluginTypeName.toLowerCase()}_qq.json"
}
apply from: "$rootDir/fingerprint.gradle"
4 changes: 2 additions & 2 deletions riru/src/gradle/taobao.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ext {
moduleName = "${pluginTypeName.capitalize()} - 指纹支付 - 淘宝"
moduleAuthor = "Jason Eric"
moduleDescription = "让淘宝支持指纹支付 Fingerprint pay for Taobao."
moduleVersion = "v${project.property("VERSION")}"
moduleVersionCode = 3
moduleVersion = "v${project.property("VERSION_NAME")}"
moduleVersionCode = project.property("VERSION_CODE") as int
moduleUpdateJson = "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/release/update_${pluginTypeName.toLowerCase()}_taobao.json"
}
apply from: "$rootDir/fingerprint.gradle"
4 changes: 2 additions & 2 deletions riru/src/gradle/unionpay.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ext {
moduleName = "${pluginTypeName.capitalize()} - 指纹支付 - 云闪付"
moduleAuthor = "Jason Eric"
moduleDescription = "让云闪付支持指纹支付 Fingerprint pay for UnionPay."
moduleVersion = "v${project.property("VERSION")}"
moduleVersionCode = 3
moduleVersion = "v${project.property("VERSION_NAME")}"
moduleVersionCode = project.property("VERSION_CODE") as int
moduleUpdateJson = "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/release/update_${pluginTypeName.toLowerCase()}_unionpay.json"
}
apply from: "$rootDir/fingerprint.gradle"
4 changes: 2 additions & 2 deletions riru/src/gradle/wechat.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ext {
moduleName = "${pluginTypeName.capitalize()} - 指纹支付 - 微信"
moduleAuthor = "Jason Eric"
moduleDescription = "让微信支持指纹支付 Fingerprint pay for WeChat."
moduleVersion = "v${project.property("VERSION")}"
moduleVersionCode = 3
moduleVersion = "v${project.property("VERSION_NAME")}"
moduleVersionCode = project.property("VERSION_CODE") as int
moduleUpdateJson = "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/release/update_${pluginTypeName.toLowerCase()}_wechat.json"
}
apply from: "$rootDir/fingerprint.gradle"

0 comments on commit 092eaa7

Please sign in to comment.