yashsingh1/xdaforums huggingface dataset:
[Android Software Development] tpuserhp:
Thanks. I was trying to place into/update apktool.jar (2.4.0) with the android-framework.jar mentioned in the url https://github.com/iBotPeaches/Apktool/commit/c2065995ed5d4e1b69b701c27a0f02f49e528d7b. Not sure whether I can do this. If not, this could be the reason of the corrupted jar.

I don't have a recent Q build to try :(

---------- Post added at 11:02 AM ---------- Previous post was at 10:55 AM ----------

This is exactly what I was trying to do: decompile- modify- recompile all the app's apk and install them using SAI app. The apk was installed but was complained being invalid during opening of the app. Will continue trying.

---------- Post added at 11:11 AM ---------- Previous post was at 11:02 AM ----------

Will review the link provided. Thanks. If i did not modify any apks, SAI can install the apk with the individual apks with no problem. This works in Amazon fire stick tv 4k with no google Play store. But I want to modify the base apk. :(
[Android Software Development] tpuserhp:
Picked another app which does not have issplitrequired keyword in the android manifest xml file. Without changes anything, decompile, recompile and sign all apks. But i have to use -r option to decompile. Install all apks using SAI app. Can run the app ok. Success. Now will try just modifying the code, not resources.

**Update: now I can modify the base apk codes, recompile, signed and install all apks. The app runs normally. Hope apktool 2.4.1 will come soon. Thanks.
[Android Software Development] Thebear j koss:
You have a broken .9.png

Sent from my PH-1 using Thebear Blue XDA Labs
[Android Software Development] *justintime*:
Thanks... Found out APKTOOL X app. And it worked with that app.
[Android Software Development] gloeyisk:
Could you provide me the app?

Edit: Nevermind, that was old app, just realized minutes ago.
[Android Software Development] Ticklefish:
Just thought I'd chip in and say you don't need to install all those APK files. You only need to install the framework ones - the ones with "res" in their filename.

There's no harm in installing the other APK's. Nothing bad will happen. Apktool just won't ever need to use them.
[Android Software Development] abdoz88:
I am having a strange issue with apktool, when I replace an old image with new one and then compile and test the app on my phone it shows the old one.

any help will be appreciated.
[Android Software Development] DragonFire1024:
Look in all folders with images for the same one. The file name may be different but if the image is the same, you need to change it too and resize to the same size. They also need to be the same extension (replace .png with .png) Also depending on the apk, you don't need to decompile. Just open up the apk as an archive in something like 7zip and look for relevant images and replace them.
[Android Software Development] abdoz88:
thanks for the replay, I tried what you said but it didn't work also,

even I just updated the old image and it alaways shows the old one without any updating,

I was facing this issue on android studio and I solved it using clean project but I am not sure if this solution can be done with apktool.
[Android Software Development] djdarkknight96:
What app and what image?
[Android Software Development] DragonFire1024:
Look for images in an assets folder if any. Also check res/raw.
[Android Software Development] spirocker:
easy APKtool fail to recompile could not exec (exit code = 1):

Hi there,

I usually have no problems with unity games using apktool but since the 64bits updates its getting tricky

any solution for this error brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1)

usin easy apktool 2.4.0 use aapt2 on windows 10

game app with unity from playsotre

Log out

I: Building resources...
S: WARNING: Could not write to (C:\Users\Zakaria\AppData\Local\apktool\framework), using C:\Users\Zakaria\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
W: C:\Users\Zakaria\Documents\APK Easy Tool\1-Decompiled APKs\com.toypopcubes.addictivepuzzle_1.0.6\AndroidManifest.xml:1: error: attribute android:compileSdkVersion not found.
W: C:\Users\Zakaria\Documents\APK Easy Tool\1-Decompiled APKs\com.toypopcubes.addictivepuzzle_1.0.6\AndroidManifest.xml:1: error: attribute android:compileSdkVersionCodename not found.
W: error: failed processing manifest.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Zakaria\AppData\Local\Temp\brut_util_Jar_4624598102009942070.tmp, link, -o, C:\Users\Zakaria\AppData\Local\Temp\APKTOOL7139164898275731339.tmp, --package-id, 127, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 200002, --version-name, 1.0.6, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -0, arsc, -0, resource, -0, arsc, -I, C:\Users\Zakaria\AppData\Local\Temp\1.apk, --manifest, C:\Users\Zakaria\Documents\APK Easy Tool\1-Decompiled APKs\com.toypopcubes.addictivepuzzle_1.0.6\AndroidManifest.xml, C:\Users\Zakaria\Documents\APK Easy Tool\1-Decompiled APKs\com.toypopcubes.addictivepuzzle_1.0.6\build\resources.zip]
[Android Software Development] Ticklefish:
Try emptying your framework directory ("apktool empty-framework-dir").
[Android Software Development] spirocker:
fantastic it did compile the app after emptying the framework, but the compiled app doesn't get installed on the phone, i didn't make any changes to the app just to try it out first, there no similar app on the phone or similar package/app_id, I can't figure this one out now.

