android writable partitions - Android Q&A, Help & Troubleshooting

Hi guys anyone know where files can be written to on android without root access? I have an app which uses Hive login (com2us/gamevil games), and it saves the username in the login field even if I uninstall the app and go as far as doing factory reset on my phone. When I reinstall the game after a factory reset, the username remains pre-filled in the space. Any idea where these are being saved to?

Sounds like it's either on your sdcard, online, /data/data/"appname"/ or in the cache of the app.

think it may be online. The login page from within the app looks like a landing page for a browser, so maybe the game itself uses some internal browser to load the login page. What I don't get though is why this information is still saved despite the fact that I wiped every accessible partition on my device /sdcard /data /cache, etc. Autofill information is saved locally right?
I'm concerned about this because I saw 3 more names on the dropdown list yesterday. They are not mine, and all have a format of 4 letters and 4 numbers, so this suggests my device was compromised and I think a botscript ran. What I'm wondering is whether or not the script can still be saved on my device, since this autofill stuff seems pretty persistent. I wasn't sure if it's possible for malicious code to write something to a partition that isn't wiped with a conventional reset, and then re-establish itself after a wipe.

gtcardwhere said:
think it may be online. The login page from within the app looks like a landing page for a browser, so maybe the game itself uses some internal browser to load the login page. What I don't get though is why this information is still saved despite the fact that I wiped every accessible partition on my device /sdcard /data /cache, etc. Autofill information is saved locally right?
I'm concerned about this because I saw 3 more names on the dropdown list yesterday. They are not mine, and all have a format of 4 letters and 4 numbers, so this suggests my device was compromised and I think a botscript ran. What I'm wondering is whether or not the script can still be saved on my device, since this autofill stuff seems pretty persistent. I wasn't sure if it's possible for malicious code to write something to a partition that isn't wiped with a conventional reset, and then re-establish itself after a wipe.
Click to expand...
Click to collapse
If it somehow got root access it can be anywhere. /system, /etc anywhere.
Maybe ask over in the security discussion? I myself am not that experienced with malware on android.
Sent from my One Plus One

Related

[Q] Installing a nand on someone else's phone

