Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.mobile.android > #141785 > unrolled thread

binary AndroidManifest.xml, resource ID to string. How to ?

Started by"R.Wieser" <address@is.invalid>
First post2024-06-04 12:31 +0200
Last post2024-06-05 10:11 +0200
Articles 15 — 4 participants

Back to article view | Back to comp.mobile.android


Contents

  binary AndroidManifest.xml, resource ID to string.  How to ? "R.Wieser" <address@is.invalid> - 2024-06-04 12:31 +0200
    Re: binary AndroidManifest.xml, resource ID to string. How to ? Newyana2 <newyana@invalid.nospam> - 2024-06-04 09:07 -0400
      Re: binary AndroidManifest.xml, resource ID to string. How to ? "R.Wieser" <address@is.invalid> - 2024-06-04 15:54 +0200
    Re: binary AndroidManifest.xml, resource ID to string. How to ? Andy Burns <usenet@andyburns.uk> - 2024-06-04 14:15 +0100
      Re: binary AndroidManifest.xml, resource ID to string. How to ? "R.Wieser" <address@is.invalid> - 2024-06-04 15:43 +0200
        Re: binary AndroidManifest.xml, resource ID to string. How to ? Andy Burns <usenet@andyburns.uk> - 2024-06-04 15:08 +0100
          Re: binary AndroidManifest.xml, resource ID to string. How to ? Andrew <andrew@spam.net> - 2024-06-04 17:04 +0000
            Re: binary AndroidManifest.xml, resource ID to string. How to ? "R.Wieser" <address@is.invalid> - 2024-06-04 20:54 +0200
              Re: binary AndroidManifest.xml, resource ID to string. How to ? Andrew <andrew@spam.net> - 2024-06-05 04:26 +0000
                Re: binary AndroidManifest.xml, resource ID to string. How to ? "R.Wieser" <address@is.invalid> - 2024-06-05 10:10 +0200
                  Re: binary AndroidManifest.xml, resource ID to string. How to ? Andy Burns <usenet@andyburns.uk> - 2024-06-05 09:18 +0100
                    Re: binary AndroidManifest.xml, resource ID to string. How to ? Andrew <andrew@spam.net> - 2024-06-05 09:53 +0000
          Re: binary AndroidManifest.xml, resource ID to string. How to ? "R.Wieser" <address@is.invalid> - 2024-06-04 20:34 +0200
            Re: binary AndroidManifest.xml, resource ID to string. How to ? Andy Burns <usenet@andyburns.uk> - 2024-06-04 20:06 +0100
              Re: binary AndroidManifest.xml, resource ID to string. How to ? "R.Wieser" <address@is.invalid> - 2024-06-05 10:11 +0200

#141785 — binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-04 12:31 +0200
Subjectbinary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3mqem$d089$1@dont-email.me>
Hello all,

I wanted to convert a binary "AndroidManifest.xml" to text again, and 
curently have a readable result.

One thing I've not been able to figure out though.  In a sourcefile I see 
lines like

android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:theme="@style/Translucent">

, but all that the binary XML file contains is resource-IDs

icon = @:7F0E0000
label = @:7F110065
roundIcon = @:7F0E0000
theme = @:7F120157

, and I have no idea how to translate the latter to the former. :-\

I've done my dues and spend time searching the Web, but have not been able 
to find any kind of clue to how to do it (the information I found stopped 
short of explaining it).

If anyone knows how to do it or has an URL to a website explaining it I 
would be obliged.

Regards,
Rudy Wieser

[toc] | [next] | [standalone]


#141791 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromNewyana2 <newyana@invalid.nospam>
Date2024-06-04 09:07 -0400
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3n3iq$egib$1@dont-email.me>
In reply to#141785
On 6/4/2024 6:31 AM, R.Wieser wrote:
> Hello all,
> 
> I wanted to convert a binary "AndroidManifest.xml" to text again, and
> curently have a readable result.
> 
> One thing I've not been able to figure out though.  In a sourcefile I see
> lines like
> 
> android:icon="@mipmap/ic_launcher"
> android:label="@string/app_name"
> android:roundIcon="@mipmap/ic_launcher"
> android:theme="@style/Translucent">
> 
> , but all that the binary XML file contains is resource-IDs
> 
> icon = @:7F0E0000
> label = @:7F110065
> roundIcon = @:7F0E0000
> theme = @:7F120157
> 
> , and I have no idea how to translate the latter to the former. :-\
> 
> I've done my dues and spend time searching the Web, but have not been able
> to find any kind of clue to how to do it (the information I found stopped
> short of explaining it).
> 
> If anyone knows how to do it or has an URL to a website explaining it I
> would be obliged.
> 
   Just a wild guess, but in PE files there's generally
