It requires two external tools:
(1) apktool.jar
The need to go online to download, it is best to download the latest https://ibotpeaches.github.io/Apktool/install/
(2) jarsigner.exe
After this there will be a JDK installed
Decompile
java.exe -jar apktool.jar d Hello.apk
Repackaging
java.exe -jar apktool.jar b Hello -o Hello.apk
Perform the signature (dk1.8.0_221 \ bin \ jarsigner.exe)
jarsigner.exe -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore test.jks -storepass 12345678 Hello.apk key0
The above indicates that the signature algorithm "SHA1withRSA", digest algorithm is "SHA1", key store password is 12345678, 12345678 key cryptography, the key is test.jks, to be signed APK is hello.apk, key alias " key0 ".