Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preserving login session across multiple Android apps

I have two apps that both log in to the same system but they have separate functions and may not both be installed at the same time. I can sign the two apps with the same signature no problem, even make them run in the same process.

How can I store the login cookie (among other things) in such a way that it is shared by both apps and still be secured from unknown apps?

like image 400
700 Software Avatar asked Sep 16 '25 10:09

700 Software


2 Answers

Shared user ID should get you access to each other's private storage, you would just need to figure out if the other was already installed, figure out the absolute path to its private storage and then look and see if it had the cookie. Hopefully you won't starve at the table of philosophers.

like image 165
Chris Stratton Avatar answered Sep 19 '25 07:09

Chris Stratton


Here's a good solution:

What's the best way to do "application settings" in Android?

Since you want to share this between two applications, regardless of the way you want to implement it, don't forget that this will be visible to all applications. You may want to encrypt your password or session ID. Here's an example:

http://android.voxisland.com/code_examples/How_to_encrypt_and_decrypt_strings.rhtml

Good luck!

like image 34
Emmanuel Avatar answered Sep 19 '25 07:09

Emmanuel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!