a resource table to store icons. The table is located
through a system of numeric pointers. You read the
file header, locate the resource table pointer, go to
that offset, walk the table pointers, etc. It's all about
pointers to offsets.

   So one thing you could check is whether some rendering
of 7F0E0000 as an offset in the file points to either icon
bytes, an icon path string, or another pointer. But you'd
also need to figure out 7F0E0000. Is it a little endian long
integer? Is it two short integers? Does the 7F mean
something else? It looks to me like those numbers may
have sections and not just represent whole numbers.

   This kind of thing can be monstrously difficult because
most people have no reason to care about such things.
So you have to track down some kind of industry spec
doc. It's like the PE file structure. There are docs that explain
it, but for the most part it's not relevant to people using
computers. And without the decoder guide it's just gibberish
bytes.

[toc] | [prev] | [next] | [standalone]


#141796 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-04 15:54 +0200
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3n6fa$f0sd$2@dont-email.me>
In reply to#141791
Newyana,

>   Just a wild guess, but in PE files there's generally
> a resource table to store icons. The table is located
> through a system of numeric pointers. You read the
> file header, locate the resource table pointer, go to
> that offset, walk the table pointers, etc. It's all about
> pointers to offsets.

The sought-for strings are not present in the binary AndroidManifest.xml 
file.

>   This kind of thing can be monstrously difficult because
> most people have no reason to care about such things.

I cannot other than agree with you, as I've not been able to find even a 
/hint/ to how that it works.

> So you have to track down some kind of industry spec doc.

:-) I already spend a few hours googeling.  I have not found anything. :-(

... Which is why I posted here.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#141793 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndy Burns <usenet@andyburns.uk>
Date2024-06-04 14:15 +0100
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<lc8ib6FbcqgU2@mid.individual.net>
In reply to#141785
R.Wieser wrote:

> I wanted to convert a binary "AndroidManifest.xml" to text again,

I'd have expected a .xml file to be text (albeit with lots of 
elemenrs/attributes) andpossibly to have been extracted from a binary 
.apk file which is a renamed .zip archive ... are the resource objects 
within a folder of the .apk file?

[toc] | [prev] | [next] | [standalone]


#141795 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-04 15:43 +0200
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3n6fa$f0sd$1@dont-email.me>
In reply to#141793
Andy,

> I'd have expected a .xml file to be text (albeit with lots of 
> elemenrs/attributes) and possibly to have been extracted from a binary 
> .apk file

I did extract it from an APK, but the file itself is a binary

> are the resource objects within a folder of the .apk file?

I wish I knew ...

I inspected two other files (next to the Manifest one), but neither had the 
sought-for strings.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#141797 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndy Burns <usenet@andyburns.uk>
Date2024-06-04 15:08 +0100
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<lc8lfjFa7phU4@mid.individual.net>
In reply to#141795
R.Wieser wrote:

> I did extract it from an APK, but the file itself is a binary
> 
>> are the resource objects within a folder of the .apk file?
> 
> I wish I knew ...

Must be some while since I poked about inside .apk files, maybe this 
itool s already what you used to extract, if not then it might help?

<https://apktool.org>

[toc] | [prev] | [next] | [standalone]


#141803 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndrew <andrew@spam.net>
Date2024-06-04 17:04 +0000
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3nhe9$17af$1@nnrp.usenet.blueworldhosting.com>
In reply to#141797
Andy Burns wrote on Tue, 4 Jun 2024 15:08:50 +0100 :

>> I did extract it from an APK, but the file itself is a binary
>> 
>>> are the resource objects within a folder of the .apk file?
>> 
>> I wish I knew ...
> 
> Must be some while since I poked about inside .apk files, maybe this 
> itool s already what you used to extract, if not then it might help?

This has been covered in this newsgroup many times in the past, so this is
just a summary which contains the links to the sources that are useful.

Here's a cut and paste from a past discussion, but there are many.
 <https://adbappcontrol.com/en/>
 <https://qwertycube.com/apk-editor-studio/>
 <https://apktool.org/docs/install/>
 <https://clonemy.app/>

The advantage of cloning is you can make changes & re-install the app.
 <https://xdaforums.com/t/tool-clonemyapp-android-apk-cloner.4513777/>

However, to help out Rudy Wieser even further, I would suggest an Android
tool that can extract the XML file as a text file, which, as Andy knows,
would be the Muntashirakon App Manager we spoke about just recently on the
Android newsgroup over here (which is the best app manager available).
 <https://comp.mobile.android.narkive.com/UFyeKiqM/muntashirakon-app-manager-is-imho-by-far-the-best-app-manager-on-android>

