check latest version if the app was updated before mounting

This commit is contained in:
j-hc 2022-12-27 13:56:09 +03:00 committed by GitHub
parent cca14ccb97
commit cc1b96d0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ ln -f $MODDIR/base.apk $RVPATH
BASEPATH=$(pm path __PKGNAME | grep base) BASEPATH=$(pm path __PKGNAME | grep base)
BASEPATH=${BASEPATH#*:} BASEPATH=${BASEPATH#*:}
if [ $BASEPATH ] && [ -d ${BASEPATH%base.apk}lib ]; then if [ $BASEPATH ] && [ -d ${BASEPATH%base.apk}lib ]; then
VERSION=$(dumpsys package __PKGNAME | grep versionName) VERSION=$(dumpsys package __PKGNAME | grep versionName | head -1)
if [ ${VERSION#*=} = __PKGVER ]; then if [ ${VERSION#*=} = __PKGVER ]; then
chcon u:object_r:apk_data_file:s0 $RVPATH chcon u:object_r:apk_data_file:s0 $RVPATH
mount -o bind $RVPATH $BASEPATH mount -o bind $RVPATH $BASEPATH