is it possible to retrieve all the data that the app has accessed in your phone and print it out? For instance the app retrieve my imei, my location and I would like to print it out to a log, like imei:123456789, location: 40° N, 74° W.
I know that in xprivacy it is possible to manually check what have been accessed and restrict the access to some information. But I'd like to know if there's an app or an alternative already to export the data in that matter.
Thanks and happy new year.
Not really. Technically, there are a couple of ways you might get quite a lot of the information, but they aren't very practical.
For example, if you had sufficient privileges, you could monitor your app with strace. This would catch kernel calls. The kinds of data access you're talking about would all involve system calls. Or you could straight up debug an app and gather information that way (not at all practical).
Making that information available constantly would kill performance, so it's not something you can get at normally.
Related
I am writing app to monitor data usage by other installed applications. By far, I managed to get data usage through mobile and wlan interface. It will be pretty useful if I could track GPS usage per application (or UID). I dont know how it will be presented (time on "fix", number of requests?).
I can't find anywhere how to get that data. Does android save logs from GPS somewhere I can read them?
As #CommonsWare indicated in the comments, there mostly shouldn't be a way to access that information for application privacy reasons.
However, a question similar to this was asked on another stack exchange website and the solution was to try using an application called Spare Parts.
I am unfamiliar with the application, but I suspect you will be unable to access this information programatically. If all you would like to do is to see this information, this should do nicely. If your intent is to create some logic based on GPS usage, you may run into a little more trouble.
I want to know how to detect when an external app runs one of this methods. I'm working with some classmates in a project where we want to examinate the response time of other applications. The idea is to measure the time between the run of each method to get an aproximation of the response time when opening the app.
Is this possible to achieve?
Android apps are sandboxed and only expose content that they intend to expose. The methods you name are part of components that cannot be accessed directly from the "outside" world. In other ways, if an app wanted you to know when those methods are being called, they will expose that information (i.e. sending a Broadcast or maybe storing the information in a ContentProvider). You can try and see if you can get some information out of the logcat, but I cannot assure how accurate and consistent it will be.
This is imprecise, but I would monitor logcat activity. Depending on the device/VM/AVD logcat is super active during transitions (such as back-grounding and foregrounding) and idle when an app is awaiting user input.
EDIT:
Other than that, if you can do your analysis off the device, perhaps look into using DDMS?
I have couple of applications that implements some login logic. If lets say one application is logged to some_account#gmail.com I want that all of these applications be logged to some_account#gmail.com. If I logout I want to all application do the same. But I don't want to immediately do the same. Application itself can handle it, but it need to know if some other application is already logged in and if yes just log in for the same email address as this app. So I need to know what is the email address for which other app is logged. I need to store one string.
First I was thinking about SharedPreferences, but this is rather bad idea because there are other options (and stackoverflow is full of bad example of SharedPreferences usage between processes). Despite it I tried this. Set up sharedUserId on all apps, called createPackageContext and eventually try to get preferences. But I cannot read from it. Always I got null, even if I used Context.Mode_WORLD_READABLE - which is deprecated by the way.
Ok, lesson learned do not use SharedPreferences for that (I suppose). But everything what I need now is to store single string somewhere where it could be read by other my apps.
Maybe I should use ContentProvider? But seriously... for one string?
What is the other option? I am sure that for so simple operation I really don't need Service or ContentProvider, but I actually haven't got idea how to do that.
You could use a broadcast receiver. All you would have to do is send a broadcast to application B when the data changes in application A. Then application B can handle the data in the background, and store it however you need to. It might be a bit of over kill, and there could be a better way to do it, but it would work.
I'm trying to make an Android app where I need to determine what kind of service class is using a phone, meaning, I'd like to know if the data connection is used for streaming, e-mail, chat, downloads, conferencing...
How can I do this?
If this is something you absolutely had to do, here's where I'd start.
There is a permission, perhaps the most dangerous of them all, called READ_LOGS. If that permission is set, then you can read the system logs. Find one relating to network access, then parse it through, and try to figure out how the phone is being used. These logs are deleted at reboot, however.
Personally, I wouldn't install that application, however...
Also worth looking at is the TrafficStats class, which will give you basic stuff, but not the details that you want.
No, you cannot know that.
If you could, it'd be a privacy violation ... If an arbitrary app could be installed, and know what I'm using my device. If you could get the application protocol type of all network connections, then you could also get the destination of the connections, and their content as well.
So I have read the LVL docs backward and forward, and have it working with my app. I have seen the questions about the response being cached. But it still leaves me wondering, based on some of the wording in the LVL docs, does Google want us to call the license checker every time the app is initialized? Is that the safest way to implement this? Using the ServerManagedPolicy like Google suggests, do we just call the license check, and either run our app or do whatever we choose if they fail? One of my small concerns is the use of network data. They drill into us the need to be cautious of using resources without informing the user, and it seems to me this is a use of network data without letting the user know.
To add to this, is anyone experiencing any type of delay to their app due to this code? Due to the nature of my app, opening it and then waiting every time for an ok to come through the network would definitely distract from its use. Should I cache the response myself, or am I way over thinking this?
You answered your own question; if you feel that calling the service every time you start would be disruptive (which it would, e.g. the user is out of coverage), then don't do it.
Google make no recommendations about how often to use the licensing service; it's down to how paranoid you as the application developer are about piracy, balanced with how much you feel constantly checking would annoy the user.
Ok, fair, only check it once in a while.. But where can you "safely" store the information, that you should check it once a day only?
Eg, the first time you start the app, you will check it. Result of LVL is valid: so you store the date of the last successful check. But where to store it? Using SharedPreferences ? Is this safe? Because if you have root access on your device you could access the preference and change the valid date (to either way in the future, an yes, ofcourse you can check that in the code :-))
PS. Sorry, could not make a comment :(
Call it every time you start the app. The LVL library, as shipped by Google, will cache the response and use it the next time the user starts the app, thus not requiring a network connection if they restart the application within the cache valid time-frame.
What you likely want to do is change the amount of time the cache is valid. By default, google ships with a fairly low cache-valid time, which resulted in some upset users who were outside of a network when the cache had expired.
Concerning LVL: Although the SDK provides a sample implementation, Google themselves, clearly recommend against using it "as-is".
http://www.google.com/events/io/2011/sessions/evading-pirates-and-stopping-vampires-using-license-verification-library-in-app-billing-and-app-engine.html
After watching that, I believe, LVL is not an option for apps sold for 1-2$. Furthermore, a failed LVL check (if no network is available) will piss off legitimate users.
while it is true, that you can implement some kind of caching LVL responses, it will always boild down to the question, in how far you want to protect against piracy at the expense of legitimate users?
And: developer time is limited, so maybe it is more worthwhile to put efforts in improving an app, instead off wasting to much time trying to cut down illegal usage.