# Question
Title: Which process is responsible for capturing (mobile/WiFi) data usage?
The problem is that it is broken for me. I customized quite a bit, specifically installing a firewall that uses root and disabling broadcast receivers and services in many Huawei and Google apps that came preinstalled. I guess one of these must be responsible for capturing how much data flows over each interface and from which app it originates, since the feature broke.

Which process (on any Android phone, I can probably find the equivalent once I know where to look) is responsible for doing this?

# Answer
> 4 votes
`DataUsageController` (a component of Settings app) collects data from `NetworkStatsService` (1) which is part of Android framework i.e. `system_server` and depends on (2) `TrafficController` (a component of `netd` native service) which in turn uses libqtaguid to tag network sockets on per app/UID basis. Previously `qtaguid` kernel module was used to track tagged sockets (by reading “/proc/net/xt\_qtaguid/stats” ()) which is being replaced with eBPF framework. Now data usage will be available in a virtual filesystem (“/sys/fs/bpf/traffic\_uid\_stats\_map” ()).

Network policy restrictions (Data/Battery Saver and Background Data (5)) and Data Limit/Warning are implemented mainly by `NetworkPolicyManager` and `NetworkManagementService`. At back end `netd` inserts/deletes `iptables` rules (6) to enforce restrictions in kernel space.

Both qtaguid (7) and quota2 modules are part of only Android kernel () while `owner` is part of mainline Linux kernel.

RELATED: How to view network traffic requested by a specific app?

---

**REFERENCES:**

1. The one we can access with `dumpsys netstats`
2. Through *NetworkStatsManager* / *TrafficStats* / *SocketTagger*, JNI *NetworkManagementSocketTagger*, *libcutils (qtaguid)*, *NetdClient*, Netd's *FwmarkServer* and possibly others
5. Can be read / set by `dumpsys netpolicy` and `cmd netpolicy`
6. Using modules *owner* and *quota2*
7. Based on *owner* module and depends on *socket* module

---
Tags: system-apps, data-monitoring
---


title: Samsung J5 stuck on Downloading Mode

text:
# Question
Title: Samsung J5 stuck on Downloading Mode
The big problem it's that the phone doesn't have the power button at all, so I can't use the usual combination (VOLUME DOWN + POWER).

Any idea what can i do?

# Answer
I have had this problem and I tried the volume buttons option and I don't think there's any other way that's not exclusive to your phone. You might just have to take it the manufacturer
> 0 votes

---
Tags: samsung
---


title: How can I run chroot on Android?

text:
# Question
Title: How can I run chroot on Android?
I have my chroot environment setup (Alpine Linux) in /sdcard/alpine. I try running my chroot with the following commands:

```
su
chroot alpine /bin/busybox

```

(busybox is the cli of Alpine)

I get the following error:

```
chroot: exec /bin/busybox: Permission denied.

```

How can I fix this?

My device specs:

Google Pixel XL (marlin)

Android 9.0

Rooted (obviously) with Magisk

# Answer
Binaries can't be executed on `/sdcard` because it's an emulated filesystem with fixed file permissions, mounted with `noexec` mount option. Create `alpine` directory on some other filesystem e.g. `/data`:

```
~# mkdir -p /data/local/tmp/alpine/bin

```

Place your executable in newly created directory and do chroot:

```
~# cd /data/local/tmp
~# chmod 0755 alpine/bin/busybox
~# chroot alpine /bin/busybox sh

```

This will drop you to a root shell (UID 0) with changed root (`/`).
> 2 votes

---
Tags: root-access, command-line
---


# Question
Title: Where is Google's internal account authentication token located?
I'm trying to write a Tasker script for my (rooted) phone that uses the same Google credentials that are being used on my device (for Gmail, Drive, etc.).

Where can I find Google's OAuth (or other) authentication tokens on my device?

I checked inside `/data/data/com.google.android.gms/databases` but couldn't find anything I could recognize as an authentication token.

# Answer
The authentication token for Google accounts and of other accounts which uses AccountManager class are stored inside:

```
/data/system/users/0/accounts.db   # for Android Marshmallow and earlier
/data/system_ce/0/accounts_ce.db   # for Android Nougat and above.

```

`0` implies primary user of the device. If you have secondary user accounts, replace 0 with the user id of that account. To find out the user id follow my answer here.

Note that access to that database requires root access.
> 10 votes

---
Tags: root-access, google, tasker, authentication
---


# Question
Title: Missing "Manage root accesses" under developer options in LineageOS 16
My phone is Xiaomi Mi 5s Plus 6GB/128GB. After a clean installation (flashed MIUI 9.6.27 first) of official LineageOS 16.0 Sep 19, 2019, I can't find "Manage root accesses" under developer options.

After the format and advanced wipe, I installed LineageOS, Open GApps Pico ARM64 for Android 9.0, and Magisk 19.4. Now all three seem to be working ok, and I was able to grant root access to AdAway and Titanium backup through Magisk. But I couldn't find manage root accesses under developers options.

So I installed `addonsu-16.0-arm64-signed.zip` from this LineageOS page, through TWRP. Though after a reboot, the manage root accesses option is still missing. It's not even displayed as a greyed-out option, it's just not there. On the "Trust" screen, it says, `Root access: Disabled` right below `SELinux: Enforcing`.

I would like to grant root access to ADB. Is it possible through a terminal emulator (on the phone)? Is there any command for it... 'coz I can become root "by su" in the terminal emulator through Magisk.

---

* Official LineageOS 16 ROM doesn't come with "Addon-SU" pre-built. Their installation instructions say to install Addon-SU (separately) from the "extras" page I have linked.
* **With Magisk, I know I can grant root access to any regular app but how could I grant "Root access to ADB"**?

The reason I'd like root access to ADB is, 2 days ago I tried updating LineageOS ROM through TWRP but it failed, and then I couldn't flash new or old Lineage ROM through ADB, as I kept getting this error:

`adb: sideload connection failed: insufficient permissions for device: user in plugdev group; are your udev rules wrong?`

Even though I was running this `adb sideload lineage-16.0-20190719-nightly-natrium-signed.zip` command as ROOT user from Ubuntu 19.04. I also tried the same from Windows 10 admin command prompt.

So after a failed LineageOS update:

1. I couldn't flash new/old Lineage ROM through TWRP,
2. I couldn't flash any Lineage ROM through ADB.

I had to install MIUI 10 ROM, then format and advanced wipe to install LineageOS back again. So now I'm trying to grant root access to ADB to prevent this from happening again.

---

1. As I have mentioned earlier, I tried the same through **Windows 10 administrator command prompt too**, and the result was the same.

As per my understanding, **Window 10 does not have "udev rules"**.
2. This is how I was running `adb sideload` command from Ubuntu MATE 19.04 Terminal:

```
admn@um:~$ sudo su
[sudo] password for admn:
root@um:/home/admn# adb sideload lineage-16.0-20190719-nightly-natrium-signed.zip

```

Was getting an "insufficient permissions" error.
3. Here is the "insufficient permissions" error in full detail, where you can see it refers to Android developer website:

```
root@um:/home/admn/Downloads# adb sideload lineage-16.0-20190919-nightly-natrium-signed.zip
adb: sideload connection failed: insufficient permissions for device: user in plugdev group; are your udev rules wrong?
See [http://developer.android.com/tools/device.html] for more information
adb: trying pre-KitKat sideload method...
adb: pre-KitKat sideload connection failed: insufficient permissions for device: user in plugdev group; are your udev rules wrong?
See [http://developer.android.com/tools/device.html] for more information
root@um:/home/admn/Downloads#

```
4. Right on the phone, through TWRP: Now I have updated the same phone for the past two+ years in exact same manner. Almost once a week for two+ years.

Note: Every single time, I always verify **sha256sum** before transferring the ROM to the phone.

First I transfer the LineageOS ROM into the Download folder of the phone through a USB cable, boot into TWRP \> install \> find the LineageOS zip.

But this time, first time in two+ years, the update failed with "Error 7".

1. I tried this route many times, after quite a few reboots, but the installation was not going through.
    2. Now the phone was not booting up normally. It was getting stuck at the LineageOS logo screen for 30+ minutes.
5. I'm trying to get to this "Manage root accesses" screen:

Of course, this image is not mine but it's from LineageOS.
6. LineageOS's "AddonSU" is NOT just meant only for userdebug builds. Here's a link to LineageOS installation instructions pages for Natrium (Mi 5s Plus) and Beryllium (Poco F1). Where at the end of a page it says: "**(Optional): Root your device by installing LineageOS’ AddonSU, (use the arm64 package) or by using any other method you prefer.**"

I'm attaching a screenshot:

>

# Answer
`addonsu` is an open source rooting solution from LineageOS. Magisk is another rooting solution. So are/were SuperSU, PHH's SuperUser, CF-Auto-Root and so on. You cannot / don't need to / should not use multiple rooting solutions simultaneously. Magisk - during flashing process - deletes any files related to other rooting solutions, including `/system/xbin/su` put by `addonsu`. That must be the reason for **Missing “Manage root accesses” under developer options**.

If your ROM is pre-built with `addonsu` (check in Developer Options), you don't need to flash Magisk. If it's not, flash either `addonsu` or Magisk.

> I would like to grant root access to ADB. Is it possible through terminal emulator (on the phone)?
> ...
> With Magisk, I know I can grant root access to any regular app but how could I grant "Root access to ADB"?

ADB daemon (`adbd`) can be run as root only on `userdebug` builds* as explained in Why “adb root” does nothing? And that doesn't require rooting your phone.
Magisk can grant root access to `shell` i.e. when you execute `adb shell su`, Magisk treats `shell` (UID: 2000) as a normal app. So *“grant root access to ADB”* is different from *“grant root access to ADB shell”*.

> I tried updating LineageOS ROM through TWRP but it failed
> ...
> as I kept getting this error:
> `adb: sideload connection failed: insufficient permissions for device: user in plugdev group; are your udev rules wrong?`

The error you have mentioned isn't related to Android but to your Linux OS. When you insert Android device to PC, the device node created in `/dev/bus/usb/...` must be readable / writable to non-root user, which is usually not. So you either need to run adb server as root:

```
~$ sudo adb kill-server
~$ sudo adb start-server

```

Or configure `udev` to set ownership/permissions of device node as explained here and add yourself to `plugdev` group (if not already) as explained here.

> Even though I was running this `adb sideload lineage-16.0-20190719-nightly-natrium-signed.zip` command as ROOT user from Ubuntu 19.04.

You executed `adb` first time without root, so ADB server was running as non-root user. Later running `adb` with root makes no difference. See documentation here.

> So now I'm trying to grant root access to ADB

ADB Sideload is supposed to be run in recovery mode i.e. TWRP in your case. In TWRP, `adbd` is always running as root. Root is required only when device is running main Android OS. Recovery and Android are two independent OS's. Also don't confuse ADB Daemon with ADB Server.

