iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
19.96k stars 3.57k forks source link

aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/aapt/linux/aapt (defaulting to $PATH binary) #2149

Closed Carlo-Raptura closed 5 years ago

Carlo-Raptura commented 5 years ago

Information

  1. **Apktool Version - Apktool 2.3.4-dirty
  2. Operating System (Mac, Linux, Windows) -Linux Mint 19.2 Cinnamon
  3. **APK From? https://apkpure.com/sennheiser-smart-control/com.sennheiser.control

Stacktrace/Logcat

Include stacktrace here

Steps to Reproduce

  1. apktool

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? yes
  2. If you are trying to install a modified apk, did you resign it? yes
  3. Are you using the latest apktool version? yes

My Problem is. When I dry to build / rebuild this APK-File then this Problem ocurs. I can whitout Problems entpack, build, sign the APK white the Command by Decode : d -r,--no-res but then I can locial not change the AndroidManifest.xml -.- Thank you very much for Help. I hope my Troubleshouting helpt by the Devolopement. And Yes before I post here my Problem I searched in the Internet to this Problem but I did not found something Helpfull. So I know that Page: https://stackoverflow.com/questions/23317208/apktool-build-apk-fails or that https://github.com/iBotPeaches/Apktool/issues/2007

`usage: apktool -advance,--advanced prints advance information. -version,--version prints the version then exits usage: apktool if|install-framework [options] -p,--frame-path

Stores framework files into . -t,--tag Tag frameworks using . usage: apktool d[ecode] [options] -f,--force Force delete destination directory. -o,--output The name of folder that gets written. Default is apk.out -p,--frame-path Uses framework files located in . -r,--no-res Do not decode resources. -s,--no-src Do not decode sources. -t,--frame-tag Uses framework files tagged by . usage: apktool b[uild] [options] -f,--force-all Skip changes detection and build all files. -o,--output The name of apk that gets written. Default is dist/name.apk -p,--frame-path Uses framework files located in .

For additional info, see: http://ibotpeaches.github.io/Apktool/ For smali/baksmali info, see: https://github.com/JesusFreke/smali root@CORSAIR-GTX670:/home/caccialupi# sudo apktool b /home/caccialupi/SennheiserSmartControlv2.1.3 I: Using Apktool 2.3.4-dirty I: Checking whether sources has changed... I: Checking whether resources has changed... I: Building resources... W: aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/aapt/linux/aapt (defaulting to $PATH binary) W: res/drawable/$avd_hide_password0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_hide_password_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$avd_hide_password2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_show_password0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_show_password_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$avd_show_password2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$ic_launcher_foreground_0.xml: Invalid file name: must contain only [a-z0-9.] brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [aapt, p, --min-sdk-version, 24, --target-sdk-version, 26, --version-code, 2899, --version-name, 2.1.3, --no-version-vectors, -F, /tmp/APKTOOL5140380408855499325.tmp, -0, arsc, -0, META-INF/android.arch.core_runtime.version, -0, META-INF/android.arch.lifecycle_livedata-core.version, -0, META-INF/android.arch.lifecycle_livedata.version, -0, META-INF/android.arch.lifecycle_runtime.version, -0, META-INF/android.arch.lifecycle_viewmodel.version, -0, META-INF/android.support.design_material.version, -0, META-INF/androidx.appcompat_appcompat.version, -0, META-INF/androidx.asynclayoutinflater_asynclayoutinflater.version, -0, META-INF/androidx.cardview_cardview.version, -0, META-INF/androidx.coordinatorlayout_coordinatorlayout.version, -0, META-INF/androidx.core_core.version, -0, META-INF/androidx.cursoradapter_cursoradapter.version, -0, META-INF/androidx.customview_customview.version, -0, META-INF/androidx.documentfile_documentfile.version, -0, META-INF/androidx.drawerlayout_drawerlayout.version, -0, META-INF/androidx.fragment_fragment.version, -0, META-INF/androidx.interpolator_interpolator.version, -0, META-INF/androidx.legacy_legacy-support-core-ui.version, -0, META-INF/androidx.legacy_legacy-support-core-utils.version, -0, META-INF/androidx.legacy_legacy-support-v4.version, -0, META-INF/androidx.loader_loader.version, -0, META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version, -0, META-INF/androidx.media_media.version, -0, META-INF/androidx.print_print.version, -0, META-INF/androidx.recyclerview_recyclerview.version, -0, META-INF/androidx.slidingpanelayout_slidingpanelayout.version, -0, META-INF/androidx.swiperefreshlayout_swiperefreshlayout.version, -0, META-INF/androidx.transition_transition.version, -0, META-INF/androidx.vectordrawable_vectordrawable-animated.version, -0, META-INF/androidx.vectordrawable_vectordrawable.version, -0, META-INF/androidx.versionedparcelable_versionedparcelable.version, -0, META-INF/androidx.viewpager_viewpager.version, -0, META-INF/com.google.android.material_material.version, -0, res/drawable-hdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png, -0, png, -0, res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, -0, res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, -0, res/drawable-hdpi-v4/abc_cab_background_top_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_list_divider_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_list_focused_holo.9.png, -0, res/drawable-hdpi-v4/abc_list_longpressed_holo.9.png, -0, res/drawable-hdpi-v4/abc_list_pressed_holo_dark.9.png, -0, res/drawable-hdpi-v4/abc_list_pressed_holo_light.9.png, -0, res/drawable-hdpi-v4/abc_list_selector_disabled_holo_dark.9.png, -0, res/drawable-hdpi-v4/abc_list_selector_disabled_holo_light.9.png, -0, res/drawable-hdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png, -0, res/drawable-hdpi-v4/abc_popup_background_mtrl_mult.9.png, -0, res/drawable-hdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_scrubber_track_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-hdpi-v4/abc_switch_track_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_tab_indicator_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_textfield_activated_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_textfield_default_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png, -0, jpg, -0, res/drawable-hdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png, -0, res/drawable-hdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png, -0, res/drawable-hdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png, -0, res/drawable-hdpi-v4/common_google_signin_btn_text_light_normal_background.9.png, -0, res/drawable-hdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-hdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-hdpi-v4/notification_bg_normal.9.png, -0, res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-ldrtl-hdpi-v17/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-ldrtl-mdpi-v17/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-ldrtl-xhdpi-v17/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-ldrtl-xxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-ldrtl-xxxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-mdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, -0, res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, -0, res/drawable-mdpi-v4/abc_cab_background_top_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_list_divider_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_list_focused_holo.9.png, -0, res/drawable-mdpi-v4/abc_list_longpressed_holo.9.png, -0, res/drawable-mdpi-v4/abc_list_pressed_holo_dark.9.png, -0, res/drawable-mdpi-v4/abc_list_pressed_holo_light.9.png, -0, res/drawable-mdpi-v4/abc_list_selector_disabled_holo_dark.9.png, -0, res/drawable-mdpi-v4/abc_list_selector_disabled_holo_light.9.png, -0, res/drawable-mdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png, -0, res/drawable-mdpi-v4/abc_popup_background_mtrl_mult.9.png, -0, res/drawable-mdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_scrubber_track_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-mdpi-v4/abc_switch_track_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_tab_indicator_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_textfield_activated_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_textfield_default_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png, -0, res/drawable-mdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png, -0, res/drawable-mdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png, -0, res/drawable-mdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png, -0, res/drawable-mdpi-v4/common_google_signin_btn_text_light_normal_background.9.png, -0, res/drawable-mdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-mdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-mdpi-v4/notification_bg_normal.9.png, -0, res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-xhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, -0, res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, -0, res/drawable-xhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_list_divider_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_list_focused_holo.9.png, -0, res/drawable-xhdpi-v4/abc_list_longpressed_holo.9.png, -0, res/drawable-xhdpi-v4/abc_list_pressed_holo_dark.9.png, -0, res/drawable-xhdpi-v4/abc_list_pressed_holo_light.9.png, -0, res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_dark.9.png, -0, res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_light.9.png, -0, res/drawable-xhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png, -0, res/drawable-xhdpi-v4/abc_popup_background_mtrl_mult.9.png, -0, res/drawable-xhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_switch_track_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_textfield_default_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png, -0, res/drawable-xhdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png, -0, res/drawable-xhdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png, -0, res/drawable-xhdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png, -0, res/drawable-xhdpi-v4/common_google_signin_btn_text_light_normal_background.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-xxhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, -0, res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, -0, res/drawable-xxhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_list_divider_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_list_focused_holo.9.png, -0, res/drawable-xxhdpi-v4/abc_list_longpressed_holo.9.png, -0, res/drawable-xxhdpi-v4/abc_list_pressed_holo_dark.9.png, -0, res/drawable-xxhdpi-v4/abc_list_pressed_holo_light.9.png, -0, res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_dark.9.png, -0, res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_light.9.png, -0, res/drawable-xxhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png, -0, res/drawable-xxhdpi-v4/abc_popup_background_mtrl_mult.9.png, -0, res/drawable-xxhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_switch_track_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_textfield_default_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png, -0, res/drawable-xxhdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png, -0, res/drawable-xxhdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png, -0, res/drawable-xxhdpi-v4/common_google_signin_btn_text_dark_normal_background.9.png, -0, res/drawable-xxhdpi-v4/common_google_signin_btn_text_light_normal_background.9.png, -0, res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, -0, res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, -0, res/drawable-xxxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-xxxhdpi-v4/abc_switch_track_mtrl_alpha.9.png, -0, res/drawable-xxxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /home/caccialupi/SennheiserSmartControlv2.1.3/res, -M, /home/caccialupi/SennheiserSmartControlv2.1.3/AndroidManifest.xml] `