So I made a nand of the rom I'm using and flashed it to my wife's phone (so she wouldn't have to set her phone up at all). It logged in under my accounts (which I expected). I removed my FB account but it will not let me remove my gmail account. It says the only way I can do that is to factory reset the phone, which defeats the point.
Does anyone have the setup wizard app or know where I can find it? I couldn't find it in the market.
Am I fighting a lost cause here?
i beleive you are I personally have yet to figure out how to remove your gmail account you can add a gmail of hers but i dont think you can remove yours from it.
Nevermind. I gave up and did a clean install. I'll just use Titanium and install her settings back. No biggie. I was just being lazy.
I am curious though if that set up wizard app would let me remove a gmail account from a phone. I even logged in and syned with her gmail account and it wouldn't let me remove mine.
Really simple... flash a rom that doesn't come with google apps.
Hungry Man said:
Really simple... flash a rom that doesn't come with google apps.
Click to expand...
Click to collapse
What I'm aiming to do is put my backup on my wife's phone...only with the ability to replace my accounts and login with hers. So pretty much any nand I create is going to have google apps already flashed.
To install a nand restore on another phone
all you have to do is put it in the right folder.
Step 1) Make a nand Backup on the new phone.
Step 2) Take the nand backup from YOUR phone, save it somewhere
step 3) Save YOUR nand backup to the right folder inside hers.
For example: Her phone will look for
/sdcard/nandroid/HTC123ABCDEFG
so her backup will be /sdcard/nandroid/HTC123ABCDEFG/2010-0814-1234/ or something
your phone might be
/sdcard/nandroid/HTC456HIJKLMNO
so you need to take your backup, maybe called /2010-0821-1111/ and put it in her folder, so that on her SD card you have
/sdcard/nandroid/HTC123ABCDEFG/2010-0821-1111/
Then she can 'nand restore' that, perfectly.
I have done this when getting new Eris's. First root the new Eris.
Then make a nand backup (so it creates the right folder)
Then drag the old nand backup into that folder
The problem is that once you nand restore, whatever Google account was set up with that backup is the ONLY primary Google account that will be allowed for that phone. So your Contacts/Calendar/Gmail syncing will have to be done with that original Google account. You have to data/factory reset anyway to change it. You could go Settings >Accounts and sync> and uncheck the the boxes for syncing contacts, gmail, and calendar, but that might be impractical.
pkopalek said:
To install a nand restore on another phone
all you have to do is put it in the right folder.
Step 1) Make a nand Backup on the new phone.
Step 2) Take the nand backup from YOUR phone, save it somewhere
step 3) Save YOUR nand backup to the right folder inside hers.
For example: Her phone will look for
/sdcard/nandroid/HTC123ABCDEFG
so her backup will be /sdcard/nandroid/HTC123ABCDEFG/2010-0814-1234/ or something
your phone might be
/sdcard/nandroid/HTC456HIJKLMNO
so you need to take your backup, maybe called /2010-0821-1111/ and put it in her folder, so that on her SD card you have
/sdcard/nandroid/HTC123ABCDEFG/2010-0821-1111/
Then she can 'nand restore' that, perfectly.
I have done this when getting new Eris's. First root the new Eris.
Then make a nand backup (so it creates the right folder)
Then drag the old nand backup into that folder
The problem is that once you nand restore, whatever Google account was set up with that backup is the ONLY primary Google account that will be allowed for that phone. So your Contacts/Calendar/Gmail syncing will have to be done with that original Google account. You have to data/factory reset anyway to change it. You could go Settings >Accounts and sync> and uncheck the the boxes for syncing contacts, gmail, and calendar, but that might be impractical.
Click to expand...
Click to collapse
It took me a few tries to figure out that I had to put my nand in her file located at sd/nandroid/whateverfilename and couldn't simply drop my sd/nandroid/whateverfilename/datenandwascreated file on her phone.
Correct me if I'm wrong. Doing a factory reset would return the rom to a factory state (like a fresh wipe and flash of a new rom)? Surely google/verizon/htc thought that people might want to change their e-mail address for whatever reason and included a way to do this without resetting the phone? Guess not.
Sent from my ERIS using XDA App
pkopalek said:
The problem is that once you nand restore, whatever Google account was set up with that backup is the ONLY primary Google account that will be allowed for that phone. So your Contacts/Calendar/Gmail syncing will have to be done with that original Google account. You have to data/factory reset anyway to change it. You could go Settings >Accounts and sync> and uncheck the the boxes for syncing contacts, gmail, and calendar, but that might be impractical.
Click to expand...
Click to collapse
Last night I ran a quick experiment with a Froyo ROM (Kaos V30):
- Shut down phone
- booted Amon_RA
- # mount /data
- # rm /data/system/accounts.db
- # umount /data
- rebooted
Reboot seemed fine, and there were no (Gmail) contacts present in the dialer, nor any access to Gmail. Shortcuts to specific (phone) contacts were still in my home screens (including images of the person), but clicking on them resulted in an error. No apparent FCs anywhere.
Clicking on the Market app took me immediately to the Google Account setup screen (which I believe is the same thing as Settings -> Accounts & sync -> Add account -> Google). I don't know if this (behavior) is unique to 2.2 or not.
I don't have a second Google account, so I just re-entered the username/pass for my account - the same one that had already been on the phone, and the phone started "syncing". I sort of wondered what might happen (because I am using Froyo "Save my settings"), but everything came back as I would expect - Contacts, Gmail, etc.
I would have proceeded a little further with this experiment, but I couldn't access the Market ("connection error") (about 1am EST Saturday morning), so I stopped, assuming this was a failure - and restored a Nandroid backup. When the restored ROM also had trouble with the Market, I thought - "oh, boy, what have I done?" But, it seems that a number of people have reported trouble with the Android Market late last night / early this AM - and the Market was working this AM on my restored ROM, too.
I could repeat the experiment if there is any interest, and this time use my GF's account for testing purposes. There are probably some things cached that should be cleaned up prior to adding back in a Google account; probably it wouldn't hurt to use
Settings -> Applications -> Manage applications
To clear the data and cache areas for a few things such as
Browser
Calendar
Calendar Storage
Contacts
Contacts Storage
Dialer
Dialer Storage
Email
Gmail
Google Voice
Maps
Market
(Plus others as appropriate - Twitter, FB, etc)
bftb0
bftb0 said:
Last night I ran a quick experiment with a Froyo ROM (Kaos V30):
- Shut down phone
- booted Amon_RA
- # mount /data
- # rm /data/system/accounts.db
- # umount /data
- rebooted
Reboot seemed fine, and there were no (Gmail) contacts present in the dialer, nor any access to Gmail. Shortcuts to specific (phone) contacts were still in my home screens (including images of the person), but clicking on them resulted in an error. No apparent FCs anywhere.
Clicking on the Market app took me immediately to the Google Account setup screen (which I believe is the same thing as Settings -> Accounts & sync -> Add account -> Google). I don't know if this (behavior) is unique to 2.2 or not.
I don't have a second Google account, so I just re-entered the username/pass for my account - the same one that had already been on the phone, and the phone started "syncing". I sort of wondered what might happen (because I am using Froyo "Save my settings"), but everything came back as I would expect - Contacts, Gmail, etc.
I would have proceeded a little further with this experiment, but I couldn't access the Market ("connection error") (about 1am EST Saturday morning), so I stopped, assuming this was a failure - and restored a Nandroid backup. When the restored ROM also had trouble with the Market, I thought - "oh, boy, what have I done?" But, it seems that a number of people have reported trouble with the Android Market late last night / early this AM - and the Market was working this AM on my restored ROM, too.
I could repeat the experiment if there is any interest, and this time use my GF's account for testing purposes. There are probably some things cached that should be cleaned up prior to adding back in a Google account; probably it wouldn't hurt to use
Settings -> Applications -> Manage applications
To clear the data and cache areas for a few things such as
Browser
Calendar
Calendar Storage
Contacts
Contacts Storage
Dialer
Dialer Storage
Email
Gmail
Google Voice
Maps
Market
(Plus others as appropriate - Twitter, FB, etc)
bftb0
Click to expand...
Click to collapse
THAT'S AWESOME! I would be very interested for you to repeat this experiment. This would be VERY useful for me. My wife likes the whole rooted phone with all the extra options but she's not into it like I am. If this works and is stable, I could easily set her phone up exactly like mine. I would test it myself but I'm not an advanced adb user. If I break something, it's just broke which would probably equal the doghouse for me since it's my wifes phone.
If this works, you should write a how-to for the community. I couldn't find one when I searched and I'm sure others would find it useful.
Sent from my Froyo Eris using XDA App
joshw0000 said:
THAT'S AWESOME! I would be very interested for you to repeat this experiment. This would be VERY useful for me. My wife likes the whole rooted phone with all the extra options but she's not into it like I am. If this works and is stable, I could easily set her phone up exactly like mine. I would test it myself but I'm not an advanced adb user. If I break something, it's just broke which would probably equal the doghouse for me since it's my wifes phone.
If this works, you should write a how-to for the community. I couldn't find one when I searched and I'm sure others would find it useful.
Sent from my Froyo Eris using XDA App
Click to expand...
Click to collapse
So long as you have adb working, you do not need to be an "advanced" adb user in order to help out with the testing. After you create a Nandroid Backup in Amon_RA, there are literally only four lines you type in using the "adb shell" (with Amon_RA still running):
Code:
mount /data
rm /data/system/accounts.db
umount /data
exit
... and then do a Wipe Dalvik-cache in Amon_RA
Everything else that I suggested is performed using
Settings -> Manage -> Manage applications
in the main OS. (I suppose it might even be possible to delete /data/system/accounts.db using a root-aware file manager, but I prefer to do stuff like that in an offline fashion)
If something goes wrong - well, you have a full Nandroid backup available to restore to. The same thing goes for your wife's phone too, right?
bftb0
PS For anyone else reading this thread: it is a quarter-baked idea (not even half-baked); don't take away from this any sort of mis-impression that this has undergone any significant testing (none at all on 2.1, in fact). Feel free to experiment yourself - but make good Nandroid backups!
bftb0 said:
So long as you have adb working, you do not need to be an "advanced" adb user in order to help out with the testing. After you create a Nandroid Backup in Amon_RA, there are literally only four lines you type in using the "adb shell" (with Amon_RA still running):
Code:
mount /data
rm /data/system/accounts.db
umount /data
exit
... and then do a Wipe Dalvik-cache in Amon_RA
Everything else that I suggested is performed using
Settings -> Manage -> Manage applications
in the main OS. (I suppose it might even be possible to delete /data/system/accounts.db using a root-aware file manager, but I prefer to do stuff like that in an offline fashion)
If something goes wrong - well, you have a full Nandroid backup available to restore to. The same thing goes for your wife's phone too, right?
bftb0
PS For anyone else reading this thread: it is a quarter-baked idea (not even half-baked); don't take away from this any sort of mis-impression that this has undergone any significant testing (none at all on 2.1, in fact). Feel free to experiment yourself - but make good Nandroid backups!
Click to expand...
Click to collapse
I do have a working adb and understand for the most part that you're deleting accounts.db in /data/system?? What I'm not following is why I would need to boot into recovery to delete the file. Would the process not work the same if you made the changes while booted in the rom? Do the changes affect the recovery partition at all or did you boot to recovery so you can immediately wipe dalvik and reboot? That's my biggest fear.
Sorta the same question - does it matter where you're booted when you do adb commands (booted, usb mounted, recovery, powered off)?
P.S. I've read several responses you've posted in other threads. You're very thorough in reponses and I personally have learned a lot from reading them. Thanx for your input and help with us noob and novice users.
Sent from my Froyo Eris using XDA App
joshw0000 said:
I do have a working adb and understand for the most part that you're deleting accounts.db in /data/system?? What I'm not following is why I would need to boot into recovery to delete the file. Would the process not work the same if you made the changes while booted in the rom? Do the changes affect the recovery partition at all or did you boot to recovery so you can immediately wipe dalvik and reboot? That's my biggest fear.
Sorta the same question - does it matter where you're booted when you do adb commands (booted, usb mounted, recovery, powered off)?
Click to expand...
Click to collapse
The changes do not affect the recovery partition - the reason that the recovery partition is used for almost all administration involving system elements is because there are not files which are "locked" by applications that are using those files, nor do you have anything running which depends on that file at the moment it is deleted.
The account credentials are important to lots of applications which are running on the phone in the regular OS, and you will get strange behaviors, crashes, and possible corruption of application state if you just yank the file out from underneath all those applications. You could try to stop those apps first - but a lot of them auto-restart on their own.
I'll use an analogy; it's like the difference between setting a table without a tablecloth, versus trying to remove the tablecloth after all the dishes are in place.
There are lots of reasons to prefer doing things in an offline mode, but the primary one is that you are not "yanking X out from underneath Y" - when "Y" thinks that "X" is still there.
It is typical for both system and application logic to do things like check for files on startup, and then either rebuild them from defaults if they are not present, or read/write their contents if they are already present. It is a lot more rare for applications to be coded in way that they are constantly check to see if something they though was there has suddenly disappeared. Moreover, the way that locking works with Linux kernels, you can delete a file that is opened by another process, and replace it with a new file - but the processes that are still running with that file open will still have a copy of it.
As for being scared - you have a Nandroid backup, right?
bftb0
That makes a lot since. I'll try this method out the next time I change my wife's rom.
Sent from my Froyo Eris using XDA App