---

* As evident from here, LineageOS's `addonsu` also seems to be working only on `userdebug` builds (which custom ROMs are mostly).
> 0 votes

---
Tags: adb, root-access, lineageos, xiaomi, developer-options
---


# Question
Title: What does vga=844 means and what other values are there?
I installed Android-x86 on VirtualBox and find the resolution to be too big, because it causes lags on the virtual device. I wanted to try a smaller resolution and came to the `menu.lst` file with the `vga=844` kernel option.

I tried to look around for a list of valid values, but can't find much information.

So, what other VGA values are there?

# Answer
The table below lists some Linux vide mode numbers.

As stated here:

> The mode you wish to use is derived from the VESA mode number. Here are those VESA mode numbers:

```
  | 640x480  800x600  1024x768 1280x1024

----+-------------------------------------
256 |  0x101    0x103    0x105    0x107
32k |  0x110    0x113    0x116    0x119
64k |  0x111    0x114    0x117    0x11A
16M |  0x112    0x115    0x118    0x11B

```

> The video mode number of the Linux kernel is the VESA mode number plus 0x200.
>
> Linux\_kernel\_mode\_number = VESA\_mode\_number + 0x200
>
> So the table for the Kernel mode numbers are:

```
    | 640x480  800x600  1024x768 1280x1024
----+-------------------------------------
256 |  0x301    0x303    0x305    0x307
32k |  0x310    0x313    0x316    0x319
64k |  0x311    0x314    0x317    0x31A
16M |  0x312    0x315    0x318    0x31B

```
> 2 votes

---
Tags: 8.1-oreo, android-x86, virtualbox
---


# Question
Title: call/alert me when I receive an SMS from a VIP
I'm an Australian, and I've signed up to receive SMS alerts at different (unscheduled) times during the USA's day time, which is Australia's night time.

I want to ensure I am alerted when I receive an SMS from them.

Is there a way I can change the sound when I receive an SMS from that VIP?

Ideally, I'd like an alarm that wouldn't stop until I attend to it.

Help appreciated.

# Answer
Found a partial answer, which will allow you to select a Sound.

**But not sure if I can set this sound to repeat until I turn it off.**

1. Tap the Conversation you wish to set a custom notification for.
2. Tap the three-dot menu icon in the top right corner of the screen.
3. Tap Details.
4. Tap Notifications.
5. Tap Sound.
6. Tap your desired tone.
7. Tap the back arrow, or OK or Save if those options appear with your ringtone picking menu.

Source.
> 0 votes

---
Tags: google-pixel-2
---


# Question
Title: Clash of clans game data tranfer from one device to another android device
Is it possible for me to transfer game data files from my nokia-x phone to another android device?cause **Nokia-x doesn't support google play services**,and i want save my village progress.how can i get the game data files?

# Answer
> 1 votes
You should be able to use file explorer to find the data inside phone storage or your micro sd card (depending on where you have the app stored) under Android and data or obb. If the game data is compatible with the version installed on your new phone, then it should be able to be copied and pasted in place of the game data from the new app. I do not play this game but have successfully done this with other apps. It is similar to a backup, but more specific.

# Answer
> 1 votes
You don’t need to get game data files to transfer to a new device. Clash of clans data is stored on their server.

Instead, go into clash of clans and create a supercell ID. Then login to your supercell ID on your new device.

I play clash of clans and have done this with my devices before. Let me know if you have any problems

---
Tags: data-transfer, clash-of-clans
---


# Question
Title: Why phones with Android One don't get update to Q right now (2019)?
Android one phones are near stock version of Android.

Starting Android 8 (or 9) project treble aims to deliver new version of Android without work from the OEM.

Yet phones with Android one and treble don't get update right away, see for example the Nokia roadmap to Android Q:

For example, Nokia 2.2, Nokia 3.2 and Nokia 4.2 all have Android one and start with Android 9 (so they are treble ready) and have to wait until Q1 2020. Why can't they get the GSI directly from Google servers to get update as fast as it's released by Google?

# Answer
> 1 votes
The updates are still required to be done by the OEM. And if you try flashing a GSI yourself, it will either not boot or be ridden with issues. The underlying vendor partition also needs an update along with new and updated drivers and HALs from the component vendors to make the hardware work properly with the new OS version. Hence, it takes time to merge, develop, test and then make the final market release. I wish updates were as easy as picking the Google system image and sending it to the phones. GSIs normally work ok if you're installing the version for which the installed vendor partition was built. But in my case they weren't fully smooth. For example, my Nokia 7 has a badly performing modem when on a GSI. And the Android 10 GSI just kept on bootlooping.

# Answer
> 0 votes
In Android one programme updates are provided by google itself and they give the pixel phone the higher priority as if all the phone will start having android 10 pixel will start losing edge. Android one updates are not necessarily the fastest. Even Huawei is providing P30pro with android 10 in coming December

---
Tags: updates, android-one, nokia-x, treble
---


# Question
Title: Can I use different countries version of the Play Store on different accounts?
I recently moved abroad and I need to change the country of my Play Store (for mobile/banking apps), I also need to keep the apps from my home country.

Can I use two different Android accounts (with two different Google account) each with their own countries? Will they interfere with each other?

Thanks.

# Answer
> 0 votes
I think yes. I have different accounts with a different country. It is working fine.

---
Tags: google-play-store, multi-user, accounts
---


title: Why don't my adbkey fingerprints match?

text:
# Question
Title: Why don't my adbkey fingerprints match?
When I attempt to connect to my phone via adb it tells me my public key's fingerprint is this:

But on my computer, per this post, my public key's fingerprint is

```
will@linux:~$ awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl md5 -c
(stdin)= 3c:be:86:c7:68:f4:36:7f:f9:d7:29:92:2d:d0:3b:0d

```

which is different, and also much shorter than the fingerprint displayed on the phone (32 characters long vs 64 for the one displayed on the phone). Does android now use a different method of generating the fingerprint than the one in the linked thread?

I'm running android 5.0.1 with adb 1.0.36, revison 7.0.0\_r1.

This is the full public key for reference:

> QAAAAJXI4EVDPeAUk18A1RBUobHqLB2V+syZaJxs3XDwX9aaIurNRF4gmmVUFo8CLYeteGVta2q/enn4HrSCw5VEJ2V2ByyhN9Obl2jhU3jJtQmiLUUkDOjHriJ7c8WQOfqkq5/DJPpAxIzI3Qlalr6Jrb9SIE0iEoIlNl5xd9tIYQgBcECMHodciV0qG8hlDkY3vXQyMJfNQ5Y1EkPf2eyeRS+h/8kViz1tLbcxoCoBwQehDeaQzCb3ACY8KV4If02i/wWy0La5m5CVvGsGCGZfoU7klPxzYqkA5fGJ03OTWI1SxsIqjwGzM/xlS40Vz6gfCODJxWq6WL5qTJgTusKbx77zJQqwj6nt5cvLOZVxVCIqticF9njcIDr1XIi79JnuBaZfr2X/IX1VJyj30T8npEFyR7IN//pY1knM6YPfmwQ6K2ynFW7id8uUbrxxqKW0aBypzPC9y4vzbFxAaQI3Ck6dpqNjvI4M+BAVPK3PdgEtxwVOU6z//oLUVsygEOtfyl5ttwd2Ni/EcQLp9zIYskwIkETHcBR56G4tv+vuL6qq7lH95IInA8sUjuz3+5daSCXFSfEkXsAobSa1EmYy3gwuBwpO1tLH+wjIH7M2w40KNu4YxRb2TW+YqPGw6c2/l5CdpEdXmCzbRN1ZjtfhEOH+WRTsdAwigx/uw/t5YjFZNj3TMAEAAQA= will@linux

# Answer
With try-and-error (actually on first attempt, which shows it was not pure lack): your fingerprint shown on android device is one that can be created using `sha256` hash-function, that is `awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl sha256 -c`.

Adb enhanced security (`sha256` much better and modern than `md5`).

```
$ cat test.pub | openssl base64 -A -d -a |openssl sha256 -c
(stdin)= bc:67:e2:fc:24:0b:69:17:c2:34:cd:16:49:0d:8a:f0:af:d7:28:1a:1e:75:6c:d0:20:65:1f:77:94:a5:0a:53

```
> 1 votes

# Answer
Check the user ID you run your `adb` server under. If it's different from `will` \- you would need to compare your fingerprint with the key in that other user's home dir.
> 0 votes

---
Tags: adb
---


# Question
Title: How can I see the fingerprint of my adbkey?
You should know that Android 4.2.2 (or just before) introduced RSA key checking for adb access. – The device asks now if you want to allow access.

To avoid asking every time, the computer presents an RSA key, which can be permanently accepted.

The dialog on the phone shows the RSA key fingerprint. – On Linux, the public/secret key pair is here: `~/.android/adbkey(.pub)`.

How can I show the fingerprint of that key file? (I’m looking for a command line to do that on the Linux system.)

# Answer
> 27 votes
This line will do it (found here):

```
awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl md5 -c

```

# Answer
> 0 votes
Run:

```
echo {public key} | base64 --decode | md5sum

```

# Answer
> 0 votes
On Android 5 and above, the hash function used was changed to `sha256`. If your hardware is such, your could try:

```
awk '{print $1}' < ~/.android/adbkey.pub | openssl base64 -A -d -a | openssl sha256 -c | awk '{print $2}'|tr '[:lower:]' '[:upper:]'

```

---
Tags: 4.2-jelly-bean, adb, ssh
---


# Question
Title: Is it possible to get the SHA256 of an APK solely through ADB?
I am currently working on a project which will identify malware that are residing on a device.

My aim is to make a hash-based detection of Android malware on a device by only accessing the ADB port of the device and getting the SHA-256 (MD5, SHA1, etc could also work) of the `base.apk` which resides in the app's data directory.

Is there any way to get the hash of an `.apk` file that is installed on a device using ADB, but without installing another app?

# Answer
On most devices the command-line application `sha256sum` is present which can be used to generate the SHA-256 digest of one or more files.

It can be used via adb so that you can use it to generate a digest of each APK file without having to transfer it to the PC.
> 3 votes

---
Tags: adb, apk, malware
---


# Question
Title: Permanently delete apps using Titanium Backup (they keep re-installing!)
Phone is rooted, running a custom ROM. I am using Titanium Backup, it has been given root privileges.

I am trying to uninstall the following:

1. default Files (I prefer X-Plore, yet, many apps keep using Files, despite setting X-Plore as default app)
2. Calculator (I have disabled autoupdates, yet THIS app was updated automatically, without my permission. This will not be tolerated.)
3. All other Google apps (Since one can auto-update regardless of settings, then the others can, too. Everything gets nuked)
4. Via browser

Titanium Backup shows that the files have been removed (the app names are crossed out), yet the apps are NOT removed from the app drawer, and clicking on them starts them normally.

