Reputation: 4754
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.
Upvotes: 3
Views: 1657
Reputation: 1006539
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.
Upvotes: 2
Reputation: 24820
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));
}
Upvotes: 4
Reputation: 10190
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.
Upvotes: 2