[Q]/dbdata/databases and Task manager/Personal Info

I am curious as to why in my Task Manager it shows that I have 19mb of "Personal Info" (PI) when I know that is not true. I have googled and searched these threads about it and this is what I have found. It seems to be some dead apps. I am running Toxic8 w/ Bali 1.2 kernal but before I had stock 2.2 from Cincinnati Bell. While on Bell's 2.2, my PI was only around 2-4mbs max (facebook/ contacts/ media-those types of things). I wiped/reset/wiped again and flashed the Toxic8 ROM.
I have an app called DiskUsage (great app) which shows what is in each folder by apk/dalvik/data-pick one, two or all. I generally just use the /data as my view point. There is a Root point to that also scans you Root folders too. It can show, lets say Facebook. You can click on it>hit show and it takes you to that apps file in Manage Apps where you can delete data/cache.
Now, I say this b/c if I run it and it shows the /dbdata folder, it shows my normal amout of personal info +/-3mb but then it also shows that /system is taking up 16+/-mb of space. I think that is the problem. What is this /system part as I have looked all over the /system folder to see if there are any links or something and can find anything that matches.
Why is my Personal Information so big if I only have 3+/-mb of personal information on it.
This is what I have tried and searched.
SDmaidPro. Corpse, Clean system/apps/ Optimize No luck
Wiped, reset, reflashed, bootloop **crap.
Wiped, reset, relashed, wiped, bootloop **crap
Wiped, reset, restored only /system, bootloop **argg*crap.
Restored and it boots up just fine but PI is still sitting at 19mb b/c obviously it was restored.
I am thinking that it is maybe the symbolic links to my first ROM that came with the phone (only had it 2 weeks or so), PLUS all the apps that came with Toxic8, but a fair amount of those, I have deleted. Think this is a Samsung bug from what I have googled. I don't want to wipe internal SD card b/c I am fairly certain the bulk of what I am looking at is not there (so it would be pointless).
Ideas and sorry for the manifesto sized post?
This is what I am finding so far after some adb work. The /system is somehow mounted to the /dbdata partition. Maybe b/c of the voodoo making them both ext4 partitions. I ran Mount and confirmed both are ext4. I don't know how or why.
I also ran busybox df -h to see what partitions are and how munch total/free/used space there is. It shows that in my DBdata partition that I have way more that I should. My personal data should only be about 3mb but it is showing at now 20mb. Before you say "why worry, you have 126mb of space". I did some tests and if I install an app, fine that is great. But say that I install it, don't like it and uninstall, it is still inflating the Dbdata partition and will not come out. This can cause long term problems with partition filled and no where to install apps. They are not in /data/data anymore but are somehow getting linked to /system AND /dbdata.
The folders in Root Explorer are
dbdata/databases
dbdata/db-journal
dbdata/lost+found
dbdata/system The four of these are normal and contain the usual personal information like passwords, cache,...and total around the 3mb as stated above.
My problem is that the /dbdata and /system partitions are somehow linked and when I install and app, it gets pushed to that phantom link and cannot be deleted. See the long term problem now?