I switched off all internet access (data and wifi), uninstalled the apps, then restarted, with no success.

How do I PERMANENTLY remove these intrusive and privacy abusing apps?

# Answer
> 1 votes
There are times Titanium Backup does not work, so I use System App Remover (root needed). However, as indicated here, a workaround for Titanium Backup is to install Termux. Issue the following commands from Termux

```
su
setenforce 0

```

Then try to uninstall the apps again with Titanium Backup

> This sets SElinux to "permissive". Then you can uninstall all your system apps. Then after you reboot, the phone automatically goes back to "enforcing" for SElinux.

---
Tags: adb, root-access, titanium-backup, bloatware
---


# Question
Title: Bad voice quality on phone calls, good with WhatsApp
I have two Samsung Galaxy S5 minis, one of which has the following problem:

The voice quality is really bad on phone calls to other people (muffled sound, chopped, extra noise/interference, echo).

I suspect it has nothing to do with the network strength, as the voice quality of the other device is very good in the same spots.

To rule out hardware issues, I called other people via WhatsApp. Everything is just fine there. Also voice notes on WhatsApp do not show any problems. So I would suspect that the microphone is ok.

I must admit that I did not try to reset the phone yet (factory reset), as I would not like to spend the time on reconfiguring everything to my needs - just to find out the problem persist.

So is there anything I can do before trying a factory reset or even send the phone in for inspection? Is there any setting that I can change? I removed some of the preinstalled apps, could this be an issue? Or is there another caller/phone app that I can try?

# Answer
> 0 votes
I tried a factory reset to resolve the problem, but it did not help. Also I send in the phone to the sellers technical service. They wanted more money for repairing the phone than the phone is worth. However, there were suggestions on the internet stating that sending the device to Samsung could help. Even if they would not repair the device, it could help resolve the problem. However, it turned out that my phone had still warranty, so they repaired it for no cost! Now everything is working fine!

---
Tags: calls, microphone, samsung-galaxy-s-5-mini
---


# Question
Title: Is it possible to transfer the internal memory/storage chip of an S9?
My Samsung Galaxy S9 is physically damaged and the board is dead. The phone will not turn on or show any signs of life. Plenty of important photos and data are on that phone which I need to retrieve.

Is it possible to swap out the internal storage chip from the dead motherboard of a Samsung Galaxy S9 and place it to an identical working board and retrieve the data that way?