[toc] | [prev] | [next] | [standalone]


#141808 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-04 20:54 +0200
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3nnuk$hu7g$2@dont-email.me>
In reply to#141803
Andrew,

> Here's a cut and paste from a past discussion, but there are many.
[snip]

Those seem to be tools.  I'm not looking for tools.

If I would have been than I would have just picked one of the several I saw 
mentioned during my searching, instead of doing the work myself.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#141811 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndrew <andrew@spam.net>
Date2024-06-05 04:26 +0000
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3opdh$2uq5$1@nnrp.usenet.blueworldhosting.com>
In reply to#141808
R.Wieser wrote on Tue, 4 Jun 2024 20:54:43 +0200 :

> Those seem to be tools.  I'm not looking for tools.

I was keying off this sentence in the original post:
 "I wanted to convert a binary "AndroidManifest.xml" to text again,
  and curently have a readable result."

While I am aware that original post was likely written in haste, my
assumption was that you want a TEXT manifest for a given APK.

The Muntashirakon App Manager easily accomplishes that, as you can see I
did myself in this thread on the XDA Developers web site.
https://xdaforums.com/t/tutorial-illustrated-mostly-privacy-based-one-tap-shortcuts-so-that-you-can-access-in-a-single-tap-any-buried-android-setting-or-app-activity.4625951/

If that's NOT what you wanted, please ignore my post as I was only trying
to help you out using the information that I knew, but I had trouble
understanding your original post (probably because it was written in
haste).

In summary, the Muntashirakon App Manager spits out a TEXT manifest file
for any app which is already installed on your phone; if that's not what
you needed, then I misunderstood the original post & I apologize for that.

[toc] | [prev] | [next] | [standalone]


#141814 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-05 10:10 +0200
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3p6j7$sv5q$1@dont-email.me>
In reply to#141811
Andrew,

>> Those seem to be tools.  I'm not looking for tools.
>
> I was keying off this sentence in the original post:
> "I wanted to convert a binary "AndroidManifest.xml" to text again,
>  and curently have a readable result."
>
> While I am aware that original post was likely written in haste,

Not really.

> my assumption was that you want a TEXT manifest for a given
> APK.

And as you quoted yourself, I have it : "and curently have a readable
result"

... which I needed so I could take a quick peek at the permissions an app
requires.  The resource-ID to string is just an (though not unwelcome)
extra.

So, what would I need those tools for ?

> The [snip app] accomplishes that,

You're mentioning the name of that app *way* to many times, making it look
as if you are trying to push it (sales pitch).  Which that makes me
uncomfortable and causes the opposite of what you are trying to effect.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#141816 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndy Burns <usenet@andyburns.uk>
Date2024-06-05 09:18 +0100
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<lcalaeFlkbvU1@mid.individual.net>
In reply to#141814
R.Wieser wrote:

> You're mentioning the name of that appway  to many times, making it look
> as if you are trying to push it

Especially considering it fails to run after installation ...

[toc] | [prev] | [next] | [standalone]


#141817 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndrew <andrew@spam.net>
Date2024-06-05 09:53 +0000
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3pcin$n5e$1@nnrp.usenet.blueworldhosting.com>
In reply to#141816
Andy Burns wrote on Wed, 5 Jun 2024 09:18:21 +0100 :

>> You're mentioning the name of that appway  to many times, making it look
>> as if you are trying to push it
> 
> Especially considering it fails to run after installation ...

It works fine for me, as you know, although I know it doesn't work for you.
Nobody should complain they don't have a text manifest file if they use it.

BTW, I've been using that App Manager for hours to open up map activities....
because I'm using it to set up backcountry mapping... 

This is just a cut and paste from my ad hoc log... 

I just used the Muntashirakon App Manager to get GPS coordinates onto
 a map of my own choosing, where without the app manager, it won't work (AFAIK).

Here's what I did... 

