{"action":"created","issue":{"url":"https://api.github.com/repos/iBotPeaches/Apktool/issues/985","labels_url":"https://api.github.com/repos/iBotPeaches/Apktool/issues/985/labels{/name}","comments_url":"https://api.github.com/repos/iBotPeaches/Apktool/issues/985/comments","events_url":"https://api.github.com/repos/iBotPeaches/Apktool/issues/985/events","html_url":"https://github.com/iBotPeaches/Apktool/issues/985","id":92653267,"number":985,"title":"Adding smali classes and multidexing","user":{"login":"pvertenten","id":55938,"avatar_url":"https://avatars.githubusercontent.com/u/55938?v=3","gravatar_id":"","url":"https://api.github.com/users/pvertenten","html_url":"https://github.com/pvertenten","followers_url":"https://api.github.com/users/pvertenten/followers","following_url":"https://api.github.com/users/pvertenten/following{/other_user}","gists_url":"https://api.github.com/users/pvertenten/gists{/gist_id}","starred_url":"https://api.github.com/users/pvertenten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvertenten/subscriptions","organizations_url":"https://api.github.com/users/pvertenten/orgs","repos_url":"https://api.github.com/users/pvertenten/repos","events_url":"https://api.github.com/users/pvertenten/events{/privacy}","received_events_url":"https://api.github.com/users/pvertenten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-02T14:36:25Z","updated_at":"2015-07-02T14:53:52Z","closed_at":null,"body":"I've written a few shell scripts that can take an arbitrary aar file and include the resources, classes, etc. in the aar and merge them in with an app decompiled with apktool.\r\n\r\nIt works flawlessly for most apps, but some apps have near the maximum number of methods for a single classes.dex, so when I copy the classes from the aar into the apk smali directory I will get a build error that the short value can't support the number of methods in that classes.dex. I've tried created a smali_classesn folder and seeing if apktool picked it up, it did in fact pick it up at build time and include then in the apk. \r\n\r\nI: Smaling smali_classes2 folder into classes2.dex...\r\n\r\nHowever these classes are not visible via the application, so no dice.\r\n\r\nWondering if I am missing some other step.\r\n\r\n\r\nAlso I am not sure if there is any interest in adding this feature to apktool.\r\n\r\nThe feature opens up the apk, copies over the libraries, examines the public.xml and the R.txt in the aar, generates new ids for all of the resources, updates the ids.xml with the new resources, updates the public.xml with the new resources, smalis the classes from the aar and copies them into the app.\r\n\r\nFor most people the feature might not be that useful however, as they would need to edit some of the other code to actually use the newly included code, but it could be as simple as adding an additional service to  AndroidManifest.xml etc.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/iBotPeaches/Apktool/issues/comments/118058178","html_url":"https://github.com/iBotPeaches/Apktool/issues/985#issuecomment-118058178","issue_url":"https://api.github.com/repos/iBotPeaches/Apktool/issues/985","id":118058178,"user":{"login":"iBotPeaches","id":611784,"avatar_url":"https://avatars.githubusercontent.com/u/611784?v=3","gravatar_id":"","url":"https://api.github.com/users/iBotPeaches","html_url":"https://github.com/iBotPeaches","followers_url":"https://api.github.com/users/iBotPeaches/followers","following_url":"https://api.github.com/users/iBotPeaches/following{/other_user}","gists_url":"https://api.github.com/users/iBotPeaches/gists{/gist_id}","starred_url":"https://api.github.com/users/iBotPeaches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iBotPeaches/subscriptions","organizations_url":"https://api.github.com/users/iBotPeaches/orgs","repos_url":"https://api.github.com/users/iBotPeaches/repos","events_url":"https://api.github.com/users/iBotPeaches/events{/privacy}","received_events_url":"https://api.github.com/users/iBotPeaches/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T14:53:52Z","updated_at":"2015-07-02T14:53:52Z","body":"Apktool works just by a basic path, looking for `smali_classes#` and assembling those to that `classes#`.dex file. I'm not sure how exactly the multidex works, but apktool does not do anything for that. It simply disassembles and reassembles the dex files.\r\n\r\nAccording to docs, it modifies `classes.dex` to load all other dex files. - https://developer.android.com/tools/building/multidex.html\r\n\r\nAs for your concern whether there is interest for such a feature. I will admit to not knowing enough about the `aar` files to have an opinion yet. Let me research them."}}