[Q] Android 4.2 multi-user and device policy - Android Q&A, Help & Troubleshooting

Android 4.2 supports multiple users. As I understand it, each of them runs in a sandbox with their own apps and data space; the different users cannot see each other's data. The primary user, the device owner, has the option to delete the accounts of other users.
What happens if a secondary user installs an app that requires device-administrator rights, such as password rules and "erase all data"? Do those rights apply to all users? Could the secondary user initiate a remote wipe that way? For example, AirDroid requests such rights and as a secondary user I can approve those rights. Those rights do not show up in the device-administrator list of the primary user, even though Android explicitly explains to the second user: "Erase the tablet's data without warning by performing a factory reset", not "Erase the user's data".
I don't really feel like trying out a remote wipe just to see what happens. Is there anyone here who knows? I haven't been able to find out on Google etc.

Update: I now tried to do a remote password reset (with AirDroid). It turns out that this only affects the password/PIN of the user that was running AirDroid.

Related

[Q] Preserve an App through factory reset

I've done everything I can think of to determine if this is a question that has been posed elsewhere - to no avail. Nothing quite seems to fit my predicament exactly (that I've found anyway - please feel free to flame/educate me if I have overlooked anything or am in the wrong thread) I am hoping you 1337 pros here on xda devs can help this poor self-loathing n00b. Apologies for the lengthy post - but it is necessary to explain my question.
I am attempting to develop an app (open source for personal use [no ads] - with enterprise edition available for a fee) that can remotely secure/locate an Android device - tablets, phones, etc -- targeted for anything running Froyo or better.
The problem I am running into is that I am unable to prevent a would-be thief from initiating a factory reset and removing the app (and it's configuration settings). I have device admin setup so that the permissions must be revoked after signing in with a username and password before the app can be uninstalled - but factory restore still wipes it.
As this would be a theft deterrent/recovery tool - relying on a thief to connect the device back to the original Google account and reinstall the apps is out of the question. I understand that if the ROM is replaced with a custom ROM (e.g. Cyanogen, etc.) it would not be able to prevent the app from being wiped - but negating the factory reset from removing the app would still be very beneficial.
Short of including the app in the manufacturer's ROM image - is there any work around to be found here? I'm at my wit's end (however limited that may be).
I am most grateful for any information you can provide - even if its bad news.

[Q] Security threat: still able to access google account after revoking password

I'm using Android 4.0.4, IceColdSandwich ROM, set up Google 2-step auth. I have generated an application-specific password and used it to set up account on the android phone.
First, I haven't found any ways to log off from the account. The only way offered is to completely remove account-related data including messages and so on.
Second, and most important, I revoked the application-specific password using web interface, and the phone still able to access my account mail and sync all the account belongings. I rebooted phone, clear data of different google applications with no luck - phone still had an access the account.
So I'm wondering why Google allows such unsecure scheme to live, and if there is a chance to revoke the access to google account in case of loosing the phone.
I have had the same problem after doing a full wipe update I revoked the old password then generated a new one so I could login. But after finding problems with the rom I restored my Nandroid backup and it never asked for a new password, it just worked which is a big security flaw.
My only guess it since I gave it the same name (ex Android Phone) maybe same names generate the same password. And has no randomness
I should do a test by generating a new password then revoking it and generating with the same name to see if they match since I have never checked if they are the same due to not knowing the old one past one time type in.
Edit they are not the same but I think I noticed what you have to revoke. At the top of the page you should see these I assume if you revoke them they don't come back until a proper password is re-entered.
Android Login Service — Full Account Access [ Revoke Access ]
sfg.google.com — Google Calendar, Google Calendar [ Revoke Access ]
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting
Moving to Q&A

Disable Android Device Manager Wipe (Stock ROM+Root+Xposed)

Hi,
I have recently went back to stock from CyanogenMod. I installed root and Xposed on it (for some other purposes). One of the things I liked about CyanogenMod was that you could not enable remote wipe and erase remotely (a security concern, in my opinion) ever since I've heard of those remote wipe hackers who wiped a bunch of iPhones, I've been paranoid. I'm encrypted with a relatively strong password.
I have already tried to disable remote wipe by disabling the Android device manager device admin (didn't work; you can press the "enable remote lock and erase" and it gets its admin back), I tried to disable remote lock and wipe from Android Device Manager through Google settings, with the same result.
It looks like the only way to truly disable this is to flip some switch I've not come across or uninstall/replace the framework for remote wipe/erase.
How do I disable remote wipe and erase (while leaving GPS and ring on) from Android device manager, without allowing it to turn back on?

How do I set a restrict user as default user when the device is powered on?

I need to setup a restrict user as default user when the device is powered on. I need to hide the owner user too. The idea is to create a custom build of android 7.1.1. (probably lineageos) with a restrict user with only some apps and with limited access to phone configurations. To achieve this the default user cannot be the owner. Any sugestion? Thanks.
Just curious, if you're building your own build, why don't you build in the restrictions, and the owner will naturally have restrictions...
(I'm not sure what type of restrictions aren't available on a system level, if any.)

[HOW TO] ENSURE ANDROID DEVICE SECURITY, PRIVACY and DATA PROTECTION

NOTE:
This is a very basic guide only for newbies like me.
I'm not a developer or something even near to that. All information provided here is copied from different sources and according to the best of my knowledge. I'll not be responsible for any harm to you or your device. Try it on your own risk.
Any additions or corrections are welcomed.
Note: Unlocking Bootloader and Rooting breaks "Verified Boot". It can be dangerous.
Unlocking bootloader:
Disables signature checking of boot image and recovery image
Allows all fastboot commands to be executed
Zeros out /data partition i.e. filesystem is erased and then regenerated on next boot
To know further: BOOT PROCESS: ANDROID vs. LINUX
As compared to iOS, Android is considered less secure OS because it's an open source project and a large number of developers are involved contrary to iOS where things are kept secret. We can face two types of threats regarding mobile security:
Data theft or loss when using mobile phone.
Different types of malware (spyware, adware, bloatware, ransomware, worms, trojans, virus, cookies) or a hacker can directly attack your device to gain access to your personal data like contacts, pictures, credit card information or even can note your habits and then forcefully show you ads etc. Sometimes the purpose is just to harm you, rather than having some benefit. To avoid this:
Keep your phone as simple as possible. Avoid installing apps from unknown sources particularly KeyGens and cracked / pirated / hacked apps and MODs offered free of cost. Use an app store like PlayStore to install apps which provide security somewhat.
Some stock ROMs (manufacturer's operating systems) contain bloatware (unnecessary and suspicious apps) running as an app or in background. Try removing as much of these as possible by uninstalling or freezing or at least restrict their permissions and internet access.
In Android 6 and above, apps ask for permissions from user when run first time. Allow for these permissions carefully. Check your list of apps auto-starting up and running in background as well as accessing storage and phone / sms etc.
Permission regarded as "Normal" by Android cannot be revoked by simple means e.g. you can restrict an app's INTERNET permission. Either use a third party trustworthy permission manager or at least review the list of permissions requested by an app at install time.
Use some firewall app like AFWall+ to block hidden internet access of apps to internet.
If your phone is rooted, try to avoid granting root access to as less apps as possible particularly those from uncertain sources.
Use some anti-malware or commonly known antivirus app in mobile phone which can scan and filter apps, attachments, links, emails, sms and webpages etc. There are numerous paid and free apps available for the purpose, though most of them are themselves promoting some kind of malware for business purpose. av-test.org is a good place to start with selection.
Data theft or loss when phone is lost or stolen
In this thread I'm focussing this part and giving here a few technical tips and measures you should always take that can help you keep your data, device and yourself safe in case if your device is LOST or in case of THEFT. Otherwise your device and your data can be accessed and misused.
The very first vulnerability of our data to theft and misuse starts with the Unlocking of BootLoader which is locked by default for security on most of the new devices. Unlocking BL makes it easy to flash custom recoveries, kernels and ROMs. That's why, the internal storage can be accessed from any custom recovery or device is factory reset or new OS can be installed for a fresh use. Therefore vendors are making it harder and harder to unlock BL without proper authorization. Personal data is also prone to wrong hands due to insufficient security measures on device as explained below:
DATA PRIVACY
Always keep Screen Lock enabled (with PIN or Password or Pattern).
But keep in mind, this option alone is of no use. It takes only a minute or two to remove screen lock protection if a custom recovery is installed or BL is unlocked / unlockable.
Always use Internal Memory of Phone to store personal data like pictures, contacts etc.
External memory (SD cards) can be removed from device and easily accessed from computer or other devices. They aren't erased usually in case an app tries to erase data in case of theft. Also, Android doesn't offer encryption of SD cards by default. A few custom ROMs offer this feature or you have to use a third part app for encryption. Built-in kernel module dm-crypt is used by AOSP for full disk encryption (FDE). A similar service is needed which auto-mounts your memory card at OS boot. Good examples of encryption at filesystem level are EncFS and CryFS which offer a stackable transparent encryption with virtual filesystem. An easy way to implement EncFS on Android 5- is explained here.
However, in Android 6.0 and above, external memory swapping with internal memory is offered called adoptable storage. That's relatively more secure because it makes SD card not readable by other devices (at least not easily).
Old Devices with Low Internal Memory - in this case instead of putting personal data on SD card, try using SD card's 2nd partition to link apps & their data to SD card by Link2SD and keep your personal data on internal memory.
However, Link2SD may slow down your device or can be a battery hog. In this case, use Third Party Encryption apps to encrypt your targeted data instead of encrypting whole /data partition. There are numerous apps like KeepSafe which is more useful if you combine encryption with cloud backup or online synchronization. However, be careful while selecting app. The app can fail to protect your data online or it can itself misuse your data. Otherwise, any app like ES Explorer or Solid Explorer can be used to keep data encrypted.
In case of third party encryption software, you must be extra conscious of your data. Sometimes sensitive data is hidden (apps data or due to .nomedia) like WhatsApp Sent folders. You have to take care of all this manually. It's really a hectic job.
Encrypt Internal Memory (particularly if BL is unlocked).
It's because and attempt to unlock BL erases all personal data on internal memory (not external SD card). However, it may not always be true. So keeping Internal Memory Encrypted always promises more security. An un-encrypted internal memory can be easily accessed from custom recovery.
Performing these steps makes your data quite secure and not vulnerable to easy access.
DATA PROTECTION
Data Recoverable - use local / online backup of your data. Read here how to do that.
Wiping Data
Bootloader Locked - so that there is no chance of flashing custom recovery and then accessing data from there or through ADB. As stated above, unlocking BL will erase data but it's not always true. So, this option alone cannot be relied on.
There are chances of wiping data if you use some anti-theft app. Android Device Manager (ADM) is a built-in app on all Android devices that suffices the basic needs of an anti-theft app. A Google account on device is mandatory and ADM must be enabled from settings i.e. Device Administrator. You can use Google Find My Device anytime to Locate (Location services should be enabled on device), Play Sound, Lock or Erase your device. Obviously, device should be connected to internet for ADM to work.
However, you may use any third party app with rich features (also SMS based).
Rendering Data Useless - as stated above, using Encrypted Internal Memory only for personal data makes it secure and hard to read by others, even useless.
DEVICE SECURITY
Device Recoverable
As stated above, there are chances of device recovery if you use some anti-theft app.
Keep your phone's IMEI number safe. Your Mobile Network Operator along with the help of police can trace your device whenever it's switched on unless its IMEI is tempered.
Rendering Device Useless
Bootloader Locked - so that there is no chance of flashing custom recovery and then flashing new ROM.
OEM Unlocking disabled - so that Bootloader can't be unlocked without proper authorization.
It can be disabled from ROM settings menu on Android 5.0 and higher devices (if found).
Factory Reset Protection (FRP) - so that after resetting device from recovery, device can't be logged in without already linked Google account. This is implemented by a separate partition named FRP or CONFIG or PDB (on Intel devices) or something else which saves information of last logged in Google (or OEM) accounts. This partition is not reset on factory data reset by stock recovery. So, if bootloader is locked and set unlockable in Developer Options, one can't flash custom recovery to erase FRP partition. He will be stuck at login screen permanently.
So a working Google account on device is mandatory. It works on some Android devices with Lollipop 5.1 and higher. However all vendors don't implement this security feature in their devices. Some use their own similar feature e.g. XIAOMI links your device to MI account.
Additionally some OEM's don't allow unlocking of bootloader without permission from OEM to ensure more security i.e. contents of partition[/URL] "devinfo" are signed by the OEM and can't be modified without their approval. After having permission, an official method is provided to unlock BL using PC.

Categories

Resources