1. Install FOSS My Location freeware (which can read Apple's Wi-Fi AP db!).
   <https://github.com/mirfatif/MyLocation>
   <https://f-droid.org/packages/com.mirfatif.mylocation/>
   <https://apt.izzysoft.de/fdroid/index/apk/com.mirfatif.mylocation>
   While free, it's not free on the Google Play Store though.
   <https://play.google.com/store/apps/details?id=com.mirfatif.mylocation.ps>

2. Run the "My Location" app to get a location latitude & longitude fix.

3. Press the GUI "Map" button to choose a map to display the location.
   Note that, for me, the available map choices were only these:
   All-In-One 
   App Manager (Interceptor)
   Earth
   Fake GPS 
   Geo Tracker
   GPSLogger II
   GPSTest
   Magic Earth

4. Instead of a map, choose the Muntashirakon App Manager Interceptor.
   And press "Send edited Intent" in that App Manager Interceptor GUI.
   Note that, for me, the available map choices were now more maps!
   Maps (Google Maps)
   App Manager (Interceptor)
   Fake GPS 
   OSMAnd~
   All-In-One 
   Organic Maps
   Earth
   Geo Tracker
   GPSLogger II
   GPSTest

   Notably "Magic Earth" did not appear in this open-with listing.

5. But look more deeply at the intents and you'll see more maps apps
   in the Muntashirakon App Manager "Matching Activities" section.
   But not Avenza or Paper Maps.

6. In the App Manager GUI, press the "adb" button which will copy
   to your clipboard the following adb command.
   cmd activity start --user 0 -a android.intent.action.VIEW -d geo:37.81444578572309,-122.47816992062673?q=37.81444578572309,-122.47816992062673 -f 50331648

7. In Windows, run that adb command (with the phone connected to adb).
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW -d geo:37.81444578572309,-122.47816992062673?q=37.81444578572309,-122.47816992062673 -f 50331648

   Note that, for me, the available map choices were now even more maps!
   Open with...
   All-In-One 
   App Manager (Interceptor)
   Earth
   Geo Tracker
   GPSLogger II
   GPSTest
   Magic Earth
   Fake GPS 

   Notably missing were Maps (Google Maps), OSMAnd~ & Organic Maps.

8. So let's add them... (these are all experiments below)...
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW -d geo:
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW -d sms:
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW -d content:
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW -d content://com.android.contacts/data/4169
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW -d geo:37.8,-122.23?z=23
   C:\> adb shell cmd activity start --user 0 -a android.intent.action.VIEW DataUri: geo:37.8,-122.23?z=23
   C:\> adb shell am start -n com.Avenza/.OpenFileWithAvenzaMapsActivity
   C:\> adb shell am start -n com.Avenza/.RootView.RootViewActivity
   C:\> adb shell am start -n ca.abbro.androidmap/.LaunchActivity

[toc] | [prev] | [next] | [standalone]


#141807 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-04 20:34 +0200
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3nnuk$hu7g$1@dont-email.me>
In reply to#141797
Andy,

> Must be some while since I poked about inside .apk files, maybe this itool 
> s already what you used to extract, if not then it might help?
>
> <https://apktool.org>

Thanks.   But how would it ?    Yes, it would (would it?) show the strings 
I'm after, but still not giving any indication to /how/ it got them.  And 
that, the method, is what I'm after.

Besides, I'm afraid that that tool won't be able to run on my current 
machine.

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#141809 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

FromAndy Burns <usenet@andyburns.uk>
Date2024-06-04 20:06 +0100
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<lc96tjFe6seU1@mid.individual.net>
In reply to#141807
R.Wieser wrote:

>> <https://apktool.org>
> 
> But how would it ?    Yes, it would (would it?) show the strings
> I'm after, but still not giving any indication to /how/ it got them.  And
> that, the method, is what I'm after.

It looked like it would even extract the numbered resource files, but I 
didn't run it.

I also saw various code libraries for reading compressed apks, search 
AXML or ABX

> Besides, I'm afraid that that tool won't be able to run on my current
> machine.

No JVM?

[toc] | [prev] | [next] | [standalone]


#141815 — Re: binary AndroidManifest.xml, resource ID to string. How to ?

From"R.Wieser" <address@is.invalid>
Date2024-06-05 10:11 +0200
SubjectRe: binary AndroidManifest.xml, resource ID to string. How to ?
Message-ID<v3p6j7$sv5q$2@dont-email.me>
In reply to#141809
Andy,

> It looked like it would even extract the numbered resource files, but I
> didn't run it.

Extracting from an APK is easy enough (7-zip "for teh win").  What would
those numbered resource files supposed to look like ?   I can see a few
files with digits in them (v??, ??dp), but nothing that I would call a
numbered file.

> I also saw various code libraries for reading compressed apks, search AXML
> or ABX

"compressed apks" as in zipped-up ?  Or something special ?

But when I need stuff like that I'll probably try myself first. Yep, I'm
that kind of hobbyist. :-)

Although my current proggie only shows resource-IDs and not strings (file
paths?), it already does what I wanted from it : extract the requested
permissions for my viewing.

And by {deity}, some, on the outside simple apps, want a shitload of them.
A PDF organizer seems to need 44 permissions.

>> Besides, I'm afraid that that tool won't be able to run on my current
>> machine.
>
> No JVM?

One of things, yes.

Regards,
Rudy Wieser


[toc] | [prev] | [standalone]


Back to top | Article view | comp.mobile.android


csiph-web