iBotPeaches commented 5 years ago

There are no bugs here, but a culmination of a few things.

1) Your system can not write binaries to /tmp, so it is falling back to $PATH variables to find aapt. You can pull binaries from another location via -p

2) The large command list is a duplicate with a work-around coming in upcoming release - https://github.com/iBotPeaches/Apktool/issues/1272

Closing as support and duplicate.

richpowell commented 4 years ago

apktool d -f -r

I was also getting the same error. Use flags -f and -r during apktool d

Now during build there is no resource error.

starbuddy55 commented 4 years ago

Yes am also having the same error while recompiling apk from apktool 2.4.1-dirty.

My OS : Android 8.1.0 - Linux 3.18.71-perf-ge84d0a7 (aarch64) Apk name: myapp version-V116

"apktool d /root/myapp.apk" work well and create myapp directory.But, "apktool b /root/myapp" shows error..

I noticed in that error that there are different versions number are found and "could not extract resource/aapt/...." Following as below,

I: Building resources... W: aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/linux/aapt_64 (defaulting to $PATH binary) W: res/drawable-v21/$avd_hide_password0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable-v21/$avd_hide_password_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable-v21/$avd_hide_password2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable-v21/$avd_show_password0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable-v21/$avd_show_password_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable-v21/$avd_show_password2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$mute_to_unmute0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$mute_to_unmute_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$mute_to_unmute2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$mute_to_unmute3.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$mute_to_unmute_4.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$unmute_to_mute0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$unmute_to_mute1.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$unmute_to_mute_2.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$unmute_to_mute3.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$unmute_to_mute_4.xml: Invalid file name: must contain only [a-z0-9.] brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [aapt, p, --min-sdk-version, 16, --target-sdk-version, 29, --version-code, 116, --version-name, 116, --no-version-vectors, -F, /tmp/APKTOOL13362809782026137514.tmp, -0, resources.arsc, -0, png, -0, wav, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /root/myapp/res, -M, /root/myapp/AndroidManifest.xml]

