Я хотел декомпилировать существующее приложение для Android, а после внесения изменений перекомпилировать и подписать его, но не могу установить на Android 11. В эмуляторе появилось следующее сообщение об ошибке:
Error code: '-124', message='-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary'
Manual Process:
Step 1: Generate Keystore (only once)
You need to generate a keystore once and use it to sign your unsigned apk. Use the keytool provided by the JDK found in %JAVA_HOME%/bin/
keytool -genkey -v -keystore my.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias app
Step 2 or 4: Zipalign
zipalign which is a tool provided by the Android SDK found in e.g. %ANDROID_HOME%/sdk/build-tools/24.0.2/ is a mandatory optimization step if you want to upload the apk to the Play Store.
zipalign -p 4 my.apk my-aligned.apk
Note: when using the old jarsigner you need to zipalign AFTER signing. When using the new apksigner method you do it BEFORE signing (confusing, I know). Invoking zipalign before apksigner works fine because apksigner preserves APK alignment and compression (unlike jarsigner).
You can verify the alignment with
zipalign -c 4 my-aligned.apk
Step 3: Sign & Verify
Using build-tools 24.0.3 and newer
Android 7.0 introduces APK Signature Scheme v2, a new app-signing scheme that offers faster app install times and more protection against unauthorized alterations to APK files (See here and here for more details). Therefore, Google implemented their own apk signer called apksigner (duh!) The script file can be found in %ANDROID_HOME%/sdk/build-tools/24.0.3/ (the .jar is in the /lib subfolder). Use it like this
apksigner sign --ks-key-alias alias_name --ks my.keystore my-app.apk
and can be verified with
apksigner verify my-app.apk
The official documentation can be found here.
Using build-tools 24.0.2 and older
Use jarsigner which, like the keytool, comes with the JDK distribution found in %JAVA_HOME%/bin/ and use it like so:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my.keystore my-app.apk my_alias_name
and can be verified with
jarsigner -verify -verbose my_application.apk
Какой инструмент мне использовать для решения этой проблемы? Когда я прочитал, это вызвано Android 11.
Я хотел декомпилировать существующее приложение для Android, а после внесения изменений перекомпилировать и подписать его, но не могу установить на Android 11. В эмуляторе появилось следующее сообщение об ошибке: [code]Error code: '-124', message='-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary' [/code] Мой использованный метод: [code]Manual Process: Step 1: Generate Keystore (only once) You need to generate a keystore once and use it to sign your unsigned apk. Use the keytool provided by the JDK found in %JAVA_HOME%/bin/
keytool -genkey -v -keystore my.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias app Step 2 or 4: Zipalign zipalign which is a tool provided by the Android SDK found in e.g. %ANDROID_HOME%/sdk/build-tools/24.0.2/ is a mandatory optimization step if you want to upload the apk to the Play Store.
zipalign -p 4 my.apk my-aligned.apk Note: when using the old jarsigner you need to zipalign AFTER signing. When using the new apksigner method you do it BEFORE signing (confusing, I know). Invoking zipalign before apksigner works fine because apksigner preserves APK alignment and compression (unlike jarsigner).
You can verify the alignment with
zipalign -c 4 my-aligned.apk Step 3: Sign & Verify Using build-tools 24.0.3 and newer Android 7.0 introduces APK Signature Scheme v2, a new app-signing scheme that offers faster app install times and more protection against unauthorized alterations to APK files (See here and here for more details). Therefore, Google implemented their own apk signer called apksigner (duh!) The script file can be found in %ANDROID_HOME%/sdk/build-tools/24.0.3/ (the .jar is in the /lib subfolder). Use it like this
apksigner sign --ks-key-alias alias_name --ks my.keystore my-app.apk and can be verified with
apksigner verify my-app.apk The official documentation can be found here.
Using build-tools 24.0.2 and older Use jarsigner which, like the keytool, comes with the JDK distribution found in %JAVA_HOME%/bin/ and use it like so:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my.keystore my-app.apk my_alias_name and can be verified with
jarsigner -verify -verbose my_application.apk [/code] Какой инструмент мне использовать для решения этой проблемы? Когда я прочитал, это вызвано Android 11.
Это не совсем мой вопрос. Это неактивный вопрос, который я нашел на Quora. Один из ответов заключался в том, что некоторые файлы заголовков могли измениться, но автор вопросов утверждает, что это не так. Мне бы хотелось услышать, что здесь скажут :)...
Я пытаюсь отслеживать вызовы функций Java в пользовательском пространстве с помощью bpftrace на устройстве Android, в частности в файлах oat/odex (специальный тип файла ELF), которые содержат предварительно скомпилированный код. Я использовал...
Я пытаюсь отслеживать вызовы функций Java в пользовательском пространстве с помощью bpftrace на устройстве Android, в частности в файлах oat/odex (специальный тип файла ELF), которые содержат предварительно скомпилированный код. Я использовал...
Мое приложение C/C++ использует сторонние библиотеки, которые выполняют системные вызовы.
Я хотел бы перехватить определенные системные вызовы, чтобы библиотеки вызывали мою версию. Я не хочу изменять их исходный код.
Я обнаружил kprobes, но мне...
Мое приложение C/C++ использует сторонние библиотеки, которые выполняют системные вызовы.
Я хотел бы перехватить определенные системные вызовы, чтобы библиотеки вызывали мою версию. Я не хочу изменять их исходный код.
Я обнаружил kprobes, но мне...