any suggestions?
[Android Software Development] djdarkknight96:
Did you sign the app after building?
[Android Software Development] spirocker:
Yes I did I tried manual with winrar, and I tried with apk-signer 1.8.5 and I tried keep original key but none of them works

I have been using easy APKtool for 2 years now never had this one, I"v tried several game apps

64bits unity build and it happens with them all, unlike same apps 32bits versions.
[Android Software Development] sdeft:
Any help in changing some resources in a base.apk taken from a bundle ? It decompiles fine but gives an error when building.
[Android Software Development] Ibuprophen:
The Apktool isn't really the greatest tool regarding Bundles and very limited depending upon them as well.

There's a few variations to the App Bundles (.apks) and isn't always "cut and dry" (or just one type).

You really need to know about the bundle itself before knowing weather or not you can just simply edit an app within a specific bundle.

I'm actually fairly new to the App Bundles myself and I've tried to modify an apk file within a bundle a few times that doesn't end up working TBH.

I've previously asked [MENTION=3924617]iBotPeaches[/MENTION] about this type of support for them and he had stated that he currently has no plans for implementing the Google Android App BundleTool into Apktool.

He also added that the Bundles are actually a fairly new thing that Google had implemented and adding support for them would not be an easy task to do but, never say never (someday in the future).

I just wanted to bring this to your attention and let you know (what I know) the best way I can. I just hope that I had explained the above information okay via text.

Good Luck! :)

~~~~~~~~~~~~~~~

Unless asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX2 Forum App on my Sanyo Juno device.
[Android Software Development] sdeft:
Very well explained.

I also tried to compile the app by removing the"'isSplitRequired' and merging the info from split apk but new apk always crashes.

I know it is possible though because I have seen modded apps of bundle as one apk and they work fine.

Thanks anyway.
[Android Software Development] DragonFire1024:
Google maps apk has an apk inside of it. So yes it is possible.
[Android Software Development] Ibuprophen:
Those who merge them uses the Google Bundletool. The following is the Github repository for it.

https://github.com/google/bundletool

I believe that it requires something like Android Studio with the bundletool jar file.

Good Luck!

~~~~~~~~~~~~~~~

Unless asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX2 Forum App on my Sanyo Juno device.
[Android Software Development] sdeft:
I don't think you can merge with this tool. I tried it in linux with no luck. Maybe I missed something though.
[Android Software Development] djdarkknight96:
It's hit or miss, some can work but some need to be installed with root with the xtra bits that are needed in the split apk's. And sometimes that doesn't work either. It depends on how the app was built I'm assuming. Only way I've only been successful using overlays to mod them with substratum. Even then some things won't change. Custom icons and things in that special apk.
[Android Software Development] Ibuprophen:
I had called a friend of mine who has a few Play Store Apps...

He's familiar with the ".apks" and stated...

I can't state, personally, that the app your trying to merge falls into the "impossible" but, the quote I had provided is just something to keep in mind (something to consider).

I do wish you the best of luck and I also learned something as well! :)

~~~~~~~~~~~~~~~

Unless asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX2 Forum App on my Sanyo Juno device.
[Android Software Development] :
hi. wheres the directory when compiling in linux?
[Android Software Development] Ticklefish:
It depends what sort of compiling you're doing. If you're decompiling, the directory that is created is wherever you've told apktool to put it. If you're recompiling, apktool doesn't create a directory.
[Android Software Development] persona78:
Hi!

I create some bat files that i think will get this easy to work.

you can download here:

https://mega.nz/#!SpR3GKqT!iHpyU40ab_k6Thb0mJ9UHTFtBkeJ03Rz5umhZUtj5A8

You will find apktool folder and Sign_apk_V2.0 folder.

In apktool folder you will get the bat tools and when you decode or rebuild a apk you will get log txt files that will help to get the errors if it happens, help a lot.

To work you need framework-res.apk from rom framework folder, some apps require that to install one framework over another framework with out unistalling previous one, example, to decompile Sony music player i had to install xiaomi miui 10 framework-res.apk then Pixel bonito-pd2a.190115.029-factory-aac5b874 framework!!! Weird, right?!?!?

For Huawei apps some times need to install framework-res-hwext.apk to.

In Sign_apk_V2.0 you will be able to sign the apk then install it like a regular apk.

I hope this will help you!
[Android Software Development] ALYSKY:
When I try to unpack .apk file, apk tool show me this:

Exception in thread "main" brut.androlib.AndrolibException: unsupported res type name for bags. Found: style2

at brut.androlib.res.data.value.ResValueFactory.bagFactory(ResValueFactory.java:115)

