# Question
Title: Install a fully functional Audible app on Android older than Android 6.0
I just bought a Samsung Galaxy S5 Mini, featuring Android 5.1. However, I cannot install the "Audible" audiobook app via Google Play (no search results).

I know that this should work, as I have the exact same device (bought earlier) where Audible is running (automatic app updates are switched off)

I tried downloading an older version (Audible-2.16.1) from www.apkmirror.com (not sure if the website is trustworthy) and installed it manually using ADB and USB debugging. The app kind of worked. At least I could log in and see my audiobooks. However, when trying to download any of the books, I get error messages.

I assume that the app tries to connect to the wrong (old) server when downloading.

Does anybody else have similar problems and knows how to get Audible going on older devices?

# Answer
**Audible 3.0.1 (APK Mirror) is the latest version that supports Android 4.1+** before it jumped to requiring a minimum Android version of Android 6.0.

---

Some additional clarifications to the question:

1. Since Audible 3.1.0 (March 25, 2021), the minimum Android version jumped to Android 6.0. This affects the app's visibility in the Play Store since *incompatible apps will not be shown when searching directly from the app*.
2. The major version jump from 2.x to 3.x possibly indicates a breaking change including on the backend server-side, thus *Audible apps before 3.0.0 might not work properly anymore*.
3. Last but not least, APK Mirror is considered trustworthy.
> 2 votes

---
Tags: android-versions, compatibility, audible
---


# Question
Title: Set android as internet gateway to local router (Not mobile hotspot)
**Background**

I have a local network and I want to have my mobile serve as an internet gateway when entering the network.

What I'm asking is asked here, here and here. An advanced version has also been asked here but all of them have no answers leading me to a conclusion this might not be possible. With this post, trying to list down what I tried, problems faced so as to open a discussion for a possible solution to this problem. Have tried this with relatively recent android 9, 10 and 11.

**Some obvious steps**

* Have static IP for the mobile which will serve as a gateway.
* Setup router to use the gateway.

**Problems**

* Android connects to wifi and gives a warning that access point doesn't have internet access. We can switch to mobile data but the local network is inaccessible as wifi is disconnected. Changing to always use mobile data in developer options also behaves the same.
* Let's suppose android is used as gateway and other devices are able to access internet, how will the device access local network? A probable solution is to make a middleware that decides to send packets to internet or intranet, or perhaps use internet as a fallback. I'm pretty sure mobile will need to be rooted for this kind of control. Is there anything developed which can be used directly?

# Answer
> 3 votes
With some help from the answers by *@Irfan Latif* linked in the comment and here, and by examining the output of `iptables -L` and `iptables -t nat -L` in various scenarios like Hotspot, BT tethering, USB tethering etc., I managed to write a script that helps me to share my mobile data connection to the local Wi-Fi network by using a static IP for the phone, and setting it as the gateway in the Wi-Fi router or in individual devices.

Here is the script I wrote, it must be run in a root shell or by prefixing `su -c`:

```
#!/bin/sh

echo "(Re-)creating iptables NAT and Forward rules..."
for i in 0 1 2 3 4 5 6 7 8 9 10 ; do
        iptables -t nat -D POSTROUTING -o rmnet_data$i -j MASQUERADE
        iptables -t nat -I POSTROUTING -o rmnet_data$i -j MASQUERADE

        iptables -D FORWARD -i rmnet_data$i -o wlan0 -m state --state RELATED,ESTABLISHED
        iptables -D FORWARD -i rmnet_data$i -o wlan0 -j ACCEPT
        iptables -D FORWARD -i wlan0 -o rmnet_data$i -j ACCEPT
        #iptables -D FORWARD -i wlan0 -o rmnet_data$i -m state --state INVALID -j DROP

        iptables -I FORWARD -i rmnet_data$i -o wlan0 -m state --state RELATED,ESTABLISHED
        iptables -I FORWARD -i rmnet_data$i -o wlan0 -j ACCEPT
        iptables -I FORWARD -i wlan0 -o rmnet_data$i -j ACCEPT
        #iptables -I FORWARD -i wlan0 -o rmnet_data$i -m state --state INVALID -j DROP
done

echo "Enabling forwarding for wlan and rmnet_data interfaces..."
echo 1 >/proc/sys/net/ipv4/conf/wlan0/forwarding
echo 1 >/proc/sys/net/ipv6/conf/wlan0/forwarding
for i in 0 1 2 3 4 5 6 7 8 9 10 ; do
        echo 1 >/proc/sys/net/ipv4/conf/rmnet_data$i/forwarding
        echo 1 >/proc/sys/net/ipv6/conf/rmnet_data$i/forwarding
done

echo "Emptying the main route table..."
ip route flush table main

echo "Copying rmnet_data interface routes to main table..."
IFS=$'\n'; for i in $(
        ip route show table all |
        grep "table rmnet_data" |
        grep -v "expires" |
        sed -Er 's/table rmnet_data[0-9]* /table main /g'
); do
        eval "ip route add $i"
done

echo "Copying wifi interface routes to main table (except default)..."
ip route del default table wlan0
IFS=$'\n'; for i in $( ip route show table wlan0 | grep -vE 'expires|default' ); do
        eval "ip route add $i table main"
done

echo "Replacing lookup routes for main table..."
while ip rule del from all lookup main ; do "" ; done 2>/dev/null
ip rule add lookup main

echo "Clearing routing cache..."
ip route flush cache

```

(I don't usually write shell scripts, so some things might not be the best here )

---

Some notes and assumptions:

1. I have only tested this on a rooted **Android 10** phone running MIUI 12, not sure if it works for others.
2. In the Developer options of the phone, I have the ***Mobile data always active*** setting switched on, to prevent turning off mobile data when Wi-Fi is connected.
3. I've written the script such that I am also able to continue **accessing devices on the local Wi-Fi network** while acting as a gateway. The icon in the status bar might wrongly indicate that Wi-Fi is being used for internet, however it can be verified in a browser, that mobile data is being used for internet.
4. The changes done by this script are **not permanent**. When Wi-Fi or mobile data disconnects or if USB tethering / Wi-Fi hotspot / BT tethering is toggled, some of the above changes are removed by Android and the script has to be run again. This can be automated using apps like Automate / Tasker.
5. **Mobile data interfaces:** In the output of `ip addr`, I see that my (dual-SIM Qualcomm modem) phone has 11 interfaces named `rmnet_data0..10` and 9 interfaces named `r_rmnet_data0..8`. I wasn't sure which one is responsible for mobile data. On toggling airplane mode on/off multiple times, I saw that `r_rmnet_data` never gets assigned an address but the phone randomly picks 2 interfaces from the 11 `rmnet_data` interfaces and assigns an IPv4 and v6 address to them (I guess SIM 1 uses the first 5, and SIM 2 uses the rest 5 but I'm not sure).
For the sake of simplicity, I decided to enable forwarding for all the interfaces. The names of interfaces might vary for different devices, so the `for` loops in the above script will need to be adjusted/removed accordingly.
6. The name of the **Wi-Fi interface** was `wlan0` on my phone. It might be different for others, and hence will need to be adjusted in the above script.
7. **Wrong data usage counters:** The data usage counters in Android settings might not show any account of the mobile data used by Wi-Fi devices in this manner, or the total data usage counter might not match with the sum of data usage counts of all apps. I believe this can be fixed by using the `tetherctrl_FORWARD` chain instead of `FORWARD` to make it count this usage as mobile hotspots, but am yet to try this out.
8. Although I have enabled forwarding for **IPv6** in the above script, I have not been able to find out how to either propogate the delegated prefix to devices on the local Wi-Fi network or use the phone as an IPv6 NAT gateway (not even sure if Android supports this). I'm currently happy with just IPv4, so I might not update the script for IPv6, unless someone is interested (comment please).
9. **Battery drain:** The battery of the phone drains considerably when using it as a gateway with the above script, just as it does while using Wi-Fi hotspot.

---
Tags: wi-fi, networking, wifi-tethering, router, gateway
---


# Question
Title: Can I rename the external storage mount point on Android10 with root access
**System**: rooted Samsung Galaxy S10 with Android10

I have replaced my old external sdcard (128GB) with a new and bigger one (512GB). The old card was automaticly mounted to `/storage/6639-3031`. The new card is mounted to: `/storage/9C33-6BBD`. Since I have a lot of configured appz that use custom paths pointed to `/storage/6639-3031/somesubfolder` I would like to change the new id: `9C33-6BBD` back to the old one `6639-3031` system wide.

Since there is no fstab in Android responsible for this and I cannot find **where this id's are stored in Android**, maybe some experts here can help me? It seems like a simple problem but I did not find the solution yet.

Some clues I already found:

1. Android equivalent of /etc/fstab?
2. Remount FUSE partition

Once I have found where this external sdcard id is stored, **can I just change the id** (I have **root**)?

**Will it be stay changed after reboot**?

# Answer
As far as I remember the mount point name is taken from the volume serial number of the SD-card (which is generated when the volume is formatted).

This means you don't have to make changes to your Android system at all. You should be able to edit this ID e.g. using a hex editor on a PC or a rooted Android phone. There are also special editor for changing the volume serial number.

The Volume serial number is stored as little-endian integer value on the header of the volume (that means the four nibbles of the number are stored in reversed order).

Directly modifying it using a hex editor is theoretically possible, but the problem is that the contained sector is protected by a checksum. There is a Python script that seems to allow to calculate the correct checksum (more info can be found here).

Additionally the volume serial number is contained twice in the volume, first in the master boot sector directly at the beginning and then a second time some KB afterwards. If you just modify the volume serial number of the master and the backup sector the volume becomes defect and can't be mounted anymore. Also Windows `chkdsk` can not correct the error.

For Windows there is the Sysinternals utility program VolumeId, which can modify the VolumeID of a volume. **Unfortunately it does not work with not exFAT volumes**, it can only handle FAT16/32 and NTFS volumes.

For Windows there are some tools available which can modify the volume serial number of an exFAT volume:
> 1 votes

---
Tags: external-sd, file-system, mount, android-10
---


title: Emulate vanila Android-arm64 on PC

text:
# Question
Title: Emulate vanila Android-arm64 on PC
I need to examine how the ELF binary (which is compiled for ARM processor) executes on Android-arm64. Can you please suggest how I can emulate Android-arm64 on the x86 system?

I have checked Android studio, but it seems that it only runs a single application but not the whole Android system.

# Answer
> I have checked Android studio, but it seems that it only runs a single application but not the whole Android system.

You are mistaken. The Android emulator in Android Studio creates and runs an entire virtual Android device. It's set up to make it particularly easy to do this with an app that you're developing in Android Studio, but that is not all of what it can do.
> 1 votes

---
Tags: vanilla-android, aosp, arm-processors
---


# Question
Title: Limit the phone to small list of whitelisted apps only (parental control)
Is there a built-in way on Android 9 phones to limit the access to **only a list of specific apps** (for my child)?