Any solutions!!??

Sulaiman3352 commented 3 years ago

[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload [-] No arch selected, selecting arch: dalvik from the payload [] Creating signing key and keystore.. [] Decompiling original APK.. [] Decompiling payload APK.. [] Locating hook point.. [] Adding payload as package com.duolingo.jlpia [] Loading /tmp/d20210310-43720-b1vnea/original/smali/com/duolingo/core/DuoApp.smali and injecting payload.. [] Poisoning the manifest with meterpreter permissions.. [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Adding [] Rebuilding apk with meterpreter injection as /tmp/d20210310-43720-b1vnea/output.apk [-] I: Using Apktool 2.5.0-dirty I: Checking whether sources has changed... I: Smaling smali folder into classes.dex... I: Checking whether sources has changed... I: Smaling smali_classes2 folder into classes2.dex... I: Checking whether resources has changed... I: Building resources... W: aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/linux/aapt_64 (defaulting to $PATH binary) W: res/drawable/$avd_hide_password0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_hide_password_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$avd_hide_password2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_show_password0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_show_password_1.xml: Invalid file name: must contain only [a-z0-9.] W: res/drawable/$avd_show_password2.xml: Invalid file name: must contain only [a-z0-9_.] brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [aapt, p, --min-sdk-version, 22, --target-sdk-version, 28, --version-code, 828, --version-name, 4.33.2, --no-version-vectors, -F, /tmp/APKTOOL4577100955902494323.tmp, -0, resources.arsc, -0, META-INF/android.support.design_material.version, -0, META-INF/androidx.appcompat_appcompat.version, -0, META-INF/androidx.arch.core_core-runtime.version, -0, META-INF/androidx.asynclayoutinflater_asynclayoutinflater.version, -0, META-INF/androidx.browser_browser.version, -0, META-INF/androidx.cardview_cardview.version, -0, META-INF/androidx.coordinatorlayout_coordinatorlayout.version, -0, META-INF/androidx.core_core-ktx.version, -0, META-INF/androidx.core_core.version, -0, META-INF/androidx.cursoradapter_cursoradapter.version, -0, META-INF/androidx.customview_customview.version, -0, META-INF/androidx.databinding_baseAdapters.version, -0, META-INF/androidx.databinding_library.version, -0, META-INF/androidx.documentfile_documentfile.version, -0, META-INF/androidx.drawerlayout_drawerlayout.version, -0, META-INF/androidx.dynamicanimation_dynamicanimation.version, -0, META-INF/androidx.exifinterface_exifinterface.version, -0, META-INF/androidx.fragment_fragment.version, -0, META-INF/androidx.gridlayout_gridlayout.version, -0, META-INF/androidx.interpolator_interpolator.version, -0, META-INF/androidx.legacy_legacy-support-core-ui.version, -0, META-INF/androidx.legacy_legacy-support-core-utils.version, -0, META-INF/androidx.legacy_legacy-support-v4.version, -0, META-INF/androidx.lifecycle_lifecycle-extensions.version, -0, META-INF/androidx.lifecycle_lifecycle-livedata-core.version, -0, META-INF/androidx.lifecycle_lifecycle-livedata.version, -0, META-INF/androidx.lifecycle_lifecycle-process.version, -0, META-INF/androidx.lifecycle_lifecycle-runtime.version, -0, META-INF/androidx.lifecycle_lifecycle-service.version, -0, META-INF/androidx.lifecycle_lifecycle-viewmodel.version, -0, META-INF/androidx.loader_loader.version, -0, META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version, -0, META-INF/androidx.media_media.version, -0, META-INF/androidx.print_print.version, -0, META-INF/androidx.recyclerview_recyclerview.version, -0, META-INF/androidx.room_room-runtime.version, -0, META-INF/androidx.slidingpanelayout_slidingpanelayout.version, -0, META-INF/androidx.sqlite_sqlite-framework.version, -0, META-INF/androidx.sqlite_sqlite.version, -0, META-INF/androidx.swiperefreshlayout_swiperefreshlayout.version, -0, META-INF/androidx.transition_transition.version, -0, META-INF/androidx.vectordrawable_vectordrawable-animated.version, -0, META-INF/androidx.vectordrawable_vectordrawable.version, -0, META-INF/androidx.versionedparcelable_versionedparcelable.version, -0, META-INF/androidx.viewpager_viewpager.version, -0, META-INF/com.google.android.material_material.version, -0, mp3, -0, png, -0, res/raw/config.zip, -0, res/raw/contractions.zip, -0, m4v, -0, res/raw/tokens.zip, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/d20210310-43720-b1vnea/original/res, -M, /tmp/d20210310-43720-b1vnea/original/AndroidManifest.xml] Error: Unable to rebuild apk with apktool

Any solutions!!??

Kiran9901 commented 3 years ago

Replacing apktool-dirty with apktool solves the problem. To do so, first remove existing apktool using the following command: sudo apt remove apktool sudo apt autoremove

Then follow the link for installing apktool: https://ibotpeaches.github.io/Apktool/install/

edgarluck commented 2 years ago

Excelente buena solucion @Kiran9901 :)

runetech0 commented 2 years ago

apktool d -f -r

I was also getting the same error. Use flags -f and -r during apktool d

Now during build there is no resource error.

I'm relatively new to all the apk stuff and this one does the job. We don't face error anymore using this method. The problem now I can't find the network related config file that I can find without using -r flag. I think that file never gets decompiled when using that flag so the solution doesn't kinda work for me. BTW, I'm trying to disable certificate pinning manually from an app. Any suggestions?

gleison1986CEO commented 3 months ago

SOLUTION FOR DIRTY APKTOOL apktool d -f -r apkfilename.apk apktool b -f -r apkpath -o apk.apk

elliot-hacks commented 1 day ago

SOLUTION FOR DIRTY APKTOOL apktool d -f -r apkfilename.apk apktool b -f -r apkpath -o apk.apk

The solution works except only when i need to edit AndroidManifest.xml then recompile.