-2

I decompiled an APK (disclaimer: for personal use, not doing anything illegal) and aside from some weird unknown_attr values some attributes such as layout_width, layout_height and android:shape have integers as values.

Such as: <shape android:shape="0"></shape> or android:layout_width="-1"

When building an APK however, the android studio is throwing errors that integer types are not allowed.

Why is it that the decompiled APK can have integer types, but when re-compiling an APK it suddenly can't?

Do I have something misconfigured in my settings?

xorinzor
  • 6,140
  • 10
  • 40
  • 70
  • "Why is it that the decompiled APK can have integer types" -- my guess is that you are misinterpreting the output of your decompiler, and that those are references to resources (`android:layout_width`, `android:layout_height`) or an incomplete decompilation of a value back to the enumeration (`android:shape`). But, since you elected not to provide a [mcve], it will be difficult to confirm this. – CommonsWare Jul 13 '16 at 15:47
  • @commonsWare I added an example of what it looks like, altough I'm not sure that's really going to help here. Either way, there is no misconfiguration in my studio settings that (when fixed) would allow me to build an APK with those integer values? – xorinzor Jul 13 '16 at 15:53

1 Answers1

1

there is no misconfiguration in my studio settings that (when fixed) would allow me to build an APK with those integer values?

No. That is an invalid ShapeDrawable resource, as you can tell by reading the documentation.

Your problem lies in your decompiler.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks, at least now I know where to look :) – xorinzor Jul 13 '16 at 16:02
  • 1
    @xorinzor: What you will be looking for is a decompiler that turns those integers into symbols (e.g., `oval` for `android:shape`, `match_parent` for `android:layout_width`) or references to resources. The *compiled* resources have those as integers; whatever decompiler you are using is not attempting to reverse those into valid resource source files. – CommonsWare Jul 13 '16 at 16:05
  • I tried the online APK decompiler, which returned a lot of scrambled results and those integer types. After trying to decompile it manually, using a tutorial found on SO I got more usable code. Thanks :) – xorinzor Jul 13 '16 at 16:21