3

Is it possible to moniter a third paty application in android means I want to know about all log of the third party app,like app xyz access contact list at 2:30am ,thursday.

Can we change the framwork code like whenever any app run any query on sqlite framework class will generate one log ? I think it should be possible through rooted device but not sure how to implement this.

Vishal Pawar
  • 4,324
  • 4
  • 28
  • 54
neeraj t
  • 4,654
  • 2
  • 27
  • 30

5 Answers5

4

LogCollector Install LOG COLLECTOR Application

Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
Rajendra
  • 1,700
  • 14
  • 17
4

One way to change the framework to know who accessed any contentProvider would be to change

enforceReadPermission and enforceWritePermission in ContentProvider.java to log the package that is calling the contentProvider,

Log.d(TAG,""+getCallingPackages() +" app called provider "+ uri.getAuthority());

getcallingpackages function

private Collection<String> getCallingPackages() {
     int caller = Binder.getCallingUid();
     if (caller == 0) {
         return null;
     }
     return Lists.newArrayList(mContext.getPackageManager().getPackagesForUid(caller));
 }
nandeesh
  • 24,740
  • 6
  • 69
  • 79
2

this may seem obvious but i'll say it anyway. You can read the logs of any application in Eclipse's LogCat.

If you know the Applications name, and it actually creates logs (ie the logs are enabled), you filter them to see the logs specific to that application.

Vinay W
  • 9,912
  • 8
  • 41
  • 47
2

Can we change the framwork code like whenever any app run any query on sqlite framework class will generate one log ?

By forking Android to add in your changes, creating your own ROM mod that contains your forked copy of Android, and installing that ROM mod on your device.

I think it should be possible through rooted device

At best, you could skip the "creating your own ROM mod" step and attempt to copy the revised framework JAR into your rooted device. However, if that framework JAR does not line up with the rest of your OS, various things may not work. That's why the only safe way to do this is via a full ROM mod.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • you are right sir, I have tried to change contact.apk but after that force close is coming in many other places. – neeraj t Sep 18 '12 at 07:56
1

Maybe you can impl a aop framework for android...

MadeInChina
  • 130
  • 6