If not, is there any other way I can get the data off of my dead phone? :(

Thank you in advance!

# Answer
Based on the iFixit tear-down of the Samsung Galaxy S9 you can see that the flash chip in this model is a single chip soldered onto the motherboard - it is inside the orange rectangle below, a 64 GB UFS (NAND flash + controller):

Therefore theoretically it may be possible to unsolder this chip and read out the content if you manage to get the chip working in a different environment.

However even if you manage to read out the chip completely it may be of no use as usually Android devices come with enabled encryption by default (not sure about Samsung and especially this device). The encryption method uses hardware based cryptography, which means that the key is not directly stored in the flash chip but requires other system components like the CPU. However I don't know the exact details on the used encryption especially where the keys protected by the "Hardware Security System" are actually stored.

As your device most likely uses File based Encryption (FBE) there may be some files accessible that are unencrypted, however I don't have any experience what files are typically stored without encryption. My assumption is that most of the app/user data is encrypted.
> 3 votes

---
Tags: samsung, internal-storage, data-recovery, mobile-data
---


title: Coming back Google Play Services

text:
# Question
Title: Coming back Google Play Services
I have Samsung Galaxy A50 which is my professional smartphone, I use it for work and it is funded by my company. It has some professional software installed in Knox like encrypted e-mail etc.

I am observing problem with Google Play services app/service. I have message coming from time to time saying (translated):

```
Device Health Services
Enable Google Play Services
Device Health Services app won't work if you do not enable Google Play Services

```

I've tried to turn off this message by disabling notifications from three apps:

1. Google Play Service
2. Device Health Services
3. FAMOC

This didn't helped. Still I get the same message between few minutes to few hours.

When I click this message I get possibility to enable or stop Google Play Services but the enable button does not work - it does nothing or sometimes is disabled. From this screen it is obvious that the app is stopped. However when going to Settings menu and below I get info that the app is enabled and working.

Stopping the app also does nearly nothing. Clearing data and/or cache does not help. Downgrade of this app is not possible. Deactivation also is not possible.

The app version is 19.2.75 (100400-269183835). It is the newest as I have other phone and the version on it is the same.

The app does not make any problems, there are no errors.

How can I get rid off this message coming from time to time?

# Answer
> 0 votes
Ok, so I found a solution.

When you block notifications for all 3 apps it is not enough.

You need to hold this specific notification longer and use options there.

Problem solved!

---
Tags: samsung, google-play-services, services
---


# Question
Title: How can I backup the entire Gallery (photos and videos) to my desktop computer?
The **Gallery** on my Android device seems to show **all the photos and videos**, whatever the method to get them could had been (camera, whatsapp, bluetooth, and so on).

I would like to **backup them all**, but all I have found on the net refers to one *nagging* method, consisting of **syncing** it to some cloud (DropBox, for example) storage. This is painfully slow, and I prefer to store my multimedia **on my desktop computer**, for example by pluging the USB cable or transferring it via USB storage device, SD card... etc.

But the only way to backup the entire gallery to my computer I have found is just the **manual method** of **copying each involved directory** that could contain those files. This is like some sort of nightmare, due to:

* There are **multiple possible directories** that I must (nearly) guess, depending of the program that got the photos/videos: camera seems to be at `DCIM`, WhatsApp at `whatsapp`, another directory for `bluetooth` ... etc.
* There are **two storage drives**: the phone itself and the SD card. So the job must be done twice.
* Some Windows system (my Windows 8.1 at least does, I don't know why) don't allow **concurrent file transfers** via USB cable, so I must seek&start the first transfer of files (say `DCIM`), wait until it finishes, start the second (say `bluetooth`) and so on.
* **Restoring** such backup requires rebuilding the **exact directory structure** on the phone, but I could prefer to store all the photos and videos on the same folder on my desktop.

Isn't there a **more simple** way?
Both solutions involving **Android's native** or **additional software** (freeware preferred) are accepted.
If not possible, I could accept a solution involving to send the entire gallery to any **cloud/internet** and recovering it on the desktop.

# Answer
> 13 votes
I don't prefer cloud backup because of high priced internet plans in my country, and the answer by Lord Ralf Adolf didn't work for my device somehow. Ultimately, I had to find a solution which is supposed to be *no pain only gain*. Here we go with one mentioned below.

## Notes:

* The solution requires a USB cable, MTP enabled (available in Android 4.xx and 5.xx) in Android device, (devices with **USB Storage Mode** would work as well), and Windows 7/8 in PC.
* If MTP somehow doesn't work in your PC, you've no access to USB cable, or your device doesn't have MTP feature, then you may very well host a server on your Android device, preferably a WebDAV server. See my answer here for *know-how*.
* Tested the solution with Android 4.2.1 and Windows 7.

---

## What this answer would achieve?

* Works well with/without **USB Storage** and **MTP** support in Android device.
* Backup **multiple directories** easily.
* Can backup **two or more storage drives** by choosing the following solution only which would require repeating the instructions, or (following+linked) answer which would make it happen in one-go.
* Fully automatic once final instruction is executed; no need to do manual copy for each file/directory.
* Copies **exact directory structure** so that you don't have to worry during restoring the data.
* **Needs no Internet connection** (other than to download some required software here).

---

## A bit of explanation before going to the kernel

The problem with most of the media backup apps (I noticed) for Android is that they don't really preserve or care for the **exact directory structure**, which means you can mine images from anywhere in the Android but you can't really mirror the directory tree for saving the file in your destination storage, i.e. (analogy)

```
copy F:/DCIM/Camera/DSC11*.JPG C:\Users\Firelord\Desktop\Test\

```

is easily possible and available by many Android apps and Windows softwares, but not

```
copy F:\DCIM\Camera\DSC11*.JPG C:\Users\Firelord\Desktop\Test\DCIM\Camera\DSC11*.JPG

```

The same holds true for many Windows Explorer alternatives for Windows 7/8 including FreeCommander, Multi Commander, Explorer++, XYplorer and other tools like SmartCopy.

(**Note** that I tried the listed ones but could not find the desired functionality with ease (auto copy with tree). Let me know (to edit) if your experience differs.)

---

Anyhow, the trick was to find a software for Windows which allows to take media backup(not disk/media imaging) with synchronization feature. Three such candidates that I tested and found easy(GUI) are SyncToy, FreeFileSync and PureSync. (All are free for personal use.)

I recommend FreeFileSync and the instructions for its usage are mentioned below.

# Instructions:

1. Download FreeFileSync(free).
2. This program might not create **Start Menu** entry. For a 64-bit Windows 7, the program's directory location is `C:\Program Files\FreeFileSync` and a relative one would be for 32-bit Windows 7. Execute the **FreeFileSync.exe** (right-click → **Run as Administrator**).
3. (On my machine this program freeze out for few seconds during its startup but eventually stabilizes and doesn't behaves alike.) The default screen for v7.0 would look like:
4. Connect your Android device into PC using USB cable, and choose MTP for data transfer.
5. In FreeFileSync, you would see two fields with name **Drag & Drop** at the top of left and right pane. They hold the location for the source and destination storage. Edit them:

* For left pane click **Browse****My Computer**(left side) in the opened window → select your device (say *HTC One*; under **Portable Devices**) → choose either Internal or External SD card of Android device → **Select Folder**(at the bottom).
    * For right pane click **Browse****My Computer**(left side) in the opened window → select the backup location (say `D:\Backup`) → **Select Folder**(at the bottom).
6. In FreeFileSync under the Menu bar, go to **Actions → Filter settings**. Here you can include the filetypes and exclude the folders from mining or backup. E.g. If I want to backup only `.jpg` and `.png` image files from my Android but I want to avoid those in the `Android`, `Data`, any `.folder` or folders that were created by some apps and includes irrelevant files with such extensions, then my filer would be:

Note that the filter is not complete in the picture as opposed to text in the answer

Tweak as much as you want since it's easy. I seriously advise excluding `Android` folder. Click **OK** when done with custom filters. (Note that I've not added but you may add video extensions too like `.mp4`, `.mkv`, etc.)
7. In the Menu bar, go to **Actions → Synchronization settings** and choose any of the variant available. For the first backup I prefer **Mirror** to backup all the filtered files. Click **OK** at last.
8. In the Menu bar, go to **Actions → Start comparison** -- this will show the filtered files in left pane (source) and files available in right pane (destination; would be empty for a new backup folder). (You can always switch the panes by clicking the blue `<>` icon available between the two panes.) An e.g. would look like:
9. In the Menu bar, go to **Actions → Start synchronization** -- this will (as obvious) synchronize the two folders based on the setting you chose in Step 7. An e.g. of process, and completion would look like:

We're good to backup anything here. Note that for restore the steps (as obvious) would be same but the locations at left and right pane would differ. Also, during restore, my phone freeze out a lot (the reason could be a low class SD card in device or altogether a program issue itself, IDK!)

### Issue with, and solution for, multi-storage Android devices

One issue that a multi-storage Android device user would've noticed is that you'll have to repeat the instructions to backup both External and Internal SD card.

This can be avoided by using a file server in Android. See **Method#1** or **Method#3** in my answer here. Just make sure that the file server should have its root directory at `/storage` so that in the FreeFileSync all storages (would be listed as folders now) can be mapped for backup.

I tried and it worked well!

**Status: Objective Completed**

---

I could cover SyncToy and PureSync here, but the latter freeze out the whole time whenever I click any option and about the former: it's intuitive and very easy in "exclude filters" but doesn't give much flexibility in synchronization variant (I would've ended up deleting images in device due to lack of such, but was stopped somehow. :) )

I think the objective can be achieved by using `find` and `rsync` tools in combination on GNU/Linux.

Let me know other options if you come to know any, or technical mistakes in my answer.

# Answer
> 2 votes
Depending on your operating system, you can use picture manager programs. I will list two free software, one for Windows, and one for Linux (I am a Linux user, so maybe the Linux method is better).

1. Under Windows (any version in the screenshots, it will be XP, which was the easiest to get on a virtual machine)

* Picassa: a powerful image manager and editor with a lot of features. I will be showing the only feature we need (importing photos from Android phone).
    * make sure you install your phone's drivers (see your manufacturer's website to grab the latest version).
    * download and install Picassa.
    * connect your phone to your PC and open Picassa.
    * click on `File` \>\> `import from ...` (it's in French in the screenshots)

* this window will show up. Click on the spinner and choose your phone. In my case here, it's an HTC one (Android).

* wait for a few seconds until the photos show up like this.

* you will see every single image file on your phone, sorted by the date of creation. You can select a full day by clicking on the little clock, or select a single picture by clicking on it. The same goes for unselecting.
* once you have picked the needed pictures, look at the bottom of the Picassa window. It looks something like this.

* choose the right options for you: where you would like to save the pictures, how do you want the pictures to be organized in sub-folders, and if you wanna delete the original pictures from the device (the phone) or not, then click on import.

# Answer
> 0 votes
Seeing this is an old question, wanted to update it with the solution I found in 2019. I was looking for an answer to this same question.

My method was the similar to @firelords answer, connect via FTP to phone via SHAREME program, and use freefilesync to synchronize the DCIM folder to the PC.

But some quick research later, I found that the following works better!

The best solution I found was to use Resilio Sync (formerly known as BTSync or Bittorrent Sync).

The key advantages I have found are

* It's free (allows upgrades but free version is good enough)
* Can use only WIFI (faster sync when on the same network)
* Stores to any other device where you have installed resilio sync
* NO MANUAL effort, automatic just like google photos but with full resolution! and bi-directional syncing! (main advantage over the previous method)

In my case I Set it up in less than 2 minutes on my phone! I was already using sync on my pc and just needed to add the link to the folder and it was ready to go! I just had to enable camera backup and share the link to my pc.

# Answer
> -1 votes
QuickPic has a Cloud Backup function that supports many services, such as Google Drive, Dropbox, Owncloud, etc. Just run the app, make sure all your images or videos are showing up, then access the cloud backup from the app settings.

# Answer
> -1 votes
Install Picasa on the computer (Google has discontinued this software, but you can get it from here). After you plug in the Android device, it'll ask for import into the library.

In Settings of Picasa, there's an option to physically move photos/videos to desired folder. Check it and you are done.

Next time you plug in your Android device, it'll physically import everything for you. And, only copies new photos/videos. So, you are good to go.

# Answer
> -1 votes
When you plugin your device and have something like Picasa or Lightroom installed, it should show an option to import pictures from the device. If it doesn't show up, try connecting the device in PTP (Photo Transfer Protocol) mode (Choose the `PTP` option from the `USB Connected` (or similar) notification by tapping on it).

Restoring this backup, is, however, manual - as each file (or set of files) has to be later copied to an appropriate location on the Android device later during restore.

It is also possible to write a script to check all image files on the device by file extension and cutoff size (so that you don't end up copying thumbnails, say 1KB+) and puts these files, preserving the directory structure and dropping them into some backup folder. I don't have much experience in this matter, so I am not covering this aspect here.

---
Tags: backup, gallery, offline
---


# Question
Title: Which version of Lineage OS do I use for Samsung s4 SPRINT?
Previously I used `jfltespr`. But Lineage OS doesn't show any builds for that. Did one of the other builds replace that?

* jfltexx
* jfltevzw
* ks01lte

jfltexx sounds appropriate but I can't find anything that confirms that it will work on S4 Sprint.

# Answer
> 2 votes
I've been using the unofficial "Optimized LineageOS" ROM by JDCTeam for several months now, and it has been working wonderfully, thank G‑d. It is a ROM for several S4 models (I think this is called a "unified" aka `jflte` build), including the `jfltespr` (which does not yet have its own official LineageOS ROM, as of 2017/09). It has generally been updated monthly.

`jfltespr` is the code name for the sprint variant of the Galaxy S4, and`jfltexx` is the codename for the international S4. ROMs for the `jfltexx` will most likely not work with the `jfltespr`, since they use different cellular radio protocols. (When I tried to install the `jfltexx` version on a `jfltespr` device using TWRP, this was detected and an error message was issued saying it could not install on the device since was the wrong device type).

# Answer
> 1 votes
As of this writing, LineageOS 16 is officially supported for the Sprint Galaxy S4.

https://download.lineageos.org/jfltespr

Note that I had trouble installing this image using the last available version of TWRP for the Sprint S4, and had to flash the lineageOS recovery image before I could get the rom to flash.

---
Tags: samsung-galaxy-s-4, sprint, builds
---


# Question
Title: Disable Volume and Power button screenshot
Pressing Volume (-Up or -Down) and Power button takes automatic screenshot. Can I disable this feature? (I often grab my phone and press those buttons by mistake).

I use OnePlus with OxygenOS 9.

# Answer
For the moment, you unfortunately can't unless your phone is rooted. A user submitted a suggestion to have Option to disable screenshot using volume down and power button for OnePlus 6T. On the same thread, there are also owners of other OnePlus models asking for the same.

If your phone is rooted, you can disable the package `com.oneplus.screenshot` although it will introduce the disadvantage of no longer being able to take screentshots.

You can also try to remap the keys as shown here.
> 1 votes

---
Tags: buttons, screenshots
---


# Question
Title: Can I install 512 gb micro sd card in Samsung S9 plus?
Can I install 512 gb micro sd card in Samsung S9 plus ?

# Answer
The specifications of the phone shows that the phone is able to handle up to 1 TB.

> microSD, up to 1 TB (uses shared SIM slot)

That means yeas you can install a 512 GB microSD card on that phone.
> 1 votes

---
Tags: sd-card
---


title: What resets the battery stats

text:
# Question
Title: What resets the battery stats
I'm looking at the "Battery" section under "Settings", and there's two major sections:

1. a graph that shows how full the battery has been over some period
2. Which apps have used the most battery power over (what appears to be) that same period.

There's a label between the two sections that says "Use since last full charge"

And I can't figure out what constitutes "full charge".

Things I've tried: 1. Not letting the battery get full. (thought it would be this simple a couple of months ago when I started this investigation, but it's not this simple) 2. Not letting the battery get empty (it seems to reset the stats more when the battery is low, 3. Time charging (it also seems to happen if it's a short or a long charge)

So, I guess what I'm asking is, "What is it precisely that resets the battery stats?"

Android is open source? Does this mean the code is readily available to look through? Where would I get started to try to figure it out myself? Is this kept in a battery library? Where's the source code for that?

Here's an example of when it reset at about 75%.  I'm running 7.1.1

# Answer
> 3 votes
> "What is it precisely that resets the battery stats?"

Quoting from an old post by a Google engineer

> ....it is reset every time you unplug from power with a relatively full charge (thus why the battery usage UI data resets at that point)....

Relatively full is not defined AFAIK but from experience 90% charge does the trick of resetting it. IIRC on KitKat reboot also did that

Location of `batterystats.bin` file is `/data/system/batterystats.bin`

* I can't point you to the code
* Battery usage statistics in Android is poor though it has improved considerably in Oreo. Without specifying the Android version and an accompanying screenshot your question about interpretation cannot be answered fully, but here's an example. Suppose you charged fully (100%) and used only YouTube and Chrome till it dropped to 70%. In app usage of it shows YouTube used 60%, it means 60 % of the drop (=30%) is used by it. In outlet words, 60\*30 =18% of battery capacity is used by YouTube. Similarly for Chrome and other apps. The total will never exactly match up. If you install GSam battery monitor, you get more meaningful interpretation

# Answer
> 2 votes
This answer is based on Android 9 (Pie).

I have been trying to find the answer to this question for quite a while. Preventing the battery graph from resetting has become somewhat of a game for me - a game that I lose if the graph resets.

If the battery charge reaches 90%, the graph will reset. Typically the graph will reset as soon as the battery is removed, but it may reset before this if the charge reaches full. I very rarely let the battery charge go above 80%, but this does not prevent a reset. Under the chart there is text indicating how long it has been since the graph was reset. Once it is reading more than a day, it does not seem to actually switch days based on when the graph reset, but from a fixed time in the day. For instance, I once had the graph reset at 9:47a.m. but a few days later I notice it went from 4 days to 5 around 10p.m.

One the "days ago" value reaches 5, the graph may reset any time you take it off the charger, no matter what the charge state is. The graph may also reset itself spontaneously while not being charged if the battery graph app gets killed. Ironically, putting the phone in battery saver may make this more likely! I am still trying to determine the exact sequence of steps to prevent this, but it is slow because it takes at least 5 days until I can try the next experiment. When I get more data points I will update this answer.

It is possible to prevent a reset for at least 8 days if all the conditions are right, as shown below:

Update: This is really frustrating me. The battery guage will apparently reset even before 5 days has been reached, as early as 4 days, 9 hours. Just taking it off power, with the screen on, seeing that it has not reset, and then turning off the screen for 5 seconds and turning it back on has led to it resetting multiple times.

---
Tags: settings, battery, battery-life
---


# Question
Title: Sync computer folder -> phone's external SD card, with USB cable
*Background*: Until a few days ago, I was happy with my Android 2.3 phone, and its *Media Storage* via USB cable : syncing my computer's `D:/MusicLibrary/` folder with my phone's 128GB external SD Card was possible in one line with `xxcopy`.

---

With my *non-rooted* Android 4.2.2, I don't have *Media Storage* anymore, but only MTP. As mentionned in many other questions, this doesn't give a drive letter anymore by default. **The only solutions I see to sync my computer's music library folder with my phone's SD card are very complex now**, in comparison to the good-old-Android-2.3-way :

* use FTP server (argh!) or Samba techniques
* root my phone to allow Media Storage via a specific plugin
* complex solutions with `adb pull`, but this won't track which files have been changed, so I would need to write different script to track changes, etc. (re-argh!)

**Is there a *simple* solution to sync: computer folder \<-\> Android 4 phone's SD card folder, via MTP, with Windows 7?**

---

Remark: Funnily, the tag about MTP says `The Media Transfer Protocol (MTP) is a protocol which purpose is to facilitate the transfer of media files and associated metadata to/from devices.`. In such a case, it seems that it doesn't facilitate but *makes things worse* instead.

# Answer
> 0 votes
MyPhoneExplorer Windows program can sync a folder between phone and PC through USB

### First time

1. Install MyPhoneExplorer program on Windows PC
2. On Android phone

1. Ensure that 'USB debugging' is enabled on phone (Settings - Applications - Development or Settings - Developer options). In Android 4.2.2 and newer, you have to unlock the USB Debugging option first (Settings - About phone - Build number -\> tap 7 times on it)
    2. Ensure that the Debug-Interface-Drivers for your phone are installed (ADB drivers)
3. Open the program on PC without connecting phone

1. File\> Settings \> unselect "start multi-sync" and unselect "connect on start up"
    2. File\> Settings \> Multi-Sync \> unselect sync phone book, Sync organiser, Sync notes, refresh call logs, refresh message folders (to avoid these sync as we focussed on PC-to-phone file sync)
4. Open the program after connecting the phone \> MyPhoneExplorer \> files \> click on customise (down black solid tringle) a side of Sync files (at the same time, give access to the phone when the pop-up appears to memory, etc.)

* Title: e.g. Mtc
    * Direction : PC to Phone
    * Source folder: browse to PC folder e.g `F:\Mtc`
    * Target folder: browse to a folder on the internal memory of the phone, e.g. External memory `\BackupLT\Mtc` (phone to be on data or file transfer mode not just on charging mode), select include subfolders
    * Mode: reflect folder

---

### Regular Sync

1. Open the program after connecting the phone \> MyPhoneExplorer \> files \> click on Sync (or customise and tap on your earlier given title).

Note:

* If just folder name is to be changed for streamlining, etc., change the folder name manually at PC and Phone of the same folder. Otherwise, it will copy name change folder to phone and delete old folder from the phone (as Direction: PC-to-Phone, Mode: reflect folder is selected condition)
* If 2nd device is to be synced for its own (configured similar to above already), the Windows program is to be closed and 2nd device to be connected and program is to be started, 2nd device configuration will be loaded

---
Tags: sync, usb, backup, external-sd, mtp
---


# Question
Title: How can I cancel and delete OS Software update of Andoroid KitKat?
Initially I would like to update my Android OS from KitKat to Lollipop. Unfortunately, it will decrease around 950MB it internal memory/RAM. Then I decided will not continue to update it. But, how can I canceled it and delete all the dawnloaded files (548.71MB of OS software)? Only INSTALL button available.

# Answer
I think you will have to factory reset your device in order to delete the downloaded OS. As it was downloaded with intention to install, So I don't think there's any other way to delete it (other than rooting and finding it).
> 0 votes

---
Tags: 4.4-kitkat, 5.0-lollipop, updates
---


# Question
Title: WhatsApp—How to prevent notifications from returning after swiping them away?
When I get a new message in WhatsApp, I get a notification that contains the beginning of the message. After I swipe it away, the old message always returns when I get a new message. How can I prevent those zombie messages from coming back? There is a "mark as read" feature but that is too complicated to use, I have to swipe down and then click, I just want one swipe to completely clear the notification.

# Answer
The notifications are showed by the Whatsapp (and there is no option in whatsapp to change this). You'll have to request Whatsapp dev for this feature. Personally, I don't think they will consider your request so easily. Anyways, Good Luck!
> 0 votes

---
Tags: whatsapp-messenger
---


# Question
Title: Accessibility options - "Home answers calls"
I like this option on my old Android 4.2 Samsung Galaxy S3 mini. Especially when I am driving it's much easier to press a button instead of sliding...

But I cannot find such option neither on Android 4.4 phones (different phones, from Motorola to Sona) nor on newer phones with Android 5.1 and 6.0.

Is it 4.2 option that is not part of newer Android version?

# Answer
> 0 votes
Only Samsung offers that feature like home button answers the call. For other phone their might be an option like this, but not necessary to have.

# Answer
> 0 votes
Yeah, As said previously: It is device specific feature. But you may have this by using a custom ROM which provides this feature. Lineage ROMs usually provide this feature. Google: "\[Your device model\] custom rom xda"

---
Tags: accessibility
---


# Question
Title: Use Google Photos from within Camera app on Samsung Galaxy S7
Is it possible to make the default camera app on the Galaxy S7 use Google Photos instead of Samsung Gallery?

I like the preinstalled camera app, but pressing the thumbnail icon in the interface will always open the Samsung Gallery, even though I have set Google Photos as the default app for photo viewing.

For newer devices, creating an "app shortcut" has been recommended in various articles and discussion forums (e.g. at lifehacker.com). This however doesn't seem to be available on the Galaxy S7.

# Answer
> 0 votes
Opening the gallery is hardcoded in the camera app of your device. There's no way you can change it. Atleast not for now. Maybe in later updates, they'd make it available.

---
Tags: photos, camera
---


# Question
Title: What reasons would an Android Phone's Network Radio turn off Sporadically
I have an android phone that is experiencing an issue that I suspect is hardware related. Randomly, service will no longer work on the phone and the only way I have found to temporarily resolve the issue is to dial `*#*#4636#*#*` and manually turn the radio back on. This will restore functionality, but only temporarily. It seems to be indeterminate when it stop working again.

I can't think of a good methodology to pinpoint the issue, so any insight would be helpful

# Answer
If you are able to turn on immediately by your manual method, then it seems to be a software issue.

Did you try a factory reset? It resolves most of software issues.
> 0 votes

---
Tags: 6.0-marshmallow
---


# Question
Title: Samsung A20 SM-A205W stuck on download mode
I have a Samsung Galaxy A20 and I was attempting to unlock the bootloader and also install TWRP. While the bootloader was unlocked successfully, while doing the TWRP part I had to use Odin and used an online tutorial to see how to do it. I ended up putting it in Odin's AP section and flashing it....

and that was the last time I saw my A20 working normally...

Now I can't switch it off (unless discharged) and it stays on all the time.

What if I try to switch it off? When switching off is attempted, it shows me the standard Samsung boot-up screen but with a yellow triangular warning sign and red text at the bottom saying "This phone is not running Samsung's official software. You may have problems with features or security, and you won't be able to install security updates." And then I'm back to the download mode screen.

I cannot go to the recovery/bootloader. I have tried pressing the buttons on the phone all at once (i.e. power; volume buttons) with no results.

In the Download Mode screen it shows:

**In the middle of the screen**: A big download logo with the text "Downloading..." below it and below that, "Do not turn of target". After some blank space below it there is the text "Volume Down Key + Power Key for more than 7 secs : Cancel (restart phone)".

**On the top left**: There is text in three lines and has a really small size.

*Note: A ? indicates incomprehensible letters due to screen layout and a @ indicates unknown number of letters that cannot be viewed there*

> ?ecovery: Error validating footer. (@)
>
> CUSTOM RECOVERY
>
> VBMETA A205WLS2ASG1, 25128537R

By the way the device region is either VMC, VTR or XAC.

Thank you

# Answer
It sounds like a soft-brick. To unbrick your device, download stock firmware for your device from sammobile.com and flash it using Odin. Make sure you download the right one for your region.

For more details: See this
> 0 votes

---
Tags: samsung, boot, odin
---


# Question
Title: What are the possible locations that a game can store coins/gold count?
I've a rooted phone along with FX File Explorer and Root add-on. I also have the following apps installed on the phone:

* SB Game Hacker
* Game Killer

When trying to modify the values of gold/coins in game, I've come across 3 use cases so far.

**Case 1:**

* I open the game and note down the current value of coins I have.
* Then I open the SB/GameKiller app and search for that value.
* Then I go back into the game and decrease/increase the coins.
* Back to the SB/GameKiller app and re-scan for the modified value.
* I repeat the process until I'm down to about 5-10 results after which I modify the value in SB/GameKiller app to a value of my liking.
* After this, when I go back into the game, the new value gets reflected
* SUCCESS

**Case 2:**

* Case 1 fails (where the final modified value doesn't get reflected in the game).
* So I go to `/data/data/<game package folder>/` folder.
* I usually find a `.json` file which contains the value of coins/gold.
* I change the value and save the `.json` file and go back into the game.
* SUCCESS

**Case 3:**

* Case 1 fails and I do not find any `.json` file
* I try to look for a database folder/file inside the same `/data/data/<game package folder>/` path but do not find one

In this case, where can a game be possibly storing this value and fetching it from? It can't be a server because I play the game without being connected to the internet. So my best assumption is that the value is stored locally.

Any suggestions?

# Answer
> 0 votes
I'd recommend decompiling the apk using apktool or any other tool. Then search in .java files for strings containing "\\" or "/" . It's time taking but worth a try.

# Answer
> -2 votes
In media,simcard,sdcard,data,dcim,plyprfs,appl.data,android,.profig.os, com.facebook.orca-katana,it's a virtual file there's a bunch of places it could be hiding ✌

---
Tags: applications, root-access
---


# Question
Title: Whatsapp: Continous loop of messages backup and no text box to type in Samsung S10
Gentlemen,

Two problems I'm facing in WhatsApp in Samsung S10 (fully updated)

1- Whenever I open WhatsApp settings, a message appears "backing up your messages" once it is completed and I try to go back to chats and starts again and again for 3 to 4 times then I can come back. (Backup settings: Never and not able to link it to any google account)

2- In any chat, the text box at the bottom is hidden and I cannot type anything, the only way around is to reply to someone then hold the phone horizontally and then I can type and send.

This is really disappointing especially that I just switched from iOS to barnd new Samsung S10 to find these issues!

(Note: I used a WazzapMigrator to get all my WhatsApp data from my iPhone).

# Answer
> 0 votes
Resetting an application usually solves such random issues. Long Click on Whatsapp -\> App info -\> Storage -\> Clear Data. It will reset Whatsapp. Now you will have to use WazzapMigrator again to transfer your data. Hope it helps

# Answer
> 0 votes
The only way for fixing this was uninstalling WhatsApp without touching any backups or databases folder. Just Uninstall, restart the phone and install the app. It will restore everything.

It worked for me and everything is fine now.

---
Tags: backup, whatsapp-messenger, samsung-galaxy-s-10
---


# Question
Title: How to run a program in an app context with Magisk?
Let's say I'm currently as root in Bash on a terminal, outside any app like Termux. I'm running Magisk.

Now I want to synchronously invoke Termux's Bash, such that it behaves the same way as it would if I had directly started the Termux app (i.e. with the same permissions and SELinux context and user/group and everything else).

How can I do this?

# Answer
Android framework takes care of a lot of things when forking an app from `zygote`. In short, it's nearly impossible to run an app process from commandline so that it behaves *“exactly the same way”* as if the app was properly launched. Continue reading to have an idea of why it's so.

In order to run `bash` in Termux app's context so that it behaves exactly the same way as if it was started from the app, it must be run at least:

* With UID/GID of the app assigned by the Package Manager at the time of installation
* With supplementary group `inet` (`3003`), which is required to create network sockets and is assigned to any app at the time of installation which declares `android.permission.INTERNET` in its *AndroidManifest.xml*. For details see How Android's permissions mapping with UIDs/GIDs works?.
* With supplementary group `everybody` (`9997`) which is used to control app's read / write access to `/sdcard`. For details see What is the “u#\_everybody” UID?.
* With supplementary groups `<uid>_cache` (UID+10000) and `all_<uid>` (UID+40000) so that app can access its cache, native executable code etc. But these aren't required necessarily since we are not running the app itself.
* By entering the mount namespace of Termux app (`com.termux` process) which is required for supgid `9997` to work. If the app isn't running (e.g. if running from `adb shell`), supgid `1015` can be used to get write access to `/sdcard` but that's not how the app works.
* By dropping all Linux capabilities (granular root privileges in *Effective*, *Permitted*, *Inheritable*, *Bounding* and *Ambient* sets) as well as setting `securebits` and process control attribute *NO\_NEW\_PRIVS* which make sure that app isn't able to elevate privileges by making use of `setuid` or file capabilities.
* With blocked `syscalls` by applying seccomp-bpf filter.
* With SELinux context of the app, which is determined at install / runtime based on MMAC (, ).
* By adding the process to relevant cgroups e.g. `cpuset`, `memcg` etc. as the Android's framework does.
* By *catching*, *blocking* and *ignoring* the same signals as the app would do.
* By setting the environment it relies on. E.g. Termux's bash won't execute without `LD_LIBRARY_PATH` which it requires for dynamic linking.

There isn't a single commandline tool available which can do all of this sandboxing, it can be achieved fully only programmatically (see Minijail), or might be using multiple tools e.g. `nsjail`/`firejail` for setting `seccomp` filters, `runcon` to change SELinux context, `capsh` to alter DAC/capabilities, `nsenter` to enter mount namespace etc. `setpriv` from `util-linux` package can do the maximum:

```
~# uid=$(stat -c %u /data/data/com.termux)
~# pid=$(pidof -s com.termux)
~# label=$(cat /proc/$pid/attr/current)
~# export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
~# exec nsenter -t $pid -m setpriv --reuid $uid --regid $uid --groups 3003,9997 --bounding-set -all --selinux-label $label -- /system/bin/sh -c 'exec /data/data/com.termux/files/usr/bin/bash'

```

* `nsenter` and `setpriv` are busybox applets but with limited functionality. For `aarch64` you may get static binaries here: nsenter, setpriv.

However we need to define `shell_exec` (label of `/system/bin/sh`) as `entrypoint` for execution by `untrusted_app` context which is not part of stock `sepolicy` (at least on Pie):

```
~# supolicy --live 'allow untrusted_app shell_exec file entrypoint'

```

Executing `/system/bin/sh` before executing `/data/data/com.termux/files/usr/bin/bash` is required because `/data` partition is mounted with `nosuid` option which prevents SELinux context transition (from `magisk` to `untrusted_app`) () and you get permission denied. You may consider mounting `/data` without `nosuid` to skip this step.
For the same reason `--no-new-privs` and `--selinux-label` can't be used in conjunction.

All this happens in native world, nothing in Java stack. So we have no direct control on things like manifest permissions which entirely operate inside Android framework. However manifest permission enforcement is also based on UIDs (). For instance if Termux was granted `android.permission.WRITE_EXTERNAL_STORAGE` the bash we are running with Termux's UID will also be able to write to `/sdcard`.

---

From your comment:

> It doesn't make sense to me how this is possible. Like, consider the output:
>
> ```
> u0_a129 ~$ /sbin/su --context=u:object_r:app_data_file:s0:c512,c768 u0_a129 -c /system/bin/id
> uid=10129(u0_a129) gid=10129(u0_a129) groups=10129(u0_a129) context=u:r:magisk:s0
> u0_a129 ~$ /system/bin/id
> uid=10129(u0_a129) gid=10129(u0_a129) groups=10129(u0_a129),3003(inet),9997(everybody),20129(u0_a129_cache),50129(all_a129),99909997(u999_everybody) context=u:r:untrusted_app_27:s0:c512,c768
>
> ```

Well, according to my understanding that's how Unix Discretionary Access Control works. First of all passing `--context` to Magisk's `/sbin/su` makes no difference as explained here:

> the option still exists for CLI compatibility with apps designed for SuperSU. However the option is silently ignored since it's no longer relevant.

So the context isn't switched as you can see it's still `u:r:magisk:s0`. Secondly Magisk's `su` isn't the actual switch user (), it provides a minimal functionality of standard `su` binary (the one we have on Linux). For details see How Magisk works?

In your first command it set UID, GID and supplementary groups to the UID you provided. You didn't ask `su` to set any additional supplementary groups, neither it can.

In second command you see the UID, GID, supplementary groups and SELinxu context which were set by `zygote` when it forked the app's DVM/ART (`com.termux` in case of Termux). Supplementary groups are explained above. `99909997` is also explained in the link given above.
> 5 votes

---
Tags: root-access, permissions, selinux
---


# Question
Title: Is it possible to delete a file through the Google Drive app?
In the Google Drive app, on its home screen, I get a list of files and a "3 dots" menu next to each file. When I open the menu, all of the options given to me are:

* Share
* Add to Starred
* Make available offline
* Link sharing off
* Copy link
* Make a copy
* Send a copy
* Open with
* Download
* Rename
* Show file location
* Details & activity
* Print
* Add to Home screen
* Report abuse

While these are a ton of options, none of them are "Delete" or "Remove" or similar. I tried looking in the "Details & activity" section to see if there was a "Delete" option, but there was not. Is there a way to delete files through the Google Drive app, or do I have to use the website to delete files?

# Answer
> 2 votes
**Yes, but not on Google Drive's home screen.**

The Google Drive Help mentions the following:

> ### Put a file in trash
>
> To remove a file from your Drive, you can put it in your trash. Your file will stay there until you empty your trash.
>
> If you're the owner of the file, others can view it until you permanently delete the file. If you're not the owner, others can see the file even if you empty your trash.
>
> 1. On your Android phone or tablet, open the Google Drive app.
> 2. At the bottom right, tap Files .
> 3. Next to the file you want to delete, tap More **Remove**.

Alternatively, you can also long-press and select multiple files, then tap "Remove" (trash icon) on the toolbar.

Note that you can also do this on "Starred" and "Shared", but not on "Home".

---

To actually remove the files, you also need to empty the trash.

> ### Empty your trash
>
> You can permanently delete an individual file or empty your entire trash. After deleting a file, anyone you've shared the file with will lose access to it. If you want others to be able to still view the file, you can give ownership to someone else.
>
> 1. In the upper left, tap Menu Trash.
> 2. Next to the file you'd like to delete, tap More **Delete forever**.

---
Tags: applications, google-apps, google-drive
---


# Question
Title: WhatsApp: How to isolate contacts and photos - Privacy concerns
Whatsapp is ubiquitous and is commonly used despite the long scary list of permissions it seeks ( see Help understanding Whatsapp's permissions )

Privacy and security conscious people would like to avoid it and use alternate means like Telegram but there are a huge bunch of people who are blind to the concerns and merrily use it

I am forced to use it, since I have a friends and relatives who are comfortable with this and won't consider switching - some got introduced to smartphones using this, for some others it is convenience of usage and the most common refrain is *I have nothing to hide* :-(

So my question boils down to **How do I use Whatsapp without exposing my contacts and private photos to Whatsapp (read Facebook)?**

This is a self answered question sharing one way and you are welcome to post other ways if you find

# Answer
# Requisites

* Download **Shelter** \- an open source app from F-droid or GitHub. Quoting the developer, use cases

> * Run “Big Brother” apps inside the isolated profile so they cannot access your data outside the profile
>
> + “Freeze” (disable) background-heavy or seldom-used apps when you don’t need them. This is especially true if you use apps from Chinese companies like Baidu, Alibaba, Tencent.
>     + Clone apps to use two accounts on one device

* Create a dummy gmail account to be populated with only Whatsapp contacts
* Device with work profiles (post Lollipop all have them) unless you used a Magisk or Xposed module to disable this

# Methodology

1. Export your contacts to your dummy Gmail account. Follow instructions here or any other way, like this Export telegram and whatsapp contacts to vcf? . Delete all non Whatsapp contacts from this account (you don't want Whatsapp / Facebook to see ALL your contacts , right?)
2. Add this account to your phone from Settings → Google → Account ( will vary , but you can search)
3. Install Shelter
4. Click on the app to see two panes *Main* (where all your apps are listed) and *Shelter* where you will see contacts , Google Play Store. Go to Main and long press on Whatsapp and choose *Clone to shelter (Work Profile)*
5. Go to shelter tab and set up Whatsapp as if it is a new account and when it asks for contacts point it to the dummy Gmail account created having Whatsapp contacts
6. Delete all Whatsapp contacts from your main account and if you wish uninstall or Freeze or disable Whatsapp

**Note:** Open whatsapp from within the shelter (work profile) not from the app drawer. If you open from outside you will find Whatsapp having access to contacts and gallery. Once you install whatsapp *it is completely limited to the storage dedicated to the work profile* and cannot see storage outside the work profile

**Profit** Your contacts and photos are separated ! and Whatsapp will not see at least your future non whatsapp contacts / pictures

On a side note, even with root and mighty Xposed module like XprivacyLua , a successor to Xprivacy, contacts by **group cannot be separated** ; in other words you can only choose all / starred/ non starred contacts to be visible per app but you can't say hide my Whatsapp contacts ( For more details see Para 18)
> 6 votes

# Answer
* OnePlus users: I've verified WhatsApp works with Parallel Apps feature, which allows you to run certain apps on a minimal profile.
* Pixel, Samsung, etc: The Island app allows you to run a fake "work" profile simultaneously.

They don't have access to your contacts, but they see your storage. You can use the apps like a normal app. Only issue is if you give it access to your contacts immediately, it will run into a glitch. Say no the first time and it will work fine.
> 1 votes

---
Tags: contacts, security, whatsapp-messenger, photos, privacy
---


title: Google Photos backup

text:
# Question
Title: Google Photos backup
I've been trying to upload my photos to google photos. It's stuck on uploading x items. I tried restarting, removing cache, clearing storage. I even tried downgrading the google photos app version. My backup and sync is on. Please need help Thank you

# Answer
Are you using wifi or mobile data for backup Check this settings/backup & sync and turn on backup and sync you can also try backup mode/ and reselect high quality it will auto upload
> 0 votes

---
Tags: backup, sync, google, google-photos
---


# Question
Title: How to prevent automatic aggregation of contacts
I have more than 3000 contacts and maintain the master copy on my PC. I regularly create a CSV file from the master and then copy the data to the Contact Manager on my Samsung S3. I have done this for years, with a Blackberry and then an iPhone.

Android Contact manager arbitrarily joins contacts together. People who work for different companies with the same name, people who live at the same address with different names, etc. The result is that I cannot find them in my address book, and phone numbers get mixed up. Without separating the joined entries I cannot tell which phone number belongs to which person when I try to call someone. Equally, when someone calls me, the wrong name is displayed. I have tried using different ways of moving data to my phone (a Samsung S3). Using Kies or VCF files. Surely there must be a way to turn off this destructive 'feature'. It would take me days to go through all my contacts and separate them manually each time I copy from the master. Synchronizing rather than delete/copy makes it worse. Entries that I have previously separated join together again!

# Answer
> 0 votes
As an Android Developer, I know, that it can be done programmatically in an app: https://developer.android.com/reference/android/provider/ContactsContract.AggregationExceptions

However, I don't know if there is any contact app having such behavior.

I know one app that has so-called "private" contacts feature - that's contacts that it does not share with Google. It might help you but you'll have to use it instead of the default one:

https://github.com/SimpleMobileTools/Simple-Contacts

Here, for a very small price (half a dollar in September 2019) https://play.google.com/store/apps/details?id=com.simplemobiletools.contacts.pro

Here, for free: https://f-droid.org/packages/com.simplemobiletools.contacts.pro/

---
Tags: contacts
---


# Question
Title: I am getting an unknown file transfer error (Flashing TWRP)
I am trying to flash twrp onto my unlocked Moto G4 Play so I can install a new version of Android but, I keep on getting this error. I have recently factory reset my phone and I am not sure if it is related.

```
C:\adb>fastboot flash recovery twrp.img
target reported max download size of 268435456 bytes
sending 'recovery' (8296 KB)...
FAILED (data transfer failure (Unknown error))
finished. total time: 5.013s

```

Any suggestions?

# Answer
The FAILED (data transfer failure (Unknown error)) error can happen for a few reason. It happens when there is issues with communication transferring data. To trouble shoot the cause start by:

* Trying different usb ports
* Trying different usb cables
* Update fastboot.exe
* Download another .img file and verify the md5.
* Double check the Bootloader is unlock
> 1 votes

# Answer
Regarding *only* the quality of USB cables, the **QooPow qualMeter** (http://www.qoopow.com/) allows you to check which of your USB (and Ethernet) cables are the best.

It might looks pricey, but it may save you lots of trial-and-error time and stress, especially if you routinely encounter cable quality-related issues.
> 0 votes

# Answer
If you're running it from a computer with a AMD chipset, that might be your problem. I am having the same issues when I am trying to use fastboot or literally anything close to a android tool on my ryzen 5 5200 processor and it won't work. as soon as I tried using said tools on mac or a intel chipset, they work. smh
> 0 votes

---
Tags: twrp, fastboot
---


# Question
Title: How to restore files on SD card protected by NQ vault?
I changed my Android mobile phone from one carrier to another. I installed Vault app from the Google Play store, and placed the old SD Card from the previous phone into this new phone. After installing the vault software in the new phone, I am unable to restore data (photos, videos) from old SD card. My old phone isn't in working condition so how do I restore these files?

# Answer
> 2 votes
There is a related post here which indicates that vault app is phone specific How to restore files on SD Card that was protected by Vault app? which indicates it is not possible, more so since your old device isn't working

Even for premium vault members it appears to be the same (need to use old phone) https://help.nq.com/entries/24327737-I-just-got-a-new-phone-how-can-I-transfer-my-Premium-Vault-service-to-the-new-device-

But both these are time lined 2013 so it's best to reach out to nq vault help and post your outcome here for benefit of others

**Edit**

**Short answer** : **NO**, unless you are a premium subscriber and made a cloud backup

**Long Answer** : I mailed NQ, since I had the app on my previous cell and was debating to go premium. Their reply, you can quote request (#239838) to follow up

> Carrie (NQ Mobile US, Inc.) Dec 23, 09:28

Thank you for contacting NQ Mobile Customer Support.

> Unfortunately, if you no longer able to access the device, it will be difficult to recover your files and information from the Vault at this time. This is because the Vault files are saved locally on the device itself and the only way to either backup, restore, or move those encrypted files would be by using the Vault application on the original device. There is no other way to do so via a computer for example, unfortunately.
>
> If you ever made a backup with our premium Cloud Backup (Vault Online) feature in the past, you should be able to restore your information to the last backup on a new mobile device by tapping " Cloud Backup (Vault Online) " in the application, signing into your NQ Account, and then tapping the green "Restore" button. If you have never made a backup or were never a Premium User, unfortunately the files are lost and there's no other way to recover them. I do apologize for any inconvenience this may cause.
>
> If you had Premium Service on your old device, however, I can assist you in transferring that Premium Service over to your new phone.

There is a **lesson** to be learnt here, before trusting sensitive data to such apps, **evaluate all contingencies before you do that**

# Answer
> 0 votes
I imported pics and videos which were in my SD card to vault, then inserted my SD card to another phone and all the pics and videos are available.

If you import data from sd card to vault so what vault does is it copies the data to vault in internal memory And 1 original copy is still in the SD card.

# Answer
> 0 votes
I imported pics and videos which were in my SD card to vault, then inserted my SD card to another phone and all the pics and videos were available.

If you import data from SD card to vault, what vault does is it copies the data to vault in internal memory and 1 original copy is still in the SD card.

# Answer
> 0 votes
Try to read your sdcard using the PC , the Vault is a form of programme that move you files to hidden. Use of find the folder, your files are there.

That's how I do last time.

---
Tags: sd-card, data-recovery, nqvault
---


# Question
Title: How to turn off Yahoo Mail notifications in 4.1.2.?
I just upgraded my Android OS to 4.1.2. and the Yahoo Mail is pushing audible notifications again (I had disabled them in the previous version of OS). When I go into the app, there is no settings in the menu. How do I disable the notifications?

# Answer
When such a notification appears...

1. Open your notification area
2. Long-press on the notification. This opens the app's settings in the system configuration.
3. Here you can disable all notifications from the app.

This is a feature introduced with JellyBean -- as you've stated your device is running Android 4.1.2, this setting should be available to you.
> 3 votes

# Answer
In the official Yahoo! Mail app, Yahoo recently changed the layout so that the Settings menu is no longer accessed by pressing the "Menu" button.

Launch the app and tap the little `<` arrow next to the "Inbox" label on the upper-left corner of the screen. This will reveal the Folders menu. Scroll it down to the "Tools" section, tap on `Settings`, then tap on `Account settings` option, and finally on `Notification Settings`. From here you can set up the notification options for new messages:

* `Choose Sound` -\> `No sound` -\> `Done` to disable audible notifications,
* `Use Vibrate` to toggle vibration on and off,
* `Show in Status Bar` to toggle the icon in your Notification panel.

If there is no "Notification Settings" tap the text that lists your e-mail address associated with the account, and you will find the settings there to shut off notifications, both audible and visual.
> 2 votes

# Answer
1. Open the Yahoo Mail app
2. Tap the 3 lines in the top left, or scroll right from the left edge of the screen. You'll see (from top to bottom): Inbox, Drafts, Starred, Outbox, etc
3. Scroll down to the 'Tools', then 'Mail settings'
4. Tap 'Mail notification settings', deselect 'Enable notifications' or 'Use vibrate' (this can be done at the same time for multiple accounts)
> 0 votes

# Answer
Finally! after months of Googling and asking others with Androids (Samsung Galaxy 4) how to turn off the yahoo notifications and getting a failed result, I finally got it on my own! Okay, here it goes: I opened up the yahoo app, far left on the email bar next to inbox are three lines. Press the lines and this will open up to your folders. Scroll all the way down to the very end and select Settings. Scroll down to General and select Notifications. Your mail notifications will all be blue, switch them to off (grey shading). And there you go!
> 0 votes

# Answer
2019 Updates:
\- 'Setting'
\- 'App & Notification'
\- 'Yahoo Mail'
\- 'Notification'
\- Tap on the name of each type, such as 'Mail from people', 'Reminder' etc
\- Under 'Behavior', select 'Show silently'
You have to repeat the last two steps for each type.
> 0 votes

# Answer
You can remove your yahoo account from your android phone. Just go to settings - \> Account & Sync - \> Serlect Account and the you will find the option to delete the account.
> -1 votes

---
Tags: 4.1-jelly-bean, notifications, yahoo-mail
---


# Question
Title: E: can't mount/cache/recovery/log on Android Lenovo a1000
I have a problem on starting my lenovo a1000 , so i decided to install firmware on it. I tried too much, but every time the phone fishing flashing , and 100% passed with spd factory flashing tool , but phone cant started. I try already 5 flashable ROM, but same thing happens on every time. SO i decided to cheak its recovery, there i found E: Can't mount/cache/recovery/log ... seeing on image for all error., now what can i do ? help please, Thanks in Advance.

# Answer
(Lenovo A1000 MTK MT8317 only) Next time, first make a full read back. flash only cache partition from SP Flash Tool.

If you don't have backup: install platform\_tools, reboot to bootloader, connect phone, install drivers, open cmd.exe as Administrator, run `fastboot format:ext4 cache`
> 0 votes

# Answer
Try clearing the cache partition using **Recovery Menu**. After you open **Recovery Menu** (search methods online), navigate to **Wipe Cache Partition** using **Volume UP** and **Volume DOWN** buttons and then press **Power** button to select **Wipe Cache Partition**. Wait a while till it finishes wiping (if it doesn't fix the problem, try wiping again and flashing and fastboot, as said in other answers)

I'm having the same problem btw, I read this online but not sure if it works so let me know if it does!
> 0 votes

---
Tags: boot
---


title: Does Android Have a BIOS?

text:
# Question
Title: Does Android Have a BIOS?
Do Android devices contain a BIOS? If not, how does it boot up? What is the software that actually boots it up and can you replace it?

# Answer
Android is an Operating System, similar to Windows. Windows does not have a BIOS either, the computer has a BIOS.

Phones don't have a BIOS though, they have firmware.
> 1 votes

---
Tags: boot, bootloader
---


title: How to manually root a phone?

text:
# Question
Title: How to manually root a phone?
I want to learn how to root a android phone manually, I mean without any apps like KingRoot, dr.fone etc. I did not found any guides or information about it.

(Background Information: I want to root a BlackBerry KeyOne, even if you say it does not work i want to learn and try it anyway)

Can you please help me?

# Answer
> 21 votes
I was looking at the web search results of “how to manually root Android devices” and I noticed that most of those are either just advertising stuff or makes use of dedicated (particularly closed source) rooting solutions. Those which worked some time ago are now obsolete since they depended on some security vulnerability in Android which was fixed over time.

In fact it's not impossible to root phone manually but it's not worth the hassle. However as a reference, let me describe an option. But before diving into the technical details, we need to understand ***what root is*** and ***how Android prevents root access***. Details can be found here but a few points in short:

* Mostly vendors ship their devices with locked bootloader, and a chain of trust is established during boot process, which won't let any modification be done to kernel (`boot.img`), recovery or the main OS. So the first step towards rooting is unlocked bootloader. Beware of the risks!
* A part of the chain of trust is `dm-verity` (`VB`/`AVB`); a kernel based phenomenon which makes sure that partitions containing core OS (`/system`, `/vendor`, `/odm`) are always mounted read-only and any malicious attempt to modify them must fail. Modifying `boot.img` or `recovery.img` is usually accompanied by disabling `dm-verity` to avoid surprises like bootloops at later stages. TWRP's standard warning:
> **This device uses dm-verity!**
> This means that swiping to allow system modifications will prevent you from being able to boot if you are using the stock kernel.
* Similarly some vendors particularly Samsung go beyond normal and build extra security features in their devices like Knox, RKP, Defex, proca, TIMA, FIPS, bla bla bla. So you might also need to circumvent those e.g. by building kernel with `SECURITY_SELINUX_DEVELOP=y`, patching kernel binary etc.
* Android apps don't have capabilities to elevate their privileges by executing binaries which have `setuid` or file capabilities set (which is the standard way to get root access). So the only option is to run a background persistent process (daemon) with root privileges outside the apps (e.g. during boot process) and request it to do privileged tasks on behalf of unprivileged apps when needed.
* Root (i.e. UID 0) is the old Discretionary Access Control (DAC), but Android also makes use of Mandatory Access Control (MAC) i.e. SELinux. A root process running with restricted SELinux context is quite helpless, so we have to break this barrier too. It requires modifying SELinux policy.

I'll address the last two points here, but first two considerations:

* Android rooting solutions deploy a special `su` binary which - when executed by an app - makes a connection to privileged daemon and gets the app a root shell. So this `su` binary and daemon are specially developed for this purpose. A less sophisticated approach would be to run already available daemons like `adbd`, `sshd` or one of the old inetutils flavors (`telnetd`, `rlogind`, `rshd`, `rexecd`) with root privileges. When running in background, these servers can provide a root shell or execute commands with root privileges when connected by a client. For the sake of simplicity I'm using only a minimal network utility named `netcat` (`nc`) which is a busybox applet. But please note that **apps can't get root access with this approach**, it can only be used from commandline.
* We are going to patch monolithic `/sepolicy` file and `/init.rc` file which are part of `ramdisk` in `boot.img`. But starting with Treble Android uses split policy which is loaded/compiled from `/system/etc/selinux/` and `/vendor/etc/selinux/`. Starting with SAR, there's no ramdisk at all in `boot.img` and `/init.rc` is part of `system.img`. So in both cases you need to necessarily modify `system` partition. I'm not giving details on that here.

**STEPS:**

* Extract `boot.img` e.g. using AIK or `magiskboot` on Android or PC.
* Create a new SELinux context, say `pseudo_su`. Set it permissive so that to allow any possible interactions with other processes / files etc. Use Magisk's `supolicy` tool or `sepolicy-inject` (, ) on Android or PC:

```
~# supolicy --load sepolicy --save sepolicy 'create pseudo_su' 'permissive pseudo_su' 'dontaudit pseudo_su * * *' 'allow pseudo_su * * *' 'allow * pseudo_su * *'

```

Or to build `split-policy` using Android's compiler:

```
~# /system/bin/secilc -m -M true -G -N -c $(cat /sys/fs/selinux/policyvers) -o sepolicy /system/etc/selinux/plat_sepolicy.cil /system/etc/selinux/mapping/$(cat /vendor/etc/selinux/plat_sepolicy_vers.txt).cil $([ -f /vendor/etc/selinux/vendor_sepolicy.cil ] && echo /vendor/etc/selinux/vendor_sepolicy.cil /vendor/etc/selinux/plat_pub_versioned.cil || echo /vendor/etc/selinux/nonplat_sepolicy.cil)

```

* Get the value of `POLICYDB_VERSION_MAX` from your kernel source.

To use vendor's `precompiled_sepolicy` or build from `split-policy` and patch:

```
~# supolicy --load-split --save sepolicy 'create pseudo_su' 'permissive pseudo_su' 'dontaudit pseudo_su * * *' 'allow pseudo_su * * *' 'allow * pseudo_su * *'

```
* Define an `init` service which starts a simple TCP server on boot, only listening to on-device connections:

```
# /init.rc
...
service pseudo_su /sbin/busybox nc -lk -s 127.0.0.1 -p 23 -e /sbin/busybox sh
    seclabel u:r:pseudo_su:s0
    disabled

on property:sys.boot_completed=1
    start pseudo_su

```

* Make sure you get the right `busybox` binary, there are multiple implementations of `netcat`.
* Use port `23` or any other unused port.
* Copy updated `sepolicy` and `init.rc` to root of extracted ramdisk, `busybox` binary to `[ramdisk/]sbin/` and set permissions.
* Repack `boot.img` and flash or test with `fastboot boot boot.img`.

**HOW TO RUN ROOT COMMANDS?**

Once booted, we can pass commands from a `netcat` client on terminal emulator app (like Termux) or `adb shell`:

```
~$ echo id | /sbin/busybox nc localhost 23
uid=0(root) gid=0(root) groups=0(root) context=u:r:pseudo_su:s0

```

* Default SELinux policy doesn't allow apps traverse `/sbin`. So either inject allow rules or put `busybox` in `/system/*bin/`. Or use some other `nc` e.g. from Termux's `netcat` package.

For ease of use, create functions (put them in `.bashrc` so that you don't have to define every time):

```
# ~/.bashrc
...
function psu() { echo "$@ 2>&1" | /sbin/busybox nc localhost 23; }
function psush() { /sbin/busybox nc localhost 23; }

```

```
~$ ls -ld /data/adb
ls: cannot access '/data/adb': Permission denied
~$ psu ls -ld /data/adb
drwx------ 7 root root 3488 2019-07-19 00:44 /data/adb

```

To get root shell:

```
~$ psush
whoami
root
^C

```

But it's just a dumb shell, not connected to terminal. To have a more feature-rich experience, other tools like `socat` can be used which support line editing, pseudo-terminals etc.
Also environment variables aren't evaluated unless explicitly passed, because commands are executed remotely:

```
~$ /data/data/com.termux/files/usr/bin/ps -p $$,1 -o pid=,comm=
23599 bash
~$ psu /data/data/com.termux/files/usr/bin/ps -p $$,1 -o pid=,comm=
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/bin/ps": library "libprocps.so" not found
~$ psu LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib /data/data/com.termux/files/usr/bin/ps -p $$,1 -o pid=,comm=
    1 init
23599 bash

```

So that's how we can get a minimal root functionality without using any specialized rooting tools.

---

**RELATED:**

---
Tags: root-access, supersu
---


title: Activate location for "Find my Device"

text:
# Question
Title: Activate location for "Find my Device"
When I go to https://www.google.com/android/find?u=0 (Find my Device), it says "Online" and "Location Turned Off" (under the device name) and the device is not located on the map.

I have checked the following on the device:

* Settings-\>Security & Location-\>Find My Device: is "On"
* Settings-\>Security & Location-\>Location-\>Use Location: is "On"
* Wifi and mobile data are on (I have Internet connection)
* The device knows its location (in Google Maps)
* Find My Device can make my phone ring remotely.

Note: Sometimes the map shows the device (and the message becomes "Last seen ...") but this happens only rarely and under unpredictable circumstances (and a reload of the webpage makes it go back to "Location Turned Off" even if the phone was not moved and no settings were changed).

My device is an Umidigi A5 Pro with Android 9.

# Answer
> 1 votes
In addition to enabling location services, the "battery saver" mode must be off.

In battery saver mode, location services will be automatically deactivated when the screen is off (Android Help). Unfortunately, Find My Device is not clever enough to deactivate batter saver mode for determining the location.

I did not find a way to use Find My Device while at the same time being able to extend battery life.

---
Tags: geolocation, location-services
---


# Question
Title: Recovery chances for a formatted SD card which was used as Android's internal storage
I used a micro SD card in a Nokia Smartphone for years as internal storage. I ejected it to test if *another phone* detects this type of SD card. Although we planned to just see if it is detected, certain off-topic factors led to the acceptance of Google's suggestion to '*format it as internal storage*'.

**As long as my phone still remembers the decryption, is there a way to recover** my Photos, GPS-tracks, Text-Notes and other data, despite being *encrypted* with the known key *and formatted* by another phone?

---

My assumptions:

* data from a non-encrypted card can often be retrieved mainly because the raw data still 'looks like' photos, mp3 etc;
* encrypted data doesn't 'look like' anything, so recovery tools won't find anything;
* Even if my phone doesn't care about data parts but about some 'yes I am your encrypted storage do not format me' file, a recovery tool would need the *decryption information* to look for the original content (i.e. *how to extract it* from the phone plus tell the tool?)

---

Side note/non-duplicate: Similar questions that I found always have somebody loosing the decryption key and I agree that recovery should be impossible in those cases.

# Answer
> 1 votes
Accessibility of the data on a storage volume that has been adopted by Android Marshmallow or higher as "internal storage" is well documented and has requirements of root at an absolute minimum... So I won't go into that in my answer, the details are here: https://nelenkov.blogspot.com/2015/06/decrypting-android-m-adopted-storage.html

You stated you do not have root on your device so the encryption key is not accessible, and rooting the device at this time will wipe the encryption key. So it is not recoverable.

Unfortunately, when the card was inserted into the other device, it was "formatted" as internal storage on the that device, not only erasing the existing data making it virtually impossible to recover even without taking encryption into account, but also changed it's identity to Android and setup a new encryption key pair between the new device and the storage card. This last step also made the card unrecognizable in the previous device as the other "half" of the key on the device no longer matches the storage volumes key.

Sadly, the end result here is that any data on the card initially is now lost permanently and is not recoverable. It is best at this time just to allow the device to format the card again, and consider that formatting the card as "external" or removable storage may be a more appropriate use of the storage card.

---
Tags: recovery-mode, encryption, internal-sd, formatting
---