Tools:
https://github.com/patrickfav/uber-apk-signer
https://github.com/iBotPeaches/Apktool
How:
apktool d app-release.apk -o extracted_apk
# Change extracted_apk/AndroidManifest.xml, for example add android:debuggable="true" right into the <application> node
apktool b extracted_apk -o app-release-mod.apk
keytool -genkey -keystore android.jks -keyalg RSA -keysize 2048 \
-validity 3650 -alias app -dname "cn=Unknown, ou=Unknown, o=Unknown, c=Unknown" \
-storepass abcdef12 -keypass abcdef12
apk-signer -a app-release-mod.apk --ks android.jks --ksAlias app --ksKeyPass abcdef12 --ksPass abcdef12 -o app-release-mod-signed