# Question
Title: DroidWall (firewall app) alternative for non-rooted phones
Are there any applications that can restrict specific applications from accessing data/internet for non-rooted ICS phones? DroidWall - Android Firewall provides this functionality but it requires Root access.

# Answer
Mobiwol is an Android firewall application that does not require root. They somehow use the VPN interface for firewalling (without actually connecting you to a VPN server).

> We've used technology available to us from within the VPN packaging module offered by Android to be able to gain visibility to your applications' network activities

I tried it and it works fine for ICS.

Should be compatible with any device running Android 3.2 or later
> 5 votes

# Answer
The other answers are correct in that setting firewall rules requires root. And if you have root, you could simply deny internet permissions for a specific app without even needing a firewall (Permissions Denied or built-in with a CyanogenMod rom).

However, there is something you can do to partially circumvent the problem. Using Set DNS, you can change your DNS provider for **wifi**. Set it to something like Open DNS. From there, you can set up rules in DNS to block certain domains. Thus, when on wifi, you could block apps from making requests to a specific domain.

Unfortunately, you can't do this your your cellular connection; In fact, most cell providers override any DNS requests and use their own server no matter what.

If you set up a VPN, you could do the same thing over your cellular connection, but if you have a VPN set up, you could use that server to set up firewall rules anyway.
> 4 votes

# Answer
NoRoot Firewall works as the name suggests. I used it to keep my phone from downloading things by itself. I couldn’t make it persistent on that phone though, so it wouldn’t restart automatically. But while it’s running, it blocks unwanted apps just fine.
> 1 votes

# Answer
Restricting internet access of specific apps isn't possible on a non-rooted device. So, an app doesn't exist.
> 0 votes

# Answer
it's simply not possible for system user to prevent another process from accessing network, it can only be done by root, therefor root is required to do firewall changes to your system.
> 0 votes

# Answer
A great firewall app alternative for non-rooted is NetGuard, it's open-source and well maintained and has been around for a while, I use it as well you can find it on the android Playstore here
> 0 votes

---
Tags: firewall
---


# Question
Title: Why does Play Store on Android Wear claim ten updates when there are only two?
My Ticwatch S2 notifies me when there are app updates available, which when tapped gives the option to update all or open (I have auto-update apps turned off). I picked open.

However, instead of the expected 10 pending updates, I'm only shown 2:

Note it shows 2 updates available (just barely visible at the top) and scrolling down just shows recently updated. When I checked each installed app individually, no other apps showed having an update (I'm not 100% the watch version of the Play Store does that, though).

This has been going on for a while. I've already tried:

* Using "update all" instead of individually reviewing updates by hitting "open".
* Clearing data for the Play Store, that cleared the list of recent updates and reset the settings for the Play Store back to defaults, but didn't solve the issue.

One thing I have noticed is that on the Play Store's main screen, it lists 8 apps on my phone that I don't have on my watch. Odd coincidence?

# Answer
> 1 votes
Not a coincidence. **The Wear OS 2.x device's Play Store shows the pending updates both on the Wear device and the phone**. This is because Wear OS 2.x allows standalone wear apps, and they can be installed/updated independently from the phone apps.

**Thus, if the notification says "X new updates, Y updates total are pending", it means there are X independent Wear apps to update, but a total of Y apps *both on Wear device and phone* to update.** Updating all from the Wear device will only affect the independent Wear apps, so the user still needs to use the phone's Play Store to update the apps on the phone.

From Android Developers - Package and distribute Wear apps

> ### Distribution to Wear 2.0 watches
>
> On devices running Wear 2.0, when a user installs a phone app that has an associated watch app (either an embedded APK or an APK uploaded via the Play Console), the user gets a watch notification about the available watch app. Tapping the notification opens the watch Play Store, giving the user the option to install the watch app.
>
> Additionally:
>
> * \[...\]
> * **When you upload a watch APK via the Play Console, you can update your Wear APK independently from the phone APK, and users receive updates via the watch Play Store.**
> * \[...\]
>
> <sup>(Emphasis mine)</sup>

Previously on Wear OS 1.x (and before, i.e. Android Wear), wear apps are embedded in the phone apps. To update the wear apps, the user has to update the phone apps first, then the Play Store will install the embedded wear apps from the phone to the Wear device.

Also from the same article,

> ### Distribution to Wear 1.x and 2.0 watches
>
> The standard distribution model for Wear 1.x was embedding a watch app inside a phone app. \[...\]. When a user installs your phone app, if you have a compatible Wear app in the Play Store, it will automatically be installed on Wear 1.0 watches.

---

Additional note: Ticwatch S2 runs on Wear OS 2.2.

---
Tags: google-play-store, updates, android-wear
---


# Question
Title: Is there a way to navigate back after an inter-page jump in a PDF reader?
Say I am reading a paper with a PDF reader on a tablet and I get to

> ... the second inequality follows from Lemma 3.2 ...

and I click on the text "Lemma 3.2" to jump to Lemma 3.2. Now that I reminded myself of what Lemma 3.2 was, I need to go back to the page I was reading before the jump.

In case of Adobe Reader which I am using on my phone, the physical back button (which I believe corresponds to the system back button) simply gets me to the recent files list.

Is there a way to navigate back after an inter-page jump in a PDF reader?

# Answer
ezPDF Reader (free trial, pro) supports this.

Assuming you have a table of contents (TOC), clicking on a chapter link will take you to a page far from the TOC. If you click on the button with "a page and left arrow" icon (encircled below), it will take you back to the TOC.
> 2 votes

# Answer
From the (now deleted) OP's comment,

> I found that Adobe Reader on Android actually has "go back" feature; after I jump to Lemma 3.2, the reader displays a new button which is for "go back". I guess I didn't try jump before because I was not expecting such a button to be created on the fly like that.
> 0 votes

---
Tags: pdf
---


title: Deleting multiple backed up photos

text:
# Question
Title: Deleting multiple backed up photos
I am trying to un back up my photos from my Gmail account. There are many and it would take a long time to go into each one and click on the trash icon. How can I select multiple photos to be sent to trash? Every time I click an image it opens up and doesn't give me the option to delete lots at once by using SHIFT. How do I send lots of photos to trash in one go?

# Answer
> 0 votes
If you are using Google Photos app, long-press on a photo. That would put a checkmark on that photo. Now single tap on as many photos as you want to select them. Afterwards, tap on the trash icon to delete them altogether.

---
Tags: backup
---


title: Automatic system-wide proxy

text:
# Question
Title: Automatic system-wide proxy
When I'm on a public network that I don't trust, I use a combination of ConnectBot and ProxyDroid (with "Global Proxy" enabled) to tunnel my phone's traffic through a trusted server that I control. However, I have to set that all up manually, and I'm sure plenty of other data leaks out around that tunnel (at the very least, apps will check in between the time I connect to a network and the time I set up the tunnel). Also, the process is involved enough that I usually only go through it when I'm on a public network and I get SSL errors from the browser telling me google.com is using a certificate signed by GoDaddy.

I'd like to set something up that smooths the process out a bit, such that a tunnel is automatically established whenever I connect to a network, all traffic is routed through it, and apps aren't able to connect to the Internet unless the tunnel is open (very important). Obviously, it should verify the authenticity of the server before connecting (though I haven't seen a VPN that doesn't). I'd like something that uses SSH since that's the simplest to set up, but anything will do. What sorts of solutions like this are out there? My server runs Ubuntu 12.04, and I can install extra software on it if needed.

Again, the most important part here is that no app can access the network unless it's going through the tunnel, and if the tunnel hasn't been established yet, no traffic escapes. Obviously, the one exception would need to be whatever app is actually making the initial connection to establish the tunnel.

I'm currently using a rooted HTC Incredible running CyanogenMod 7. I'm in the market for a new phone though, so if anyone knows of any solutions that require something newer than Android 2.3, those would be welcome as well.

# Answer
> 1 votes
Maybe shadowsocks? There are different os client/servers, even for routers. http://www.shadowsocks.org/

# Answer
> 0 votes
Proxies by design aren't meant to be set system-wide. Apps are supposed to make proxied connections if they want to. And mostly apps fall back to no-proxy mode if for some reason proxy server isn't accessible. Also there are other limitations. `http` proxies can't handle UDP traffic and SOCKS proxies can't handle ICMP echo (which `ping` uses). A VPN network, however operates at lower level and forwards all traffic to remote end. For details see Why proxy set on Android does not work when used as hotspot?

> it should verify the authenticity of the server before connecting (though I haven't seen a VPN that doesn't)

Mostly `http` proxies support basic authentication, and obviously SSH and VPNs do.

> I'd like something that uses SSH since that's the simplest to set up

You can create a SOCKS5 tunnel using SSH dynamic port forwarding, it can forward UDP traffic too. But you need to use third party apps, Android doesn't support SOCKS proxies. For details see: How to set up a socks5 with Android cli?

> I'd like to set something up that smooths the process out a bit, such that a tunnel is automatically established whenever I connect to a network, all traffic is routed through it, and apps aren't able to connect to the Internet unless the tunnel is open (very important).

Android by-default doesn't offer such functionality but you can use automation apps in combination with VPN based apps to hopefully achieve the desired result.

---
Tags: vpn, proxy, ssh, openvpn
---


# Question
Title: How to bind mount a folder inside /sdcard with correct permissions?
I am using a Sony Xperia M4 Aqua. As is well known, the internal memory is rather small. Especially the `Media` directory of `WhatsApp` uses a lot of precious space, therefore I am trying to move it to the SD card. I am using Android 6 and I have formatted the SD card to have an adopted storage partition.

Adopted storage would be normally used to migrate all `/data` to it, as discussed here. I am however interested in moving just the single directory `WhatsApp/Media` somewhere else (possibly in the adopted storage partition), and then bind-mount it to its original location.

For this purpose, I moved the `WhatsApp/Media` directory to the adopted storage. Then, following this discussion, I have modified the script `/system/etc/init.qcom.post_boot.sh` adding the following `mount`commands (the phone has no support for `init.d` scripts)

```
mount -o bind /mnt/expand/4fdb2500-9aa7-44bc-a2c4-80aeae28e764/WhatsAppMedia /storage/emulated/0/WhatsApp/Media
mount -o bind /mnt/expand/4fdb2500-9aa7-44bc-a2c4-80aeae28e764/WhatsAppMedia /mnt/runtime/write/emulated/0/WhatsApp/Media
mount -o bind /mnt/expand/4fdb2500-9aa7-44bc-a2c4-80aeae28e764/WhatsAppMedia /mnt/runtime/read/emulated/0/WhatsApp/Media
mount -o bind /mnt/expand/4fdb2500-9aa7-44bc-a2c4-80aeae28e764/WhatsAppMedia /mnt/runtime/default/emulated/0/WhatsApp/Media
mount -o bind /mnt/expand/4fdb2500-9aa7-44bc-a2c4-80aeae28e764/WhatsAppMedia /data/media/0/WhatsApp/Media

```

Notice: `/mnt/expand/4fdb25....` points to the adopted storage partition.

This only apparently works: if I open a shell with `adb` I can correctly see that the `WhatsApp/Media` directory contains the mounted directory. Also, I see no additional views that contains the WhatsApp directory, as can be checked by doing, in an `adb shell`

```
find / -type d -name WhatsApp

```

Nevertheless, WhatsApp is not able to access the Media gallery. For instance, in the chat I just see blurred pictures (like a preview), and clicking on it I do not see the full picture. Moreover, if somebody sends me a picture, all I can see is a blurred preview with the download icon. Clicking on the download icon does not produce anything.

Wrong permissions are presumably the source of problems. For example, some permissions/group ownership appear to be incorrect on some views:

```
root@E2303:/ # ls -n /storage/emulated/0/WhatsApp
drwxrwx--x 0        1015              2019-09-04 14:37 Backups
drwxrwx--x 0        1015              2019-10-19 02:00 Databases
drwxrwx--x 0        1015              2019-09-04 20:24 Media
root@E2303:/ # ls -n /mnt/runtime/write/emulated/0/WhatsApp
drwxrwx--- 0        9997              2019-09-04 14:37 Backups
drwxrwx--- 0        9997              2019-10-19 02:00 Databases
drwxrwx--x 0        1015              2019-09-04 20:24 Media
root@E2303:/ # ls -n /mnt/runtime/read/emulated/0/WhatsApp
drwxr-x--- 0        9997              2019-09-04 14:37 Backups
drwxr-x--- 0        9997              2019-10-19 02:00 Databases
drwxrwx--x 0        1015              2019-09-04 20:24 Media
root@E2303:/ # ls -n /mnt/runtime/default/emulated/0/WhatsApp
drwxrwx--x 0        1015              2019-09-04 14:37 Backups
drwxrwx--x 0        1015              2019-10-19 02:00 Databases
drwxrwx--x 0        1015              2019-09-04 20:24 Media
root@E2303:/ # ls -n /data/media/0/WhatsApp/
drwxrwxr-x 1023     1023              2019-09-04 14:37 Backups
drwxrwxr-x 1023     1023              2019-10-19 02:00 Databases
drwxrwx--x 0        1015              2019-09-04 20:24 Media

```

Permissions and group ownership of the `Media` directory should be the same of the other (non bind-mounted) directories `Backups` and `Databases`. Oddly enough, an attempt to remount the directories with the correct gid

```
root@E2303:/ # mount -o remount, gid=9997 /mnt/runtime/write/emulated/0/WhatsApp/Media
root@E2303:/ # mount -o remount, gid=9997 /mnt/runtime/read/emulated/0/WhatsApp/Media
root@E2303:/ # mount -o remount, gid=1023 /data/media/0/WhatsApp/Media

```

does not produce any changes in the group ownership: `ls -n` as above gives identical results.

Even more strange, but maybe unrelated, omitting the space between `remount` and `gid=...` results in

```
mount: Invalid argument

```

How to bind mount `WhatsApp/Media` folder from external SD card with correct permissions?

# Answer
I have been using two different approaches (in fact many with small differences) on my older Android versions to mount whole `/sdcard/WhatsApp` directory from external SD card. I have tested, it works on Android 9 too, but the storage things have changed on Android 10.

Before getting into practical details, we need to keep in mind a few points:

* `/sdcard` isn't an actual but **emulated filesystem**. Android uses `sdcardfs` (or `FUSE`) to emulate actual storage on `/sdcard`. See What is /storage/emulated/0/?
* Both of the above filesystems have a **fixed SELinux context**: `u:object_r:sdcardfs:s0` (or `u:object_r:fuse:s0`).
* Normally **`/data/media`** is emulated over `/sdcard`, but in case of Adoptable Storage when data is migrated, **`/mnt/expand/[UUID]/media`** is emulated. See How to free Internal Storage by moving data or using symlink / bind-mount with Adoptable Storage?
* Files and directories on `/sdcard` have **fixed ownership and permissions** which depend on if the app has `android.permission.[READ|WRITE]_EXTERNAL_STORAGE` permission granted or not. Files have never executable permission. Apps' data directories in `/sdcard/Android/data/` have ownership set to respective app's UID. For details see What is the “u#\_everybody” UID?

We assume here that every app is allowed to write to `/sdcard` by setting ownership `0`/`9997` (user/group) and permissions `0771`/`0660` (directories/files).
* To achieve above said behavior, since Android 6 every app is run in an **isolated mount namespace** and `/storage/emulated` is bind mounted to a different *VIEW*: `/mnt/runtime/[default|read|write]/emulated` with private/slave mount propagation. So mounting directly to `/storage/emulated` won't appear in apps' mount namespaces unless you enter every app's mount namespace explicitly. The same is true if you mount from some app's isolated mount namespace. See Partition gets unmounted automatically in Android Oreo.

We are going to mount from root mount namespace to `/mnt/runtime/write/emulated` which is propagated to all apps' mount namespaces.
* `read` and `default` views have different permissions than `write` (), but mounting to both is usually unnecessary. Permissions `READ_EXTERNAL_STORAGE` and `WRITE_EXTERNAL_STORAGE` belong to same permission group. So granting one to an app through GUI also grants the other, and all apps with Storage permission will only see `write` view. `default` is only to let apps (which don't have READ/WRITE Storage permission) traverse `/sdcard/Android/data` directories. So mounting to `default` will let such apps just pass through subdirectories on `/sdcard/`, no files will be visible.

Also at least with `sdcardfs` emulation, `read` and `write` are bind-mounted () from `default` and mounting to one also mounts to other two. So it's not possible to mount all of three with different permissions.
* `/sdcard` does not support Extended Attributes (`xattr`) and Access Time (`atime`). Other mount options include `nosuid`, `nodev` and `noexec`. See mount manpage for details.

---

First of all make sure you are in root mount namespace as explained in the link given above. Or use `nsenter` to get a root shell in global namespace:

```
~# [ $(readlink /proc/1/ns/mnt) = $(readlink /proc/self/ns/mnt) ] || busybox nsenter -t 1 -m /system/bin/sh

```

## 1. MOUNT SD CARD MANUALLY:

The straightforward way is to format external SD card as portable storage with `exFAT` or `FAT32`. Since these filesystems aren't native to Linux, their in-kernel driver implementations support `uid`, `gid`, `fmask` and `dmask` mount options. You can use `exfat` or `sdfat` drivers with `exFAT` and `vfat` with `FAT32`. Former has also a userspace implementation `mount.exfat-fuse` which requires only FUSE support from kernel. Check with `grep fuse /proc/filesystems`.

Let's say `/dev/block/sda1` is your `exFAT` partition:

```
~# mount -t exfat -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0,uid=0,gid=9997,fmask=0117,dmask=0006 /dev/block/sda1 /mnt/runtime/write/emulated/0/WhatsApp
~# mv /data/media/0/WhatsApp/* /sdcard/WhatsApp/

```

* Replace `u:object_r:sdcardfs:s0` with `u:object_r:fuse:s0` or whatever label your `/sdcard` has.

You can also create multiple partitions on SD card. Or after mounting with required mount options you may also bind mount a directory instead of whole partition. Let's say you first mount SD card to `/mnt/my_sdcard`, then bind mount WhatsApp directory:

```
~# mount -o bind /mnt/my_sdcard/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp

```

**Downside** with this approach is that `vold` mounts external SD card on boot, so you need to un-mount first.
Secondly the data on SD card isn't encrypted, though there are multiple ways to encrypt manually. See Decrypting microSD card on another Android device or desktop computer.

## 2. ADOPTABLE STORAGE:

An easy way to counter the above said downsides is to make use of kernel's built-in FDE by formatting the SD card as Adoptable Storage, but only if you don't want to migrate all `/data/media/` to external SD card. Once formatted, external SD card will be mounted at `/mnt/expand/[UUID]` (filesystem UUID is a 16 bytes number). But we can't simply bind mount a directory from there to `/sdcard` because the filesystem on Adoptable Storage is `ext4`, which follows UNIX permissions model but the apps can't handle those as explained above. Even if you make it work somehow (using `chown`, `chmod` etc.), every app will create files with its own UID which won't be accessible to other apps e.g. Gallery may not be able see pictures downloaded by WhatsApp.

For this method to work your kernel must support `sdcardfs` (check with `grep sdcardfs /proc/filesystems`). Create a directory on Adopted SD card and emulate it to `/sdcard/WhatsApp`:

```
~# mkdir /mnt/expand/[UUID]/media/0/WhatsApp
~# mv /sdcard/WhatsApp/* /mnt/expand/[UUID]/media/0/WhatsApp/
~# restorecon -rv /mnt/expand/[UUID]/media/
~# mount -t sdcardfs -o nosuid,nodev,noexec,noatime,mask=7,gid=9997 /mnt/expand/[UUID]/media/0/WhatsApp /mnt/runtime/write/emulated/0/Whatsapp

```

Please note that we necessarily need to use path `/mnt/expand/[UUID]/media/` because it's labeled as `media_rw_data_file` () (like `/data/media` ()) which is allowed by SELinux policy to be accessed by apps (). If you use a different path, you need to modify SELinux policy. Unlike other filesystems `sdcardfs` itself doesn't change SELinux context when accessing underlying filesystem.

## 3. PORTABLE / ADOPTABLE STORAGE:

This method is the most flexible, it works if you want to use:

* Portable storage but don't want to mount whole partition, instead a directory.
* Adoptable storage but your kernel doesn't have `sdcardfs` support.
* Adoptable storage but don't want to use `/mnt/expand/[UUID]/media/` path necessarily.

Use a third party tool named `bindfs` (which uses FUSE) to simulate the behavior of emulated filesystem. Actually Android's built-in tool `/system/bin/sdcard` does exactly this on pre-`sdcardfs` releases but it has some fixed paths and other unnecessary things, so its source code needs to be modified to achieve what we want. You can build `bindfs` yourself or try this this one.

```
~# DIR=/mnt/media_rw/[UUID]    # for Portable Storage
~# DIR=/mnt/expand/[UUID]      # for Adoptable Storage
~# mkdir $DIR/WhatsApp
~# mv /sdcard/WhatsApp/* $DIR/WhatsApp/
~# bindfs -o nosuid,nodev,noexec,noatime,context=u:object_r:sdcardfs:s0 -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore $DIR/WhatsApp /mnt/runtime/write/emulated/0/WhatsApp

```

***Side notes:***

* `sdcardfs` also works partially with this method except it doesn't support SELinux `context=` option (so far). So it depends on what is the SELinux label of backing directory on SD card.
* Other tools like `rclone`, `encfs`, `sshfs` etc. which make use of FUSE can also be mounted inside `/sdcard` the same way. Related: How to mount rclone on Android?
* `-u` and `-g` options require `/etc/passwd` and `/etc/group` to exist on `bindfs` \< v1.14.2.

---

So you may go with whatever method suits you. Usually in-kernel drivers perform better than userspace solutions, and methods native to Linux kernel are more robust and stable. FUSE (over FUSE) may exert performance penalty sometimes e.g. if SD card itself supports high speed data transfers.

You can place the required mount commands in an `init.d` script or define and `init` service. See How to run an executable on boot and keep it running?

**Note:**

* Apps which don't scan `/sdcard` filesystem themselves but rely on Android's MediaProvider for any changes may need a forced media scan for new files on mounted filesystem to appear immediately.
* If you use multiple users or profiles, you need to mount new filesystem for every `User_ID`. For device owner it's `0`.

---

**RELATED:**
> 14 votes

---
Tags: applications, internal-storage, external-sd, permissions, mount
---


# Question
Title: How to make bind-mounted (mount -o bind) folders visible for non-root users?
I want to mount-bind an app data folder in `/data/data/...` to a user subfolder in order to automatically synchronize the contents for backup purposes. As root I use the following command:

```
mount -o bind /data/data/org.blabla.app/database/ /storage/emulated/0/blabla_database

```

The command seems to work and I can access the files in the mounted folder as long as I am root. However, as soon as I exit root, the files become invisible and the bind-mounted folder is empty.

How can I make the files visible for non-root users so that my sync app can access the files for backup?

# Answer
> 2 votes
In order to have different file ownership and permissions for every app in `/sdcard`, since Android 6 every app is run in an **isolated mount namespace**. `/storage/emulated` is bind mounted for every app with **private / slave mount propagation** to a different VIEW:

```
/mnt/runtime/default/emulated
/mnt/runtime/read/emulated
/mnt/runtime/write/emulated

```

It depends on if the app has `READ_EXTERNAL_STORAGE` or `WRITE_EXTERNAL_STORAGE` permission granted or not. For details see What is the “u#\_everybody” UID?

Mounting directly to `/storage/emulated` won't appear in apps' mount namespaces unless you enter every app's mount namespace explicitly. The same is true if you mount from some app's isolated mount namespace as mentioned by @Izzy in comment. See Partition gets unmounted automatically in Android Oreo.

So you need to mount from root mount namespace to one of the above VIEWs, so that mount is propagated to all apps' mount namespaces.

For more details see How to bind mount a folder inside /sdcard with correct permissions?

---
Tags: file-system, mount
---


title: Fix SELinux contexts for a SU binary

text:
# Question
Title: Fix SELinux contexts for a SU binary
I am trying to root my android 6.0.1 phone using the following method:

I first booted into a TWRP image using `fastboot boot`, then using the TWRP terminal I copied the `su` binary from the SuperSU kit to /system/xbin/ and ran `chmod 6755 ./su`, `chown root:root ./su` and `chcon u:object_r:system_file:s0 ./su`. Now I booted into Android and opened a terminal emulator and goto /system/xbin/ and see that the SUID bit is set for `su`. But when I run `su`, nothing happens and the binary exits with a `0` value.

Running `strace su` shows that the `setresuid()` and `setuid()` calls are failing. I suspect this is because of SELinux contexts.

What should the SELinux contexts be for the binary?

# Answer
> 1 votes
Apps can't elevate their privileges by making use of `set-uid-root` or file capabilities. It's due to Security Enhancements in Android 4.3:

> * **No setuid/setgid programs.** Added support for filesystem capabilities to Android system files and removed all setuid/setguid programs. This reduces root attack surface and the likelihood of potential security vulnerabilities.
> * **Restrict Setuid from Android Apps.** The /system partition is now mounted nosuid for zygote-spawned processes, preventing Android applications from executing setuid programs. This reduces root attack surface and the likelihood of potential security vulnerabilities.
> * **Capability bounding.** Android zygote and ADB now use prctl(PR\_CAPBSET\_DROP) to drop unnecessary capabilities prior to executing applications. This prevents Android applications and applications launched from the shell from acquiring privileged capabilities.
> * **NO\_NEW\_PRIVS**. Android zygote now uses prctl(PR\_SET\_NO\_NEW\_PRIVS) to block addition of new privileges prior to execution application code. This prevents Android applications from performing operations which can elevate privileges via execve. (This requires Linux kernel version 3.5 or greater).

Default SELinux context of `/system/xbin/su` is `u:object_r:su_exec:s0` but it may not be the only constraint.

For more details see:

Also:

# Answer
> -1 votes
Impossible to say with that little information. You said:

> ...and ran `chmod 6755 ./su`, `chown root:root ./su` and `chcon
>  u:object_r:system_file:s0 ./su`

This seem to imply you are already root. If it's SELinux problem, you shouldbe able to see this in `logcat -b main *:V`.

---
Tags: 6.0-marshmallow, root-access, selinux, supersu
---


# Question
Title: DNAT iptables rule on rooted Android phone?
How i can set `iptables` rule like this on my rooted Android phone:

`iptables -t nat -A PREROUTING -i wlan0 -s 192.168.1.100 -p tcp --dport 80 -j DNAT -–to-destination 192.168.1.101:8080`

... since Android iptables implementation doesn't support protocol by name and DNAT?

# Answer
According to this question on Stack Overflow

1. iptables is available in Android source distribution.
2. **Users of retail Android devices cannot access iptables** binary. **Even Android OS itself cannot access that binary.** This is hard-coded in Android. Many devices also don't have iptables at all.
3. The only way to access iptables binary is to build your own Android images. Check out http://randomizedsort.blogspot.com/2010/08/building-android-and-linux-kernel-for.html. Once you get comfortable with that process, check out http://randomizedsort.blogspot.com/2011/03/porting-iptables-1410-to-android.html.

`iptables` is a default module in , you can use netfilter to write c code to handle that.

For example, you can create an android project, and write a JNI file, use ndk-build to compile that, and then push the executable to the android file system to execute. And in the mobile end, you can adb shell to it, directly use iptables command as a root user, just like in Linux.

To check if your device supports iptables:

Issue the following command in ADB shell or in Terminal Emulator:

```
iptables -L -t nat

```

Alternatively you could try the beta of IP Tables app on Google Play to see if it does what you want.

There is also Droid Wall that you could try. It supports scripts that may help, e.g.

```
$IPTABLES -A "droidwall" --destination "192.168.0.1" -j RETURN

```
> 3 votes

# Answer
You can try AFWall+ for example. Available in Play Store and in F-Droid.
> 0 votes

---
Tags: iptables
---


# Question
Title: Unable to configure wifi and/or bluetooth on Google Glass EE 2
I have a Google Glass *Enterprise Edition 2* (yes). I am unable to connect either wifi or bluetooth (primary goal is wifi).

For wifi, I first tried the following:

1. On the glass: Settings → Wifi → Selected network.
2. On the MyGlass web site: "Continue with my computer" → Enter wifi info → Generate QR code.
3. Glass prompts to scan QR code, I scan it, it says "invalid QR code". Considerable searching yielded no additional troubleshooting info.

I then attempted to use the MyGlass app on an Android device. I tried the following on a Google Pixel and a Kyocera DuraForce Pro:

1. Install MyGlass app.
2. Enable bluetooth.
3. There aren't really any on-screen instructions; it appears there is supposed to be an embedded video tutorial in the app but it never loads. Clicked "find my glass" in the app. It did not see the Glass.

I tried pairing the Glass with the phones manually, first from the Glass side:

1. Enter Bluetooth settings on phone so it becomes visible.
2. Phone shows up on Glass, select it, pair.
3. Pairing appeared successful, but then it immediately disconnects.

Then I forgot all devices and tried again from the phone side:

1. Enter Bluetooth settings on Glass so it becomes visible.
2. "Google Glass Enterprise Edition 2" shows up on phone. Select it, pair.
3. Pairing appeared successful, but then it immediately disconnects.

In both cases, after pairing, if I select the Glass from the phone's Bluetooth menu it says "Connecting..." → "Connected" → immediately disconnects.

In all cases, I was unable to make any progress in the MyGlass app.

So I am unable to configure wifi, and unable to pair the device. Does anybody know how to do either of these?

# Answer
All right, well I was able to configure wifi at least. I had to use the Android menus rather than the QR Code based UI:

1. I found an application called Vysor that allows control of the Glass through a PC, so I installed it, connected the Glass with a USB cable and did the rest through there.
2. From there I went to the device information card, clicked it 5 times (there's a countdown) to open the Android menus.
3. I then went to wifi configuration and entered the configuration there just as on any other Android device, and it connected just fine.

Still no luck with Bluetooth, but since my use for Bluetooth was just to configure wifi in the absence of working QR codes, and I was able to configure Wifi through the Android menus via Vysor, I don't really have a use for Bluetooth any more.
> 2 votes

---
Tags: wi-fi, bluetooth, google-glass
---


title: How to check IMSI/ICCID on MIUI10?

text:
# Question
Title: How to check IMSI/ICCID on MIUI10?
Is there any way to view IMSI and ICCID numbers of my SIM-cards? I didn't find such menu neither in About-Status nor anywhere else.

# Answer
> 1 votes
There are APIs available which apps (like this) use to read SIM information. Looking for CLI solution (refer to this, this and this), we can get IMSI and ICCID with following commands respectively (up to Android 9):

```
~$ service call iphonesubinfo 7

```

```
~$ service call iphonesubinfo 10

```

* Codes depend on order of methods defined here, which may differ on different Android versions.
* For dual SIM device use code `8` and `11` instead and append `i32 2` to command to get second SIM information.

Pass the output through following pipes to convert hexadecimal output to a good looking string:

```
... | grep -oE '[0-9a-f]{8} ' | while read hex; do echo -ne "\u${hex:4:4}\u${hex:0:4}"; done; echo

```

Terminal emulator apps usually don't have permission `READ_PHONE_STATE` (though you can grant manually with root) which is required by both functions. So commands need to be executed from `adb shell`.

Codes `7`/`8` correspond to getSubscriberId and `10`/`11` to getSimSerialNumber. However both methods have been removed for normal apps usage in Android 10. Only system apps with `READ_PRIVILEGED_PHONE_STATE` will be able to get this information. `iphonesubinfo` service can't be dumped with `dumpsys` either. So root is the only solution on Android 10+.

RIL may also log the operator/SIM related information to `logcat` when SIM state changes. With root access it's possible to read telephony database (the component of application framework which interfaces RIL) and also RIL database itself (which interfaces modem). On my Qualcomm device RILD stores information to `/data/vendor/radio/qcril.db` including ICCID and MCC/MNC.

```
~# sqlite3 -line /data/user_de/0/com.android.providers.telephony/databases/telephony.db 'select icc_id,card_id,carrier_name,display_name,mcc,mnc from siminfo'

```

```
~# sqlite3 /data/vendor/radio/qcril.db 'select ICCID from qcril_manual_prov_table'

```

As of Android 9 IMSI is also stored in `/data/system/netpolicy.xml` to set mobile data limits for MNOs separately.

```
~# grep -o 'subscriberId=[^ ]*' /data/system/netpolicy.xml

```

---

**RELATED:**

---
Tags: sim-card, miui, redmi, miui-10
---


# Question
Title: Clone android phone storage without root
Is there any way to clone the internal storage of a phone (huawei honor v10, android 8.0) if the phone is not rooted and USB debugging is disabled? I am currently locked out of the phone, but I want to preserve it's state (so I can recover photos in the future) and make the phone usable in the meantime.

# Answer
Do you mean you don't know the PIN (or pattern or so), but you might remember it later? I am sorry, Android is designed to prevent it. And if you somehow manage to do it, it is likely to be far more expensive than buying a temporary phone until you remember the PIN.

Imagine what would happen when you were allowed to do that. You would be able to bypass any PIN protection. You would be able to do so even if the data were encrypted by the PIN, as this would allow you to brute-force the PIN.

As far as I know, the data are not encrypted by the PIN (or any key derived from the PIN by PBKFD or so). Instead, they should be encrypted by a key that is released from a hardware-based key storage after the correct PIN is provided. The hardware-backed storage should handle remaining PIN attempts and clear itself after the PIN attempts are exceeded.
> 1 votes

---
Tags: hardware, ram, storage
---


# Question
Title: Can I make my phone start recording sound without removing it from my pocket?
Sometimes I would like to **record sound** from my Android phone, **very quickly**, without having to touch the screen. *(Example: record funny situations in the street, funny sounds, etc. )*

**Can we launch sound recording "with hands in the pocket"?** (i.e. without using the screen)

More generally, is it possible to launch an app with hands in the pocket, by pressing one of the buttons during 3 or 4 seconds for example?

# Answer
> 1 votes
Four years later I found a solution with MacroDroid!

I start recording and stop recording by just pressing 4 times on the Power button (with hands still in my pocket!)

* Trigger: Power Button Toggle (4 times)
* Local variable: rec
* Action:

```
If rec = False
     Record Microphone (Until Cancelled)
     Vibrate (short buzz)
     Set Variable rec = True
Else
     Record Microphone (Cancel Recording)
     Vibrate (long buzz)
     Set Variable rec = False
End If

```

# Answer
> 1 votes
The only hardware buttons that can be used by apps (to launch other apps or start a recording) are the “camera” button on the device and the “media” button(s) on the headset. You’ll need a sound recording app that support it, or use an automation app like Automate with its Media button and Audio record blocks.

---
Tags: applications, buttons
---


# Question
Title: ID a caller regardless of custom number prefix and/or suffix
Where I'm living right now people can call you with reverse charges by adding 99 prefix to the call.

The problem if that the received call ID appears with 99 as prefix and suffix, and unless you know their number you have no way of knowing who's calling.

Example:

> Let's say John's number is 5 123 4567 and he calls me with reverse charges. My phone caller ID will then display that 995123456799 is calling.

What I would like to do is to get the phone to both tell me it is a reverse charge call and who is the person calling.

Is there a way to do this other than creating an extra contact per person named "Reverse Contact"? (e.g. "Reverse John")

# Answer
It's possible to accomplish it using automation apps. I have used Macrodroid.

1. In the Triggers tab, in "Call/SMS" section, select "Call Incoming", then "Select Contact(s)". Choose "{Any Contact\]", "\[Any Number\]", "\[Non Coontact\]" and "Unknown Caller". Click OK.
2. In the Actions tab, in "Macrodroid Specific" section, click on "Set Variable", then "\[New Variable\]". Click OK. Enter the variable name, set its type to "String". Keep it local then click OK.
3. In the Actions tab, in "Macrodroid Specific" section, click on "Text Manipulation". then "Extract Text" followed by OK. For the "Source text", click the 3-dot and select "Call number", then click OK. For "Text to match (regex)", enter `^99(.+)99$`. Choose "Group 1", then for "Save variable to", select the variable create during step 1. Click OK.
4. Save the macro and give it a name.
5. Edit the macro. Click the "+" on the Actions tab. In "Conditions/Loop" section, select "If clause". Click the "+" next to conditions, then in "Macrodroid Specific" section, select "Macrodroid variable". Select the variable created in step 1, choose "Contains". Enter `\w+` and enable "Enable regular expression matching". Click OK.
6. In the Actions tab, in "Notification" section, click on "Display Dialog". Enter the dialog title. For the dialog text, press the 3-dot and select the variable created during step 1. Click OK.
7. On the Actions tab, click the up and down arrows and move the Display Dialog created in step 6 between the "If" and "End If".
8. Save the macro. It will look like the image below.

**Explanation:** When you receive a call, the number will be stored in the variable. it will then be checked if it starts and ends with 99 using the regular expression `^99(.+)99$`. If yes, the number without the 99s ( the `(.+)` part of the regex) is extracted and displayed in a dialog box. If no, then no dialog is displayed.

See Regular Expression
> 0 votes

---
Tags: caller-id
---


title: Purchased music won't play without wifi

text:
# Question
Title: Purchased music won't play without wifi
Why won't the songs I purchase from Google play actually play without wifi? I have set the settings to download without wifi. I don't care about the data. I don't like waiting until I get home to be able to finally put the music I have purchased on my phone

# Answer
Stumbled across this thread since I am having a similar issue with my unlimited google music subscription; hope your issue has been resolved by now!

I had this issue happen randomly to me. I was able to stream all the songs in my library, then suddenly half of them were grayed out and wouldn't play ("Can't play this song without internet connection").

I contacted Google customer support and they helped me fix the issue. They said that my phone hadn't checked in with their servers in 24 hours, so they had me force my phone to do that. They had me change the date, time, and time zone in the Date and Time settings. They recommended to change it so there were no similarities (i.e. if its AM there, choose a time in the PM; if its 2015 change it to a date in 2016; etc). I verified the time and date changes on the home screen, then changed the Date and Time settings back to Automatic.

They then had me fully close the music app and reopen it, and voila, all my songs would play via cellular data again.
> 3 votes

# Answer
Go on google play music and find a small icon that looks like a pin which is grey, click on it and google will download music on your phone and you will be able to listen to your music whenever you want.

Hope it will help.

edit : I have just checked on my phone the icon could be an arrow also.
> 2 votes

# Answer
I noticed I was having this issue when I went camping, only to find about 30% of songs I downloaded weren't available. A screenshot of this is shown below.

Even removing and re-downloading an album wouldn't fix the problem. Changing the clock as Austin suggested didn't help either.

**The Solution:**

While connected to wifi (disable download only mode), go to Settings \> Account \> Refresh. Wait a few moments. Play a different song, then start playing your album again. This fixed the issue for me, and I really wasn't expecting it to be so easy.

And you can test this by using Download Only mode in the main menu.

---

Below is what it looks like when some songs you downloaded don't work offline (or in download only mode).
> 1 votes

# Answer
Go to settings-\>apps & notifications -\> Google Play Music, clear cache & storage.
> 0 votes

---
Tags: google, google-play-music
---


title: Re-run Pixel 4 Setup

text:
# Question
Title: Re-run Pixel 4 Setup
My girlfriend just purchased a Pixel 4 from Verizon. Apparently, the Verizon representative rushed through the initial setup flow, and my girlfriend didn't get a chance to configure her phone the way she wanted. Is it possible to re-run the onboarding flow?

# Answer
> 0 votes
If you are **not** familiar with ADB environment, then the **most suitable solution** for you is to **Factory Reset** your device. However, if you are familiar with ADB, then follow this:

```
adb shell su
pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardActivity

adb shell settings put secure user_setup_complete 0

```

> Please note that the commands are case-sensitive and require permissions.

---
Tags: google-pixel, setup-wizard
---


# Question
Title: On Android, how to disable Google Chrome's incognito mode
If you thought that disabling incognito mode was enough to protect your children, you're probably mistaken. Let me explain.

# Dear readers: Disabling incognito mode may be completely insufficient.

Please remember that, even if you disable Google Chrome's incognito mode, there are other ways for device users to browse the Web without leaving any tracks. Even technologically-illiterate kids **can ask Google or their friends what to do**. So it's wise to also install a good filter.

I haven't researched the set of available filters very recently.

As of a few years ago:

Free options include Qustodio and Google Family Link. The free version of Norton Family is perhaps not as good. If you're willing to pay, I've read that Netspark or GenTech are better than the free products.

In general, Android filtering software is not as good as desktop filtering software.

You may also want to collect up your spouse's and kids' new and old Android devices, and to lock them all in your bedroom every night.

# Dear readers: Some thoughts about night time.

"When kids have their own devices, they are tempted to be in touch constantly — and maybe even feel obligated to be in touch when they don't want to." If your kid gets a Facebook message at 1 a.m., it might be rude for her to ignore it until the morning, and so she might reluctantly end up in a long conversation. (Based on this source.)

The solution to the late-night messaging problem is this: Late at night, there are ways to prevent your kid from using her phone, tablet, and laptop. You can keep them locked in your own bedroom to charge. Or, for Android devices, you can use Google Family Link to set a bedtime: please see here or here. This will also make it harder for your kid to **secretly spend hours** on addictive pursuits: YouTube, Facebook, pornography, and games.

# Dear readers: Please test your filter immediately after installation, and again at least yearly.

Once you install a filter, I suggest: Immediately test to make sure that it works well. Go to a few adult websites and make sure they're blocked. If you have monitoring enabled, check to see that it does what it's supposed to. If you've set a bedtime, then check yearly to make sure that the phone actually locks itself at bedtime.

Even if a filter's control panel claims that it's working, **the filter might not actually be working at all**. It's wise to test it yourself.

If you'd like to test the filter even further, try to visit one or two wikiHow articles with mature content. If the filter is really good, it might block them. I don't have high hopes.

Test your filter again periodically. At least once a year; preferably more often.

Retest after major operating-system or browser upgrades, and again whenever a supplemental browser (e.g. Firefox) is installed.

Filters are not foolproof. Many kids can bypass the filters without the parents knowing. But a filter may still be better than no filter.

# Background to my question

Google Chrome for Android includes a feature called incognito mode. This feature, when I activate it, is designed to help prevent Chrome from automatically remembering and storing information about which websites I've visited in the past.

To help protect myself, I've installed the free version of Qustodio (a Web filtering/monitoring app) on my Android device. Unfortunately, as soon as the user enters incognito mode, Qustodio for Android stops working.

What are my options? Well:

* I could try upgrading to Android 6 or higher, or to CyanogenMod 13 or higher, or could buy a device that ships with one of these OSes preinstalled. A support knowledge base article on the Qustodio website claims that, on these operating systems, Qustodio works fine even when incognito mode is active. But I suspect that this claim may be inaccurate. I don't know for sure. Please leave a comment below.
* I could do the following procedure:

1. Install the free version of NetAddictSoft plus the Brehm browser. Mr. Brehm's claims aren't all correct; in truth, there's an easy way to clear the Brehm browser's history. But the free version of NetAddictSoft claims to be able to monitor all use of the Brehm browser and email out weekly usage reports. (Note that, on most devices, NetAddictSoft can only monitor usage of the Brehm browser, and cannot monitor usage of Chrome or Firefox or any other browser.)
    2. Configure Smart App Lock or similar to prevent the use of other browsers. (Note: Smart App Lock isn't perfect, and it's possible to defeat it.)

I might do the above procedure, but: My device has an old Android version installed. For me to upgrade to a newer Android version, I'd have to switch to a third-party ROM, and this would be a hassle.

* I could spend money on a more-powerful filter, such as NetSpark or GenTech. But I'd rather not spend any money.
* I could contact Qustodio's support team and send in a bug report. But I hear they can't really help. The feature is experimental. (Source.) And it's been experimental for years now. It's not really fully supported.
* I could uninstall Qustodio, could install Norton Family, and could try Norton Family's incognito-detection feature. But I don't want to bother doing that either.
* I could look into why Qustodio doesn't work when incognito mode is active, then file a feature request with Google to ask them to fix the problem.
* I could sell my phone and buy an iPhone or iPad. They include built-in Web filtering. I don't know whether or not it's any good.
* I could sell my phone and switch to a phone without built-in Wi-Fi. Perhaps a Palm Treo or Centro or an old BlackBerry.

But I don't want to choose any of the above options.

# My question

On desktop OSes, I already know that it's possible to disable Google Chrome's incognito mode. But I also use Android. How can I disable Google Chrome's incognito mode on my Android device?

Please assume the following:

* I always run the latest version of Android.
* My device is owned and controlled by me. It is **not** administered by a Google Apps domain administrator at my workplace or my school. And so I cannot use the Google Apps admin console to disable incognito mode. (I also don't want to pay a fee in order to sign up for Google Apps for Work.)
* I am willing to root my device.

I thank Android.SE user Lucky for inspiring this question.

# Answer
> 1 votes
# Google Family Link

If you set Google Family Link to protect an Android device, it will automatically disable Google Chrome's incognito mode on that device. (Google says so in this article. I myself have tried Family Link and verified that the article is correct.)

Family Link can also do Web filtering, screen-time monitoring, and device-location tracking. But these features are optional; you may disable them if you wish.

The usual Family Link setup is as follows: One device (a computer or mobile device) is the "parent" device, and a second device is the "child" device. Incognito mode will only be disabled on the "child" device.

If you'd like to get started, you may set up a "parent" account now.

# It has quirks

Google Family Link has some quirks. I've described the biggest quirk I've noticed, and its workaround, in another thread.

I hope that Google will work on eliminating the quirks in the future.

Despite its quirks, Family Link works reasonably well already, and I think it's a good way to disable incognito mode.

# It may be easy to defeat

I'm not sure whether or not Family Link is easy for crafty children to defeat. But, in general, there are ways to defeat most parental-control software tools.

It's wise to buy your kids a flip phone with no data plan, and a non-portable computer which is permanently stored in a public room such as the living room. It's also wise to store all of your personal cellphones, laptops, and tablets in your bedroom at night, so that your kids can't secretly use them.

# Answer
> 4 votes
If you have rooted your phone, you can build and push a system ChromeCustomizations app. This installs a content provider which, among other things, allows disabling Incognito mode in Chrome.

This uses the officially-supported way that device manufacturers use in order to control the starting page and default bookmarks of Chrome on their devices.

# Answer
> 4 votes
You could try Incoquito \- it's a paid app and allows you to either automatically close all incognito tabs when the screen turns off or to disable incognito browsing altogether by preventing incognito tabs from being opened at all. It includes a monitoring mode as well as logging of events/activities related to incognito browsing in Chrome as well as the ability to hide the app from the launcher. It also includes the following experimental features (as requested by several parents):

* Log videos played within the YouTube app
* Uninstall detection & prevention
* Android settings guard
* Block access to YouTube app

Disclosure: I am the developer of Incoquito.

# Answer
> 1 votes
As explained by tealhill you can install NetAddictsoft and the NetAddict browser without incognito mode.

In NetAddictSoft, you can block any App and there is an option to forbid all the browsers excepted NetAddict Browser.

Disclosure: I am the developer of NetAddictSoft. http://netaddictsoft.com

# Answer
> 0 votes
I have just released a new app which blocks incognito tabs from Chrome, Incognito Away.

The Chrome tabs are blocked instantly, as soon as some tries to open it. You can also have a pop-up message appear when some does try and open an incognito tab, to serve as a helpful reminder or warning.

It also has Scheduled Blocking, meaning that you can choose to if you want, to have incognito tabs only blocked from 6PM to 9AM every day for example.

Additionally, there is an inbuilt feature to hide the app’s icon from the launcher, so that it’s harder for someone to remember or find that the app is installed.

Pairing Incognito Away, with those steps above, and a Web Filter like Qustodio would make it pretty rock solid in preventing one from browsing privately.

Note: I am the developer of Incognito Away. If you have any questions, feel free to get in touch :)

PS: I know there is already another accepted answer, but this app has some additional features which may be of benefit (as discussed above) :)

# Answer
> 0 votes
You could install Automate from Play Store and create a flow that looks for Incognito mode notification and automatically clicks it to close all Incognito tabs.

---
Tags: security, chrome-for-android, privacy, parental-control, content-filter
---


title: Find My Phone shows "No Active Devices"

text:
# Question
Title: Find My Phone shows "No Active Devices"
I have a Moto G5, running Android 8.1.0 (the latest available version for this device). I previously used "Find my phone" and it worked.

I had to factory reset my phone.

Recently I wanted to use Find my Phone again, but I noticed that when I went to google.com/android/find it shows "No Active Devices".

Luckily I found my phone, but I wanted to make sure it would be findable by find my phone so I walked through the steps at https://support.google.com/android/answer/3265955

Confusingly, the device is turned on, it's signed into a Google account, it's connected to both mobile data and wifi, it's visible on Google Play, it has Location turned on, and it has "Find My Device" turned on.

If I go to (on the phone) Settings \> Google \> Device Phone Number it says "no number available", but the device correctly shows up on the webpages when accessed on pc. Also, if I go to Settings \> System \> About Phone \> Status \> Sim Status I expect to see my phone number listed, but it says "unknown" for My Phone Number. If I open Contacts it correctly lists my number, although I had to add this. If I go to https://myaccount.google.com/phone it correctly shows my number, and that it has been verified. I'm not offered an option to re-verify it.

I have downloaded the android app "Find my device" to my phone, and the app will show my phone as an active device and will ring it.

What do I need to do to make sure my phone is shown as active in the "Find my Phone" webpage?

(I don't know what appropriate tags would be).

# Answer
I was able to install the app "Find My Device" to the phone. I then used the app to "secure my device". This caused my account to be signed out from the device. I had to sign back in. My device now appears in the Find My Device webpage.

This didn't fix any of the "phone number not available" settings, so I guess they're not relevant.
> 1 votes

---
Tags: factory-reset
---


title: Warning: [Video] Recording Failed

text:
# Question
Title: Warning: [Video] Recording Failed
I recently got a Samsung Galaxy S7 Edge, and was using it just fine. I imported all of my previous apps and app data and everything went smoothly.

Then, a few weeks later, I tried to record a video, and received the popup:

```
Warning: Recording Failed

```

This only happened with the video, and NOT with regular pictures (I could capture still images)

I've tried:

1. Taking out the microSD card
2. Formatting the SD card
3. Restarting the device
4. Clearing camera cache and data
5. Clearing system-wide cache partition
6. Factory data reset

Option 6) actually solved it, so I think it may be the cause of an app. What's going on?

# Answer
The culprit is probably an app that accidentally doesn't release a critical lock.

In my case, it was the Cortana app that was causing the issue. It has a setting for the "Hey Cortana" hotword in the app, which requires that the application grab the microphone lock. It seems like the app, when quit, never released the lock, and so the camera couldn't have access to the microphone (and couldn't record)

If you don't have Cortana, try scouring your app list for apps that will obtain a lock for (and have the possibility of keeping it across runs):

1. Microphone
2. Camera
3. Storage

P.S. I've also heard that this issue can be caused by interference from Smart Stay, but I've never had issues with it
> 1 votes

# Answer
this is because some app is locking your mic or camera. For example, if you have the Hue Disco app (which uses the mic to measure the music so that the Philips Hue lights can change) and then you try to load the Camera app to record a video, it will fail to record the video because the Hue Disco app is already using the mic. You can't have 2 apps using the same microphone at the same time.
> 1 votes

# Answer
On my galaxy S8+, I had to set options to High Performance for the video recording to work
> 0 votes

# Answer
This issue started happening to me after the June 2018 update. I'd restart the phone and for about a min, the video recording would work fine. Then suddenly stopped working. I have a microphone blocker app. I disabled that and recording started working again.
> 0 votes

# Answer
My new Galaxy S9+ worked great for the first two months then I also was unable to record video...still pictures only. I went into applications - permissions - microphone permissions - and turned ON and OFF microphone permissions on various apps. Luckily, I quickly found an app that had microphone permission ON and when I turned it OFF I was once again able to record video. Hope this helps.
> 0 votes

# Answer
I was having the same issue, the issue was with Sd card I think. I open the settings\>device maintenance\>storage\>sd card\> options at the upper right end\> unmount the sd card. After unmounting I waited a minute, then mount the sd card. I opened the camera app and start recording. This solves the problem for me.
> 0 votes

---
Tags: samsung, camera, samsung-galaxy-s-7-edge
---


# Question
Title: Does the use of Android One remove the risk of OEM spying?
China is forcing tourists to install text-stealing malware at its border.

Also, U.S. intelligence officials imply that Huawei, ZTE devices aren't safe for consumers (even in the West).

Some suggested avoiding Chinese phones:

> Consider a scenario where you may use a Hauwei or KTE phone to have a conversation with a friend or a work colleague. It could be a discussion about a business deal, a programming project you’re working on, or important business meetings. You could inadvertently pass along proprietary information to a foreign government without even realizing it.
>
> What global intelligence communities are hinting to the world is that there is enough evidence in their posession to warrant banning these phones from military bases and governments. Even if you don’t believe them, history has turned up enough wrongdoing by these companies to justify very real concern.
>
> **Avoiding phones made by Chinese manufacturers is a good start**.

Assuming the accusers are correct, does the use of Android One, as is done by some Xiaomi phones, reduce the risk of OEM spying on you, or is Android One irrelevant here?

(There is a difference between trusting an American company, like Google, subject to US laws and regulations, and trusting a Chinese OEM)

# Answer
> 3 votes
AndroidOne can lower risk of spying due to vendor's negligence or non-systematic action (e.g., one employee adds some spying code without anyone else in the company knowing about that). The more modifications are there, the more places to inject some malicious modification and the more employees to care about.

You might argue that the vendor is just replacing the code from Google, so this is exchange of one potentially risky part for another part with the same risk. However, I would assume that the code from Google (especially the AOSP parts) get much more scrutiny both internally (within the vendor) and externally (by phone vendors and others).

When talking about some backdoors intentionally added (and probably approved by the management), AndroidOne cannot protect you. It might be harder to find a suitable place, but there always will be some:

* There can be an additional app in AndroidOne. Nokia is known to add a controversial app for battery management. While this one is not known to be malicious, it shows that Android One can be less pure than you think.
* The phone vendor can add some hardware-based backdoor.
* The phone vendor can claim it is AndroidOne, while actually not fully being AndroidOne. This can be even obscured in some ways, so it is not noticable from the OTA update packages.

# Answer
> 5 votes
> You could inadvertently pass along proprietary information to a foreign government without even realizing it.

This holds true when a person is using non-Chinese communication or computing devices as well. Just because western economies are also democratic countries do not mean that those democratically elected governments or their intelligence agencies do not engage in the activities the Chinese national government and the Chinese companies are alleged with. Here, try this food for thought.

If you get hold of the book Permanent Record, its author mentioned one obvious but highly uncomfortable point: the internet, the computing and communication hardwares, and the softwares upon which the world runs at large are mostly US centric (whether developed in the US or by companies from the US), so it is natural for US govt and its agencies to make use of this monopoly for ends that may not necessarily be in public interest.

Let this be clear that this aggressive anti-China stance in technological matters is not precisely because of Chinese intrusive activities in civil and military affairs of the US and its nationals (this has been going on for a decade or more), but because China had the audacity and showed the capacity and the will to buy leading chipset and communication device manufacturers of the US, and China -- a non-Western, non-democratic, non-NATO country -- further frustrated the US by beating it in developing, testing, and marketing the 5G (the next revolution in communications that would bring unimaginable amount of data -- currency for tech companies and billions of dollars to a 5G leader's economy). If there continues to be demand for Chinese 5G products (either by individual consumers for cellphones or by telecom operators for 5G communication and relevant equipments) in the US, its national security would continue to be undermined1 by China, so it is natural for the US to create this anti-China fear among its people and beyond.

> Assuming the accusers are correct, does the use of Android One, as is done by some Xiaomi phones, reduce this risk, or is Android One irrelevant here?

1. If you do not have access to the source code of the software you are using;
2. If you cannot understand that source code in entirety;
3. If you do not have access to the blueprint (or whatever that is called) of the hardware you are using (including the software that is part of the hardware);
4. If you do not have the skills and the means to detect hardware vulnerabilities or backdoors;

than you cannot have absolute control over your device. You risk unwillingly giving away your private information to a party you may not even know. Everything than rests on trust (that you would not be harmed and the data not be collected involuntarily or misused) and the mitigating measures that you can undertake within the flexibility provided by the software and the hardware.

At last, if you want to stick with some western technological products, do it, but know that you are trusting one potential adversary with another. It is all the same if you are not from the western world.

1: FCC to vote to bar Huawei, ZTE from government subsidy program, sources say

---
Tags: security, huawei, malware, xiaomi, android-one
---


title: How do Android EMF detectors work?

text:
# Question
Title: How do Android EMF detectors work?
Searching the play store for `emf detector` shows a bunch of apps that can measure the electromagnetic radiation level and they do seem to somehow work.

What is the operating principle behind these apps and what kind of sensors are they using?

What level of accuracy these sensors provide and how do they compare to dedicated EMF detectors which sell online starting with ~$7?

In the Android docs I see: `SENSOR_TYPE_MAGNETOMETER`, `SENSOR_TYPE_MAGNETIC_FIELD` and `SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED` — can these possibly be used to measure EMF radiation levels and if so then which ranges are supported?

### Update:

# Answer
The question does not only apply to android phones, **but to all mobile devices**. Our mobile devices use EMF to communicate. Mobile phones are, by definition, devices that can detect EMF since their ability to communicate **depends on radiofrequency fluctuations in electromagnetic fields**. Our devices, especially smartphones, which are extremely reliant on internet services emit a huge amout of EMF radiation. That should imply that mobiles can precisely detect and manipulate EMF, right? No. Our phones are designed to **work with only specific frequencies, from about 800 to 2.2GHz**, so **it is quite unlikely that a mobile phone can detect general fluctuations in EMF**.
Now, the creator of the app might tell you that it uses magnetic sensor, and you might think that EMF can be detected using a magnetic sensor, since it is also (partly) a magnetic wave, but you cannot. EMF exists when a wave has both electric as well as magnetic parts.
> 1 votes

---
Tags: sensors
---


# Question
Title: Suddenly VOLTE not working on my moto g4 plus
I was using VOLTE services (from reliance jio in India) seamlessly since November 2016, but since June 2017 it suddenlt stopped working. I get an error "Unable to place call. Please try another method" while trying to make a call. I am able to access the internet and make/recieve calls from the Jio 4G Voice app.

**UPDATES:**

* I have enabled "enhanced 4G LTE mode"
* Did a factory reset
* My jio connection is on and working. Also, I can place/receive calls from the `Jio4GVioce` app which means the service is working fine.

# Answer
> 0 votes
Go to **Settings/Wireless and networks/...More/Cellular networks** and check whether **Enhanced 4G LTE mode** is enabled. Somebody (you) might have turned it off accidentally.

# Answer
> 0 votes
I also had the same problem

Steps:

* I tried to wipe partition, does not worked for VOLTE.
* Removed the JIO SIM from slot 1 and inserted on slot 2.
* then removed the JIO sim from slot 2 and inserted BSNL SIM in slot 1, BSNL works. Then remove the BSNL SIM & insert JIO SIM in slot 1.

Now VOLTE is working.

# Answer
> 0 votes
Your best bet is to **boot into safe mode** and then toggle Volte on and check if it works there.
**To (re)boot into safe mode:**
Press the Power key, then tap and hold on Power off, and then tap OK when Reboot to safe mode The Moto G4 will reboot and you should see Safe Mode in the bottom-left corner.

---
Tags: motorola-moto-g, voice-over-lte
---


title: Restrict data for google play services

text:
# Question
Title: Restrict data for google play services
Google play services consumes some data. Can I restrict data access to it. Does user experience compromised if I do. If yes what are they?

# Answer
> 2 votes
You can restrict apps from using data in several ways.

Android itself provides a built-in feature to restrict data for individual apps. It can be found at **Settings****Data Usage** → scroll down and select the app to restrict. You will find restrict background data option there. Select **Google Play Services** from there then restrict data.

As you mentioned that you need Google Play Services to be restricted, before going with this you should be aware about these.

* You cannot use Play Store with background data disabled, but you can still disable the automatic update feature in Google Play settings: go to **Settings****Accounts** → Disable sync.
* Turn off Google Maps offline caching in Maps settings.
* Use third-party apps like Onavo Count.

# Answer
> 1 votes
You **can** forcibly restrict Google Play Services data consumption however it will impact the **'seamlessness'** of your android experience. Google Play Services are responsible for keeping your android in sync with numerous Google services that you and your device uses.
Google Play Service is a background service that helps to integrate several APIs like Location API, Maps API, Play Protect, etc. and limiting/disabling data access will impact these services.
If you still want to proceed, you may use firewalls that work on non-rooted devices as well.

---
Tags: background-data
---


# Question
Title: Phone still stuck in a bootloop after flashing official firmware with Odin!
I *successfully* flashed a stock ROM on my Galaxy Note 4 using Odin 3.13.1 but, unfortunatelly, the bootloop is not gone.

**Device info**:

* SM-N910C
* unrooted
* Android 6.0.1 Marshmallow

**Bootloop sequence**: Samsung boot screen **—\>** Android is starting... Optimising Apps 2 of 2. **—\>** Android is starting... Starting apps. **—\>** LOOP

**What are my options to restore my personal data from now on?**

# Answer
> 1 votes
Hoping that you have not wiped your data while flashing firmware using Odin, the process of data retrieval can be variably difficult.
The best way I can think of is to **flash a custom recovery on your device** then **mount** desired partitions.
PS I have no information whether your phone is rooted or not, so just providing the most workable way.

---
Tags: samsung, rom-flashing, data-recovery, boot-loop, odin
---


# Question
Title: Disable "Unkown sources" setting in Android Oreo
In previous versions of Android one could go to Personal \> Security and there disable the Unknown sources setting in order to install freely APKs from unknown origins. In Androi Oreo this was changed and this field is no longer in the Settings. I looked everywhere and was unable to find it. So now, when my app tries to install another APK from an unreliable source, I get a Popup saying "Allow Google to regularly check device activity for security problems..." with a Decline and Accept options.

My question: imagine that I factory reset my Android Oreo device, is there a setting that I can set or a system property to modify that will prevent this anoying popup to appear? Does someone know how to disable its appereance?

PS: Please don't answer "just hit decline". That is not the answer I am looking for, nor a viable option.

# Answer
> 0 votes
In previous versions of Android, one could control the system-wide app installation from unknown sources, which saved time but was **risky**. Having refined control over settings makes your device more secure.
Moreover, the mechanism has now been shifted to **app-specific instead of system-wide**, that is you can now control app installation from particular apps.
In order to modify that, head to **settings and search for 'Unknown Sources', and you'll find Special App Permissions**. In order to always allow a specific app to install apps, toggle it **'allowed'**.

---
Tags: settings, 8.0-oreo, 8.1-oreo, unknown-sources
---


# Question
Title: How to call my own phone with a loud ringing tone (in order to find it in my house) even if it is in silent mode?
My phone (Samsung A3, Android 5) is nearly always in **silent mode** (for many reasons: work, or kids who should not be awakened by a ringing tone).

But sometimes I don't find my phone at home, and lose 10 minutes finding it!

A solution would be to call my phone from another phone (home phone)... but obviously this doesn't work since the phone is in silent mode!

* Is there a way to make one specific number **always** ringing loud? (even if the phone is in silent mode)
* Or is there an app such that my (lost-in-my-house) phone there could be called from another phone, or from a computer, **with a loud ringing tone**, even if the phone is in silent mode?

# Answer
> 15 votes
You can automate the process. Install Macrodroid on the old phone, open it and add a macro. Then follow the steps below:

1. In the Triggers tab, in the Call/SMS section, select "Call Incoming', then "Select Contact(s)". Choose your phone number.
2. In the Actions tab, in the Volume section, select "Volume Change". Give the appropriate permission to Macrodroid. Select "Volume Change", enable Ringer and set the volume percentage.
3. In the Constraints tab, in the Screen and Speaker section, select "Ringer Volume", then Silent.
4. Save the macro, give it a name.

# Answer
> 63 votes
You may consider using **Google's Find My Device (web version, app)**. I would not suggest a third-party app from unreliable sources (although you can't trust Google as well :p).

# Answer
> 8 votes
> Is there a way to make one specific number always ringing loud? (even if the phone is in silent mode)

Another solution could be that instead of putting the phone in silent mode, you can set the default ringtone to a silent audio file. Then, you can set a normal ringtone for the contact of the number you want to call from.

# Answer
> 6 votes
It is possible with Samsung Find My Mobile feature. Register here, and you'll be able to make loud sound even If your phone is in silent mode.

# Answer
> 4 votes
Another solution would be using Termux (my favourite app). In silimar cases, I can SSH to my phone from my computer, adjust volume with termux-volume, play some sound file with mpv, or activate the motor with termux-vibrate.

# Answer
> 3 votes
If your phone is connected to the Google account, you can use a computer to find your phone. It won't matter if the ringer is off.

You could also use Do Not Disturb mode at home instead and allow only calls from specific contacts (home phone, spouse's phone, kid's phone, etc.). It might be useful since you can still allow calls from only a couple of contacts that might only call in an emergency.

# Answer
> 3 votes
In addition to the app mentioned in Reddy Lutonadio's Answer, similar apps like Tasker or the popular IFTTT can also be used to achieve this.

IFTTT is probably the easiest to configure: Just activate the 'Turn up volume if a specific number calls' task and input your home phone number.

You could also use 'Send a text to unmute phone'. It's an extra step but the advantage here is that it works from any device, in case you also can't find your home phone.

# Answer
> 2 votes
If you have a Google Home device (normal, mini, etc.), you can use "hey Google, where's my phone?" and it will ring your phone. (I don't remember what setup you have to do in advance, but I use this all the time.)

If you have a Tile device paired with your phone, you can push and hold the button on the Tile and it will make your phone ring if it is within range. (Tile is a tracker that you attach onto something like your keys and install an app on your phone--then when you have lost your keys, you go into the phone app and ask the Tile to ring. But in this example it also works backwards, when you can find your Tile but can't find your phone.)

# Answer
> 2 votes
Just in case you don't want to use the "where's my phone" functionality, as suggested by the other answers, you could create a contacts entry for the phone you plan to call it from, and assign it a special ringtone and flag it as emergency/VIP/starred contact (whatever your phone model uses). If you enable VIP contacts to ignore DnD/silent mode, this could achieve the same functionality without relying on external services.

# Answer
> 1 votes
There's an app I've been using for years called "Where's My Droid". You text it a specific code (using the default or a optionally pre-configured code) from any number or a white-listed set of number(s) and it will ring loudly, vibrate and blink the flash.

It can also send you the phone's current GPS location. Send you a picture from both the front & rear facing cameras (so you can see who's absconded with your phone), and a whole host of features that I've never used.

\*Not associated with the company in any way, just a pleased user of the free version of the app.

# Answer
> 1 votes
I use the Lookout app. It's a security app that scans for viruses, provides location, wiping, locking and scream (the feature that the OP is looking for) functions as well.

http://www.lookout.com

# Answer
> 1 votes
I use an app (similar to Lookout mentioned above, but no Anti-virus) called Prey. The main goal of the app is to recover lost/stolen phones, but one of its features is to make noise when a certain phrase (e.g. "Wake up phone!") is received by SMS.

https://preyproject.com/

---
Tags: calls, silent-mode
---


# Question
Title: Is there a way to get a disk image of the user storage space on modern Android devices?
I want to know if it's possible to get a "disk image" of the storage space on Android devices when they don't use external storage like SD cards.

I'm mostly interested because my kids factory reset my Kindle Fire HDX and I was hoping I could get a disk image (using something like dd in Linux) and then try to recover some of the user data like photos and videos (using something like PhotoRec, http://www.cgsecurity.org/wiki/PhotoRec). I've done this lots of times with SD cards and hard disks by simply mounting the storage device in a desktop running Debian, and executing something like:

```
# dd if=/dev/sdb1 of=image.iso

```

Then you can use PhotoRec and/or TestDisk, depending on what you want, to get useful stuff out of the image file.

Even some of my very old Android devices seem to allow mounting a storage device in this way (without removing SD card from the phone) and following this process. Unfortunately, it looks like many new devices that don't have removable storage (like my Kindle Fire HDX and my Nexus 5) only allow you to interface with a computer using Media Transfer Protocol (MTP) and Picture Transfer Protocol (PTP).

Can I use these protocols to get a bit-by-bit copy of the storage in the device? Is there a way to add the older storage device capabilities to new phones?

# Answer
> 7 votes
After doing some more research, I think I've found a partial solution here:

http://forum.xda-developers.com/showthread.php?t=2450045

* First, you need to get ADB set up on your computer. In Linux it's pretty easy. Something like running `# apt-get install android-tools-adb` or downloading and extracting a directory.
* Find your partitions. Run something like: `adb shell` `cat /proc/partitions` There are other options in the link for how to find and identify all the partitions.
* Copy the data The dd tool should be available. You can run something like `dd if=/dev/block/mmcblk0p9 of=/sdcard/image.img`

Unfortunately, I have two problems with this. The first is that the permissions on partition devices might require root access. The second is that the Kindle Fire HDX and many other modern devices that don't have "USB Mass Storage" also don't use SD cards. So there is no easy location to write the image you want that isn't already used for something else on the device.

I'm trying to find a way to mount network devices or transfer data over USB between the device and computer (adb push and adb pull won't do what's needed as far as I can tell). I'll update this if I can find a good solution. Otherwise I'll ask some other questions about it.

Edit: This page has a great description along the lines of what I have above: http://www.df.lth.se/~jokke/androidfilerecovery/

As noted below, root is necessary, but there are usually lots of ways to get that easily. Unfortunately, I was working with the Fire HDX 8.9. Halfway through my copying data to an image file, the thing auto downloads an update to 4.1.1. Next thing I know, root access disappears and I don't think there's an exploit out for it yet. I probably lost any recoverable data after the update was written to the internal storage anyway. I'm so frustrated with Amazon lately...

# Answer
> 5 votes
Joshua pretty much answered the question. However, Izzy gave extra insight to tackle them odd/rare variations of the same problem.

I would like to contribute (my first contribution post in over 10 years) for those who would stumble into the very same scenario as I did. Anyways, 24 hours later, with persistent and determination, the following command will shed some light (assuming you've intermediate/advanced skills already).

Btw, I won't be explaining it, as the command itself is pretty obvious.

```
adb shell "dd if=/dev/block/mmcblk0p37 of=/dev/pts/0" > part37-img-dump.dd

```

These are the tools I used to get the job done.

```
C:\HTCOneRoot\
 |--\adb.exe (version 1.0.31 21/05/2013, latest was buggy)
 |--\fastboot.exe (version fc2a139a55f5-android 24/04/2016)
 |--\AdbWinApi.dll
 |--\AdbWinUSBApi.dll
 |--\part37-img-dump.dd (output from the 'adb' command)

```

> **Note:**
>
> > 1. *dd* will output stats to *stdout* after completion (BusyBox related)
> > 2. find a tool to trim the unwanted offsets at the EOF (not a must to do)
> > 3. mount the image using the preferred data recovery software or whatever
> > 4. */dev/pts/0* should work straight up, but if you happen to be running multiple adb shell command from multiple console/terminal, then be careful of the dev pointer ref number as it will be different. By using the following command, you can simply figure out which one: pts:0, pts:1, ...
> > > ```
> > > adb shell "ps -l"
> > >
> > > ```

# Answer
> -1 votes
This line: `adb pull /Dev/block/device-by-name/userdata data.img` should work. I didn't test it out but should be close. This would pull the whole image which you could flash or maybe push later in the process of restoring. It only works if you're rooted. I won't work when you aren't. Permissions error. I am guessing if you did fastboot with TWRP and not rooted, if you get decrypt working, you can copy the image that way. I am avoiding rooting right now. Seems to be more stable with Android 10

---
Tags: internal-storage, recovery-mode
---


# Question
Title: Galaxy S6 - Can't unlock phone after factory reset
I just got a new Galaxy S9 to replace my 3-year-old Galaxy S6 and I will be giving it to my mother so I did a Factory Reset to my Galaxy S6. To my surprise, doing a factory reset didn't actually delete everything from the phone so I went into recovery mode and did a "Wipe data/factory reset" from there.

After restarting the phone and connecting to a WiFi network I'm asked to enter my Samsung Account, which I did, but I can't get past this screen! When I click on the "Sign In" button this is what happens:

The dialogs disappear and nothing happens. If I put a wrong password it tells me the password is wrong but when entering the correct one I can't get past this. I tried doing a factory reset again, unlocking the device from my Samsung account (which fails because it says remote access is not enabled or something like that) and even removing the device from my Samsung account. I also tried multiple methods that you can find online to bypass this but none of them work on Android 7 (Nougat).

I don't know what else to do, my device is just unusable now.

# Answer
> 0 votes
Ok, I finally got a solution to my problem, this is obviously a Samsung bug in their software because I can't unlock my phone with the legitimate Android account. The following method works for unlocking any Samsung phone which is good and, at the same time, bad because a skilled enough thief can unlock your phone (although he won't have access to the data because the phone must be wiped).

1. Download Miracle Box, at this time 2.58 is the latest version.
2. Put your phone in Download Mode and connect it to the PC.
3. Open Miracle Box and go to the Samsung tab.
4. Select the `Reset Reactivation/EE Locks` and click `Start Button` and wait for it to finish.
5. Your phone won't boot now, download a stock Samsung ROM with the same version as you had. I had Nougat so I have to download that, don't try a lower version because the bootloader won't allow you to flash it.
6. Use ODIN to flash the new stock ROM.
7. You should be able to boot your phone normally without entering the Samsung account.

If you think this is too much for you give UnlockJunky a try. It was going to be my last resource.

---
Tags: samsung, locked-out, samsung-galaxy-s-6, accounts
---


title: (Semi) permanently disable touch input

text:
# Question
Title: (Semi) permanently disable touch input
I own a Samsung Galaxy S4 (GT-I9515L "jfvelte") running Lineage OS 16. It has a broken touchscreen which register random "ghost" touches.

I'm able to use it with the help of a USB mouse. To disable the touchscreen I use `adb` to open a shell on `/dev/input` and remove `event3`, which disables the touchscreen (renaming or moving the file doesn't work, only removing it) - until reboot.

How do I keep it disabled even after reboot? Preferably, I'd like a way that I can enable it later if I ever want to.

# Answer
> 1 votes
Turn's out there's `init.sh` support on Lineage (content of `/etc/init.d/90userinit`):

```
#!/system/bin/sh
# call userinit.sh if present in /data/local

if [ -e /data/local/userinit.sh ];
then
   log -p i -t userinit "Executing /data/local/userinit.sh";
   /system/bin/sh /data/local/userinit.sh;
   setprop lineage.userinit.active 1;
fi;

```

So I wrote a bash script that removes the `/dev/input/event3` on boot, thus It disabling touch input on boot time:

`/data/local/userinit.sh`:

```
#!/system/bin/sh
rm /dev/input/event3

```

If I ever need to re-enable touch input, I can simply remove the bash script.

---
Tags: adb, lineageos, touchscreen
---


# Question
Title: How to restore original android OS and remove cyanogenmod?
My situation is that I downloaded cyanogenmod and liked it. I then performed a factory reset and wipe data off of my phone. When a restart my phone, I no longer have google play store installed or any of the stock google apps for that matter.

What has gone wrong and how do I restore everything back to the stock version of android?(the way it was when I didn't have cyanogenmod and just the plain old android OS)

My phone was a Sony Xperia Z. It is running on android 5.1.1.

# Answer
Instead of trying to head back, why not flash GAPPS (Google Apps suite) if there's nothing wrong with CM itself? Get appropriate GAPPS for your Android version at opengapps.org.
> 1 votes

# Answer
As discussed by @Andy Yan, you can download an appropriate GApps suite and flash it from the link that he has provided. If you still want to revert to stock, grab a stock firmware file from here https://xperiastockrom.com/sony-xperia-z-c6603 or from XDA and flash it using a flash tool.
> 0 votes

---
Tags: cyanogenmod
---


# Question
Title: Why do I need to confirm my phone number to send a group SMS?
I am using the Android Messages app to send an SMS to more than one person at a time. I get prompted with a message that "Messages needs your phone number" and a button labelled "Fix". I then get this dialog:

I have two questions:

* Why does Android Messages need my phone number? Doesn't it know it already? Will I have to change it later if I change SIM card? I don't get this prompt when sending an SMS message to one person.
* Is Android Messages doing something other than sending normal SMS messages here?

I'm using Android 6 and the latest version of Android Messages from the Play store.

# Answer
Had the same problem, I know my phone number is on my SIM because enabling DSDS and toggling on eSIM displayed my phone number under the right carrier. I turned this all off, but at least I knew my SIM wasn't messed up.

I used dialing code `*#*#4636#*#*` to look at Phone Information. Even this menu showed my phone number as unknown!

I used the ellipsis menu on the Phone Information screen to Select Radio Band and set it to United States, which seemed to kick the connection to my carrier and now my phone number is showing up and messages doesn't nag.
> 0 votes

---
Tags: sms
---


# Question
Title: How to extend screen on a secondary monitor in Android-x86?
I'm looking for a way to get two **separate** (i.e. "Extended" or split) display outputs on my Android x86 setup.

It appears that I need to modify the content of `/grub/menu.lst` file, but every guide that I have found instructs the user to either clone (i.e. "duplicate" or mirror) the displays, or worse, it instructs the user to entirely disable the internal LVDS display. This is not what I want.

What I want is to simply have a separate output for each of my displays (two 1920x1080 monitors using HDMI.) This is something that is available on many Linux distros and even Windows.

Is what I want even possible on Android x86 at the moment?

# Answer
A quick check of android-x86.org shows at the bottom:

> **Development (2019/10)**
>
> **What we are working on now**
>
> * Android 10 (Q release) porting (q-x86 branch)
> * Upgrade kernel to 4.19 or newer
> * OpenGL ES hardware acceleration for intel/radeon/nvidia/amdgpu (pstglia, mauro) and virgl(robh) GPUs.
> * HDMI audio (cwhuang)
> * LineageOS integration (jjm)
> * Hardware accelerated codecs
>
> **To-Do List**
>
> * Multiple displays support
> * Better power management
> * Miracast

So the feature **Multiple display support** is on the **To-Do List** and probably dependent on OpenGL ES hardware acceleration efforts.

So as of 2019-10 the feature you want isn't available.
> 4 votes

# Answer
This feature is not yet available. You could instead switch between your screens by adding `video=LVDS-1:d` to your grub configuration file.
> 1 votes

---
Tags: screen, lineageos, external-display
---


# Question
Title: Establishing MTP connection for Android Studio
I am trying to connect an Android device to my PC in order to use it to test an app created with Android Studio. After connecting the device, I don't get the usual USB connection notification on my device and nothing shows up in my PC's file manager either.

I tried using both my Honor 5x (Android 6) and Nexus 9 (Android 7) as well as Windows 10 and Elementary OS and multiple ports/USB cables. On the Nexus 9, I enabled the developer options and set the connection mode to MTP.

Is there something obvious I'm missing?

# Answer
Android Studio needs a device connected in ADB not MTP, though MTP can be activated with no effect.

On the device:

* Open the Developer options
* Enable USB debugging.
* You need to install drivers for the device to get detected by the PC.

On the PC, Android Studio:

* **Alt + F10** should open a window showing your device connected

Then you'll be able to test apps build with Android Studio
> 0 votes

# Answer
Have you turned on the Developer Mode ON on your Android device, and allowed USB Debugging; and does your PC have proper device drivers installed? Check whether ADB is working or not. If the problem persists then you need to uninstall everything and reinstall things in the sequence required, like first installing Java, and then ADB, and then Android Studio, and then setting up your Android Device as developer mode with USB Debugging allowed.
> 0 votes

---
Tags: usb-debugging, mtp
---


# Question
Title: Notifications are very delayed on android - but only sometimes (apparently FIXED)
I searched for my problem but what I found either wasn't answered or was very old response and maybe things have changed since then...

I just got a Samsung Galaxy S8 and it's amazing, but maybe since yesterday notifications are a bit slow. I just answered and email that I got an hour ago from my computer while my phone still didn't show the notification. I got some test messages and again, they showed up but only after I opened up gmail app and refreshed it.

What might help find the answer - right now I'm spending most of the time on my computer when I have gmail website opened (for hangouts) and thunderbird for emails. However the days before I was mostly outside with my laptop either turned off of inactive.

Btw, I had a similar issue with the old phone (also android) but I just blamed it being 4 years old and acting up.

So what could be the possible issue? Some kind of setting on my phone? Possible network changes? (I changed cities in those days, maybe the network here sucks and phone tries to use it instead of wifi... I'm just looking for options here). Or is it just the fact that I have gmail / thunderbird opened?

Thanks in advance.

# Answer
I looked around with more settings and a lot of online research and eventually I found this link:

https://support.google.com/mail/answer/1075549?co=GENIE.Platform%3DiOS&hl=en

Apparently what I really had to do was go to gmail app -\> settings -\> my account name below notifications there's item "inbox - sound and vibration" Turn "Notify about every message"

And that decreased the delay from hours (or never getting notifications) to 10 minutes maximum, with average time being 5 minutes.

I still don't know why this option would be off by default, seems like a very important thing. I am posting this in case someone else will have this problem.
> 0 votes

# Answer
You could try to exclude Gmail app from the battery optimization setting: Go to Settings → Battery (or Power Manager) → select Battery optimization → search for Gmail and set as not optimizing battery use. This process might be different on newer versions of Android, I am using Marshmallow (Android 6).

And also in the new version of Gmail has a feature for notifying only for important messages and maybe it's turned on.
> 0 votes

---
Tags: notifications, 7.0-nougat
---


# Question
Title: How to remove someone's google account off my phone when asked to verify
We are going through custody battles atm, and I allowed my child to take her phone to her mother's, in case she needed me or felt unsafe. Her mom took the phone, removed my google account, added hers and make it to where it needs to verify the account before I can make any changes. So now she can control all the parental locks, send messages when she shouldn't be, ect. How can I remove her account and replace mine since they are my phones to begin with?

# Answer
What you're basically trying to do is unlock the device to re-establish control and that will be done first through Google's "find my device" and is that doesn't work just unlock the device through factory reset and use FRP bypass if you need to!
> 0 votes

# Answer
Go to settings, accounts, Google, select the account to remove, tap 3 dot menu, select remove account. U maybe asked to enter device's pin or pattern. The process may be different in different versions of Android
> 0 votes

---
Tags: google-account, google, 2-step-verification
---


# Question
Title: Running older Android apps on Android Pie
I have Samsung Galaxy J9 running on Android 9 Pie. I bought Grapher Pro from the Play Store and installed it. When I tried to run it, a message was shown:

> This apk was built for an older version of Android.

Because of this, I refunded it.

Is there any way to run such apps? The free version doesn't show the issue though.

# Answer
You may try to change the target Android version of the app using APK Editor and change the API version. But it most likely won't work for paid apps. Instead, you can try to run the app in a virtual machine in which an older version of Android is installed. See VMOS Virtual Root Android on Android-Double System.
> 1 votes

---
Tags: applications, 9.0-pie
---


# Question
Title: How can I boot into TWRP from LineageOS Recovery?
My phone is in bootloop. It keeps booting to TWRP Recovery. I want to trouble shoot this. How can I boot into TWRP to do this?

# Answer
To boot into TWRP from LineageOS Recovery, from LineageOS Recovery

* Click Advanced
* Click Reboot to Bootloader

Jump to the console on your machine, and run

```
fastboot boot twrp-*.img

```

That'll get you into TWRP from LineageOS Recovery.
> 4 votes

---
Tags: recovery-mode, twrp, boot-loop, lineageos
---


# Question
Title: Make new notifications beep every 5 minutes?
When a new message arrives, my phone lights up the screen for 2 seconds and plays a notification sound.

If you miss it, you'll never know that you have new messages, unless you turn on the screen.

Is there any way to make it beep every 5 minutes or so?

# Answer
For others reading this:

I found the option to do this hidden under `Accessibility / Advanced Settings / Notification reminders` on my Samsung.

(not the best place to put it, if you ask me)
> 1 votes

---
Tags: notifications, 9.0-pie, alerts
---