Install apk into the system partition via ADB
Take Google Pinyin as an example:
googlepinyin1.4.2.apk
Extract the so file
Libjni_googlepinyinime_4.so
Libjni_googlepinyinime_latinime_4.so
The contents of the bat batch script are as follows:
Path "D:\Program files\ perfect brush machine \tools";%path%
Prompt $G
cd/d "%1"
Cls
ADB devices
adb shell su-c "Mount-o remount Rw/system"
Set apk=googlepinyin1.4.2.apk
ADB push%apk%/data/local/tmp/
adb shell su-c "cat/data/local/tmp/%apk% >/system/app/%apk%"
adb shell su-c "Chown 0.0/system/app/%apk%"
adb shell su-c "chmod 644/system/app/%apk%"
Set lib=libjni_googlepinyinime_4.so
ADB push%lib%/data/local/tmp/
adb shell su-c "cat/data/local/tmp/%lib% >/system/lib/%lib%"
adb shell su-c "Chown 0.0/system/lib/%lib%"
adb shell su-c "chmod 644/system/lib/%lib%"
Set lib=libjni_googlepinyinime_latinime_4.so
ADB push%lib%/data/local/tmp/
adb shell su-c "cat/data/local/tmp/%lib% >/system/lib/%lib%"
adb shell su-c "Chown 0.0/system/lib/%lib%"
adb shell su-c "chmod 644/system/lib/%lib%"
adb shell su-c "Mount-o remount Rw/system"
Pause
ADB reboot
If the APK software is very large, you need to use the batch installation script, the content is as follows
Path "D:\Program files\ perfect brush machine \tools";%path%
Prompt $G
cd/d "%1"
Cls
@echo Current directory: CD =%cd%
@echo Current File: file=%file%
@echo.
ADB wait-for-device
ADB devices
adb shell su-c "Mount-o remount Rw/system"
for/f "delims="%%i in (' dir/b/a-d/S *.apk ') do (
echo Push%%~nxi To/system/app
Set Apk=%%~nxi
ADB push%%~nxi/data/local/tmp/
adb shell su-c "Cat/data/local/tmp/%%~nxi >/system/app/%%~nxi"
adb shell su-c "Chown 0.0/system/app/%%~nxi"
adb shell su-c "chmod 644/system/app/%%~nxi"
adb shell su-c "Rm/data/local/tmp/%%~nxi"
)
for/f "delims="%%j in (' dir/b/a-d/S *.so ') do (
echo Push%%~NXJ To/system/lib
Set LIB=%%~NXJ
ADB push%%~nxj/data/local/tmp/
adb shell su-c "CAT/DATA/LOCAL/TMP/%%~NXJ >/system/lib/%%~nxj"
adb shell su-c "Chown 0.0/system/lib/%%~nxj"
adb shell su-c "chmod 644/system/lib/%%~nxj"
adb shell su-c "RM/DATA/LOCAL/TMP/%%~NXJ"
)
adb shell su-c "Mount-o remount Rw/system"
Pause
ADB reboot
This script also supports, drag the APK folder to the above automatic installation.
Install apk into the system partition via ADB