at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:350)

at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:276)

at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:252)

at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:175)

at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:131)

at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:82)

at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)

at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:748)

at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)

at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:59)

at brut.androlib.Androlib.getResTable(Androlib.java:68)

at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:228)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:118)

at brut.apktool.Main.cmdDecode(Main.java:167)

at brut.apktool.Main.main(Main.java:76)

How to fix this?

---------- Post added at 18:30 ---------- Previous post was at 18:30 ----------

When I try to unpack .apk file, apk tool show me this:

Exception in thread "main" brut.androlib.AndrolibException: unsupported res type name for bags. Found: style2

at brut.androlib.res.data.value.ResValueFactory.bagFactory(ResValueFactory.java:115)

at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:350)

at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:276)

at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:252)

at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:175)

at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:131)

at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:82)

at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)

at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:748)

at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)

at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:59)

at brut.androlib.Androlib.getResTable(Androlib.java:68)

at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:228)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:118)

at brut.apktool.Main.cmdDecode(Main.java:167)

at brut.apktool.Main.main(Main.java:76)

How to fix this?
[Android Software Development] Ticklefish:
The trick with this sort of problem is to look at the first error line:

Exception in thread "main" brut.androlib.AndrolibException: unsupported res type name for bags. Found: style2

Everything else is important but is just telling you which lines of various bits of code are being affected by that error. Useful but not what you need to know right now.

If you Google "unsupported res type name for bags. Found: style2", the very first result tells you what's going on: https://github.com/iBotPeaches/Apktool/issues/1719

According to that site this is most likely caused by the developers using a tool to protect the APK from being decompiled. The only solution so far is to change the apktool code itself and build your own version of the tool. That'll be able to process your APK.

If you do this, feel free to share the resulting JAR file as I'm sure lots of other people would find it useful!
[Android Software Development] persona78:
Do you use the framework from apk rom?

.
[Android Software Development] LoqqaL:
hi guys i'm new on xda

i have a question

i have a game want to modify it but this bundles blocks me

when i take the game from my phone to pc there is 2 file "base" and "lib"

i modify lib and recompile it again then trying to install but it gives error

when i put lib files to base file and try to recompile its ggiving error "xml. files says issplitrequired"

so i modify the xml made issplitrequired to false

but its still says isplitrequired

then i try to find someones mod and their apk is not bundle and include lib files

so i change my lib files with its lib files then recompiled it

when i install it i get blackscreen on app without any error so its not working(but without my lib files its working)

what should i do for merge or how can i solve blackscreen problem?
[Android Software Development] Ticklefish:
The easiest way to answer that is probably with another quote...
[Android Software Development] Tamibal:
Best to perform small debugging and helping with some repetitive tasks
[Android Software Development] titan-computer:
hi

i'm new to use apktool

i've read about that on https://ibotpeaches.github.io/Apktool/documentation

i want to decode all files of an apk even classes.dex

i grab my framework-res.apk and install that on C:\ on win10

then i decomplie my apk but i see classes.dex.dat is not decompiled and i cant open that with notepad++

what should i do?

decoding log :

C:\>apktool d myapk.apk -p C:\
I: Using Apktool 2.4.0 on myapk.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
[Android Software Development] djdarkknight96:
Classes decompile to smali folders
[Android Software Development] titan-computer:
i've checked that before. there is just 2 files with less than 300 kb data and when i open those on notepad++ i didn't see any regular codes to understand or edit. it seems scrambled.

.class public Lir/bmi/bam/ProtectedBmiApplication;
.super Landroid/app/Application;