Example:

* Phone app
* Camera app
* One or two games
* *No access to Chrome*
* *No access to Facebook*

Is it possible with Android 9's built-in tools, and no third party apps? (or in case an app is needed, I'm looking for a free app without ads)

# Answer
> 0 votes
You can try Google Family Link App which gives a reasonable informed control over multiple devices.

---
Tags: applications, parental-control
---


title: Flash custom ROM via EDL

text:
# Question
Title: Flash custom ROM via EDL
I trying to find any way to flash custom ROM or some images on locked bootloader via EDL (device is Xiaomi Redmi Note 3 Pro, kenzo). I downloaded stock developer fastboot-EDL ROM and modified recovery.img to custom recovery, but when I boot phone, it's reboots again, and I see stock recovery (system partition was bricked). I saw KEYMASTER, CMNLIB and SEC partitions stores some secure-boot hashes. Any way to skip boot verifying? (locked bootloader, EDL, XiaoMiFlash 2017)

# Answer
I recommend you to unlock your phone first. Then use Fastboot to install TWRP and then install your own ROM. To unlock your phone, go to mi.com and sign up a new account then enter it into your phone and unlock it by mi unlock app: https://en.miui.com/unlock/ or https://mega.nz/file/xeQ3GRgQ#DpaEfaUSZZFBCQ6HOitWgQu9EMIl4q\_XM8-eChUusbY
> 0 votes

---
Tags: custom-roms, xiaomi
---


# Question
Title: How to disable the automatic saving of *any* wireless networks?
With wifi settings in Android:

I know that you can disable "auto-connect" for a specific network.

I know that you can "forget" a specific network once Android has automatically added it to its list of "saved networks."

But is there a way to completely turn off the automatic adding/saving behavior so that it never saves any network?