Factory reset - What EXACTLY happens?

Hello,
In my question, What EXACTLY happens during a factory reset, the emphasis is, obviously, on "exactly". I will explain why I need to know this - the research I've done has failed to answer my question.
Carrier-phones come with a bunch of pre-installed apps. Of all possible scenarios, Japanese smartphones, and particularly Sharp smartphones, are the worst case. They are very difficult to root, very finicky phones that seem to go into a boot loop whenever you do something to them that you're not supposed to - all the more challenging
If we manage to root a Sharp phone, the first thing we do is freeze some of the Docomo or Softbank pre-installed apps that take up precious memory. We know that if we want to do a factory reset, we must first un-freeze all those apps, or we risk going into a boot loop, and having to ship the phone back to Japan to get repaired (for those of use who don't live in Japan).
Now, the million dollar question is, what happens if we delete/uninstall those system apps? And here I am asking about the general case, hoping that Sharp haven't invented some twisted scheme here too.
When we do a factory reset, how does the phone know what was - and what is supposed to be - in the /system/apps folder? Hence: What EXACTLY happens during a factory reset?
Does the phone look up a file which contains a list of all those pre-installed app, and verify the contents of the /system/app folder against it --- and if something is missing, it gets stuck during reboot? Or does it simply delete the contents of the /data folder, without paying attention to /system/app? And why does it go into a boot loop, if a system app was frozen?
In the end, I don't simply want to freeze some apps, I want to get rid of them completely --- you can't imagine the load of BS that Japanese carriers cram into their phones (a built-in Rakuten auctions app, a McDonald's app, a BeeTV app??? and so on and so forth) --- but I want to make sure the phone isn't checking what's supposed to be in /system/app.
---------------------
In the case of my 005SH, the rootkit came with a recovery that helps me "resurrect" the phone from a boot loop - and that has happened twice after a factory reset so far - I deleted some seemingly insignificant app, and Titanium Backup failed to restore it for some reason, so it's now gone forever. But not every rootkit comes with a proper recovery...
cheeseus said:
Now, the million dollar question is, what happens if we delete/uninstall those system apps?
Click to expand...
Click to collapse
Some system apps are important for the device to run properly and some are just bloatware that can be deleted without harm (e.g, Youtube, ChatOn.. etc). There are several app lists in the forum of safe app to remove (this is one).
But I advice you not to play with system apps if you don't know which app is safe to remove.
cheeseus said:
When we do a factory reset, how does the phone know what was - and what is supposed to be - in the /system/apps folder? Hence: What EXACTLY happens during a factory reset?
Click to expand...
Click to collapse
All app in system partition will be restored as if it was first time to be run, although all of your installed app, contacts, sms, WiFi access and data will be deleted
majdinj said:
Some system apps are important for the device to run properly and some are just bloatware that can be deleted without harm (e.g, Youtube, ChatOn.. etc). There are several app lists in the forum of safe app to remove (this is one).
But I advice you not to play with system apps if you don't know which app is safe to remove.
All app in system partition will be restored as if it was first time to be run, although all of your installed app, contacts, sms, WiFi access and data will be deleted
Click to expand...
Click to collapse
Thanks but this does not answer my question. I know perfectly well which apps are bloatware and which are essential. I will restate my question:
Is there some register or list, which the phone checks during factory reset, and which says what apps were originally installed in /system/app? That is, will the phone "know" that I have removed some of the original apps?
cheeseus said:
Thanks but this does not answer my question. I know perfectly well which apps are bloatware and which are essential. I will restate my question:
Is there some register or list, which the phone checks during factory reset, and which says what apps were originally installed in /system/app? That is, will the phone "know" that I have removed some of the original apps?
Click to expand...
Click to collapse
As I mentioned, factory reset will delete all data apps that can be found in data partition not those found in system partition.. If it happens some of original apps are installed in data partition, then they will be deleted (unless if they are found in preload partition!!).. I can't be clear more than this..
majdinj said:
As I mentioned, factory reset will delete all data apps that can be found in data partition not those found in system partition.. If it happens some of original apps are installed in data partition, then they will be deleted (unless if they are found in preload partition!!).. I can't be clear more than this..
Click to expand...
Click to collapse
Really, read my question carefully, please, not just the title of the thread. You are talking about something very different.
It is known that on Japanese Sharp phones, if you uninstall and remove completely some of the apps that are installed by the manufacturer or the carrier in /system/app, when you do a factory reset, the phone may - or even will - go into a boot loop (will be bricked). This has nothing to do with apps that are installed in /data.
Is it possible that Sharp have added an extra "security" mechanism to their phones to prevent users from removing pre-installed apps (similar to their MIYABI LSM lock)? I want to know how to find this security mechanism, if it exists, and - hopefully, how to cheat it.
How does the phone know what apps are supposed to be in /system/app, and if it doesn't find them when rebooting after a factory reset, why does it go into a boot loop?

[Q] Questions About: Encryption + Backups

I've recently been getting into more security cautious habits with encryption and what not, due to this whole NSA/Big-brother is watching business... But I have a question (more may pop up as this discussion goes on). Sorry if I seem noob-y, I am still getting a hang of all this encryption business. But here's my first round (regarding just the files being backed up):
If I go ahead and do a full phone encryption with my GN2 where will I stand as far as backups to Dropbox/Copy/Google Drive/etc.?
I currently have photos and such backing up to copy, and I often move backups made through recovery to Dropbox and such. If I were to have photos automatically sync to copy or move system backups to dropbox wouldn't that render them basically useless as I am assuming they move out of the phone encrypted (not being decrypted as they exit).
The photos would be unusable anywhere besides my phone right? So moving them off my phone to share vacation photos for instance would be impossible, and if my phone were to crash they'd be irretrievable? Making the backup process pointless.
Wouldn't the back up be rendered useless as well, exactly when I might need said backup? If my phone were to ever crash or die for some reason, I would lose the encryption key, would even be able to do a full system restore through the recovery? It would seem that the encryption key wouldn't be kept with those back up files, so while it might place everything back in its correct place, it would still be unreadable. Or does it maybe keep the key in system files somewhere so that a full backup would restore the key as well?
And my second round of questions (regarding recoveries and what not):
I am also under the impression that I would not be able to flash through custom recovery either as the internal SD would be inaccessible from the recovery being it doesn't have the encryption key. I am currently running OmniROM and it is in a nightly stage still for my phone. I wouldn't be able to update nightly would I? I am assuming since it basically flashes/overwrites system each time, that I would be losing my encryption key and making everything besides system unusable then right?
And what about downloading ROMs to flash/update directly to my phone? As I download them from in browser or another app and they go to the default /downloads folder they would be encrypted. They wouldn't be accessible from there in recovery, but if I were to try and move them out of internal SD to the external SD they would retain encryption and still be inaccessible? So the only way to download ROMs and updates would be from PC and only move them to the external SD?
Overall, this seems to be crippling a lot of the way I use my phone...
Bump?
Sorry, this is already getting buried and I kinda want to know what's going on before I go ahead and do this...
Zombtastic said:
I've recently been getting into more security cautious habits with encryption and what not, due to this whole NSA/Big-brother is watching business... But I have a question (more may pop up as this discussion goes on). Sorry if I seem noob-y, I am still getting a hang of all this encryption business. But here's my first round (regarding just the files being backed up):
If I go ahead and do a full phone encryption with my GN2 where will I stand as far as backups to Dropbox/Copy/Google Drive/etc.?
Click to expand...
Click to collapse
I'm not (yet) an expert on this, but when you've encrypted your device, it encrypts the file system on your internal memory and SD card. You have to enter a PIN/password when you turn on your device (and when it times out) to gain access. When the correct PIN is entered at boot time, the file system is available as normal - the underlying data is still encrypted, but the file system can unencrypt it in "real time" for use by apps and the system.
So that means that Dropbox et al all see your files as normal, and any copying you do from your device to something on the net (Drive, Dropbox, a server, etc.) works as normal - the data appears normal to the apps and is copied as normal. So photos would copy across as photos, music as music, etc.
Think of it like this: You can't speak Urdu, only English. There is a book you own that is written in Urdu that you want to tell someone about. You find a translator to read the book and tell you what it says. He reads the first page in Urdu, translates it in his head to English, and tells you what it says. You then tell your friend what it says (in English, of course). Your friend writes down what you told him, in English, then tells you something in reply. You tell your Urdu translator what your friend said (again, in English). Your Urdu translator then translates (in his head) what you said from English to Urdu, and writes it down in the book in Urdu.
At no time do you understand Urdu, nor does your friend. Your friend doesn't even know the book is written in Urdu and doesn't care. He never sees it or accesses it directly. If anyone ever steals your book, they can't read it unless they can read Urdu. The book is only useful to you and your friends if you have an Urdu translator sitting there in the loop. (the analogy is imperfect and incomplete but you get the idea).
So, getting back to your phone, if you have it encrypted, the underlying file system deals with translating things on the fly if you've given it the correct password at boot and login time. No apps ever know about the encryption - they just see data as normal (unencrypted). So any app that wants to copy a photo to Dropbox just sees a normal photo - it never sees the underlying encrypted data. But if you don't enter the correct password at boot time, the phone can't boot, and anyone trying to access the data on the phone won't be able to read it unless they know the password.
Does that help or confuse?
Zombtastic said:
I currently have photos and such backing up to copy, and I often move backups made through recovery to Dropbox and such. If I were to have photos automatically sync to copy or move system backups to Dropbox wouldn't that render them basically useless as I am assuming they move out of the phone encrypted (not being decrypted as they exit).
Click to expand...
Click to collapse
Hmm, this does my head in a bit but lets untangle it:
- you boot into Recovery. The Recovery you're using (obviously) understands encrypted file systems (some versions of CWM do, some versions of TWRM don't for instance - see near the end of this post for a bit more on this). So when you boot into Recovery and enter your PIN/password, it can then read your file system. You can then do a Recovery-based backup of your file system (or individual files, though I'm not aware that you can do this). The backup it creates is written to the encrypted file system and thus encrypted with the same encryption keys used for everything else.
- You boot the phone back up as normal and enter your PIN/password, and start up Android. You then use Dropbox to copy the Recovery backup files to the cloud. So the question is, "Are these files encrypted?" and I think the answer is, "No". Why? Read the rest of this post and hopefully you'll work out the same conclusion. But I'm pretty sure that the data that ends up on the Cloud is not encrypted.
One general comment worth pointing out as an aside (sorry, this paragraph isn't really related to the above but I wanted to point this out somewhere and its still useful) is that each time you encrypt your phone, it creates a unique encryption key - even if you give it the same PIN/password to use. So if you're forced to rebuild/reflash/wipe your phone in the future, it won't be able to access any data that is still on there (in internal or SD memory) since it won't know the previous encryption key. So you'll have to wipe all data and start again. And at that point, if you choose to encrypt your fresh, newly initialized phone, it will have a new, unique encryption key that won't work on any encrypted data from previous. So if for instance, you plug in an SD card that was encrypted on your phone in an earlier ROM, it won't be readable even if you know the correct PIN/password, since your phone will be using a different underlying unique key.
Zombtastic said:
The photos would be unusable anywhere besides my phone right? So moving them off my phone to share vacation photos for instance would be impossible, and if my phone were to crash they'd be irretrievable? Making the backup process pointless.
Click to expand...
Click to collapse
So, if you're following this, you'll now understand that moving your photos off your phone could be done two ways:
- while you're using the phone as normal (ie. you've booted it, entered your PIN/password, and copying your photos to Dropbox via an app while you're logged on. If you do it this way, you're simply copying photos as normal that can be viewed as normal in Dropbox.
- by copying backups generated while in Recovery. But Recovery will be firstly mounting the encrypted file system successfully (if you gave it the right PIN/password and your version of Recovery supports encryption), which means it can read your photos as normal files, then backs them up into its own normal Recovery file/folder structure and writes them to your encrypted file system, so the underlying data is encrypted unbeknownst to Recovery. Then when you boot up your phone and log in successfully to Android, you can access that data as normal (and unencrypted). So when you then copy it to Dropbox, all you're copying is normal Recovery-created backup files. The copied data won't be encrypted (unless Recovery encrypts them itself, independently, which I don't think it does). So you could copy this data to anybody's phone, so long as they were using a compatible Recovery version and probably compatible ROM.
Zombtastic said:
Wouldn't the back up be rendered useless as well, exactly when I might need said backup? If my phone were to ever crash or die for some reason, I would lose the encryption key, would even be able to do a full system restore through the recovery? It would seem that the encryption key wouldn't be kept with those back up files, so while it might place everything back in its correct place, it would still be unreadable. Or does it maybe keep the key in system files somewhere so that a full backup would restore the key as well?
Click to expand...
Click to collapse
I'm not 100% sure on this, but I think your logic is correct. The backup would be useless if the phone loses the encryption key, which it would do if you re-initialized your phone and/or did a new encryption. So you can only recover your backed up data if you haven't done either of those things. A solution to this is to use backup software that runs on your phone (Titanium Backup) that gives you the option to encrypt your data. Some caveats to this approach should be obvious:
- you firstly need to decide if you trust your backup software's encryption
- you need to use a strong password and be able to recall it months/years from now when you go to restore your data
- you need to copy your backups off your phone (such as onto your SD card, cloud, dropbox, etc.) in case you lose your phone.
Zombtastic said:
And my second round of questions (regarding recoveries and what not):
I am also under the impression that I would not be able to flash through custom recovery either as the internal SD would be inaccessible from the recovery being it doesn't have the encryption key. I am currently running OmniROM and it is in a nightly stage still for my phone. I wouldn't be able to update nightly would I? I am assuming since it basically flashes/overwrites system each time, that I would be losing my encryption key and making everything besides system unusable then right?
Click to expand...
Click to collapse
Tricky - if you flash/update your phone with a new ROM, you will probably be OK so long as you haven't wiped the part of your phone's storage that holds the encryption information. I don't know where this is. But the nightly updates I do to my phone don't normally touch my data - all my apps are still there and it boots identically to the way it did before I updated it. HOWEVER, its possible that an update may force me to wipe my phone for some reason - the update may fail, it may contain significant changes, or I might screw something up. I probably end up completely wiping my phone at least once every 2 months just because I like to play with the latest and greatest ROMs, or I screw something up. So if that happens, I'm going to lose the encryption information and thus would lose everything on the phone.
Of course, I can always restore my apps and data via Titanium Backup, since I back up my stuff quite often and then copy it to Dropbox.
Zombtastic said:
And what about downloading ROMs to flash/update directly to my phone? As I download them from in browser or another app and they go to the default /downloads folder they would be encrypted. They wouldn't be accessible from there in recovery, but if I were to try and move them out of internal SD to the external SD they would retain encryption and still be inaccessible? So the only way to download ROMs and updates would be from PC and only move them to the external SD?
Click to expand...
Click to collapse
Hmmm - good question. A simpler question is, "Is my encrypted file system accessible while in Recovery?" I believe the answer is, "Yes, if you use CWM, No if you use TWRM". But I say that because from what I've been reading, some versions of CWM/TWRM can/can't handle encrypted devices. But you'll already have sorted this out at the time you're trying to encrypt your device anyway since the encryption process involves rebooting your phone into recovery I believe - and if you're not using the correct supported Recovery, this step will fail. But if you are using a supported recovery, this step will work, and therefore logically I'd assume that you can access your encrypted file system while in Recovery in the future. I'd imagine Recovery would prompt you for your PIN/password in order to mount the encrypted file system.
So assuming the above is correct, you would be able to access the newly-downloaded ROMs while in Recovery and thus can flash them. But of course, Caveat Emptor with flashing the new ROM - if it forces you to wipe anything, you may end up unable to access any of the data.
Zombtastic said:
Overall, this seems to be crippling a lot of the way I use my phone...
Click to expand...
Click to collapse
From what I've been researching, you won't have a problem anyway, because I haven't come across anyone that has successfully encrypted their phone using a custom ROM. Strangely, this ability seems to be unwanted by XDA people. My tinfoil hat tells me that there are people ensuring that this ability continues to not work on custom ROMs until/unless a backdoor capability is found. Hopefully I'm wrong on many counts.
douginoz said:
From what I've been researching, you won't have a problem anyway, because I haven't come across anyone that has successfully encrypted their phone using a custom ROM. Strangely, this ability seems to be unwanted by XDA people. My tinfoil hat tells me that there are people ensuring that this ability continues to not work on custom ROMs until/unless a backdoor capability is found. Hopefully I'm wrong on many counts.
Click to expand...
Click to collapse
Amazing post by the way! It does seem very helpful.
BUT it's very funny you mention it not working. Because that's exactly what happened. After not getting a response here or in the ROM's forum for a few days, I decided to just take the plunge and do it. I was just planning on testing everything out my self and figuring it out as I went. The first time it seemed fine, the encryption went through it seemed.
Being as I didn't know any of the info you just enlightened me with, I did fear that nothing was truly encrypted though. Everything was transferring to my computer with a drag and drop and working fine, so I was afraid (without evidence) that nothing was truly encrypted. I asked on the ROM's forum again (still waiting for an answer).
That night, my phone was left plugged in charging, yet some how had turned off in the night. I awake to my phone asking for an encryption key. I enter my key in to no avail. Nothing works and my phone is left unable to boot. It was utterly denying my password. I had to reflash. I asked about that in the forums as well, whether that was normal or if encryption was maybe not implemented yet, etc. The dev running the nightlies for my device has responded to the forum multiple times but not to me. Another user mentioned it might be that it is now merged together as a Galaxy Note 2 ROM and not specifically a T-mobile Galaxy Note 2 ROM (might be possible. Idk.).
Now, I have tried to re-encrypt. Multiple times. But I cannot for the life of me get it to even start now. Every time I go to start the encryption process it shows me the fullscreen image of the android unzipped horizontally (at which point it is supposed to reboot and start encrypting) and it hangs/sits there forever. Not rebooting, not anything. If I hit the back button, the image disappears and it goes back to my phone. Working perfectly fine, like it never even started doing anything. I am not doing anything differently. I don't know what could be happening to stop it from even getting as far as it did last time. Unless the devs maybe started working on it and have disabled it for the time being/screwed it up worse, I dunno.
Not you got me crafting a tin-foil hat...

Retrieving data from locked device

My brother passed recently. I am in possession of his s9+ and want to either remove the lock screen PIN (preferable) or just retrieve the pictures (if all else fails). This is very important to me. It is a Verizon phone.
If the images are stored on an SD card and the card is not encrypted you can just take the SD card out and use it from a computer.
If the phone was configured to backup photos to samsung cloud you can try logging into that using the appropriate credentials. The URL for samsung cloud login is https://support.samsungcloud.com/#/login
If the images are stored on the internal storage you are most likely gonna have too contact samsung for help. I honestly don't know if there is a way to do this considering the phone is unrootable and what your asking is to break/remove the phone's security features.
In case it has twrp installed ,you can use it
a_t_21002000 said:
In case it has twrp installed ,you can use it
Click to expand...
Click to collapse
The G965U and G965U1 are unrootable at the moment... So any options for the OP that involve rooting the phone is not going to do much good
Recover file from G965U1
I have a G965U1 from which I want to recover a deleted video. I don't care if I brick the phone. I simply want the video. I'm tempted to rip open the phone, pull the memory and solder on a USB reader. Can you give me any good options prior to the rip.
stevearas said:
I have a G965U1 from which I want to recover a deleted video. I don't care if I brick the phone. I simply want the video. I'm tempted to rip open the phone, pull the memory and solder on a USB reader. Can you give me any good options prior to the rip.
Click to expand...
Click to collapse
Best suggestion (not just to you, this is in general for everyone who has this issue) is that in the future if there is a file you want to keep or is of great value to you make a backup of it elsewhere. I do this with what pics/videos I take on my phone for this very reason. There isn't a reason why no one can't make a backup of an important pic/video with this phone... It has a removable SD card, you can transfer files to a computer or use cloud backup.
Other suggestions:
Did you check the gallery trash to see if it is in there? When you delete a file using Gallery it ends up in the "trash" (essentially acts like the recycle bin on windows). In the gallery app look for the 3 dots that run vertically at the top right corner. Pressing on those will show a menu, the word "trash" will be listed.
Pressing the option to access the trash will show you what is able to be restored on the phone. Files you delete will be sent to the trash and remain there until you empty the trash or 15 days pass since the deletion. If you have the phone backing up the files to Samsung cloud you might be able to access the file(s) from the cloud using the link I posted previously.
If the gallery and cloud storage don't help:
I am afraid there really is no other good option.. The software I can find which does data recovery requires root access (which we can not do). Google searches pretty much yield the same result. There are some that say you can without root, but further reading into them show it's a misleading statement and that root is still needed. You may be able to find a software recovery service locally that might be able to do what you want... And I would suggest (unless you have the tools, software and ability) you go that route first before you try to CSI cyber your way to accessing that data. Please don't take this the wrong way, I do not believe what your thinking of doing will even work... Assuming the location where the video was has not been overwritten by data already (if it was then your SOL unfortunately), removing the memory and placing it onto a USB reader will most likely not resolve/remove any permission based issues.
This is a drawback of not having root ability on our phone
scottusa2008 said:
I am afraid there really is no other good option.. The software I can find which does data recovery requires root access (which we can not do). Google searches pretty much yield the same result. There are some that say you can without root, but further reading into them show it's a misleading statement and that root is still needed. You may be able to find a software recovery service locally that might be able to do what you want... And I would suggest (unless you have the tools, software and ability) you go that route first before you try to CSI cyber your way to accessing that data. Please don't take this the wrong way, I do not believe what your thinking of doing will even work... Assuming the location where the video was has not been overwritten by data already (if it was then your SOL unfortunately), removing the memory and placing it onto a USB reader will most likely not resolve/remove any permission based issues.
Click to expand...
Click to collapse
While this is older topic and probably it doesn't really matter anymore, i might add something. First of all, those phones are factory encrypted. Second, ability to recover deleted files from modern phones in nonexistent in practice. You may find that there was such file but it's already empty inside or not find any leftover that it was even there. You don't have to fully overwrite the space it occupied like on SD cards or HDDs for this to happen. There are mechanisms, like TRIM that take care of deleted content to maintain storage chip performance. It is possible to recover deleted data stored inside database files, like contacts, texts, chats, notes etc.
In general, there's no harm in trying but this requires you to create a decrypted memory chip dump and this either requires root or some fancy exploit, for example to boot custom kernel image with adb and root permissions that won't tamper with data. Achieving root on those devices without factory reset is not really possible for the time being, and enabling OEM unlocking (requires for TWRP and Magisk) itself triggers factory reset (there's a warning so that's good).
Desoldering memory chip and dumping it directly also won't work. First of all due to factory encryption, so no there won't be any useful data and it can't be decrypted outside that specific phone. Second, it's an UFS type memory and this requires expensive reader. The cheapest on the market is currently easy-jtag plus with adapters for UFS, but this still ~$1000 and i'm not sure it supports chips used in S9+.

Categories

Resources