• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Read AndroidManifest file in eclipse plugin code

nchy13

Lurker
up vote 0 down vote favorite
I am trying to read AndroidManifest file to extract all android permissions in eclipse plugin developnebt but have reached a dead end. It is not able to open file in /Project_root_directory/res/AndroidManifest.xml. I searched and found that it is in encrypted form.

But there should be some way because eclipse shows it in human readable format to the end user. I can't figure how to read it using Java. Any help is appreciated.
 
What I meant was I don't want any software to do my job but through java code. I am interested in extracting permissions of android app to evaluate it on certain parameters.
 
Thanks for the reply. But just so that we are on the same page, if I were to provide uri of a a package other than that of android, would it give an exception.
 
yep, sorry ignore that above post

[HIGH]

private void getInstalledApps()
{
PackageManager pkgMgr = c.getPackageManager();
List<ApplicationInfo> list = pkgMgr.getInstalledApplications(0);

for (ApplicationInfo content : list)
{
String pname = content.packageName;
String appLabel = (String) pkgMgr.getApplicationLabel(content);

PackageInfo pi = null;

try
{
pi = pkgMgr.getPackageInfo( pname,
PackageManager.GET_META_DATA |
PackageManager.GET_PERMISSIONS );

String[] reqPerms = pi.requestedPermissions;

}
catch ( NameNotFoundException e1 )
{
if (D) e1.printStackTrace();
}

}

}
[/HIGH]
 
But can I use PackageManager class in eclipse plugin. I am not coding an app. I am developing an eclipse plugin.
 
Maybe a SAX parser then? I don't know how to write eclipse plugins but if you can get the XML I could help you parse it.

Sorry I misunderstood your question
 
I tried to access the AndroidManifest.xml in res folder of project's root directory but I was not able to find it. Could you help me in locating this xml file in an android app?
 
in eclipse the manifest is in the root level. like where src and res have folders, the manifest in the the same level as those main folder, not in /res

and if you use something like apktool, itll be in the main level as well, where the res and smali folders are.
 
Back
Top Bottom