I find it annoying (because, "Hey, I didn't tell you to do that!" and also a potential privacy problem -- using wifi monitoring tools, people can see what networks your phone is trying to connect to, and thus, what networks you have been connected to in the past.

# Answer
> 0 votes
Any Device has to remember wifi credentials because if the signal fluctuates/disconnects, they need to reconnect. It would be far more annoying to enter credentials every time the signal is lost than to "Forget" once when you don't need it.

---
Tags: wi-fi
---


# Question
Title: Phone is not working and in fastboot device is showing as "???????????? fastboot"
I have a realme 2 pro and I wanted to revert it back to stock rom. I had orangefox recovery installed at the time. I tried flashing an ozip file for the device and just call it my stupidity but I the flashed that file as system image and because of that not device is not booting anymore. Both the system and recovery are inaccessible and the device when is fastboot mode shows as "???????????? fastboot". I tried to flash an recover image from fastboot but it game the folling error. FAILED (Write to device failed (no link)) Can anyone suggest what I can do to fix it?

# Answer
> 0 votes
1. try twrp+magisk+patch if it had bootloader unlocked
2. take it to service centre - they can restore stock rom for free

---
Tags: rom-flashing, recovery-mode, fastboot, boot-loop, unbricking
---


# Question
Title: How to install Another Term, an alternative to Termux for Android 6.0 and below?
I am running a lower Android version and need to install a Linux proot container in Android. Another Term is the closest alternative, but how do I install it? It seems pretty hard.

# Answer
> 3 votes
1. First, read the readme of AnotherTerm GitHub repo and this

You can run the stock `install-linuxcontainers.sh` you downloaded from the Git repo without tweaks for an automatic install. It gave me errors, that's why I did this Q&A style question to write the tutorial on how I got it to run on my old tablet.

Download Another Term from Play Store. If the Play Store version does not work, then go here and try previous versions that work on your device and issue the bug.

2. Know yor phone architecture
3. Download run-tpl (after downloading, make sure it has no extension), installshellscript (the file must be like `install-linuxcontainers.sh`), proot-android.tar.gz (download both if your architecture has 2 gunzips), and minitar.

As for the `rootfs.tar.xz`, google search `images.linuxcontainers.org` and enter. Upon entering, select Distro, then release.

For architectures, if your phone architecture is arm7-a, select "armhf", and if arm8-a, select "arm64". The same applies to i386 and amd64.

Then select default, then choose any build date you want, and then select `rootfs.tar.xz`, then the file will start downloading. After downloading all the files, download Simple HTTP Server app from the Play Store or any webserver app to host the files.

Copy or move `minitar`, `rootfs.tar.xz`, `proot.tar.gz`, and `run-tpl` to `/android/data/com.phlox.simpleserver/files`

Open the app and start the server. Launch your browser and go to your IP address and port specified in the app. On Chrome or whatever browser, long press to copy the download link address (if using a desktop right click) then go and edit the `install-linuxcontainers.sh` using a text editor and replace all URLs beginning which are like this `http://192.168.43.239:8080` and replace them with corresponding download URLs which you copy from your browser. If your ip local ip is 0.0.0.0 then the url should look like `http://0.0.0.0:8080` .Make sure that all URLs have been replaced by your own URLs you copied from the browser and save the script.

**Final Step**

Install and open Another Term and click the + icon on top, name the shell profile and save (I did not edit anything).

Stop the webserver in the app

Start on the profile to start the terminal. Maybe you will notice too small or too big font, but you will change the font settings later. Tap on the keyboard icon (top-right leftmost icon) to switch to your default keyboard.

```
u0_a176@goyave3g:/data/data/green_green_avk.anotherterm.oldgood $ cd /storage/emulated/0/Download
u0_a176@goyave3g:/storage/emulated/0/Download $ ./install-linuxcontainers.sh Debian Buster

Installation subdir name proots/___ [linuxcontainers-Debian-Buster]:
Actual name: kgktk

To uninstall: run `rm -rf "$DATA_DIR/proots/kgktk"'

Creating favorites...
Done.

Arch: armv7a
Variant: -pre5
Root FS: Debian Buster

Source: http://192.168.43.239:8080/rootfs.tar.xz

Getting minitar...
failed to connect to /192.168.43.239 (port 8080): connect failed: ECONNREFUSED (Connection refused)

```

Type your fake random directory name and enter.

Profile pop-ups will appear, but quit both and tap OK and Exit and you will return to the shell.

As you can see above, the variant shows "-pre5". If it's not, you are good to go. But if it's "-pre5", you must start the webserver, go to the browser, copy the download link of `prootpre5.tar.gz`, go and edit install shell script replacing the `proot.tar.gz` link with the new pre5 one, then save the script.

Don't stop the webserver.

The second Run:

```

u0_a176@goyave3g:/data/data/green_green_avk.anotherterm.oldgood $ cd /storage/emulated/0/Download
u0_a176@goyave3g:/storage/emulated/0/Download $ ./install-linuxcontainers.sh Debian Buster

Installation subdir name proots/___ [linuxcontainers-Debian-Buster]: Buster

Actual name: Buster

To uninstall: run `rm -rf "$DATA_DIR/proots/Buster"'

Creating favorites...
Done.

Arch: armv7a
Variant: -pre5
Root FS: Debian Buster

Source: http://192.168.43.239:8080/rootfs.tar.xz

Getting minitar...
Getting PRoot...
Getting Linux root FS...

/etc/passwd:
=======
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:104:105::/nonexistent:/usr/sbin/nologin
=======
Regular user name [my_acct]: my_acct
Preferred shell [/bin/bash]: /bin/bash

Setting up run script...
Configuring...

Done!

u0_a176@goyave3g:/storage/emulated/0/Download $

```

Now we are going for the last time. Start the `./install-linuxcontainers.sh`, type your distro and release as shown above.

Now, type the real subdirectory name of your pr choice. In my case, I chose to type Buster. This time, save & exit the two pop-up profiles. After saving, you will come back to the terminal and notice rootfs downloading progress. After that, you will be asked to type user and shell preferred, type the ones inside the \[\] brackets and enter, and you will notice it done.

Quit this shell by tapping back then long-pressing on it, and click terminate then confirm the termination. Tap on any of the shell profiles you save before name; Buster and Buster (Root) in my case and welcome to Debian, I mean your chosen distro.

By the way, I am in no way part of this project, but I'm just a Linux newbie who has found an amazing project he was searching for for quite a long time.

Shoutout to the devs for this amazing app.

Useful Screen shots:

**EDIT:**

For new android versions the script has been updated and no need to use the edited script and method except maybe if you want to have a backup of the files needed wenr you want a clean container. For "very old android versions" (e.g 4.4.4 range and maybe 5.0.0) you cam use this script because there is an error in old versions.

# Answer
> 0 votes
You can also choose a bit simpler way...

## Prerequisites

## The process

* Create a "local" profile with the "execute" field left set by default and launch it.
* `$TERMSH pick .` to put the aforementioned `wget` by an Android file picker into the `$DATA_DIR`.
* Create the `$DATA_DIR/certs` directory and put your up-to-date certs into it.
* Fix your favorite installation script by replacing all the `$TERMSH cat / copy / etc` HTTPS stuff with appropriate `wget --ca-directory="$DATA_DIR/certs" ...`

## PS

I will create a ready-to-use script a bit later...

---
Tags: 4.4-kitkat, 4.0-ice-cream-sandwich, installation, terminal, termux
---


title: How do I get a stable LineageOS build?

text:
# Question
Title: How do I get a stable LineageOS build?
It seems like all LineageOS builds are marked as nightly, which makes it impossible to pick out more stable builds from the not-so-stable ones.

How do I find a stable build? Is there a plan to mark some builds as stable, or make snapshots as CyanogenMod used to? Should I hold off before moving to LineageOS until those appear?

# Answer
> 1 votes
**On LineageOS, there is no "stable" build, but despite the naming, "nightly" builds are considered stable.**

There was a discussion on Reddit, Why are all downloads of type "nightly"? where it was revealed that that is just how LineageOS went with the naming since it is always built from the latest commit automatically (i.e. "nightly"). An official answer by a mod of the subreddit said,

> LineageOS is a "rolling release" software. It means that new builds are continuosly produced (every week for each device since it takes a long time to get through all the devices builds without abusing the hardware) and there's no "stable" / "recommend" release.
>
> All our official builds are meant to guarantee you the hardware will be working (from 15.1 onwards this is enforced, but most 14.1 builds should be fine too).

Another reply by user 'goosnarrggh' also explained the distinction from CyanogenMod's nightlies,

> As you correctly inferred, the nightlies are produced automatically using the most recent commit on the currently-supported branch of development for each component of the OS. That's all that officially exists. Despite the word "nightly", however, each device receives a build once per week (all things being equal) due to limited build hardware resources.
>
> Every device listed with downloads from LineageOS's website does have an active maintainer, and those devices do provide a minimally complete functionality ~~as spelled out~~ in an informal process that will be formalized soon through the project's charter. However, bugs can and do crop up occasionally from one build to the next; sometimes they're device-specific and sometimes (but more rarely) they may be project-wide.
>
> In LineageOS's predecessor, CyanogenMod, there used to be a distinction drawn between the bleeding edge of development, "nightlies" and feature-frozen builds which had been manually judged to be of adequate stability, labeled as "snapshots". The snapshot builds would have been proposed for points in the OS's development in which the feature set was considered reasonably functional, and then each device which was demonstrated to be in proper working order would receive a build based on that snapshot. LineageOS has not continued this practice; at least in part, this is due to the demands that workflow would have imposed on the project's volunteer maintainers.

This is unlike CyanogenMod which has "snapshots" for stable builds, where "nightly" can be considered unstable.

---
Tags: custom-roms, lineageos, builds
---


# Question
Title: How can I disable the official YouTube app's incognito mode?
# Preface: A warning for parents

If you want to protect your kids, disabling Incognito mode is usually not enough. If your kids are under age 13, it's wise to use a good filter to block the YouTube app and website altogether. You can then switch them to YouTube Kids.

To prevent late-night video viewing, and to avoid the late-night reluctant messaging problem: At night, you can take away your kid's laptop. And you can configure a bedtime for her phone and tablet. This will also make it harder for her to secretly use Facebook and games overnight.

# Background

The official YouTube app for Android includes an feature called "Incognito mode". I'd like to prevent myself from using this mode, in order to discourage myself from viewing risqué content.

I'm logged into a Google Family Link "child account". Family Link has automatically disabled Chrome's incognito mode. Unfortunately, the YouTube app's incognito mode still works fine.

My phone is not rooted. Please assume that, if necessary, I'm willing to root it.

# My options

I assume my options include:

* To downgrade to an older version of the YouTube app, from before the feature was rolled out.
* To disable the app altogether. (If I still want to watch YouTube, my only remaining options will then be to use a web browser or a third-party YouTube client app. The website works quite well in both Chrome and Firefox Mobile. Maybe some of the third-party apps work equally well; I haven't yet tried many of them.)
* Or to contact the Family Link team with an enhancement request.

# My question

Do I have any options other than the three options mentioned above? For example, can you offer me some instructions for modifying the decompressed YouTube .apk file contents, or can you suggest some other options?

# Answer
> 0 votes
Same situation as yours, but one idea click on my mind. I have one temporary solution:

1. With the help of Family Link app, incognito is disabled in Google Chrome and Google Search app.
2. using Family Link, block the original YouTube app so that your child/brother can't use original YouTube app.
3. With help of Chrome, open YouTube website, and install YouTube icon using "add to home screen" option present in Chrome. In this YouTube, no incognito option is there, so our motive is complete to safe monitoring of YouTube.
4. Instruct your brother/son to use this app for YouTube.

Another option may be paid apps.

---
Tags: security, privacy, youtube, parental-control, content-filter
---


# Question
Title: Gmail app not sending Email with attachments
I have a lot of images I want to send from my phone to an email. I had in the past some error messages about emails being too big, so this time I sent in most emails 3 pics, which all queued in the `outbox`, and about 3 emails got through after a while. But now I have more than a day 20 emails in the `outbox` and it seems that nothing is happening. So my questions are:

1. Whats going wrong?
2. Is there anything I can do? (beside sending via BT to a computer, and email from there)

I have tried:

* Leaving the phone with open Wi-Fi connection all night
* Rebooting the phone (and leave another night with Wi-Fi)
* Checked at google's documentation and found out that they're limit is 25 MB per mail

Random info that might be relevant:

1. All mails are going to the same person with the same subject, and no body - gmail could be blocking them because a misuse is suspected.
2. I can surf the web as usual through the browser. No connection problems.
3. Each image is about 3MB, so each mail has a total of 9 MB.
4. There is exactly one email that has 4 images in it - not the first in the list.
5. First email in the list has only 2 images (both smaller that 2.9 MB)
6. I get notified about new emails I get.

# Answer
> 0 votes
I have the same problem, I think also for emails without attachments. The solution is to open the respective email. When I open it (by tapping on it in the `Outbox`), it gets sent within a few seconds (the caption goes from "Queued" to "Sending" to "Sent" or something like that within seconds).

---
Tags: samsung-galaxy-s-2, gmail
---


# Question
Title: can I push 'hanging' sending email in gmail outbox?
I sent out three (big emails - 6 pictures from my mobile camera) very quickly one after each other. Now after 10 or so minutes they are still in the gmail outbox folder. I experienced the same when I was connected via both wireless or mobile network.

**Can I somehow push the emails to be sent out?** I tried to open them and send again but it didn't help.

Last time this happened I deleted them and sent out slowly one after each other again and it went ok.

HTC Desire 2.1

# Answer
> 3 votes
This problem is a known bug in Android 2.1 (don't know if it is still present in newer versions). There is not much that you can do except being careful not to send too big emails. From my experience, it will eventually be sent but it can take up to a day.

Be careful because it will block all the emails you sent after the large one! It seems they need to be sent in the order they were created.

A solution to this problem is to use the Dropbox application, to upload your pictures to Dropbox, to "long press" on the filename, then "Share..." and "Share a link" by email to your recipients. This will only send a link by email so the message will not block as it does with large files.

# Answer
> 0 votes
I have the same problem, I think also for emails without attachments. The solution is to open the respective email. When I open it (by tapping on it in the `Outbox`), it gets sent within a few seconds (the caption goes from "Queued" to "Sending" to "Sent" or something like that within seconds).

---
Tags: htc-desire, gmail
---


# Question
Title: Why can't ARMv8a applications run on ARMv7a?
I have an ARMv7a device and I am not able to install ARMv8a applications. But I am able to install ARMv7a + ARMv8a applications.

How am I able to install ARMv7a + ARMv8a and ARMv7a but not ARMv8a applications?

# Answer
## Basics

Applications that are entirely built from Java or Kotlin code, including all the libraries and SDKs they use, *don't care* about which of armv7a and armv8a a device supports. However, quite a few apps include "native code", aka "machine code", usually compiled from C or C++ code using the Android Native Development Kit ("NDK").

A given piece of machine code is either 32-bit (armv7a) or 64-bit (armv8a). It *cannot* be both.

## Running native code

Applications that support both armv7a and armv8a have *two sets* of machine code included in their APK files:

* One set for armv7a
* One set for armv8a

Your armv7a device can happily run the code that's intended for it. It can understand that, and has the libraries and other software it needs to run it. It can't understand armv8a code at all, and is thus unable to run it. Applications that only support armv8a thus can't be run, so Android prevents you from installing them. If it let you install them, you'd waste data and storage finding out that they crashed when run.

## Forthcoming complexities

The ARMv9 architecture Is gradually appearing in Android devices. The Qualcomm Snapdragon 8 Gen 1 was one of the first v9 chips announced, in November 2021. Most ARMv9 cores can't run armv7a code, because they don't implement that 32-bit instruction set (or any other). The 2023 generation of new core designs from ARM is the first with *no cores at all* that can run armv7a code. They *can* run armv8a code.

This means that devices with ARMv9 processors:

* Can run apps that support armv7a and armv8a.
* Can run apps that only support armv8a.
* Can't run apps that only support armv7a.

It's a good thing that Google have been demanding that new and updated apps for the Play Store include armv8a code since August 2019 if they include *any* native code.

If and when the Android NDK acquires an option to build for armv9a, such code won't run on armv7a or armv8a devices. I presume that Google will require APKs with armv9a code to provide armv8a code as well, at least for a few years.

### Why is there any armv7a machine code in use?

Android has quite a long history, and when it started, neither armv7a nor armv8a had been standardised. So there's been a gradual process of upgrading native code to newer standards.

In more detail, the original NDK in June 2009 only supported "armeabi" machine code, using the ARMv5TE instruction set. Armv7a was added in June 2010, x86 in June 2011 and MIPS in May 2012. Armv8a, along with 64-bit x86 and MIPS was added in July 2014. Armeabi, MIPS and MIPS64 were removed in June 2018.

Someone starting on Android NDK work today would support armv7a and armv8a, or maybe only armv8a if they were only interested in newer, faster devices, or their app needed to use *lots* of memory.

There have been a few Android devices that had 64-bit processors and a 64-bit Android kernel, but didn't have 64-bit Java/Kotlin run-times. The one I encountered was a 2017 model of the Amazon Kindle Fire HD 10, which is now discontinued. I bought it for the 64-bit Android 5, and the lack of 64-bit Java run-times was no problem for the native code I needed to test in the ADB shell.

The main benefit of 64-bit Java/Kotlin run-times is that they allow apps running on them to access more memory. This is only significant on devices with at least 4GB of RAM, so providing those run-times on devices with smaller memories has little value. As of 2023, 4GB seems to be becoming the standard for new low-end Android devices.
> 6 votes

# Answer
Regarding the SoC:

* ARMv7 SoC =\> 32-bit
* ARMv8 SoC =\> 32-bit + 64-bit both

Regarding the app:

* ARMv7a + ARMv8a packages =\> it has both ARMv7a and v8a binaries of that app bundled, so it installs the 32-bit version (ARMv7a) of the package if the device has an ARMv7 SoC or the 64-bit version if the device has an ARMv8 SoC.
* ARMv7a packages =\> it only has 32-bit binaries, installable on both ARMv7 and v8 chips.
* ARMv8a packages =\> it only has ARMv8a installable binaries, so if the device is 32-bit, the app package simply won't install.
> 1 votes

---
Tags: applications, arm-processors
---


# Question
Title: Can Sensors Off (developer options) be controlled via ADB?
Can Sensors Off (developer options) introduced in Android 10 be controlled via ADB?

Haven't got it from AOSP sources yet: Sensors Off | Android Open Source Project

# Answer
First of all, thanks to @irfan-latif for providing the right answer to this question in the comments column. But apparently, this will be allowed. So, I will help complete the answer.

On Android 10:

```
service call sensor_privacy 4 i32 1

service call sensor_privacy 4 i32 0

```

On Android 11:

```
service call sensor_privacy 4 i32 1

service call sensor_privacy 4 i32 0

```

On Android 12:

```
service call sensor_privacy 8 i32 1

service call sensor_privacy 8 i32 0

```

On Android 12L:

```
service call sensor_privacy 8 i32 1

service call sensor_privacy 8 i32 0

```

On Android 13:

```
service call sensor_privacy 9 i32 1

service call sensor_privacy 9 i32 0

```

Else, the above command does not produce anything, you can search for ISensorPrivacyManager Interface in Android Code Search according to the revised version of your Android device\[2\] (Hint: the number on the back is the revision number.). Then, change the sequence number of the Method in which setSensorPrivacy() resides.

\[2\]: getprop | grep ro.vendor\_dlkm.build.id
> 1 votes

---
Tags: adb, developer-options, sensors
---


# Question
Title: For Android devices, is internal storage memory typically faster, slower, or equal to microSD card storage?
For Android devices, is internal storage memory typically faster, slower, or equal to microSD card storage?

For example, let's take the Samsung Galaxy S10 Android phone. It comes in 128GB, 512GB, and 1TB storage configurations. It also has a single microSD card slot.

The cost difference between the different tiers of integrated storage is slightly more than cost of a comparable microSD card, but not a big difference.

Which will result in better performance: An Android device with only integrated storage, or one with an equivalent amount of storage in the form of integrated storage + a quality microSD card?

# Answer
The internal flash is usually way faster than an SD-card. In your example, the Samsung Galaxy S10 uses UFS 2.1 storage for interfacing with the internal flash chip.

UFS 2.1 for the 1TB storage configuration you can expect in reality about (maximum values):

* 1000 MB/sec sequential write speed
* 260 MB/sec sequential write speed
* 50000-58000 IOPS

If you try to get a micro SD-card, there are a few that are as fast as the internal storage, but they use the UHS-II standard or newer (max ~620 MB/sec). For UHS-II, the micro SD-card reader in the phone needs additional contact points, but only recent high-end phones have such a reader integrated (I have read that the Samsung Note 10 released 2019 was the first Samsung phone to have such a reader).

Another problem of micro SD-cards is their size. The faster cards require a lot of CPU speed of the CPU integrated in the card. Because of the small size the card is very limited regarding dispensing the created heat. If you for example use such a micro SD-card in a PC card reader the micro SD card is getting hot very fast and then starts throttling the read/write speed.

But development of UFS also does not stop. Just recently, UFS 4.0 has been announced which can reach transfer speeds that are common for NMVe SSDs in a PC (up to 5GB/sec).

Therefore, for most micro SD cards, I would expect that speed of a combined set-up of integrated storage + a quality microSD will not be faster that the internal flash chip alone. Because of the latency of the micro SD-card, it might be even slower (but that may depend on the used phone and the micro SD-card).
> 2 votes

---
Tags: internal-storage, sd-card, storage, performance, adoptable-storage
---


# Question
Title: Delete older device contact backups on Google
Google has a feature to restore contacts that can be accessed from Settings - Google - Set up & restore - Restore contacts. This screen shows "Google Contacts" and "Device backup".

I want to delete older device backups.

I can't seem to find out online anywhere that is specific to this issue.

# Answer
> 2 votes
Follow these steps:

1. Go to Google Contacts.
2. Sign in the account where you want to delete old contacts.
3. Choose contact(s) by 'check mark sign' before contacts name.
4. Click 'more' from above drop down menu, there you'll get delete option.

It's done.

**In case you have two different Google accounts added to device** and one is having your old contacts then you can disable syncing of contacts of that particular account without deleting contacts.

Go to Settings and search for 'Google account' in search tab, or alternatively, open **Settings → Cloud and accounts/accounts → click Google**

There you will see list of all connected Google accounts. Now, simply click the account you want to disable auto syncing of any particular option, such as contacts.

# Answer
> 1 votes
I know your question is 3 years old now but I had more or less the same problem of not knowing where they were.The backups are stored in Google Drive under storage (see this for how to get at them) and once you delete them there than your contacts backup is deleted too. I hope this helps.

---
Tags: contacts, backup, google, google-contacts
---


# Question
Title: Where are notes stored on Xiaomi devices?
The screen of my phone is dead, and I would like to find the notes I have on my phone.

I use a SD card. I found a folder on the SD card named `com.miui.notes` with a folder named `files` inside of it.

But this folder is empty although I had a few notes created on my phone.

How do I find them?

# Answer
> 2 votes
Notes are stored in SQLite database `/data/user/0/com.miui.notes/databases/note.db` and therefore the file is not accessible to user without root.
You can find your notes in Mi Cloud if MIUI account is allowed to sync.

---
Tags: internal-storage, xiaomi, notes
---


# Question
Title: How do I switch between keyboards if accessibility button is displayed in bottom-right corner?
In the rightmost area of the navigation bar, button for fast switching between keyboard apps (e. g. SwiftKey and Hacker Keyboard) is visible when a keyboard is open. But if accessibility button is displayed in that area, original keyboard switching button is always suppressed.

What is the fastest way to switch between keyboard-providing apps in such a case?

# Answer
> 2 votes
I have the same question. So far I have found two answers but neither are as elegant as having the dedicated keyboard switch button. I'm using a Samsung S10e on Android 12.

1. you can install the Keyboard Switcher app by Kunzisoft. It offers a few different keyboard switching options. A floating button is one option, but alternatively you can choose to include a button in the notifications area. It works well and is accessible from any app at anytime. Just display notifications by pulling down from the top of the screen and you will see the keyboard switcher. Click it to change keyboards.
2. The other option (which may only be available in Android 12), is you can change the accessibility icon on the navigation bar to a floating button instead of the little man and your keyboard button will return to the lower right corner. To convert the little man to a floating button, go to 'Settings'\>'Accessibility'\>'Advanced Settings'\>'Accessibility button'. Choose floating over apps instead of navigation bar.

Both solutions work but neither are as tidy as I would like. I'll update my post if I find something else.

---
Tags: samsung, keyboard, accessibility
---


# Question
Title: Can I make NFC payments using Google Pay while in airplane mode?
Can I make NFC payments using Google Pay while in airplane mode, like when I don't have cell phone or wifi service (particularly when travelling)?

# Answer
> 2 votes
The payment system of Google Pay uses tokens for non-online/non-website payments:

> Google Pay does not send merchants their customers' actual card numbers when they pay in stores; instead, Google Pay facilitates a process called tokenization in which a token stands in for a customer’s actual credit and debit card numbers.

As far as I know Google Pay stores a limited number of prepared tokens in the app so that you can pay without the necessity of data transmission by the phone if you want to pay something. But if these prepared tokens are used-up you need an online-connection for making the next payment.

> 1. Customer tokenizes card: A customer adds their card to Google Pay. Then, their mobile device stores a payment token that is encrypted using a limited / single-use key.
> 2. Merchant receives token: When the customer taps their device on an NFC-enabled terminal at the store’s point-of-sale, the device sends the token, token expiry date, and cryptogram to the terminal via the NFC protocol.

https://support.google.com/pay/merchants/answer/6345242

---
Tags: nfc, airplane-mode, google-pay
---


# Question
Title: MTP changes with Android 12 update on Pixel 5?
I have a Google Pixel 5 that recently updated to Android 12.

Since then, it has not been able to connect to my Debian 11 Linux desktop to transfer files in the usual way.

The "usual way" is, I have USB debugging enabled, connect the device to the computer by USB, select "Use USB for" -\> "File Transfer" in the USB Preferences dialog that's available from the notifications. Then on the linux desktop, I do `jmtpfs` and transfer files. (This is a command-line operation.)

This is no longer working. The `jmtpfs` invocation reports:

```
$ jmptfs /mnt/android
Device 0 (VID=18d1 and PID=4ee2) is a Google Inc Nexus/Pixel (MTP+ADB).
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
  what():  Can't open device
Aborted

```

If I change the selection away from "File Transfer / Android Auto" in the USB prefs, I just get `No mtp devices found`.

I also have an `mtp-detect` tool, which reports the same error:

```
$ mtp-detect
libmtp version: 1.1.17

Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee2) is a Google Inc Nexus/Pixel (MTP+ADB).
   Found 1 device(s):
   Google Inc: Nexus/Pixel (MTP+ADB) (18d1:4ee2) @ bus 2, dev 92
Attempting to connect device(s)
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0

```

I *can* use the `adb` tool. `adb devices` reports the device ID and "device", and `adb pull /path/to/file destination` works, so it is still *possible* to do the file operations I want to do, but I'm mystified by the change in behavior.

This activity is kind of irregular, so I can't *prove* it was the Android 12 update that caused it, there have also been routine package updates on the desktop, but the Android update seems like the logical suspect, given that Debian package updates rarely cause breakage.

The fact that adb works suggests the fundamentals (hardware, cables, device detection, Linux drivers) are probably OK.

Maybe some kind of extra layer of MTP permissions in Android 12? A change in the MTP protocol that's gotten ahead of the Linux command-line tools?

Any help greatly appreciated.

Android build is #SP2A.220505.002.

`jmtpfs` is the Debian-11 packaged version, and reports:

```
$ jmtpfs --version
jmtpfs version: 0.5
FUSE library version: 2.9.9
fusermount3 version: 3.10.3
using FUSE kernel interface version 7.19

```

`mtp-detect` is from the Debian-11 `mtp-tools` package, version 1.1.17-3.

# Answer
While this doesn't explain why jmtpfs is having trouble or how to fix them, let's for a moment assume that's an XY problem and tackle the real one: How can you properly mount your phone so it is accessible in the Linux file system?

As you state that `adb pull` and `adb push` are working fine, the first option coming to mind is using **adbfs** – which is what I do successfully for about 10 years now and am quite happy with. *adbfs* sits on top of ADB and utilizes ADB pull/push for file transfers plus other ADB commands (e.g. `adb shell ls`) for other background information. It works reliably and stable, is transparent to the entire system (so you can access the device from the command line as well as from GUI applications), plus transfers are much faster than via MTP.

For setup etc. please refer to my answers here, here and here. An advanced setup for multiple devices connected at the same time plus integration with Midnight Commander you can find in my answer here.
> 1 votes

---
Tags: adb, linux, mtp, google-pixel, android-12
---


# Question
Title: How do I toggle grayscale in Android 11?
In Android 10 I had grayscale display turned on. This was achieved by dragging editing the dropdown shade to add the Grayscale tile.

I just updated to Android 11. The display is still in grayscale, but the Grayscale tile is removed, so there doesn't seem to be any way to turn it off! I sometimes want to when using the camera, but then switch back to grayscale for day-to-day use. How can I toggle grayscale in Android 11? Moreover, is there a quick way to do so? The old way (pre-Android 10) involved turning on developer mode and changing a deeply embedded developer setting.

---

**EDIT**: There is a new Bedtime Mode tile. When I turned it on and off, color was restored. Turning bedtime mode on goes into grayscale, but also sets Do Not Disturb. So I can turn on grayscale only be entering bedtime mode and then turning *off* Do Not Disturb. This is less than ideal. Also, bedtime mode only lasts till the following morning. Is there a way to either (a) recover turning on grayscale *without* bedtime, or (b) change bedtime mode to last until turned off?

# Answer
> 2 votes
Actually you can **schedule** and **customize** the **Bedtime mode**.
If you long press the Bedtime mode tile, it'll open the Bedtime mode screen.

1. In the schedule option, select all the days and in the time select **00.00** to **23.59**, so as to keep it on almost the whole day(max. possible time - 23hrs 59 mins a day).
2. If you tap the **Customize** option, you can see a way to turn off the DND mode.

That's it, done! Now you can simply tap the **Bedtime** tile and it'll remain on

Once you've done this, you need not turn off DNS, while enabling Bedtime mode, as it's customized now.

---

A small point: Bedtime mode turns off an hour before if you've set an alarm, say you set an alarm at 5.00 a.m. Then, the screen turns back colorful at 4.00 a.m. And if you set an alarm daily at that time, schedule bedtime from say, 5.05 to 5.04 or so

# Answer
> 1 votes
This guy in reddit has a great approach: https://www.reddit.com/r/GooglePixel/comments/9w4xc8/easy\_toggle\_between\_monochrome\_and\_color\_display/

He shares that the Accessibility feature in Android has the ability to easily toggle monochrome in Android 11, even if there's no shortcut available from the pull-down menu. On my Pixel 3, I go to Settings, Accessibility, look for Color Correction, and turn that on to get black and white. Then scrolling down in the Color Correction menu, under Options, select "Color correction shortcut" to either swipe up with two fingers to toggle between monochrome and color, or hold both volume buttons. Enjoy!

# Answer
> 1 votes
You can turn on grayscale permanently from the developer options. Go to settings -\> about phone -\> software information -\> click on build number repeatedly until you unlock developer options. Then go back into settings -\> developer options and find "simulate color space" under hardware accelerated rendering. You can choose monochromancy there and it will greyscale your phone everywhere without turning off or relying on bedtime mode.

# Answer
> 1 votes
Going along with the first answer **@19aksh**

You can an add a quick toggle.

So when it's clicked, it just goes into greyscale only, leaving out the no audio and time restraints.

This is a Xiaomi Redmi 10, Android 11

# Answer
> 0 votes
Try this app.. https://play.google.com/store/apps/details?id=com.vegardit.grayswitch
Grant it the write secure settings permission through adb and change the settings accordingly.

And if you don't want to use a 3rd party app then try these commands..

```
  adb shell settings list secure (if not in this then try the other 2)
  adb shell settings list system
  adb shell settings list global

```

and see if there is a option of grayscale. If there is then.. `adb shell settings put global <name> 0` to disable and `1` to enable back.

---
Tags: android-11
---


title: Wifi connects disconnects on android

text:
# Question
Title: Wifi connects disconnects on android
I have android device with stock android(moto edge 20). Whenever the wifi signal(router) are weak the wifi disconnects. This problem is frequent when my device is connect to a Bluetooth device. This problem mostly occurs when wifi signal is weak and I am doing some internet heavy task, like watching 1080p YouTube video, as the buffering starts the wifi disconnects. I have tried this on many device and the problem is only coming with phones with stock android and not with phones which have some other custom skin.

Stock Android devices I have test this issue with are,

* Moto Edge 20
* Moto One Fusion Plus
* Asus Max Pro M1
* Xiaomi Mi M1

With all these devices I am facing the same issue. I have also tried this with Realme Narzo 30 5g and Samsung M51 and for both of these devices there is no such problem.

Can anybody give a fix for this?

# Answer
I assume you refer to a personal mobile hotspot rather than a router.

You could try Settings \> Connections \> Mobile Hotspot\> changing the AP band to 5.0Ghz.
> 0 votes

---
Tags: wi-fi, networking, stock-android, motorola
---


# Question
Title: Unlock bootloader or flash TWRP with EDL on Xiaomi Redmi Note 3 Pro (kenzo)
I have a Xiaomi Redmi Note 3 Pro (kenzo) phone with a locked bootloader. Earlier, I unlocked this, but I do this with an easy switcher tumbler "OEM-unlock", so I flashed TWRP, custom ROMs, etc. After this, I flashed one more official MIUI ROM (Android 5.1), and the bootloader was locked.

I tried `fastboot oem unlock`, `fastboot flashing unlock` and other commands to unlock. I unlocked with Mi unlock and many attempts to unlock. Then I flashed the official Android 6.0 ROM with EDL, but when I tried to replace the stock `recovery.img` to TWRP recovery (yes, I renamed the file to `recovery.img`), I still see the stock recovery.

I also unpacked `boot.img` in EDL ROM and replaced `ro.secureboot.devicelock=1` to `ro.secureboot.devicelock=0`, but when I flashed it, it doesn't boot (fastboot only).

How can I unlock the bootloader or flash TWRP with EDL?

# Answer
> 1 votes
I find a way to unlock device without waiting. You need to: Mi Account and SIM-card with same number, that registred in Mi-account. Then, you need to link account to device (in internet much of instructions). Then the main step: download another version of Mi Unlock 5.5.0224.55, and unlock with this version. It do next steps: bypass the unlock time, unlock without getting any keys/tokens.

---
Tags: rom-flashing, twrp, xiaomi, bootloader-lock
---


# Question
Title: How to determine if device supports 802.11ac?
How to I determine if an Android device supports 802.11ac (5Gz WiFi)?

# Answer
Check CPU Info's Hardware tab, item "WiFi 5Ghz".
> 1 votes

# Answer
goto Settings - WiFi - show available networks. if you see 2.4G/5G your device supports it
> 0 votes

---
Tags: wi-fi
---


# Question
Title: Backup Pixel 3 before erasing phone with TWRP
I am attempting to take a recovery/backup of a Pixel 3 using TWRP. I do not need to flash TWRP, just boot from it to perform the backup. Meaning, I don't care if TWRP is installed permanently.

The problem I am running into is that I need to unlock the bootloader before I can boot TWRP. And if I unlock the bootloader, the data on the device will be erased.

**My question is:** If I unlock the bootloader, will I be able to boot back into fastboot mode, and thus boot into TWRP, before the erasure occurs? And if to, how do I perform this? (I presume that if I hold the volume down button it will before rebooting it will go back into fastboot mode.)

*I am trying to obtain a backup of the phone before the erase script is activated.*

I have searched around and have not been able to resolve this question as of yet.

Thanks in advance for any assistance provided.

# Answer
> 1 votes
This appears to be the answer to my question:

Pixel 3 (blueline) immediately wipes the data partition upon unlocking the bootloader. It appears there is no way to boot it back into fastboot before erasure occurs.

---
Tags: twrp, fastboot, bootloader, google-pixel-3
---


# Question
Title: How to install Google Play Services without through Play Store in Redmi 3?
A bunch of my apps ask me to install Google Play Services but my Play Store won't start since the service is missing.

# Answer
> 0 votes
Just install Google Play Services from a trusted website. You can download it from apkmirror.com, but it is important to choose the right version for your smartphone. Read the minimum Android version and architecture (arm/arm64/x86).

After that you need to install the APK. Well, sometimes the Play Services don't work after the installation.

In my experience, it's caused when the Android doesn't have Google Services Framework, Google Contacts Sync, and Google Account Manager app. If your phone doesn't have all the Google apps (usually with MOD ROM or MIUI ROM) you have to install them first. Just find them on the website I mentioned above.

# Answer
> 0 votes
You have to install it from third party sources. Such as

* Aurora store. fdroid link Open source and uses googles APIs to download apps from google.
* or you can use this site to download play service. Evoji

---
Tags: google-play-store, google-play-services
---


# Question
Title: How can I do adb backup without a visible screen?
I need to repair my Android phone (it is Jiayu G4 with Android 4.0.2) since its display is not working. Yet, touches are being handled. Could anyone with Android dev tools installed at their PC instruct me which gestures should I do after

```
adb backup -apk -shared -all

```

command? It expects me to unlock the device and allow backup, but I cannot see which button to press.

Good answer is:

1. Press button at 3/4 of height and 2/3 of width of the screen;
2. Swipe selector located at 1/10 of height in the left...
3. ...or something.

Please help.

# Answer
> 1 votes
When you invoke the `adb backup` command, this is the screen popping up on your device:

The button you would need to hit is "Back up my data". So after invoking the command, wait for 3..5 seconds to be sure the screen is "loaded", then hit the area on the lower-right where the button should be. The backup process then should start immediately. Even if you see nothing happen, give it another 30s or so, then check (from a different terminal/command shell); you should see your backup file growing then.

# Answer
> 2 votes
(For later Android versions)

You may want to try ways to mirror the screen. (Method 2 involves mirroring over WiFi)

Or narrate the screen.

With a totally blank screen, you can:

```
# enable USB debugging (not shown here, but the prompt is in the upper 40% of the screen. Yes is on the right)
# verify the phone is recognized and has authorized your PC
adb devices
# unlock the screen on the phone (power button, swipe, enter password, etc.)
# send the backup command (adjust as needed and try quotes or escape characters)
adb backup -apk -shared -all file.ab
# Respond to the prompt on the phone

```

The prompt is full screen and the confirm button is in the bottom right, above the launcher tray (back, home, recent apps).

Once confirmed, there is nothing on the destination PC that shows it's working.

On the source phone, it will display each package as it copies them (seems that way).

The destination file will show as 0 KB (empty) until the process completes.

Use a reliable cable and leave the phone somewhere it can safely rest without moving or even touching it. It took around 30 minutes to backup a Pixel 2 (16 GB backup, about 64 GB of data on the device). Not everything is part of ADB backup.

If you ctrl-C the process on the dest PC, the dest file will fill over the next few seconds with the incomplete backup. The phone will also show more packages that it was iterating through to copy. You could maybe use this to verify the backup was working.

It's not clear what the collision policy is on sending a backup with the same name as an existing file.

---
Tags: adb, backup, 4.0-ice-cream-sandwich, broken-screen, accessibility
---


# Question
Title: Control playback using headset media buttons when using Android Select to Speak functionality
**What I ideally want to achieve:** TTS for any text I see on my phone, with the user experience similar to my podcast app.

**My current approach:** Use Android Select to Speak functionality.
This works to read the text on the screen, works in the background, etc which is great. But it totally ignores any attempt to control the playback using media buttons on my headphones.

**Question**:
How do I make Select to Speak work with media buttons on headphones:

* Play/pause
* Skip back/forward (ideally allowing me specify time interval for this)

Or is there an alternative to Select to Speak that works better with media controls?

# Answer
You may be able to set up a custom accessibility service (https://developer.android.com/guide/topics/ui/accessibility/service) and listen for KEYCODE\_MEDIA\_PLAY\_PAUSE using a background service (https://stackoverflow.com/questions/21175914/determine-if-headphones-are-plugged-in-through-appwidgetprovider-pause-music-wh).

Then, as you described, the custom accessibility service could detect that you've short-pressed (KEYCODE\_MEDIA\_PLAY\_PAUSE) or long-pressed (KEYCODE\_VOICE\_ASSIST) the button on your headphones.
> 0 votes

---
Tags: bluetooth, audio, headphones, accessibility, text-to-speech
---


# Question
Title: Does the native VPN client support IKEv1 as of Android 12?
Is there any official documentation on what IPSec key exchange types are supported by the native Android 12 IPSec client (Racoon)? Specifically I’m interested in whether IKEv1 still works.

I’m asking this because I’m thrown off by a paragraph on the OpenWRT wiki which seems to indicate that as of v12, only IKEv2 modes are supported, killing off ISAKMP which has worked until v11. After spending some time searching for an official announcement or even just a feature list I came up empty handed.

The screenshot on this Github issue: https://github.com/SoftEtherVPN/SoftEtherVPN/issues/1373 appears to confirm the removal of IKEv1 in v12.

# Answer
The answer is **no**.

This commit added an exception that is thrown when the user tries to initiate an IKEv1 connection. The bug with the id given in the commit message is non-public so presumably this change was motivated not by technical but policy considerations.
> 1 votes

---
Tags: vpn, android-12
---


# Question
Title: How do you record the first time setup of an Android device without USB Debugging enabled?
I'm trying to record the initial setup of an Android phone/tablet for my company but i'm running into an issue where none of the Android to PC mirroring programs work during this part without having USB Debugging enabled. The problem is that these settings are not available because of the company settings and even then trying it on a private Android device it seems that when you Factory Reset the device the enabled USB Debugging setting is reset to its default which is off.

So my question is how do people take pictures or recordings of the initial Android setup with this conundrum in mind?

# Answer
Robert's suggestion of taking a screenshot helped. I used screenshot key combination Power + Volume down button wherever I needed to take screenshots during device setup. Those screenshtos were saved to the Gallery.
> 0 votes

---
Tags: adb, samsung, usb-debugging, screen-mirroring
---


# Question
Title: How do I enable Mobile Data only for select apps on a rooted phone?
Unfortunately my carrier charges €0.10 per MB of data -- and I've found out the hard way that Android is a data hog.

As a result I keep my mobile data almost exclusively off.

Is there a way, perhaps through an app, to *only allow **some** apps to use mobile data*? For example I'd like to be able to use Whatsapp and Opera Mini, but disable every other service.

I've found that without wanting to, apps like eBuddy and (especially) Google Talk always want to re-connect, even when they haven't been directly run.

I am aware that as from 2.2, Google tightened security on app capabilities (especially task managers and home screen selectors). For what it's worth, my device is rooted and running CyanogenMod7 RC4 (based on Gingerbread) so this might break compatibility with pre-2.2 apps.

# Answer
As you are rooted, you can use DroidWall to control network access on a per app basis.

From the Market page:

> Front-end application for the iptables Linux firewall.
> Allows you to restrict which apps can access the network.
> This is the perfect solution if you don't have an unlimited data plan, or just wants to see your battery lasting longer.
> 10 votes

# Answer
Since the current answer is a few years old and the app it recommends is no longer being updated, AFWall+ is another firewall app (actually a fork of DroidWall).

Its features are:

> Features
>
> * Easy to install & simple to use
> * Free and open source
> * No advertisements
> * Choose your preferred language
> * Search for installed applications
> * Get a notification about new installed application
> * Blocked packets notification and filter
> * Device Admin Support (Protect AFWall+ from uninstall)
> * Easy to manage your rules with a custom script
> * For any (stock) variant of Android version 2.2 - 4.4.4 (ICS, JellyBean, KitKat)
> * Ipv4/Ipv6 support
> * LAN-, VPN-, Tether-, Roaming-Control support
> * Tasker and Locale support
> * Firewall Logs service
> * Multi-User (multiple-profiles) support
> * Build-In Iptables/Busybox
> * Export and Import rules (Import All Rules needs donate version)
> * Option to prevent data leaks during boot (REQUIRES init.d support or S-OFF)
> * Supports MIPS/x86/ARM

https://github.com/ukanth/afwall/
> 1 votes

# Answer
There is also NetGuard, which unlike AFWall+, doesn't require root.

Google Play: https://play.google.com/store/apps/details?id=eu.faircode.netguard
Website: https://netguard.me/
Source code: https://github.com/M66B/NetGuard
> 1 votes

# Answer
You can buy a Huawei smartphone. In the settings go to "Data tarffic management" then you see this:

Click on "Networked apps" and you see this:

You can determine which app can use mobile data or wifi.

The actual place of this setting might depend on the model of your Huawei smartphone.
> 0 votes

---
Tags: data-connection, mobile-data
---


# Question
Title: Changing DNS settings on Android doesn't work
My device is a LeMaker Guitar Kit. I do not have root access on the device. I followed the guide from XSLAB - How to Change DNS Settings on Android to change the DNS. I am accessing my WiFi at home. When I set my DNS on my Android device and go to DNS leak test, it's not the DNS that I set in the DNS settings. It's the DNS set by my ISP.

**How can I get it to use the DNS that I want?**

---

Maybe I need to have root and/or use an app like the one mentioned on How to change mobile connections's DNS on Android KitKat? \- Override DNS. Also need to work out what version of Android it is, but think it is the most recent version.

Related question on Change DNS but stay on DHCP leaving the IP as dynamic (currently giving it static IP from the router) and using apps to change the DNS.

Related question on where are DNS settings under 4.4.2?, but he can't save the new DNS settings.

A possible option from Can't change DNS on S3 mini, in one of the answers is use debugging mode and adb to change the DNS settings, but my problem is not changing the DNS, it is getting the DNS I change it to work.

# Answer
First you must have **dnscrypt** installed. These scripts require root access:

```
#!/bin/sh
#root is required

#daemonize dnscrypt
dnscrypt-proxy --daemonize --resolver-address=208.67.220.220:443 --provider-name=2.dnscrypt-cert.opendns.com --provider-key=B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79

#this will redirect dns query traffics to localhost
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1

```

If you want to restore DNS to default, run this:

```
#!/bin/sh
iptables -t nat -D OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1

```
> 2 votes

# Answer
You can change the DNS but you will need to set a static IP as well. If you long press on the WiFi name you can change the options from there.
> 1 votes

# Answer
On Android, in addition to using settings. You can still use a third-party application to change DNS. Such as:

1. DNS Changer | Mobile Data & WiFi | IPv4 & IPv6
2. Net Optimizer | Optimize Your Internet Speed
3. DNS Smart Changer - Web content blocker and filter
4. 1.1.1.1: Faster & Safer Internet
5. Turbo VPN- Free VPN Proxy Server & Secure Service
> 0 votes

# Answer
This question (2016) is 6 years old and I had the same problem recently. Because I used my own DNS server (BIND 9), I finally found that there was a problem with the BIND settings. According to the prompts in `/var/log/named/named.log`, I corrected my own DNS server settings and the problem was solved.
> 0 votes

---
Tags: wi-fi, networking, dns
---


# Question
Title: Why I can't I add contacts on my Telegram?
I can't add more contacts to my Telegram account. They said "\[Name\] is not on Telegram yet, would you like to invite them to join?" but the contact is indeed already existed on Telegram. I change my phone already and the setting was good but still the same I can't add anybody on my Telegram.

So I just want to know if there are any solutions and suggestions that I could do to deal with this. Please help me.

# Answer
Their privacy settings is hiding the info from you.

Tell them to send their telegram username from Telegram\> hamburger menu \> settings \> username. There also is a link that opens direct chat with them.
> 1 votes

---
Tags: contacts, telegram
---


# Question
Title: Is there a way to schedule the sending of messages on whatsapp?
Is there a way **to schedule** the sending of messages on whatsapp using some particular program or script (obviously having the root of the device)?

I tried many applications to schedule sending messages, but none of them was automatic, they all needed user interaction.

I also tried to create some sort of scripts but with no results because they were in conflict with the operation of the application. My phone has Android 11 and I noticed that going on with the versions is getting more and more complex to work at the programming and automation level.

In particular, I would need something **automatic** that requires **no interaction to send these messages**

# Answer
I couldn't comment so I had to write this as an answer? There is a TaskerNet task to send WhatsApp messages here: WhatsApp Message. I have not personally used it, so I don't know if it works. Also, if your phone is rooted there are a couple of guides using autovoice and tasker, and one using SQLite.
> 0 votes

# Answer
I was searching for the solution for a long long time, the best what I found is to use Takser task. It's described in this Reddit thread: https://www.reddit.com/r/tasker/comments/bnnkvg/send\_whatsapp\_with\_sql\_with\_locked\_screen/f2xi0zx/?context=3

However, with latest Whatsapp versions it doesn't work with sending to groups, couldn't find out why.

Alternatively, you can use custom Whatsapp client, as I do now
> 0 votes

---
Tags: whatsapp-messenger, automation, android-11
---


# Question
Title: Is it possible to back up the encryption key of Android?
Is it ever possible to get a backup of my Android smartphone's decryption key (I have my `/data` partition encrypted) in case something goes wrong?

My phone is rooted. I have Galaxy Note 4 SM-N910C.

# Answer
You didn't specify in your question whether you're looking for the FDE, Full Disk Encryption, key or the FBE, File-Based Encryption, key. Technically they can both can have their keys recovered (so long as the FBE key is not hardware wrapped), but I've only needed to find a practical method for FDE so far.

**Full Disk Encryption**

The way to get the FDE that should work across devices and android versions is using the cold-boot method, you don't even need root. I suspect this isn't the answer you're looking for as I don't consider it in the practical realm for most even technically advanced people.

The easiest way, that I've discovered, to get the FDE userdata encryption key is to ask for it, and you might be lucky enough to get it. I've tested with on a Nexus5 Android 6 device, but other devices or android versions may have a kernel that prevents this. You'll need root for this to work.

They way to ask the system for the key to perform the command: `dmsetup table --showkeys`. Just as you would on a linux desktop with a dm-crypt device loaded. The 4th field of the output will be the encryption method used, `aes-cbc-essiv:sha256` in my case, and the 5th field will be the hex encoded key. If the 5th field is not a 32 or 64 character character hexidecimal string that looks random (ie. not all zeroes), then this method won't work. It could be that some android phones use the kernel keyring service, which may be configured to not allow showing the key.

The trouble is that you'll need the `dmsetup` binary, which is not distributed with android. So you'll need to find a binary compiled for your architecture. Ideally there would be a statically compiled binary that one could download, but I've yet to find one. Or using termux would be nice, but at the time of writing this termux has no package which installs dmsetup. For my test, I used Debian's `armhf` binary packages instead of building my own dmsetup binary. I haven't looked up your device, but if its 64-bit RM, you'll need to download the `arm64` versions.

One gotcha with this approach is that you must also install the `libc6` package because the dmsetup binary can not be loaded with the android dynamic linker. You also must set the appropriate `LD_LIBRARY_PATH` for dmsetup to find the dynamically linked libraries it needs to start. Furthermore, you'll need to download all the packages that the `dmsetup` package depends on an their dependencies. It's about 7 packages total. And since you can't install Debian deb packages on android, the paths are right, you'll have to unpack them manually using `dpkg-deb -X <pkgs> <install dir>`. In the end, the command I needed to use to run dmsetup looked like this, assuming my current working directory is the `<install dir>`:

```
LD_LIBRARY_PATH=$PWD/lib/arm-linux-gnueabihf \
  $PWD/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 \
  $PWD/sbin/dmsetup table --showkeys

```

**File-Based Encryption**

There is also an updated cold-boot attack for retrieving FBE encryption keys, but again not in the realm of practical for most people. I suspect that there is a way to get the FBE keys via user-space if you have root and the keys are not hardware wrapped (and may be if they are), but I'm not currently aware of how to do so.

The FBE implementation that stock android uses is `fscrypt` and seems to only be using raw protectors. In order to unlock the FBE on a linux desktop you'll need to make sure your kernel has the proper support for it. There are 2 fscrypt keys per user, a Credential Encryption (CE) key and Device Encryption (DE) key. Once you have the raw key for the directory you're wanting to decrypt you should be able to unlock the fscrypt'd directory using google's `fscrypt` program. The trick will be in getting the raw key for the particular directory you want to unlock. The data used to construct the raw key and fscrypt parameters are in `/data/misc/vold/user_keys`. The android docs give some clues as to how to create this raw key and suggest that the creation of the key must be done on the phone (needs a special master key from the TEE). Ultimately, `vold` will get this raw key and use it to setup the `fscrypt` instance. So I think the easiest way to get the key(s) will be to hack vold to output them to a file. Here seems like a good candidate because vold just did the kernel call to setup fscrypt, so we have the raw key and the directory that the raw key goes to. If its a hardware wrapped key, then the key data from that ioctl won't likely do us any good unless its known how to "unwrap" the key, which, if even possible without hardware hacking, would likely involve interfacing with the TEE.
> 3 votes

---
Tags: backup, data-recovery, disk-encryption
---


# Question
Title: Cannot skip WiFi in Google Setup Wizard after Factory Reset
I own a Klipad KL4888 tablet running Android 6.0.1

After a crash, I had to do a factory reset and a wipe cache from the recovery menu.

However, when restarting and running the setupWizard, it asks me a Wifi/GSM, but systematically the message "Can't connect to the internet" appears.

So I went through ADB (the device is unfortunately not pre-rooted), and in the logs I noticed this :

```
02-28 23:03:25.995 2784 2929 I SetupWizard.CheckConnectionTask: connecting to walled garden server. retries=0
02-28 23:03:26.246 970 1174 D WifiService: acquireWifiLockLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@52836c}
02-28 23:03:28.123 970 1176 D WifiService: releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@52836c}
02-28 23:03:36.239 2784 2929 W SetupWizard.CheckConnectionTask: IOException e=java.net.SocketTimeoutException: failed to connect to status.eqoe.cn/185.234.212.233 (port 80) after 10000ms
02-28 23:03:36.239 2784 2929 I SetupWizard.CheckConnectionTask: connecting to walled garden server. retries=1
02-28 23:03:46.301 2784 2929 W SetupWizard.CheckConnectionTask: IOException e=java.net.SocketTimeoutException: failed to connect to status.eqoe.cn/185.234.212.233 (port 80) after 10000ms
02-28 23:03:46.301 2784 2929 I SetupWizard.CheckConnectionTask: connecting to walled garden server. retries=2
02-28 23:03:56.360 2784 2929 W SetupWizard.CheckConnectionTask: IOException e=java.net.SocketTimeoutException: failed to connect to status.eqoe.cn/185.234.212.233 (port 80) after 10000ms
02-28 23:03:56.360 2784 2929 I SetupWizard.CheckConnectionTask: connecting to walled garden server. retries=3
02-28 23:04:06.421 2784 2929 W SetupWizard.CheckConnectionTask: IOException e=java.net.SocketTimeoutException: failed to connect to status.eqoe.cn/185.234.212.233 (port 80) after 10000ms

```

I also tried to disable Wifi, in order to be able to choose the "Ignore" option but obviously not enough rights.

The problem is that this famous site that is being tested is obviously no longer reachable. Is there any way to get out of this situation? An upgrade, but is the hardware compatible? Modify the Java sources, in order to ping another site?

Thank you !

# Answer
> 2 votes
I was stuck with the same device for 1 month. I finally got rid of this by DNS cheating.

1. Setup your own DNS server
2. Add a primary zone named `status.eqoe.cn`
3. Add a ressource record A type on the zone with target `216.58.204.110` (IP found resolving `clients1.google.com`, setup android site)
4. Declare your own server as DNS in your wifi setup
5. Now setup your device and don’t forget to forget your wifi settings (in order to flush dns cache)

You will access standard google android setup, instead of unresponsive `eqoe.cn` one.

When your device is ready to work you can discard DNS setting on wifi setup

# Answer
> 1 votes
I had this problem after factory resetting my Samsung Galaxy Tab 2 and trying to install a Marshmallow custom ROM (Slim6). The setup wizard successfully connected to wifi, but then hung at the 'Checking connection' stage, with no option to skip having to use wifi. The tablet doesn't have GSM, and there isn't any way of turning the wifi off before the setup wizard automatically starts.

I found a few potential solutions, hopefully at least one of which will be helpful to someone else:

1. Rename `SetupWizard.apk` so that it never starts. Using the TWRP custom recovery, mount the System partition read-write, then from Advanced/File Manager, navigate to `/system/priv-app/SetupWizard/` and delete or (safer) rename the `.apk` file.
2. Edit the `/system/build.props` file to make the wifi part of the setup wizard optional. I didn't actually try this, but you can use Advanced/Terminal in TWRP to get a command line that will let you edit the file, and this gist suggests some `ro.setupwizard` keys that look like they would do the job.
3. Try using a different GApps distribution, e.g. Open GApps or Delta GApps.

In my case, the first option worked, but it turned out that the real problem was that the version of GApps that I was using (Open GApps) wasn't compatible with my ROM; switching to Delta GApps fixed the problem with the setup wizard, as well as various other bugs.

Any of these options have the possibility of bricking your device if you get them wrong, hence I haven't described how to do them in detail. If you don't already know what TWRP or GApps are, or how to install them, then you need to do a lot more research first, until you are confident you understand the risks! Look for instructions that are specific to your model of device, and versions of the software that are known to work with it.

# Answer
> 1 votes
I had the "no internet" WiFi icon when the tablet came back from having the screen repaired. Internet worked, but automatic connections to WIFi didn't.

And then \[recently\] I started getting "open captive portal" messages

connect with adb shell:

```
adb shell

```

use superuser:

```
su

```

Check what setting is set (just out of curiosity): settings get global captive\_portal\_server

```
status.eqoe.cn

```

I didn't bother with any of the fallback or http/https settings, I just did the following setting:

```
settings put global captive_portal_server "connectivitycheck.gstatic.com"

```

and it worked! That's a relief!

---
Tags: wi-fi, 6.0-marshmallow, recovery-mode, setup-wizard
---


# Question
Title: Android/Google Play store: How to find app available in different languages?
I have a German friend who doesn't speak English. How can he find apps made in Germany using the German language?

Right now for example if he searches "rennen" which means "racing" in english he is shown all racing games in the english language. There has to be developers making apps and games for people in languages other than english, right?

# Answer
I wanted to see the actual German version of the text, but it kept giving me US English.

Just add &hl=de\_DE for Deutsch. Add &gl=DE&hl=de\_DE for the German site in Deutsch.

https://play.google.com/store/apps?hl=de\_DE&gl=DE
> 0 votes

---
Tags: applications, google-play-store, languages, google-play-games
---


title: How to set WIFI proxy via adb shell?

text:
# Question
Title: How to set WIFI proxy via adb shell?
Genymotion 2.2 & Android 4.0

I want to set a global HTTP proxy in Android, and all Apps will go through this proxy.

Now I can only do this in GUI as following way: Wi-Fi -\> WiredSSID -\> Modify Network -\> show advanced options

Is there any way to set the WIFI proxy via adb shell?

I've Googled and tried several ways such as:

```
 1. export http_proxy xxx
 2. setprop net.gprs.http-proxy xxx
 3. sqlite3 /data/data/com.android.providers.settings/databases/settings.db; INSERT INTO system VALUES(99,'http_proxy','xxx.xxx.xxx.xxx:xxxx')

```

and nothing worked.

# Answer
> 35 votes
On my Android 7 and 8 devices:

```
adb shell settings put global http_proxy <address>:<port>

```

Seems the setting is lost at reboot, however.

# Answer
> 5 votes
on master device:

1. Configure wifi proxy manually
2. `adb pull /data/misc/wifi/ipconfig.txt`

on second device:

1. `adb shell svc wifi disable`
2. `adb push ipconfig.txt /data/misc/wifi/ipconfig.txt`
3. `adb shell svc wifi enable`

# Answer
> 1 votes
I posted this over in this StackOverflow question and it looks like it would work for what you are trying to do.

I developed an app that will allow you to change the proxy from adb for use in my own automation setup and it has been working reliably for me so far. You can look at the source and download the apk from github. All you have to do is install it on the device you want to automate proxy changes and then run an adb command to have the app set your proxy settings. More details on how to use it are in the README on github.

# Answer
> 1 votes
for removing the proxy, `adb shell settings put global http_proxy :0`. i struggled with my android phone after setting the wrong proxy. not sure if there's any default settings via GUI in the android settings, I'm using an Android lollipop OS phone so not many options there. To check that you've set the wrong proxy, if you get errors like `Caused by: java.net.ConnectException: failed to connect to /127.0.0.1 (port 1337): connect failed: ECONNREFUSED (Connection refused)`, a very likely cause would be wrong proxy.

---
Tags: wi-fi, adb, proxy
---


title: Encryption precautions on android

text:
# Question
Title: Encryption precautions on android
So I want to encrypt my phone and my SD card. What are the precautions should I have?

What if my phone doesn't work anymore. Can I restore the data again? What should I do in order to make sure that if the phone doesn't work or anything goes wrong I can decrypt the data and not lose it?

I have samsung galaxy note 3.

Thank you.

# Answer
> 2 votes
Before encrypting you should:

* Ensure all your contacts are associated with, and synced to, your Google account. This can be verified by viewing your contacts online at https://www.google.com/contacts.
* Your photos and other media are backed up. Photos and videos can be automatically saved with the Google+ app. Any other files/data can be saved to your computer by connecting the Android device via USB and copying them over.
* Make note of all installed apps.

You can’t reverse encryption on Android devices. If you decide you want a decrypted device you will have to perform a factory reset at which time all your data will be removed and lost. In addition, if the encryption fails or doesn't complete partial or full data loss will occur (the most common reason for this is power loss during the encryption process).

# Answer
> 0 votes
Based on the comments from the accepted answer, it looks like you're wanting to backup the key used to encrypt the internal and/or external storage. It is likely possible that you can backup both of the encryption key(s) *if* you can get root using `dmsetup`. If you have backups of the encrypted block devices and have the key, you can access the decrypted files on a linux system supporting dm-crypt.

In order to do a backup of the internal storage block device, you'll need to have the bootloader unlocked to use TWRP or be rooted. If you relock the bootloader, userdata will be wiped, and I suspect a new encryption key generated, so be careful of that.

There's also an alternative method for getting the encryption key for the external storage, root needed as well.

---
Tags: encryption, samsung-galaxy-note-3
---


# Question
Title: My phone's system keeps breaking and eventually stops booting
I own a Xiaomi Redmi 4X which has a really strange problem. The phone keeps restarting at random over a few hours until it enters on a bootloop, and eventually can't boot to the system anymore (the loop stops, it straight up doesn't boot at this stage and only shows the loading screen)

I've tried everything, from doing a factory reset to unlocking and flashing the stock rom, as well as custom roms that I checked were compatible with my device, but no matter what I do it always ends the same way even if it looks like it got fixed (usually about a week without restarts and after that the phone straight up refuses to boot, with the animation even freezing in some instances)

Doing a clean flash allows me to use the phone again for a few days, but as I said, it eventually breaks again without me doing anything to the system. I know it has to be something happening to the configuration of the device because I can access recovery and fastboot just fine and dirty flashing doesn't mitigate the problem at all, however I have a hunch that it may be a hardware problem, because sometimes the phone restarts itself several times when it reaches 80% charge and has been turned off (sometimes when it is on too, but is somewhat inconsistent). Can anyone help me and give me some direction on what to do?

# Answer
This device probably reached wear estimation for eMMC flash memory (eMMC wear-out). Backup your data that device will reach end of its life soon.
> 0 votes

---
Tags: boot-loop, unbricking, xiaomi, redmi
---


# Question
Title: Unable to flash GApps zip after lineage OS 18.1 ROM
I have flashed a lineage OS 18.1 custom ROM on my Samsung A30 device. I am able to boot into the system successfully. However, I am facing issues while flashing Open Gapps. I have followed below steps:

1. Flashed Lineage OS 18.1 (`lineage-18.1-20220414-UNOFFICIAL-arm64_bvS.img.xz`) using TWRP recovery. (selected `System Image`)
2. Booted into the system.
3. Enabled 'USB Debugging' in developer options.
4. Turned off the device.
5. Booted into Recovery mode (TWRP)
6. Install \> Install Zip \> OpenGapps.zip
7. Got the error code 70 (insufficient space)
8. Again went back to home screen of TWRP
9. Wipe \> Selected 'System' \> Advanced Wipe \> Resize File System.
10. Got this error - `/sbin/e2fsck -fp /dev/block/mmcblk0p25 process ended with ERROR: 4 Unable to repair system`
11. Tried changing file system of '`System`' to `EXT2` and then back `EXT4`. \[I am little bit skeptical of this step, since I feel this would wipe out the entire partition (owing to my experience in installing Arch Linux, where the user should format a file in ext4 partition for `/home`). Nevertheless, I followed this because it was mentioned in of the forums\]
12. Boot into system. Now the device is stuck in boot loop.

I am not quite sure, where I am going wrong. I am using TWRP 3.3.1-0. Any help is greatly appreciated.

# Answer
> 1 votes
there is enough size on partition 4800MB just the file system 1907MB is not using half of it. can be fixed with `resize2fs`

```
resize2fs /dev/block/mmcblk0p25 1171875

```

---
Tags: samsung, twrp, lineageos, google-apps
---


# Question
Title: How is an APK prevented from making security changes during their installation process
What if the APK installation ran a few scripts? Overwrote files outside it's designated folder? Edited a few files? etc? What would prevent it from doing so?

# Answer
An APK does not have any control over its installation process. Installation is performed by the Android operating system. Details can be found in this answer.

But once an app is installed, it can then run its code and try to make malicious changes.

> What would prevent it from doing so?

At Linux kernel level:

* DAC (UID, GID, mode)
* MAC (SELinux labels)

Read more about Android app sandbox.

At Android platform level:

* Manifest permissions
* AppOp permissions

Read more about permissions here, here and here.

**Related:**
> 3 votes

---
Tags: security, installation
---


# Question
Title: How do I get the temperature of my phone via ADB?
At work, I run lots of automated software testing on Android phones. They stay permanently plugged into a development machine, and are given jobs to run via ADB. I'd very much like to be able to monitor their temperatures, and doing so via ADB would be the easy way.

# Answer
This is simple, on Android 10 or later, once you find out how.

`adb shell dumpsys thermalservice`

On my Samsung A52 5G with Android 12, this produces, with values apparently in Celsius.

```
IsStatusOverride: false
ThermalEventListeners:
        callbacks: 1
        killed: false
        broadcasts count: -1
ThermalStatusListeners:
        callbacks: 4
        killed: false
        broadcasts count: -1
Thermal Status: 0
Cached temperatures:
        Temperature{mValue=0.0, mType=2, mName=SUBBAT, mStatus=0}
        Temperature{mValue=0.0, mType=2, mName=SUBBATRAW, mStatus=0}
        Temperature{mValue=25.6, mType=0, mName=AP, mStatus=0}
        Temperature{mValue=25.7, mType=5, mName=PA, mStatus=0}
        Temperature{mValue=23.8, mType=2, mName=BAT, mStatus=0}
        Temperature{mValue=24.7, mType=3, mName=LRB, mStatus=0}
        Temperature{mValue=24.7, mType=3, mName=LRF, mStatus=0}
        Temperature{mValue=24.7, mType=3, mName=LRP, mStatus=0}
        Temperature{mValue=0.0, mType=4, mName=USB, mStatus=0}
HAL Ready: true
HAL connection:
        ThermalHAL 2.0 connected: yes
Current temperatures from HAL:
        Temperature{mValue=25.6, mType=0, mName=AP, mStatus=0}
        Temperature{mValue=23.8, mType=2, mName=BAT, mStatus=0}
        Temperature{mValue=24.7, mType=3, mName=LRB, mStatus=0}
        Temperature{mValue=24.7, mType=3, mName=LRF, mStatus=0}
        Temperature{mValue=24.7, mType=3, mName=LRP, mStatus=0}
        Temperature{mValue=25.7, mType=5, mName=PA, mStatus=0}
        Temperature{mValue=0.0, mType=2, mName=SUBBAT, mStatus=0}
        Temperature{mValue=0.0, mType=2, mName=SUBBATRAW, mStatus=0}
        Temperature{mValue=0.0, mType=4, mName=USB, mStatus=0}
Current cooling devices from HAL:
Temperature static thresholds from HAL:

```

A Samsung Galaxy Tab A7 Lite with Android 11 has (trimmed down):

```
Current temperatures from HAL:
        Temperature{mValue=29.1, mType=0, mName=CPU, mStatus=0}
        Temperature{mValue=29.1, mType=1, mName=GPU, mStatus=0}
        Temperature{mValue=24.0, mType=2, mName=BATTERY, mStatus=0}
        Temperature{mValue=26.0, mType=3, mName=SKIN, mStatus=0}
        Temperature{mValue=25.0, mType=5, mName=POWER_AMPLIFIER, mStatus=0}
        Temperature{mValue=29.1, mType=9, mName=NPU, mStatus=0}

```

My very cheap Chinese Android 10 tablet says:

```
IsStatusOverride: false
ThermalEventListeners:
        callbacks: 1
        killed: false
        broadcasts count: -1
ThermalStatusListeners:
        callbacks: 2
        killed: false
        broadcasts count: -1
Thermal Status: 0
Cached temperatures:
        Temperature{mValue=30.8, mType=3, mName=test temperature sensor, mStatus=0}
HAL Ready: true
HAL connection:
        ThermalHAL 2.0 connected: yes
Current temperatures from HAL:
        Temperature{mValue=30.8, mType=3, mName=test temperature sensor, mStatus=0}
Current cooling devices from HAL:
        CoolingDevice{mValue=100, mType=0, mName=test cooling device}

```

That's probably the default configuration in Android 10.

The underlying Android service for this is a bit complicated. It says that HAL 2.0 appeared at Android 10, and previous versions only had HAL 1.0. I've tried two Android 9 devices and a single Android 8.1, and `dumpsys thermalservice` didn't produce any output on any of them.

I have only figured out parts of the mName values so far. It seems clear that the names vary between manufacturers, but the mType values seem to be consistent.

* AP = Application Processor - maybe the SoC, or the CPU? mType 0.
* BAT = BATTERY = Battery. mType 2, which makes it very plausible that SUBBAT and SUBBATRAW are battery-related, as the names suggest.
* CPU = CPU. mType 0.
* GPU = GPU. mType 1.
* NPU = Neural Processing Unit? mType 9.
* PA = Power Amplifier. mType 5.
* SKIN = Device case, presumably. mType 3. That suggests that LRB, LRF and LRP on the Samsung are something to do with the case or buttons, and that the sole sensor on the cheap tablet is monitoring the case.
* USB = Universal Serial Bus, presumably. mType 4.

Source for some of those.

The mStatus values are the power throttling status, from 0 (no throttling) to 6 (shut down due to heat).

## Evaluating the results

Rather than trying to decide on temperature limits myself, the best way seems to be to parse the output for "Temperature{ ... }" lines, and if any of them have mStatus values greater than zero, treat the device as overheating and stop giving it work for a while. That delegates the decision to the device manufacturer, who will inevitably know more than me about the thermal behaviour of their designs.
> 9 votes

---
Tags: adb, sensors
---


# Question
Title: How do I make WhatsApp access contacts from a specific SIM?
I have two SIM cards, one personal and the other for business. I would like WhatsApp to use contacts in the SIM card that I use for business only rather than bringing all the contacts.

Is there a way to do so?

# Answer
I dont think you can import the contacts from SIM. Contacts are imported from your google account only.
> 0 votes

---
Tags: contacts, whatsapp-messenger, sim-card
---


# Question
Title: How to set custom text notification sounds with a Samsung Galaxy S22?
I just purchased a Samsung Galaxy S22. It runs Android 12 and One UI 4.1.

What I am trying to do is use a custom notification sound for my text messages (Google Messages). I want a custom sound for one specific person and another for everyone else. I had this previously on my Galaxy S8.

Unfortunately this does not work for me. I have added the sounds I wish to use to my phone's storage. This includes custom ringtones. Those do work as I am able to select them when choosing a ringtone. I can see them in my list of available ringtones. But the sounds I have added for notifications do not appear in the list of available notification sounds.

I have tried placing them in the following locations:

* /root/sdcard/Notifications
* /root/sdcard/Ringtones
* /root/sdcard/Android/media
* /root/sdcard/Android/media/Notifications

It's this still possible to do? If so, what am I missing?

# Answer
> 2 votes
Turns out what I was missing is that the format of the file *must* be MP3. Mine were .wav files which worked on the older OS but not in the newer OS.

---
Tags: samsung, notifications, samsung-galaxy-s, custom-sounds
---