# static fields
.field private static volatile transient b:[Ljava/lang/Object;

.field private static qJ:[B

.field private static r:Ljava/lang/String;

.field public static s:Z

.field private static wbC:Ljava/lang/Object;

.field private static wvzy:Z

# direct methods
.method static constructor <clinit>()V
.locals 1

.prologue
const/16 v0, 0x2c51

new-array v0, v0, [B

fill-array-data v0, :array_0

sput-object v0, Lir/bmi/bam/ProtectedBmiApplication;->qJ:[B

return-void

:array_0
.array-data 1
0x76t
-0x65t
-0x2et
-0x3ft
-0x42t
-0x6dt
-0x39t
-0x5at
0x61t
0x5ft
-0x41t
0x17t
-0x3t
[Android Software Development] djdarkknight96:
Then that's all the smali it has. What app are you trying to mod? Some apps are web only. Smali is kinda readable.
[Android Software Development] titan-computer:
its a banking app which prevent rooted device to use

i want to find root checker code and disable that.
[Android Software Development] djdarkknight96:
Just use magisk hide, you'll have hard time finding that IMO.
[Android Software Development] titan-computer:
magisk hide didn't work on this app. i think it maybe check another things like lucky patacher or titanium abckup existance, i cannot hide all things.

how can i find the codes of root checking on that?
[Android Software Development] djdarkknight96:
They hide that code for a reason, might even be server checked from the bank. Banking apps aren't gonna be easy to crack bro. I say give up!
[Android Software Development] titan-computer:
i've modded 2 apps already, but this is different because i can't find any codes.

you say maybe they checks root from server? how is that possible?
[Android Software Development] djdarkknight96:
2 bank apps I doubt that bro

Server checks can download code and be on your data not within the apk.
[Android Software Development] titan-computer:
yeah, 2 simple bank apps. i've just change 0x1 to 0x0 in root checker codes and yes it works.

i don't think so, i've uninstalled the app and reinstall again, turn off wifi and mobile data and run app, without internet it sais rooted device!
[Android Software Development] djdarkknight96:
I'm just making suggestions with it having barely any source. Most apps with no java or barely any java/small are usually web view. Might be the case here also.
[Android Software Development] titan-computer:
can you check this apk?

http://bamapps.bmi.ir/app/android/bam-v2.6.7-Android4.4AndUp.apk

i want to mod this app to can be used on rooted phone.
[Android Software Development] Ticklefish:
So there are only two smali files inside this APK's DEX file: "MessageGuardException.smali" and "ProtectedBmiApplication.smali". Both of these decompile to fairly standard-looking smali.

If the code you need to edit isn't in those files then you're out of luck. App developers can sometimes be quite clever, especially when it comes to secure things like banking apps, and it's not impossible that the code you want to get to is held on the server side.
[Android Software Development] titan-computer:
it's a normally smali code?

why is it so scrambled? am i wrong?

is there any app to edit or it can read better smali codes?

i've use notepad++ and i didn't find any readable code in those files.
[Android Software Development] djdarkknight96:
I could read it just fine with note++, smali has a lot you can read. Public values and smali hex colors etc.

Like I said before that app doesn't have much inside, gotta be server fed security.
[Android Software Development] Tagdu17:
Hi guys !

I'm trying to recompile Framework-res (From Samsung) with APK Easy Tool but I constantly have these errors (see attached logs).

I tried with APKtool 2.4.0, 2.3.4 and 2.3.2 but it's always the same : I get these errors...

Maybe someone here could help me to find out a solution :D

Thx in advance for your help !

Greetings :)

PS : I'm using aapt2 to compile
[Android Software Development] titan-computer:
it doesn't server side, i've checked before. because i've uninstalled the app, turn off all data and wifi, install app. without internet it knows rooted phone.

i'm failed on rebuild apk, after i change the codes, i've build apk and sign. apk is going to install but didn't open app and make force close.

after that i've tested many times and didn't succeeded.

another time from beginning i've just decompile the apk and compile again without any changes, the apk installed but didn't run like before. do i something wrong?
[Android Software Development] Ticklefish:
I've done a bit more research into this. Your APK has some DEX files in its asset folder:

I think you mentioned these DEX.DAT files in your original post but I didn't think anything about it at the time. Sorry about that.

These files are going to be the ones that you'll need to edit as, from what you've been saying, the two smali files I mentioned previously haven't got the relevant code.

If a DEX file is somewhere other than the root of the APK file, apktool won't process it. As [MENTION=3924617]iBotPeaches[/MENTION] mentioned on github (https://github.com/iBotPeaches/Apktool/issues/1312): "This is intentional behavior currently. I stupidly didn't reference the bug when I made commit, but there were applications with dex files in the non-root directory thus apktool would disassemble them and then assemble them into the root of application breaking the original purpose.".

You can use baksmali.jar to process these files but there is a problem. These aren't DEX files...these are DEX.DAT files.

Doing a bit of googling, it looks like these are files that have been encrypted by DexGuard. This is discussed here: https://stackoverflow.com/questions/34426911/what-methods-are-being-used-to-protect-this-android-apk-reflection-encryption. It is technically possible to decrypt an encrypted file but it is a lot of hard work. As it says on that link: "...the summary of the answers is that you must be very familiar with Java, Reflection and the way Dalvik and ART work, so you could manually decrypt the classes. It's hard enough even for a professional.".

I know it's not the answer you're hoping for but it does look like you're out of luck with this one. Sorry.

This is what's stopping your APK from compiling:

...framework-res\res\values\attrs.xml:2590: error: invalid value for type 'attr'. Expected a reference.

This is normally caused by some dummy values produced during decompiling.

Try decompiling with apktool 2.2.4 instead. That should sort this issue out.
[Android Software Development] titan-computer:
thanks for responding.

i know about the dex.dat, i've found those files. didn't want to decrypt that.

i've probably found the root checker code in smali but problem is at any circumstances, after compiling apk, the app didn't run even i've change nothingm just decompile and compile again, the apps immidately closes with force close report.

another question, can i change somethings in root folders of android after installing the app? where is it?