Getting package name and signatures from uid / pid application in native client

This is my first Android project and Im not comfortable with this environment.

I need to write my own application that can infer the name of the application package and its signature from the [user ID of the application and the pid of the executable instance of the application].

Ive looked through the scope of an Android application and found that PackageManger has the ability to receive package signatures. msgstr "

but this shows the possibility of obtaining signatures from the package name in a Java application. as I said, our input parameters are just the process id id id / running instance of the application. and also i need my own non java client application.

My question can be divided into the following.

  • Is there a way to get the package name from the uid and pid of the application launch in my own program? If a native client is not possible, Java methods are also welcome.

  • Is there a way to get signatures from the package name? As I said, Ive found a Java solution for it.

  • Is it possible for my own client to use the Binder service? Did this method help my problems? if so, how?

early!

+6
source share
1 answer

A1: I assume that you can scan the application directories for the package name, and then try to match the corresponding user ID in the native code. In Java, you can just use getPackageForUid () .

A2: I did not see anything native to do this. Access to arbitrary .apk files is actually not possible on a non-rooted phone.

A3: “Maybe not” and “Maybe not” and: I don’t see how to do it. Binding to a remote service does not provide service identification information; even if this happened: How to verify the signature without access to the signed content, i.e. .apk .

Edit:

The pm tool mentioned here may help.

+5
source

Source: https://habr.com/ru/post/901588/


All Articles