aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/aapt/linux/aapt (defaulting to $PATH binary)
Information
- **Apktool Version - Apktool 2.3.4-dirty
- Operating System (Mac, Linux, Windows) -Linux Mint 19.2 Cinnamon
- **APK From? https://apkpure.com/sennheiser-smart-control/com.sennheiser.control
Stacktrace/Logcat
Include stacktrace here
Steps to Reproduce
apktool
Questions to ask before submission
- Have you tried
apktool d,apktool bwithout changing anything? yes - If you are trying to install a modified apk, did you resign it? yes
- 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] <framework.apk> -p,--frame-path
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_password__0.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_password__2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$avd_show_password__0.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_password__2.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] `
There are no bugs here, but a culmination of a few things.
-
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 -
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.
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.
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_password__0.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_password__2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable-v21/$avd_show_password__0.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_password__2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$mute_to_unmute__0.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_unmute__2.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$mute_to_unmute__3.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_mute__0.xml: Invalid file name: must contain only [a-z0-9_.] W: res/drawable/$unmute_to_mute__1.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_mute__3.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!!??
[-] 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
Any solutions!!??
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/
Excelente buena solucion @Kiran9901 :)
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?
SOLUTION FOR DIRTY APKTOOL apktool d -f -r apkfilename.apk apktool b -f -r apkpath -o apk.apk
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.