# Question
Title: No option to choose "Do Not Validate" under "CA certificates" when connecting to PEAP/MSCHAPV2 WiFi (Android 11)
I can't connect to campus WiFi anymore after installing latest ROM with december 2020 security patches. The configuration is PEAP/MSCHAPV2. Under CA certificate, we usually choose "Do not validate" but now CA certificates is set to "Use system certificates" and can't be changed. "Use system certificates" setting requires Domain name which I don't know and have never needed to use before in any ROM.

Is there any workaround to choose "Do not validate" in "CA certificate"?

# Answer
On a rooted phone, first try to connect to the WiFi network (although it will fail), then turn off WiFi entirely. Now, modify `/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml`. Find the entry for your WiFi network, and set `DomSuffixMatch` (which is what the UI shows as 'Domain') and `CaPath` to empty strings. Maybe set other similar entries to blank strings also, for example `CaCert`. Here's what my `WifiEnterpriseConfiguration` section looks like:

```
<WifiEnterpriseConfiguration>
...
<string name="ClientCert"></string>
<string name="CaCert"></string>
<string name="SubjectMatch"></string>
...
<string name="AltSubjectMatch"></string>
<string name="DomSuffixMatch"></string>
<string name="CaPath"></string>
...
</WifiEnterpriseConfiguration>

```

Now, reboot your phone, verify that your changes in `WifiConfigStore.xml` were saved, and try to connect to the WiFi network.

It should be possible to write an app to do this, without requiring root. Docs for WifiEnterpriseConfig, and example usage on stackoverflow

Of course this is insecure (anyone could create a fake WiFi network and steal your credentials), but any https connection within the network is still OK.

(Tested on Pixel 3, LineageOS 18.1, Android 11)
> 2 votes

# Answer
To add to XMB5's answer, you can do this on a rooted phone using the following commands:

```
adb shell
su
sed -i 's%<string name="CaPath">.*</string>%<string name="CaPath"></string>%' /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
sed -i 's%<string name="DomSuffixMatch">.*</string>%<string name="DomSuffixMatch"></string>%' /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
reboot

```

(I included `CaPath` and `DomSuffixMatch` because only these two seem to be required to get past the UI)

**Note:** This clears the domain and CA certificate of all saved networks. You probably don't need to worry, unless you have multiple enterprise networks with 802.1X authentication saved. In that case, you can run this script, and then reconfigure the other networks through UI.
> 2 votes

# Answer
Have you asked the IT department from your campus ?

Looks like if you 'just' enter the correct domain, it should work with the system certificates. If so, then you would end up with a more secure WiFi connection.

The article where Yogesh is pointing at, is more an advertisement than independent information. Obvious that securew2 is writing to use their products instead of another solutions.

The root of the problem is a user unfriendly way to connect to a Wifi network in Android. In many other OS's you need to 'trust' a certificate, which is needed for a safe connection.

Before December update, Android gave 2 options:
1st solution is to import a certificate on a smartphone. Which manually is a hell, or by using an app. (Like securew2, connect this with the site were the article is hosted)

2nd option was to 'not validate' the certificate, and just trust any certificate presented. This however is of course less secure, but a lot more user friendly and can be explained. The risk is that if someone (with bad intentions) set up a network with the same 'name'/SSID, the android phone connects regardless, without warning you are connecting to a rogue network.

To address the security problems in the second option Android has removed the do not validate option and (according to your screenshot) it seems to be replaced by using system certificates (with a domainname check).

I am curious If you can connect when you would use the correct domain name.
> 1 votes

# Answer
"Do not validate" has been removed by Android.

You need to use the domain name of the server certificate being used by the authentication server.
> 1 votes

# Answer
Well you can try to fill in the last part of your email addresses for domain - so everything after the "@". like my last part of email address is **isbstudent.comsats.edu.pk** As written in one of the guides, normally you would enter the domain address of the authentication server / the common name which is part of the certificate of the server... It worked for me!!!
> 0 votes

---
Tags: wi-fi, certificates, android-11
---


# Question
Title: How to backup gmail data from android with adb
I have a non-gmail account with a cache of messages in my android gmail app. **How can I make a backup of the emails and attachments?** Accessing the mail server to make a backup is not possible. I tried the method in the answer here: Backup gmail emails offline However, the backup file is too small to realistically contain the emails and attachments. It's only coming out 549 bytes, even with trying a few different adb backup options.

# Answer
You can copy these files and directories and paste into new device:

1. /data/data/com.google.android.gm: for Gmail cache
2. /data/system\_de/0/accounts\_de.db and /data/system\_ce/0/accounts\_ce.db: for Gmail accounts and some google authentication info

maybe this method solves your problem
> 0 votes

---
Tags: adb, backup, gmail
---


# Question
Title: Disable web search in Microsoft Launcher
Recently, Microsoft launcher has started to give web search suggestions when I click on my home button and search for an app.

I only want to find apps, but in addition to installed app results the launcher now also gives internet search suggestions.

I want to disable that because I do not use it for that functionality. I guess this is MS's way of pushing Bing, but I still would like to disable it. Is that possible?

# Answer
# It's Microsoft pushing ads for its apps, yet again

#

# Solutions

* Find another launcher and uninstall Microsoft Launcher. Or change search engine in settings, if you want to continue using the launcher.
* Uninstall Microsoft Edge. XDA blog says that launcher triggers these ads *only* when Edge is installed (but some users have reported in comments that they don't have Edge installed but get this Bing search).
* Report to Play Store - use Report Inappropriate Apps. Play Store has a very aggressive policy wherein developers are not allowed to even link their *own* apps.This may cause app to be removed from Play Store

**Related (app violations)**
> 1 votes

# Answer
# The real solution

Just disable app's network access.

Go to settings - \> apps - \> find Microsoft launcher - \> disable network access

It is indeed a really well made launcher.

Cheers
> 0 votes

---
Tags: applications, launcher, ads
---


# Question
Title: Is my data secure after factory reset with NO password SET
I had one plus 8 pro brand new phone Android 10. I sold the phone in a week's time. I never set any password or screen lock. I understand android 10 uses file-based encryption. I just did a factory reset and sold the phone. can the buyer retrieve by data though I have not set the screen password? will the file-based encryption take care?

# Answer
> 1 votes
The file encryption on Android 10 is used no matter if you have set a lock screen password or not. The file encryption does incorporate the password but an additional secret random key is also required for accessing encrypted files.

This key is erased on factory reset, so encrypted files become impossible to decrypt.

---
Tags: factory-reset, data-recovery, encryption
---


# Question
Title: How can enable the Android Accessory Interface (USB) on Windows?
I would like to use the Android USB Accessory Mode. This allows to open a data connection between an Android app and an app on another USB device, like a Windows machine.

To start this communication, on the Windows machine, an App must start a USB Host mode. For this, it must send some specific data to the Android Accessory Interface, which will be shows as a USB device inside Windows.

Unfortunately, on my Windows machine, this Android Accessory Interface will not be shown. This will be identified by a device instance ID of `USB\VID_18D1&PID_2D01&MI_...`.

To show this device, I updated my Windows 10 Pro installation and all drivers. Additionally, I installed a special USB driver from Samsung for my Galaxy A20e.

**How can enable the Android Accessory Interface (USB) for my Samsung Galaxy A20e device?**

# Answer
To switch to the Android Accessory mode, I enabled the USB debugging inside the settings of my Samsung A20e. After this, I was able to connect from my Windows App to the Android device to start the accessory mode with this procedure:

1. Get the device ID of the USB adapter (ADB interface) with the GUID `f72fe0d4-cbcb-407d-8814-9ed673d0dd6b`.
2. This can be used as the file name to get a file handle with `CreateFile` (please use `FILE_FLAG_OVERLAPPED`).
3. The file handle can be passed to `WinUsb_Initialize` to get a `WinUsb` handle.
4. Now you can request the protocol (51) and send some information (52) like manufacturer, model, etc. to the Samsung device with `WinUsb_ControlTransfer`.
5. After this, you can start the accessory mode with command 53.

This will disconnect my Samsung Galaxy from my Windows computer and connect again as Google device (VID of 0x18d1).

After this, I wasn't be able to use MTP or RNDIS furthermore.
> 0 votes

---
Tags: usb, windows, android-open-accessory
---


# Question
Title: Can I set up two children on one device both managed by Google Family link?
The Google Family Link FAQ says you are only permitted to have one child per device.

But on this page it says you can add a second profile to your child's device.

Does this mean two children share one device under Family Link? Or that there can be one Family Link account and one other account?

What are the limitations / implications of a second account?

# Answer
> 3 votes
Yes you can! I just did it.

Under Family Link, I set up two Google accounts for my kid. I installed one on the device, and then created a new user on the device and added the second Google account into its setting. It seems to be working fine, allowing access to the one profile whilst the other is locked.

The idea was that I set up one profile just for education purposes, and the other where I can install other apps, games, etc. The plan is to have tighter time restrictions on the gaming or fun profile and allow more access to the education apps so they will move to the second profile and do better activities once their game time is over.

Maybe you can do this with other control apps, but I think this could be a good long-term solution under the Google Family Link system which doesn't seem to provide individual app timers.

# Answer
> 2 votes
Many Android devices allow multiple user profiles (not to be confused with Google accounts). It's a similar function to what computers have, where you can have the admin account and the child one.

From the second link you posted:

> The steps below will only work if your child's device allows multiple profiles

From your comment on this post it's apparent that you're using an Asus Zenpad 3s. That device doesn't seem to have the multi user functionality. (You can confirm this info by simply going settings and looking for "users"). Therefore, you will not be able to add more accounts.

So to explain the difference between the two links you posted, the first one seems to be talking about adding a second Google account to the same device (from settings → accounts → Google,) while the second link is discussing how to get past the limitation of one account per device, by adding a second user, which in turn make it as if you're using a different device, with a lock screen preventing the child from switching between users.

> Does this mean two children share one device under Family Link? Or that there can be one Family Link account and one other account?

With a device that supports multiple users, you can add either a child, or a regular Google account. If you're adding a regular account, make sure to have a lockscreen preventing your child from switching between users.

> What are the limitations / implications of a second account?

Had that been possible, your child would be able to open Google play store, switch to the other account, and download any app they want.

Therefore, they don't allow more accounts unless you add a new user to the device.

# Answer
> 0 votes
In family link I had to select the device (in my case an android nokia) and that had an option to allow my son to add other accounts. . This is restricted to a school controlled account so it's not any type of account.

# Answer
> 0 votes
Yes!

I have successfully setup two user profiles on my Android tablet, each using a different Google account, and both accounts are enrolled in Family Link. However, it wasn't easy.

Some background:

1. Android devices let you have more than one user profile on the same device (but note that not all android devices support this option).
2. These user profiles are not the same as different Google accounts! Each user profile can be connected to one or more Google accounts of their choice, which may or may not be different from the accounts on other profiles.
3. A device always starts with one pre-installed user profile, which is the *administrator* profile.
4. If you are on the administrator profile, you can enroll a connected Google account in Family Link, and have a parent supervise the activity of that profile.
    * Note that Family Link is connected to the *Google account*, not the user profile. If you connect this account to any other profile on this or another device, Family Link will supervise that profile too. If you remove the account from the profile, the profile will no longer be supervised, but the account will remain enrolled in Family Link.
5. If you are on a user profile other than the administrator - you **cannot** enroll a connected Google account in Family Link. To make things worst, if you try to do this, you just get a generic "something went wrong" error message, with no additional clarification.

Here is how I managed to work around this limitation:

1. For each Google account you want to enroll in Family Link, connect to this account while on the administrator profile of an Android device, and enroll it (by using the "parental controls" option in settings).
    * You can use multiple devices for this if you want, it's OK to use devices other than the one you eventually want to have the accounts on.
    * You can also repeat this for multiple accounts on a single device if you need to. After you enroll one account, remove it from the device, and then connect with the next account.
2. Once all accounts are enrolled in Family Link, you can create additional user profiles on your device, and on each profile connect to one of the accounts.
    * Note that if the administrator profile is already connected to a Family Link enrolled account, you might not be able to add additional user profiles. You need to explicitly allow this, using the Family Link app on a parent's device.

I hope this helps.

---
Tags: google-play-family
---


title: Process has died: cch CACC

text:
# Question
Title: Process has died: cch CACC
I have a 32-bit app that is crashing on an LG-H872. When I look at the logcat output, I see

```
I ActivityManager: Process my.app (pid 18816) has died: cch  CACC
W cr_ChildProcessConn: onServiceDisconnected (crash or killed by oom): pid=18816

```

What does `cch CACC` mean?

# Answer
**This log is posted when a process is killed due to out-of-memory (OOM)**. It is accompanied by 2 codes: the OOM adjustment level and the process state.

The relevant code from ActivityManagerService:

```
reportUidInfoMessageLocked(TAG,
  "Process " + app.processName + " (pid " + pid + ") has died: "
  + ProcessList.makeOomAdjString(setAdj, true) + " "
  + ProcessList.makeProcStateString(setProcState), app.info.uid);

```

The following is the list from the AOSP source code for the OOM adjustment level and the process state.

**OOM adjustment level**

| Message | Code | Explanation |
| --- | --- | --- |
| cch | CACHED\_APP\_MIN\_ADJ | This is a process only hosting activities that are not visible, so it can be killed without any disruption. |
| svcb | SERVICE\_B\_ADJ | The B list of SERVICE\_ADJ -- these are the old and decrepit services that aren't as shiny and interesting as the ones in the A list. |
| prev | PREVIOUS\_APP\_ADJ | This is the process of the previous application that the user was in. This process is kept above other things, because it is very common to switch back to the previous app. This is important both for recent task switch (toggling between the two top recent apps) as well as normal UI flow such as clicking on a URI in the e-mail app to view in the browser, and then pressing back to return to e-mail. |
| home | HOME\_APP\_ADJ | This is a process holding the home application -- we want to try avoiding killing it, even if it would normally be in the background, because the user interacts with it so much. |
| svc | SERVICE\_ADJ | This is a process holding an application service -- killing it will not have much of an impact as far as the user is concerned. |
| hvy | HEAVY\_WEIGHT\_APP\_ADJ | This is a process with a heavy-weight application. It is in the background, but we want to try to avoid killing it. Value set in system/rootdir/init.rc on startup. |
| bkup | BACKUP\_APP\_ADJ | This is a process currently hosting a backup operation. Killing it is not entirely fatal but is generally a bad idea. |
| prcl | PERCEPTIBLE\_LOW\_APP\_ADJ | This is a process bound by the system (or other app) that's more important than services but not so perceptible that it affects the user immediately if killed. |
| prcm | PERCEPTIBLE\_MEDIUM\_APP\_ADJ | This is a process hosting services that are not perceptible to the user but the client (system) binding to it requested to treat it as if it is perceptible and avoid killing it if possible. |
| prcp | PERCEPTIBLE\_APP\_ADJ | This is a process only hosting components that are perceptible to the user, and we really want to avoid killing them, but they are not immediately visible. An example is background music playback. |
| vis | VISIBLE\_APP\_ADJ | This is a process only hosting activities that are visible to the user, so we'd prefer they don't disappear. |
| fg | FOREGROUND\_APP\_ADJ | This is the process running the current foreground app. We'd really rather not kill it! |
| psvc | PERSISTENT\_SERVICE\_ADJ | This is a process that the system or a persistent process has bound to, and indicated it is important. |
| pers | PERSISTENT\_PROC\_ADJ | This is a system persistent process, such as telephony. Definitely don't want to kill it, but doing so is not completely fatal. |
| sys | SYSTEM\_ADJ | The system process runs at the default adjustment. |
| ntv | NATIVE\_ADJ | Special code for native processes that are not being managed by the system (so don't have an oom adj assigned by the system). |
| (integer number) | (none) | Value when it is below the lowest defined level (NATIVE\_ADJ = -1000) |

**Process state**

| Message | Code | Explanation |
| --- | --- | --- |
| PER | PROCESS\_STATE\_PERSISTENT | Process is a persistent system process. |
| PERU | PROCESS\_STATE\_PERSISTENT\_UI | Process is a persistent system process and is doing UI. |
| TOP | PROCESS\_STATE\_TOP | Process is hosting the current top activities. Note that this covers all activities that are visible to the user. |
| BTOP | PROCESS\_STATE\_BOUND\_TOP | Process is bound to a TOP app. |
| FGS | PROCESS\_STATE\_FOREGROUND\_SERVICE | Process is hosting a foreground service. |
| BFGS | PROCESS\_STATE\_BOUND\_FOREGROUND\_SERVICE | Process is hosting a foreground service due to a system binding. |
| IMPF | PROCESS\_STATE\_IMPORTANT\_FOREGROUND | Process is important to the user, and something they are aware of. |
| IMPB | PROCESS\_STATE\_IMPORTANT\_BACKGROUND | Process is important to the user, but not something they are aware of. |
| TRNB | PROCESS\_STATE\_TRANSIENT\_BACKGROUND | Process is in the background transient so we will try to keep running. |
| BKUP | PROCESS\_STATE\_BACKUP | Process is in the background running a backup/restore operation. |
| SVC | PROCESS\_STATE\_SERVICE | Process is in the background running a service. Unlike oom\_adj, this level is used for both the normal running in background state and the executing operations state. |
| RCVR | PROCESS\_STATE\_RECEIVER | Process is in the background running a receiver. Note that from the perspective of oom\_adj, receivers run at a higher foreground level, but for our prioritization here that is not necessary and putting them below services means many fewer changes in some process states as they receive broadcasts. |
| TPSL | PROCESS\_STATE\_TOP\_SLEEPING | Same as PROCESS\_STATE\_TOP but while device is sleeping. |
| HVY | PROCESS\_STATE\_HEAVY\_WEIGHT | Process is in the background, but it can't restore its state so we want to try to avoid killing it. |
| HOME | PROCESS\_STATE\_HOME | Process is in the background but hosts the home activity. |
| LAST | PROCESS\_STATE\_LAST\_ACTIVITY | Process is in the background but hosts the last shown activity. |
| CAC | PROCESS\_STATE\_CACHED\_ACTIVITY | Process is being cached for later use and contains activities. |
| CACC | PROCESS\_STATE\_CACHED\_ACTIVITY\_CLIENT | Process is being cached for later use and is a client of another cached process that contains activities. |
| CRE | PROCESS\_STATE\_CACHED\_RECENT | Process is being cached for later use and has an activity that corresponds to an existing recent task. |
| CEM | PROCESS\_STATE\_CACHED\_EMPTY | Process is being cached for later use and is empty. |
| NONE | PROCESS\_STATE\_NONEXISTENT | Process does not exist. |
| ?? | (none) | Default value when the code is not in the list. |
> 9 votes

---
Tags: applications
---


# Question
Title: Unsupported SD format renders my micro SD card useless. Is there a way to fix it?
I have just flashed a new ROM and the microSD card is gone. It appears in the notifications as "unsupported SD card". Is there a way to fix it?

# Answer
> 3 votes
Plug it into PC and format it to FAT32. That should done the trick. Or maybe you can format it trought phone take a look for that option in storage settings.

# Answer
> 1 votes
I tried all the suggestions I could find on the web, including third-party-software, but none of them worked! My SD card was neither accessible on the device itself (via file explorers) nor on a PC. (I didn't expect to be able to access it on the PC, though, as I had "adopted" it as internal storage on my (non-rooted) Android device, so it was encrypted.)

Surprisingly, I was able to access the SD card with adb:

* `adb shell ls \$EXTERNAL_STORAGE`: List all folders on sdcard
* `adb shell du -hs \$EXTERNAL_STORAGE/*`: Check size of folders on sdcard
* `adb shell echo \$EXTERNAL_STORAGE`: Print out SD card folder name; in my case: `/sdcard`
* `adb pull <SD card folder>`, e.g. `adb pull sdcard`: Download all files and folders from sdcard to current directory. Depending on the folder size and number of files, this may take very long. It may be better to download only the folders required: `adb pull <SD card folder>/<path to be downloaded>`.

I was even more surprised to find out that some of the files on the SD card were updated that very day, e.g. the WhatsApp backup, even though I had not been able to access the SD card for months and was always getting the "unsupported SD card" on start-up. I seems that a number of apps were still able to access it.

---

*EDIT:*

I just saw that `sdcard` is a symbolic link to my primary storage: `/storage/self/primary`! So it may not have been my original sdcard content I was viewing and copying but data added since my SD card got corrupted (and Android added the symbolic link to allow apps to use the internal storage as if it was an sdcard). The alternative is that adopting an sdcard as internal storage leads to this symbolic link. I find the former more likely, but cannot evaluate that in my case, as my SD card had been corrupted for a long time now.

---
Tags: rom-flashing, sd-card, formatting
---


# Question
Title: Can't add widgets to home screen on Huawei P30 Pro
I have a Huawei P30 Pro on Android 12. I normally have a large clock on my home screen, but it was somehow removed and I can't add it back.

I click/tap and hold and I don't get any options to add a widget or anything for the fact. I've searched and all articles say to tap and hold to add a widget, but nothing appears to me.

How to add a widget to the home screen?

# Answer
> 0 votes
1. Select a screen where you want to add your (lost) widget.
2. **Pinch with 2 fingers** (move them as you would to zoom this screen out).
In the bottom of your screen will appear some icons.
3. Tap on the **Widget** icon. The bottom row of icon will change to (scrollable) row of icons of your widgets.
4. Select your lost widget.

This instructing video may help you, too.

---
Tags: huawei, app-widgets
---


# Question
Title: How do I share apps between users in Android 5 Lollipop?
I got a Nexus 9 tablet that I'm sharing with my wife.

I set myself as owner and set my wife as another user.

How do I give the other user access to some of the apps I have installed, without re-installing the apps in the other user space?

# Answer
You reinstall the app, but they use the same install with different data, so the apk isn't downloaded twice (when you click install on a app that is already installed for the other user you will notice it is quite quick). So they already use the same app.

However if you want to share data, you could use one local account, or log in both yours and your wife's local account into the same account for whichever service you wish to share.
> 9 votes

# Answer
I haven't read Android 5 manuals, everything said is just a ~2 hour experimentation since I've opened nexus 7 box and upgraded it to Android 5.

There are several types of users: Owner, Normal, Restricted and Guest.

* Owner can share an installed application to Restricted users (even if it is purchased application). Data in this case is separated (each user has his own app data).
* Normal users can install apps on their own (haven't tried yet to share from normal user account to restricted). Normal users do not see applications installed by owner.
* Guest user can use a base set of applications from vanilla installation (may be more) and all his cached data can be removed upon next login or data can be reused.

These observations are incomplete.

If you desire to grant access to applications you installed in your account to your wife, probably best way is to create a restricted account for her, otherwise you may need to pay for some of these apps again.
> 2 votes

# Answer
I was able to share apps on our Nexus tablet, running Android 5.0.2. We have two accounts, mine (as owner) and my wife's. I had installed some apps as owner. Then, when logged in my wife's account, I opened Settings, then Accounts, and added my Google account (so my wife's account has both her Google account and mine registered). I disabled notification/sync for email etc. for my account. Then, I was able to visit the App store and install apps that I had purchased with my account, such as Beautiful Widgets
> 0 votes

# Answer
That's not ideal. All you have to do is turn on sync and you can then read all your emails.

A solution I've just tested and seems to work is to install your purchased apps on your user. Switch to the other user and add your Google account. Then install again all the apps you wish to share. Once installed for them, remove your Google account. The apps stay and are usable for them.
> 0 votes

# Answer
**Google Play's Family Library** with app and game sharing goes live July 2, 2016.

From the relevant post on the website Android Police:

> Family Library and sharing have been a long, really long, time coming on Google Play. In his different app teardowns, Cody has repeatedly discovered strings pointing out to the feature coming to Play Books, Play Movies, Play Services, the Play Store, but up until recently, the only Google entity that had benefited from any kind of family sharing was Play Music and its Family Plans.
>
> But at this year's Google I/O, Google announced that Family Library was coming to Google Play app and games purchases with the new changes taking effect on July 2nd.
>
> \[...\]
>
> What *has already* changed though are the terms of the Google Play Developer Distribution Agreement. A new section 5.4 explains how a family group, with one manager and different members, can purchase the product once and share it with other members of the family. So starting July 2, any purchases you make on the Play Store will be available for sharing with your other family members.
> 0 votes

# Answer
Old question and not sure if this works on ancient Android versions. This answer is for other users struggling to find the solution, tested on Android 13. You can use this command in adb shell or in terminal emulater with root access:

```
pm install-existing --user USER_ID PACKAGE_NAME

```
> -1 votes

---
Tags: 5.0-lollipop, nexus-9
---


# Question
Title: Assign a default app to a file type in Android 11
Is it possible to assign a default app to a file type in Android 11?

In Android 7 I had no problem to assign e.g., `.mp3` file type to a particular application (e.g. to Laya Music Player).

Now, in Android 11 I don't see any way how to reach it. If it is possible, please tell me, how.

**EDIT:**

To be more specific, I want in *arbitrary* file manager:

1. See the icon of the application chosen by me (e.g. Laya Music Player) near every `.mp3` file.
2. After tap (or double-tap) on to be opened in that application (Laya Music Player).

# Answer
This is not the fully satisfactory solution, but the beeshyams' comment under the question suggests that *Android most likely doesn't provide this feature anymore.*

Some file managers, as Total Commander or MiXplorer have an option to

* assign different file extensions (as `.mp3` or `.pdf`) to an appropriate, selectable application,
* save those assignments for future use, and
* edit / remove every such individual assignment.

Unfortunately, such assignments are **only internal** ones, i.e.

* those file managers **will** open the appropriate applications by tapping / double-tapping on the file name,
* but other applications (and Adroid OS, too) **will not change** their appearance and behavior.
> 2 votes

---
Tags: files, android-11
---


# Question
Title: Why does my stock Samsung Galaxy phone/tablet lack some features compared to other Samsung Galaxy models?
I have Samsung Galaxy M12 on stock Android 12. When I'm reading about Samsung features on the internet (including -related questions here), sometimes I found that I don't have such features on my phone, like Secure Folder.

What are the possible reasons for the lack of features?

# Answer
**There are at least 4 possible reasons:**

* Device model
* One UI Core
* Android Go
* Android versions

---

### Device Model

Newer Samsung phones and tablets tend to have more features despite having the same Android version (One UI version). Example:

### One UI Core

One UI is Samsung's customization on Android OS available since Android 9 Pie for the Samsung Galaxy series. While it packs many additional features outside of AOSP, there is also One UI *Core*, the stripped-down version of One UI usually found on budget models such as Galaxy M and A series.

Some known missing features:

### Android Go

Android Go is an Android variant optimized for devices with low memory spec. Although not Samsung-specific, some features may be disabled:

* Notification Access
* Do not Disturb
* Picture-in-picture
* VR helper services
* Zen mode

### Android versions

Android versions also affect which features are available on the device, although this is also not really Samsung-specific. *(Since there are too many differences, please refer to Wikipedia for the summary of each version)*

---

References:
> 5 votes

---
Tags: samsung, stock-android, samsung-one-ui
---


# Question
Title: Create Google passkey for Web authentication
Webauthn passkey support is mainstream as of Chrome 108.

How do I generate a Google passkey using my android device?

# Answer
> 2 votes
You'll be automatically prompted to create a passkey when visiting a Webauthn site or using an app that supports it.

---

If you want to kick-start the process:

* Open https://www.passkeys.io/
* Enter your email address
* Enter the OTP sent to your email address
* Tap "continue" when you see a prompt similar to this:

To test:

* Logout
* Login again and notice you don't need to enter a password

---
Tags: chrome-for-android, password, passkey
---


# Question
Title: Can an Android device connect to the internet before decrypting the storage?
Can an Android device connect to the internet before the user enters their decryption password? I assume it cannot connect to saved WiFi networks, as these should be encrypted, but how about mobile networks?

# Answer
> 11 votes
Yes, it can. Android uses File Based Encryption which has **Device Encrypted** storage that encrypts device data and non-personal user & app data without screen lock credentials so that this data can be decrypted in **Before First Unlock** (BFU) state. **Device Encrypted** (DE) storage includes data like WiFi passwords, Bluetooth connections, alarms, theme, wallpaper, apps & device settings. Apps can also mark some of their data to be encrypted by DE so that they can operate in BFU state. Most of your personal and app data is encrypted under **Credentials Encrypted** (CE) storage which requires screen unlock credential for decryption.

Mobile networks and SIM card does not depend on device encryption. Only `/data` partition is encrypted. `/system` and `/vendor` partitions kickstart the hardware components. As soon as their firmware is loaded from `/vendor` after verified boot checks, modem starts searching for mobile networks and then SIM card authenticates with the station. You will receive incoming calls and SMS but you won't be able to see their contact names. For security reasons, the incoming SMS is not shown in BFU state either. As device settings are decrypted at BFU state, your device knows your preferred connections to choose from. From Android 12 onwards, you can disable 2G connections.

Android 12 devices support Resume on-reboot feature which schedules reboot for OTA updates. This requires an internet connection before and after the scheduled reboot so that the device can connect to Google servers to obtain the encryption key which is used to fully resume the device without having you unlock it.

---
Tags: internet, disk-encryption, wifi-password
---


# Question
Title: I deleted my .asec files, what happened to the apps on my SD-card?
I have a phone with Android 4.4 kitkat and a 32GB SD card on which I had noticed the .android\_secure folder was taking up 1.5GB of storage so I decided to free up some storage. There were apps in the folder that I didn't have installed on my phone anymore so I thought it'd be safe to delete them as they were not used by my phone anymore. Many apps also had their creation and modification dates set to a couple days ago instead of the date they were actually installed which I thought was odd.

I didn't expect anything to go wrong, but after deleting some asec files and putting the sd card back in the phone, I noticed not a single app from my sdcard loaded. I waited a bit but even after it was mounted my apps weren't there. To my horror when I went in settings and looked under the apps, all my apps were gone. I tried recovering the deleted asec files and putting them back but the apps don't appear anymore. Luckily the asec files only contain the apk files of the app, and the data is stored on the phones internal memory right?

How can I get the phone to read the asec files again? Or if I can't get it to load the asec files, can I reinstall the apps and will the data still be kept or is the app data deleted? Lastly I want to know if it's safe to put an sdcard with apps from one phone onto another phone and be able to swap the sd card between the two phones or if that might also cause the phones to reject the asec files?

# Answer
> 1 votes
It took a bit of testing but I found what I was looking for.

I reinstalled some of the apps from apk files I had on my sd card and both surprisingly and unsurprisingly my data is actually still there! Even the installation date of the app is the date still the same as it was before its asec was deleted, I assume the installation dates are then stored in the app database, which is stored as /data/system/packages.xml. This answers the most important question: If you deleted your .android\_secure or deleted your .asec files, the app data will likely still just be safe in the phone memory, luckily. For data recovery I would suggest testdisk and photorec or recuva, so if you don't remember what apps you had installed to your sd card you can actually partially recover the asec files and see what apps are deleted and the dates of when they were last edited. The files themselves are hard to recover but the original folder structure can be restored. The reason I think the recovered asec files don't work is they are most likely fragmented files and the recovery tools have a hard time puzzling the pieces of a fragmented asec together as it's encrypted and not a clear structure of data. Reinstalling the app from the same apk you had before pretty much writes the asec identically to how it was before it was deleted.

Asec files keys are stored under /data/misc/systemkeys/AppsOnSD.sks and I assume it's safe to move the sd card between different phones and the apps on sd card should be fine. If you install one app on the same card from different devices it'll store multiple dm-crypt volumes with each device's separate key. I don't know yet why the .asec files appear to be rebuilt or modified sometimes, they seem to have their creation dates all updated at once at a seemingly random dates in groups.

Conclusion: It's no big deal if you delete your .asec files, you can always reinstall the apps from a .apk file and it will create a new one for the app and it leaves the app data untouched after reinstalling. The app data and cache is kept even if the .asec file for it is missing, so also if you want to delete an app, make sure to properly do it from settings because deleting the asec or apk files leaves the app data under the /data/data folder where you can't access it or delete it when you don't have root access.

I couldn't find much useful information about this online so I hope this info helps or teaches someone a bit about how this app2sd works.

---
Tags: applications, sd-card, data-recovery, app2sd
---


title: Run C-executable from SD card on Termux

text:
# Question
Title: Run C-executable from SD card on Termux
I have just installed `termux` in my Android 6 phone and have given storage permissions so I can read, write or compile from the terminal in the folder `/sdcard/myC/` by using `clang -o birthday birthday.c -lm`. However, when I try to run the executable, I get `-bash: ./birthday: Permission denied`.

I have tried compiling and running in multiple places, i.e. `/sdcard/data/com.termux`, and have tried the command `termux-setup-storage` that ensures the permissions are granted to read/write. I have tried to `chmod` the program as well.

I should be doing something wrong because apparently, the app is really good.

# Answer
> 4 votes
Finally I got it to work. Programs can only be run if they are located at the home directory of `termux`. That is, run `pwd` to know where the home directory is and put the source files there, then compile and run, enjoy!

# Answer
> 1 votes
Files store on `/sdcard` cannot have execution permission on android.

You can copy the binary generated to `/data/data/com.termux/files/home/directory/of/your/choice`.

Then make it executable by using `chmod`

Or, you can use this program to do that for you.

Usage:

```
binrun <your executable> <arguments...>

```

Ps: I made that program

---
Tags: external-sd, file-permissions, termux
---


# Question
Title: Does anyone else have to re-register their fingerprints every few days?
Not an Android question exactly, but has happened on every Android phone I've had including my current phone, a Pixel 7 Pro. My **fingerprint unlock** stops working after a few days and I have to reregister my fingerprints to get it to work again. Not specific to any one finger, happens on all fingers. It is not forgetting the fingerprints, they are still showing as saved. I think the subtle variations in dryness of my skin from week to week cause them to become invalid but I am not sure. Does anyone else have this problem?

Note that this is not affected by my fingers being wet or dry. I have also tried registering my fingerprints when my skin is at different levels of dryness (e.g. summer and winter profiles), but that does not seem to solve the issue either.

# Answer
> 1 votes
Maybe you can try a couple things, like wash off the screen and your hands and try registering again, or maybe you can try to register one finger multiple times. From experience the software learns to recognise the biometric unlock methods when using them, so usually when I set my fingerprint I lock the phone, use biometric unlock, then lock the phone and unlock again and repeat that a couple time wich usually makes it read my finger better. Maybe you are trying to unlock it in a way that's different to how you held the phone while registering.

I don't see how it would forget the fingerprint data. Maybe you can just try to unlock using your finger a bunch of times in a row for a couple days and see if it still stops recognising your finger. I hope it helps.

---
Tags: fingerprint
---


# Question
Title: Can I restore backup in WhatsApp from first Gmail account when currently my data is being backup in the other?
All my data was backed up in my Google account, then I login WhatsApp in my other mobile and backed up next data in other second gmail account. Is there any way way to restore data from first account too?

# Answer
Normally WhatsApp makes local backups too. I assume when you say other mobile you are using WhatsApp on a second phone, so on the first phone you might be able to open WhatsApp and go to settings, backup and tap make a backup now. It should make a local backup to your internal storage or sdcard if you have one under a folder named WhatsApp. The backups are encrypted so you can't just modify them. The key is stored in the app data. There is information on how to merge WhatsApp databases on XDA forums but it requires root.
> 1 votes

---
Tags: whatsapp-messenger
---


# Question
Title: How can I view which app has the permission to turn on and off the location services in Android?
How can I view which app has the permission to turn on and off the location in Android? I use a Samsung Galaxy S9 phone with Android 10.

# Answer
> 4 votes
As an answer to your comment, you can use PermissionManagerX. If your device isn't rooted, you can grant elevated privileges using ADB (instructions in app help). But elevated privileges are not required if you only want to see the list of permissions.

Search for `android.permission.WRITE_SECURE_SETTINGS` permission to get the list of apps:

To view also the system and framework apps, disable exclusion filters in drawer -\> Exclusion Filters.

# Answer
> 1 votes
try settings \> privacy \> manage permissions \> location\>

you should be displayed a list of the apps

Always allowed \> Allowed during the use\> Not allowed\>

**I suggest you tick the three horizontal dots on up right side of the screen to display the system processes also** and if if you don't know wtf that specific service is just make a search on google, that will keep you entertained for a while, it does for me hahah!

---
Tags: permissions, android-10, geolocation, location-services, samsung-galaxy-s-9
---


# Question
Title: How to clear bluetooth cache when it is disabled?
I'm trying to follow online guides like this or this to clear the bluetooth storage on my Pixel 5a.

1. Settings \> Apps \> All \> Triple Dots \> Show System \> Bluetooth
2. Storage & Cache
3. I want to tap "Clear cache" but the button is disabled:

How can I clear the Bluetooth settings?

---

The reason I'm trying this is I'm having problems with pairing my Pixel Buds, but only from *my* phone. I can successfully pair them from my macbook, and can set them up from another Pixel. But on my phone during Set Up it runs for a while, then fails with the error message:

> Couldn't connect Try manually pairing to the device by going to Settings

And the Pixel Buds have been renamed to "Carl's Pixel Buds" but they're not connected. Trying to connect by tapping on the entry in bluetooth, nothing happens.

# Answer
> 1 votes
I don't know why this option is disabled. The closest option I can find is

1. Settings \> System \> Reset options
2. Reset Wi-fi, mobile & Bluetooth

*This is a big hammer! Thanks to @acejavelin for more context:*

> It is probably worth stating that this does a LOT more than just reset Bluetooth settings... All saved WiFi passwords, any custom APN settings, Hotspot settings, VPN settings, Data Saver settings, etc... will all be returned to factory defaults. Clearing data on Bluetooth is only clearing the driver cache, not the actual settings, this they would be automatically regenerated with no effect.

This didn't change the `kB` for either User data or Cache, but it did remove my existing paired devices.

---

After doing this reset then rebooting my phone, my Pixel Buds successfully paired!

---
Tags: settings, bluetooth, cache
---


# Question
Title: How to find HTTP requests in apk source code
I've extracted an apk(react native) with dex2jar and jar to java through jd-qui and also with apktool, and I can view the source code but there is no clue where are the HTTP requests in the source code.

When I intercept the apk traffic I can see all the requests to graphql endoint but I cannot see in the source code, where they are triggered or stored.

I searched the extracted source code with some keywords such as `grahpql` endpoint name, and the server address but still no result.

And the code seems not obfuscated to me, just some parts are like;

```
@Metadata(d1 = {"\000\026\n\002\030\002\n\002\020\000\n\000\n\002\020\002\n\000\n\002\030\002\n\000\bf\030\0002\0020\001J\020\020\002\032\0020\0032\006\020\004\032\0020\005H&\006\006"}, d2 = {"Lcom/shopify/arrive/E2EModule;", "", "launch", "", "intent", "Landroid/content/Intent;", "app_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
public interface E2EModule {
  void launch(Intent paramIntent);
}

```

Is there any way to reach where these requests are triggered or stored on the source code?

This is the apk name, com.shopify.arrive

# Answer
There are many ways you can try

First option is to Reverse engineer code into dex and decompile using any tool like fernflower or CFR. Then apply regex extract script to pull all the http links. Reference of code

Second option is to use pre-build tool like MobSF Automated tool which is used to extract http urls

Another possibility is that the developer of app has hide the urls/link in the splitted way or has encrypted it, in that case you can do dynamic analysis to fetch the urls along with the file from which url is being called.

Another possibility is that developer has hidden it in the binary usually written in C using JNI Java Native Interfaces. You can use tool like IDA or Ghidra to disassemble code to have sneak into it.Here is tool

There are some other ways too which can be explored if these doesn't work.
> 3 votes

---
Tags: apk, https, java
---


# Question
Title: Cell broadcast for emergency warnings in Germany - why is Android 11+ required?
Germany is preparing to use **cell broadcast messages for emergency warnings** issued by the government. A first country-wide test is planned for December 8, 2022 as part of the Nationwide Alert Day 2022.

Many publications claim that reception of these cell broadcast messages will only work under **Android 11 or newer**:

However, as far as I understand, the underlying technical standard is about 20 years old, and Android has supported cell broadcast for ages (since at least Jelly Bean / V4.1, release 2012).

**So why should there be a problem with Android versions before 11?**

# Answer
*I'll try to answer my own question :-)*

## tl;dr

This seems to be a misunderstanding. **With Android 11 or later, cell broadcast messages for emergency warnings are pretty much guaranteed to work, but they work on many devices with older versions, too.**

---

## Source of the claim

This claim seems to be based on a misunderstanding - probably some press release that got misquoted or incorrectly abbreviated somewhere along the line.

It is unclear where this claim originated. Many news sources have published it (see links in question), but the sources I found all do not attribute the claim, and use similar wording, so they probably copied it from some press release or article somewhere. The official site of the responsible German government agency (*Bundesamt für Bevölkerungsschutz und Katastrophenhilfe* \- https://www.bbk.bund.de/ ) does not mention Android 11 specifically - instead, it lists individual phone models that are or are not supported (Kann mein Gerät Cell Broadcast empfangen?).

## Technical details

* Each Cell Broadcast message contains a "message identifier" or "message ID" (also called a "channel" on some phones), a number from 0-65535. That message identifier tells the phone the type and content of the message, such as a weather report, a technical message, or a warning message.
* For emergency warnings, specific message IDs have been reserved for different types of warnings, in particular IDs 4352 – 6399. The technology, along with the message IDs, is contained in the standard ETSI TS 123 041, at least since version 9.2.0, published in January 2010. The new German warning system, specified in the offical standard Technische Richtlinie DE-Alert, basically follows this standard.
* Support for emergency warnings via Cell Broadcast mainly requires that the phone reacts to Cell Broadcast messages with these message IDs. The offical Android source code has supported these emergency warning message IDs since at least V4.2/Jelly Bean (see source code).

## Conclusion

The offical Android source code (as published by the Android Open Source Project) has supported cell broadcast emergency warnings with the standardized message IDs since at least V4.2/Jelly Bean, so **in principle emergency warnings should work at least with all phones running Jelly Bean or later**..

**However**, phone manufacturers (and even mobile network operators supplying phones to customers) can and do customize the official Android source code they put on their devices. It is *possible* that some of them removed or deactivated warning messages, either entirely, or specifically for German phone networks, as these warnings were not previously used in Germany. For example, on older Samsung phones warnings are supported, but must be manually activated (offical Samsung page).

This **changed with Android 11**. Before, emergency warning support was part of the general source code, which manufacturers modify and ship to end users. In Android 11, a new Cell Broadcast module was introduced. While the actual functionality seems mostly unchanged, the new module can be **updated individually by Google** via OTA updates (specifically as an APEX package). That means Google can push updates without requiring a complete Android OS update, and independently of the manufacturers (who may not want to provide updates for old phones).

That means that phones which

* run Android 11 or later, and
* are up to date with Google updates

are practically guaranteed to support emergency warnings, as Google has provided a suitable update. However, many phones running Android 4.2 or later also support these warnings.

## Check settings

To see if your device supports warning messages, check Android settings, or the message app settings (depending on device). If the configuration is available in the settings (look for a section called "emergency alerts" or "wireless emergency alerts"), and if the alerts are activated there, the phone will most likely support the warnings (unless the manufacturer made complicated changes, which is possible but unlikely).
> 5 votes

# Answer
That's not an easy to answer question. According to reporting Germany extended the GSM standard that already was provided by most mobile phone vendors, by insisting on a message-identifier length of four instead of three digits. Germany formerly relied on a bunch of apps like

* NINA
* BIWAPP
* Katwarn

to only name the best known ones. Neither of them were widespread enough to provide propper warnings for all citizens, nevertheless the Bundesamt für Bevölkerungsschutz und Katastrophenhilfe (BBK) pushed for these apps instead of an app-independent solution so much that some vendors even removed the CBS functionality completely if the device ought to be sold in Germany (my LG for example does not provide it). This would be another obstacle to overcome now anyways.

Interestingly enough does section 9.4.1.2.2 of TS 123 041 specify the four digit message-identfier 4370 to 4393 used by DE-Alert even in version V11.4.0 of 2012 for PWS/EU-Alert. So why this shouldn't be implemented in most phones for years, I don't understand. Perhaps I have misread the whole thing but for me it represents as a lack of pressure from other countries to implement the standard. Additionally, as the working group for critical infrastructure (AG Kritis) in Germany states: the practice (in other countries) in the past were three digit message-identifier (reserved for operator messages according to TS 123 041). **But** the BBK amended it's requirements in a way that older devices would also receive a message-id 919 in parallel for highest severity, unfortunately they did this too late for other providers than T-Mobile to comply before alert day was due.

---

## TL;DR: Other countries used existing functionality in phones to implement PWS while Germany relied on apps for years. Which is the reason they decided to drop backward functionality for older phones until it was too late for the test on alert day.

Sources:
> 1 votes

---
Tags: android-11, cell-broadcast
---


# Question
Title: How to block Wi-Fi on tablet via interface without possibility to restore
Is it possible and how to block Wi-Fi on a tablet via its Android's interface without possibility to restore Wi-Fi back via the interface?

So that I would be able to restore Wi-Fi only with root permissions or by means of reinstalling Android

Maybe type a password somewhere and forget it. Or something else, I don't know...

# Answer
> 1 votes
There are **apps** that will block Wi-Fi, meant for parental control.

However, the easiest way to do it is on the **router**. You can easily set up a rule on the router to block that **MAC address**. The proviso is that the tablet is not set up for random MACs.

---
Tags: wi-fi, tablet, internet
---


title: Clearing Wifi Data Usage Statistics

text:
# Question
Title: Clearing Wifi Data Usage Statistics
I have a rooted Samsung Galaxy Tab S8 Ultra and I have been trying to clear the "Wifi Data Usage" statistics in the setting menu.

It seems like there was someone that asked the same thing 7 years ago. How to clear the data usage?

However, this method seems outdated. I was not able to find any files to delete in the /data/system/netstats directory.

I've tried different file manager applications, including termux, to see if there were any files, but It was empty.

I'm in a situation where I have to frequently clear the statistics, so doing a factory reset every time is not a viable option.

# Answer
> 1 votes
I don't see why this method will not work on rooted phone as well.

1. Go to **Settings**
2. Select **Connections** (Internet/Networks)
3. Select **Data Usage** (towards the bottom)
4. Select **Billing Cycle and Data Warning** (Data Warning and Limit)
5. Select **Start Billing Cycle on**
6. Select Today's Date and press **Set**

---
Tags: samsung, root-access, data-monitoring
---


# Question
Title: Charging Boot Loop on Samsung Galaxy Tab 2 7.0
I have a rooted Galaxy Tab 2 7.0 (p3113) that has worked fine for over a year. After draining the battery completely out (which I have done many times before), I plugged it in to find it stuck in a boot loop. When I plug it in over USB or a normal outlet, it shows a battery with a frozen spinning dial in the center. It then shows the same battery icon that starts animating and filling itself for about a quarter second, before shutting down and doing the same thing all over again. I can't boot in to recovery or download mode (It doesn't get to that boot stage before shutting down), and the only way to stop the loop is to unplug it. It almost seems like the act of showing the charging icon is depleting the small store of battery and making it turn off. It is not on long enough to be recognized by my computer and so I can't do anything with that (no adb or fastboot).

Is there anything else that I can do to get it to boot to recovery or stop booting on charge altogether? Or is it now just useful as a paperweight?

# Answer
> 2 votes
After leaving it in the loop for days using 4 different wall adapters and a USB port, I found the wall-to-USB adapter that originally came with my device. I plugged my tablet in with that and it booted normally and started working; I don't know why that fixed it, but it did.

# Answer
> 0 votes
I had the intuition that the screen was discharging the tab, so, I tried disconnecting the ports that were draining the battery and charging till it could hold the initial charging phase.

# Answer
> 0 votes
Open it, unplug everything, leave for 10 mins, plug everything back in, and plug in the charger. Should work again. This is tested.

---
Tags: boot-loop, samsung-galaxy-tab-2-7
---


# Question
Title: Delete "Not assigned" Contact Group on Samsung Galaxy S9+
On my Samsung Galaxy S9+ in my Contacts app, I have a group called "Not assigned" with 712 contacts. How do I delete this group and its contacts that are not in other groups?

These contacts are not sync to Google. The rest of the contacts are.

# Answer
If you got those 'Not assigned' contact from a google account then you are in luck.

* Log in back to that google account to which those 'Not assigned' contacts belong.
* Once you log in, those 'Not assigned' will be assigned back to the google account that you just added.
* Select that google account in the display option.
* Now you'll be able to bulk select all contacts and delete them. (Note: it will also be deleted from your synced google account but you can easily and quickly recover it from https://contacts.google.com/trash or from VCF file)
* Now you can remove your google account from your Samsung device without leaving any 'Not assigned' contacts.
> 1 votes

# Answer
Not the solution I was looking for, but I tapped on each contact and deleted it. This required 4 taps per contact. My wrist was getting sore half way through. It took me about 1 hour.
> 0 votes

---
Tags: samsung, contacts, delete, samsung-galaxy-s-9
---


# Question
Title: How can I use browser userscripts on my Android phone?
I am a passionate Stack Exchange user and I have a lot of userscripts in my desktop Chrome browser, installed with Tampermonkey. I want to use them on my Android phone, is it possible?

# Answer
> 11 votes
Google Chrome on Android so far doesn't support plugins, of which Tampermonkey is necessary to run userscripts, so here I recommend Firefox for Android. You can install Tampermonkey addon in Firefox and then start with your favorite scripts. Note that all userscripts are not compatible with Tampermonkey such as SE-AutoReviewComments for which you need USI- Unified Script Injector addon.

### Where can I find scripts to play with?

Stack Apps is a Q&A site for apps, scripts, and development with the Stack Exchange API. People discuss about developing around SE, and publish their projects there. You can find a lot of userscripts in the scripts section.

### One of my scripts isn't working

beeshyams asked me this question before, but I wasn't a Firefox user then, so I installed Firefox fresh and installed that userscript, and found nothing wrong.

When you encounter some issues with userscripts, try removing and reinstalling them, as well as clearing/resetting your Firefox addon, and see if the issue resolves by itself. Usually this solves 99% of them.

# Answer
> 1 votes
Tampermonkey or any other userscript manager can no longer be added to Firefox as of writing this answer. It was never even possible with Chrome. However, You can instead install actively maintained android firefox fork iceraven that supports extensions like tampermonkey, greasemonkey etc.

# Answer
> 1 votes
The situation changes all the time, I was using Firefox 68 for that but later versions drop add-on support. And using old version 68 is not very safe.

But hopefully Kiwi Browser took the relay of Firefox for browsing with userscripts on Android:

Since 2021 or so, **I've been using for months without problems tons of userscripts with Violentmonkey (open source)** and many userstyles with Stylus **with Kiwi Browser!**

It can install and run also other extensions from the Chrome Store.

# Answer
> 1 votes
It is possible with the help of **Xposed framework**.

I am the author of `ChromeXt` which adds support of UserScripts to Android Chrome: https://github.com/JingMatrix/ChromeXt.

---
Tags: firefox-for-android, browser-add-ons
---


# Question
Title: How can I check storage I have used on Google photos
I know google photos is giving unlimited storage (for 16MP photos and 1020p videos). I have uploaded around 5000 photos and videos, but I cannot find the storage I have used.

# Answer
> 17 votes
How to find storage requirements of your free Google Photos:

1. got to https://takeout.google.com/
2. pick only Photos for download
3. select parameters of the archive
4. wait for the process to finish (you will also get email)

You will then see the size of the archive(s) before downloading. As a bonus, you have now complete backup of your Google Photos.

# Answer
> 8 votes
Check here: https://drive.google.com/settings/storage

There under "Total storage" you can see your used storage, and below when you click on "View details" you can see the details:

```
Storage details

XX.XX GB used
Drive   X GB
Gmail   X GB
Google Photos   X GB

```

# Answer
> 2 votes
It is available in google drive as well as from within the photos app.

**Photos App**

1. Open photos app.
2. From the side menu, tap on settings
3. Tap on Back up & sync
4. Here you'll find backup account details with the storage analytics.

---

**Google Drive**

1. Visit drive.google.com
2. Click on the gear symbol at the top right. That's the settings
3. Under settings you'll find storage which should give you a fair estimate on how much storage space you've used and how much is remaining

If you need a breakdown of which google app is using how much storage,

1. Visit drive.google.com
2. To the bottom left you'll have a notificiation that says - x GB / Y GB used.
3. Click on it and it gives you a breakdown where in you should be able to see how much data google photos is taking up.

# Answer
> 1 votes
Firstly update photos app on playstore then, Go to google photos app - - click on profile icon - - click on account storage option - - click on upload size - - there on the top you will xx storage out of 15gb used!!

Best luck!!

# Answer
> 0 votes
Google very annoyingly refrains from revealing a list of *which* photos/videos count against your quota.

If it makes your blood boil, I'm with you.

The only tools that I've found (after searching for hours) are:

and

But those do not fully address the question.

---
Tags: google-photos
---


# Question
Title: Place all app icons on one home screen instead of two on Redmi Note 10 (MIUI)
I just switched from Xiaomi Redmi Note 9 to the Note 10. I haven't started installing apps on the 10, but already the home screen is split into 2 pages.

On my old phone, everything was on one screen.

How do I fix this? I'd also like to get rid of the "weather, time, and search bar" theme, it's taking up too much space.

# Answer
> 2 votes
Turns out you can long press those elements to get rid of them, then move the icons to the 1st screen and it will collapse to 1 screen.

---
Tags: xiaomi, home-screen-shortcuts, home-screen, miui
---


title: How do I "train" Face Unlock?

text:
# Question
Title: How do I "train" Face Unlock?
After updating my UK HTC Sensation to Android 4.0 I was keen to try out Face Unlock. I'm happy to say that it works *reasonably* well, however the setup process has led to me having a query.

When setting up face lock, after your face has been captured for the first time and setting up your backup access, you are given the following prompt:

> # You've Finished!
>
> To unlock your phone, just look at it.
>
> *Tip: Improve face matching by having your face captured in different conditions*

The tip sounds good, however it doesn't actually tell you how to have your face captured in different conditions! After clicking OK to the prompt you are returned to the security menu and any attempt to re-set-up face unlock just seems to over-write your previous settings (or at least I assume it does as it asks you to set up a new backup system).

How can I recapture my face multiple times to improve face recognition?

# Answer
> 7 votes
As discovered here, HTC have removed the link to the training option in the settings menu. However, the actual feature remains intact so I have created a quick app to access it.

Please note that we don't know why HTC took it out, they may have had a very good reason and I could be meddling, however I have used the training feature successfully on my sensation without any negative effects and the recognition is **much** improved.

I've put the application on Google Code, the download link being here (including CR code for devices). Please note that all use is under the MIT License \- hope this helps others with the same problem!

Also, the option seems to have been returned to it's normal position in the menu in the following android/HTC versions:

```
Android 4.0.3
HTC Sense 3.6
Software number 3.33.401.53

```

Viewable in Settings --\> About Phone --\> Software Information

# Answer
> 7 votes
Go to `Settings -> Security -> Lock screen -> Improve face matching`. You will need to confirm your PIN, and then follow the on-screen directions to capture your face again.

After each successful capture you will be placed back to the `Lock screen` settings menu, so just keep going into the `Improve face matching` section to repeat the process as many times as you wish.

# Answer
> 0 votes
One hypothesis is this:

Face unlock learns automatically. Each time you unlock successfully, the function learns a new variation of your face image. Therefore the "Improve face matching" function is not needed. Just keep unlocking, and your phone will get better and better at it. But be patient, because of security concerns the learning has to be slow and reluctant.

This is only a hypothesis. I have asked in a Google forum whether it is true or not, but got no answer.

# Answer
> 0 votes
To train face unlock for the fastest unlock:

* hold your phone perpendicular, like taking a selfie
* allow for the offset between where front lens is and your nose
* blink before training, and when opening

Blinking is important, and results in a virtually instantaneous unlocking.

AFAIK, only fingerprints can be registered multiple times; that is done by reusing the same finger and registering it as a different finger. While most people only have one face to register reusing your finger gives misrecognition a chance to *carry over* to the *next* finger, increasing the opportunity to recognize a dirty finger.

If the option is available on your phone there is an "Add alternative look", for glasses, hairstyle, or a second chance:

---
Tags: 4.0-ice-cream-sandwich, htc-sensation, face-unlock
---


# Question
Title: ADB sideload lineageOS Samsung J530F: E3004 This package is for device: j5y17ltexx; this device is
## Context

While trying to sideload this LineageOS from this link, on a Samsung J530F I'm getting the error:

> E3004 This package is for device: j5y17ltexx; this device is .

Normally that message can be used to indicate you are trying to install the wrong/an incompatible operating system on the phone. However, in this case the `this device is .` does not show what the device type actually is. And when I rebooted the phone into its original recovery mode, it said on top:

```
Phone type is:
j5y171texx/j5y171te.

```

So I think the lineageOS package is the right one for the right phone.

## Image with Error:

## TWRP version

TWRP version is: `3.1.1-0` from the Team Win Recovery Project

## Question

Why does the phone not indicate what type it is/how can I ensure the lineageOS file is installed anyways?

# Answer
> 1 votes
The answer was to update the twrp version to version 3.2.x. I tried roughly 14 TWRP versions until I found a working one. Additionally on that one I installed TWRP 3.2.x from TWRP 3.1.1-0 (which was installed on the RECOVERY partition), onto the BOOT partition.

Within that new TWRP, the error on installing the Lineagos zip changed from the above to error 7, which also implies the image and the phone are not compatible. One could overrule that by unpacking the image, taking out some asserts, and repacking it. However, I did not do that, instead I found an /e/ os image in this link which did work.

---
Tags: lineageos, side-loading, samsung-galaxy-j5
---


# Question
Title: How can I change the Google account used by the Google Lens app?
I use a Pixel 6 and Android 12. When opening the Google Lens app for the first time, the following dialog appears:

> **Welcome to Google Lens**
>
> Google Lens helps you search what you see. You're signed as `account@example.com`
> This account will be able to see your Lens, Search, and Assistant activity.
>
> `Cancel` `Continue`

How can I change the Google account used by the Google Lens app?

# Answer
Lens seems to be integrated with the Google Assistant. So you'll want to change the account that is selected to be used for the Assistant.

**Fast way (using Settings search)**

* Settings (app)
* Search at the top for "assistant"
* Pick the account here you would rather use

**Long way (going only through menus)**

* Settings (app)
* *Apps & notifications*
* *Assistant*
* *See all Assistant Settings*
* Pick the account here you would rather use
> 1 votes

---
Tags: google-account
---


title: How can I edit values in memory?

text:
# Question
Title: How can I edit values in memory?
Is it possible to edit values in memory used by an app? I would assume this requires root.

# Answer
That may be possible without root if the app you want to manipulate allows debugging via Android Debug Bridge (ADB). If an app can be connected to an debugger is specified in it's `AndroidManifest.xml` in the `android:debuggable` entry.

If the app is enabled for debugging you can enable the USB debugging mode on your device and connect to it via adb. Then you can connect an standard Java debugger to the app and inspect/modify variables.

If it does not allow debugging you can try to decompile it using `apktool`, change the debuggable value in `AndroidManifest.xml` and the re-build and sign the app (using a custom generated key pair).

A second alternative would be to include Frida Gadget into the app and load it at run-time. Then you can use Frida to connect to the app on an unrooted device and hook Java or native methods as well as modify app memory.
> 4 votes

# Answer
In Android the system memory is just another file, so with the appropriate rights it's just as simple as `vi -b /dev/mem` (device node may vary for your system). The result of changing a running system's memory could be one of a nop, a touch of an electric fence, a system crash or a simple nuke resulting in an unusable device.
> 2 votes

# Answer
You can use a program called `ACE Engine` to scan and edit memory value of any running app or program in android which can be download here

you need to install the program with adb and run the program in adb shell

1. run `ACE engine` and select a process which you want to edit its value.
2. scan for value in process's memory, like a coin, health or anything
3. you may got a couple of matches result you can reduces the matches, by changing the value in the game and scan for the new value to reduce scan results
4. repeat the processes until you got 1 match
5. write any value to the address to change the game/apk's value

you can find more details in the tutorial here

**DISCLAIMER!!!: I am the author of this program**
> 2 votes

---
Tags: ram
---


title: Where does Magisk look for image files?

text:
# Question
Title: Where does Magisk look for image files?
I'm attempting to root a Nexus 5x. I've installed Magisk 25.2 but I don't know where to place the image file so that Magisk can find it. When I select "Select and Patch a File", Magisk allows me to select from "Recent", "Audio", "Downloads", and "Photos". Where are these folders on the file system so that I can move to the image file with `adb push`?

# Answer
> 0 votes
If you click the three dots in the top-right corner, you'll see the option "Show Internal Storage". Once you click on that, the "Internal Storage" item will show up in the side bar. Clicking on that, you'll see various subfolders which are contained in `/sdcard` (at least, on my phone).

---
Tags: rooting, magisk
---


# Question
Title: How to copy the phone number of the sender of a text message?
I'm using a service to report SMS spam via text messages. First step is to forward the text message, and the second step is to send a text message containing the phone number of the spammer.

I achieve the first step by doing a long press on the message itself, then I have a forward menu. But I can't find a reasonable way to do the second step.

I can see the phone number in various places, but never in a selectable text field. So I have to create a new contact for the spammer, give him a name, tap the phone number text field, copy, and go back a few steps to create a new text message, then paste the previously copied phone number.

Is there a faster way to do this ?

# Answer
The message itself reacts to a long press, but the contact bubble on its left reacts to a single tap. Then you can long press on the phone number in the bottom field, and you can copy the phone number from there.

Edit:

There has been a change in in Android 6.

This answer does not work with the new message application.

With Messengers (as opposed to Hangouts, you can't copy the phone number by tapping the bubble icon.

Instead, tap the three dots in the top right, then find Participants et options (not sure what it is called in english), long press the bubble the label or the bubble of the person you want to copy the phone number from, then copy.

Unfortunately, the actual copy operation behind the menu doesn't seem to be implemented. The phone number is not copied using this operation..

This is inconsistent with the previous way, but it makes more sense in a way, if it worked.
> 2 votes

# Answer
Press the three dots top right. Choose 'Add Reciptent'. Phone No. appears in a box with a red minus sign to the right. Tap on the number. Choose 'Edit' from the box that appears. Long press on the phine number. Select 'Copy' from the menu which appears (3rd right). Open a new text message. Press inside the message box. 'Paste' appears. Selecting it - Bingo!!!
> 3 votes

# Answer
As an alternative, you should be able to automate this process very easily via Tasker. You can configure certain qualities of a spam message and have Tasker automatically forward it, or you could 'tag' the message somehow (reply with a certain string possibly) and have Tasker detect the tag and forward the corresponding message.
> 0 votes

# Answer
On Samsung phones (tested with a Samsung Galaxy Note10+), with the Messages application:

1. Tap on the number.
2. Tap on the (i) icon that has just appeared.
3. On this new screen, long-press on the number.
4. In the menu that appears, choose "Copy".

Unfortunately, it is currently not possible to long-press on the number at an earlier step.
> 0 votes

---
Tags: sms, 5.1-lollipop, google-hangouts, copy-paste
---


# Question
Title: Change System Language to one not listed?
I have a Samsung Galaxy Grand Prime, which isn't exactly the most high-end Android/Samsung Smartphone out there, I do not have a lot of features that other people have, and I was simply wondering if there is any way to change the system language to Japanese. When I go into Settings \> Language and input \> Language, I only have the options shown in this image:

Is there any way to change the language to Japanese or am I out of luck? Thank you in advance.

# Answer
Background:

Firstly please take a look at the similar post: How do I add a new language?.

> Adding a full language support for a device is done at ROM level, the langauges that the default keyboard will support are added before compiliation and the android keyboard will only give you the option to download dictionaries for the languages it supports..

Generally it is not easy to add a new language to the OS if it is not done by the manufacturer.

> The best solution will be to flash a new ROM that holds your desired language, either a stock ROM made for your area by your device manufacturer or a custom ROM.

---

Having said that, nevertheless it could be that the ROM supports many languages but are **hidden** because of things like:

* CSC (Customer Service Code) location
* Region or
* Carrier

This behaviour has been noted for Sony, HTC and **Samsung** devices. Luckily there is a possible workaround in this case (yay!).

Since you have a Samsung device, you may try Language Enabler (Wanam) which is recommended on this XDA thread.

> Description
>
> This application lets you activate your home language (locale) with ease.
>
> Language Enabler activate all supported Samsung languages and keyboard inputs.
>
> Starting with Android 4.2, the permission to change your system language became protected.
>
> If you are familiar with Android developments tools, then you can grant the required permission to the App without root, by executing this command through usb `adb -d shell pm grant com.wanam
>  android.permission.CHANGE_CONFIGURATION`
>
> If you have root access on your device then Language Enabler can automatically do it for you.
>
> This application supports all languages / locales: Arabic, Chinese, Indian, Spanish, French, Hebrew, Farsi... عربية، عبرية، فارسية.
>
> There are some devices variants (US,Chinese) that remove completely all unused languages, sadly there is no much thing we can do in this case.

Features :

* Choose *language to be enabled (83+ languages)*
* Display Languages on their Locale encoding
* Auto Backup your stock language settings
* Restore your stock language settings

**Important**

*This app doesn't add any language support, it just enable all supported languages, so if you don't get your local language after reboot, that means it's not supported in your ROM.*

Please remember to share you feedback in comments section
> 6 votes

# Answer
I'm aware that this is an old post, but I've decided to leave my answer here. So if anyone in the future is stuck, they can reference from my post.

Most of articles that I've found bait you to install and buy their apps. I don't trust those apps and I sure don't want to pay any money for it. So I've put together what I've found based on 2 reliable sources, including the answer up there.

**(Contents are pasted down below)**

Source: How to add a new language that isn't provided by manufacturer on Android

**1. Enabling the developer mode:**

Developer mode allows you to gain access to more controls, but it's hidden by default.

So in order to enable Dev mode, do the followings:

**Open your Device (Phone/Tablet) \> Settings \> Device/Phone Information \> Tap on Build Number 7 times.**

**2. Enable USB Debugging:**

In order for your PC to control your device, you need to enable something called USB Debugging and that can be found in Dev Mode

Go back to the Settings and Search up **"Developer Options".**

In the Dev Options, scroll down until you see **"USB Debugging"** option and enable it.

**3. Using adb commands on PC:**

Now you have to **connect your Android Device to your PC** using an USB cable.

Then **download Android Studio** from Google.

You can verify your install location: `C:\Users\[USERNAME]\AppData\Local\Android\Sdk\platform-tools`.

Or, just open Command Prompt (Terminal) and go to the root folder by typing the command below.

```
cd C:\Users\[REPLACE_WITH_YOUR_PC_NAME]\AppData\Local\Android\Sdk\platform-tools

```

Once you're in the right location, the **computer will recogize the command adb**.

You can start using adb commands. Before we get into any further, we have to go back to our Android Device.

**4. Download Language Installer App:**

There is an app called Language Enabler by Wanam.

After installing the app, run the following commands on your command prompt.

This command will give the app root access to your device to make changes.

```
adb -d shell pm grant com.wanam android.permission.CHANGE_CONFIGURATION

```

**5. Langauge Installation:**

Now all you have to do is to install the language using the Language Enabler app.

Go back to the app, select the language you want to install and press install.

This'll install the language and you can now delete the app and undo everything up there as we no longer need them.
> 1 votes

---
Tags: samsung, stock-android, languages
---


# Question
Title: Is there a way to write a full vCard via NFC?
Is there a way to write a full vCard to a NFC tag? All of the apps I've tried off Google Play seem to only write the email address or other subset. I've tried apps such as NFC Task Launcher, NFC TagWriter by NXP and NFC Classic Tag Reader/Writer.

I'd like to write a vCard with one or two urls, a note field, phone number, email, name, and title. And yes, it's under the storage limit for the tag.

# Answer
> 3 votes
I've found NFC Tools to be a good app for this. You can write several default tag types, but they also offer a "raw" format, where you specify the mime type/header and content directly. I was able to make a Version 3 vcard with a small PNG image included which worked well on several android devices. Just be sure your vcard format is in spec when you do that, and be careful of space issues. Most NFC tags can't hold more than a few hundred bytes, most on the market are under 1K.

# Answer
> 3 votes
if you have an app like NFC Tools or a manual reader/writer, you can add a custom/manual data record and use text/vcard as the content type.

For the data field, just paste your vcard data like:

```
BEGIN:VCARD
VERSION:2.1
FN:Your Name
TEL;CELL:(123) 555-1212
EMAIL;WORK:123@yahoo.com
ORG:Company Name
TITLE:Your Title
URL:google.com
URL:fb.com/username
URL:twitter.com/username
END:VCARD

```

That's it! then just write to your chip. you don't need http or https unless you have redirect issues with your domain. i'm able to make my links and social feeds work without it. every character adds up. you can list as many urls as you'd like. there are other fields you can add as per the vcard standards u can look up, but i believe, these are the ones android and apple understand.

I experimented with photo encoding and could not get it with NFC. 2KB! lol way too big. I was able to link to a vcard with a photo. I even tried the URL method for inserting photos and that didn't work. I hope this helped.

# Answer
> 2 votes
In NFC Tools, there is a simple contact option.

# Answer
> 1 votes
It must be user error, because NXP TagWriter and Tagstand Writer both let me select fields from a contact to include now. I did switch to a contact in the phone as opposed to browsing for a vcf file.

---
Tags: nfc, vcard
---


# Question
Title: Why is rooting most Android phones "difficult"?
Why is rooting relatively difficult/manual-labour intensive?

I assume phone-sellers would like to

1. keep collecting data (for themselves or others)
2. and keep the users safe.
3. Be sure that warranty calls are not activated due to damaging homebrewn software.

So I assume that is why most manufacturers make it quite difficult to root an Android phone. Based on my experience, the following steps are required for rooting most Android phones:

0. Enable developer mode.
1. (Allow unlocking oem/bootloader)
2. Enable ADB
3. Find a TWRP/bootloader that works for that specific phone
4. Use some leaked/hacked tool like ODIN (for Samsung) to push that TWRP/bootloader over the existing recovery mode, whilst rooting the device.
5. Or an open source tool like Heimdall.
6. Or using some rooting app, which I assume use some security exploit in the factory-default phone/OS.

Because if the issue were merely point 2 and 3, decent support for rooting may be provided with a simple prompt asking the user: *"Are you sure? Are you really really sure?"*

I think there is quite some consumer value to be reached in rooting phones automatically, so I would like to better understand how this ecosystem works, and what the perspectives of the manufacturers are on rooting.

# Answer
Android Security is quite different from Computer OS and heavily depends on isolated apps. This is done by each app becomes a "user" with its own uid (file system permissions) so every app can only access its own directory /data/data/pkgname.

For the same reason it's forbidden to grant access to /data as that is apps internal data not intended to mess up.

Indeed that's what you expect on iPhone, iPod, Smart TV or wifi router as these are embedded systems devices running precompiled firmware.

I don't agree normal consumer could benefit from rooted device, especially not Samsung devices where this would break Samsung Knox which is must have for privacy.

The fact that some OEMs still allow unlocking bootloader is a gift to android community, it hands over the risks and responsibilities to the customizing developer and excludes warranty, which is not what most consumer want.
> 3 votes

---
Tags: rooting, manufacturers
---


# Question
Title: Why does the fingerprint sensor trigger the screen?
When I touch the fingerprint sensor while I watch YouTube in the app it activates the controls on YouTube, like I was tapping the screen. Somehow the YouTube app and maybe other apps listen to the event of the fingerprint sensor and reacts to it. This is very annoying to me since the fingerprint sensor is in an easy to reach place so it happens often. This is reproducible on different phones and android versions. Is there a way to disable this behavior somehow?

# Answer
The purpose of fingerprint is to wake up the screen (unlock screen lock).

fingerprint sensor is designed to unlock screen. it is (usually) only touched when screen is in locked state. But it does not harm to "unlock" screen each time fingerprint is detected, even it's already in unlocked state. From developers point of view there is no need for extra coding routine to ignore requests in unlock state. Like there is no need to ignore staircase light button while light is on.
> -2 votes

---
Tags: sensors, fingerprint
---


# Question
Title: How to open Google Assistant from lock screen without voice command?
On a Samsung phone, I cant find a way to open/command Google Assistant from lock screen with a touch button or even side keys. Looks like only way to open it from lock screen is "ok google" voice command. I'd like to start it via touch button or side key, not voice. Thanks.

# Answer
> 0 votes
## On Android 13

* Open **Settings**
* In Search, type in **Side**
* Click on **Side key**
* Enable **Double Press**
* Select **Open App**
* Select **Google**

Now a double press will launch it. On my Note 20, it is the **Power** Key.

## On Android 11

I cant test it, but this is supposed to work. You need to make a quick command, change Bixby to double press and assign Google to single press.

* Open Bixby
* Press on three dot menu
* Select **Quick commands**
* Press the **+** button on the upper right of the screen within the **Quick commands** page
* Enter **Google** in the field under "What Bixby does"
* Press **Type a command**
* Enter **Launch Assistant** exactly
* Press Bixby key once
* In **Settings**
* Enable **Double Press to Open Bixby** Now Bixby will launch with double press
* Select **Use single press**
* Enable it
* Select **Run quick command**
* Select **Google**

Now Google should open with one click of the Bixby button. Ref gadgethacks

---
Tags: samsung, google, google-assistant
---


# Question
Title: How to filter out repeated keystrokes like "uu" or two consecutive blank spaces and automatically turn them into one single character like "u" and " "
Cheap Bluetooth keyboards have some serious drawbacks that could be easily avoided by software. I bought one for 7 Eur and nearly half the times I hit "u" I get "uu" or "uuu", which is clearly because of faulty hardware since it doesn't happen to any other vocal or symbol and no, it has nothing to do with leaving a key pressed in order to get something like "uuuuu".

Then I got a somewhat more expensive model (15 Eur) and about one in 4 times I hit the space bar I get two consecutive blank spaces and not one, unless I hit it very slowly, carefully and in the exact center of the key.

This could be easily avoided by purchasing a 70 Eur keyboard unless you are poor like me, and the other option would be to have Android filter out repeated characters that are typed very quickly (with a time threshold like, e.g. 'filter out any repeated character that is typed 100 ms after the first one'), thus effectively turning my dreadful double blanks and "uu"s into single blanks and single spaces respectively, without me having to spend more money that I can afford right now.

Please give me a soluuution. Thanks.

# Answer
EDIT #3: ... "External Keyboard Helper Pro" $ 1.49 US, Google Play Store, does indeed have that setting, and so far is the only app I've found which I'm certain does.

EDIT #2: ... Confirmed: some phones don't have that setting except perhaps when an external/physical keyboard is attached, in which case I'd suggest using the Search field in your phone's Settings to find "physical keyboard" (worked on 2 diff phones here each with diff locations for it within Settings), or "external keyboard", or just "keyboard"... And again, as a last resort you could probably find another general Keyboard app at Google Play/Store which does have that setting, try using Google Search to find which apps include it, such as "android keyboard app with key repeat delay setting" (I've yet to see a computer/system without it since 1983, it's often one of the first settings I personalize whenever using a new system; I'm old-school IT/Tech/programmer)... HTH...

EDIT #1: ... Thx to a helpful reply here, it appears different phones have different Accessibility settings... (I'd incorrectly assumed something that Fundamental would also be Universal; my bad, sigh, lol)... I have a Samsung Galaxy S10 with Android 12; my fiance's Moto w/11 is completely different, I've just discovered; I'll try to find the setting in hers and re-edit soon...

ORIG:

Android OS-level setting: Accessibility/Interaction and Dexterity/Bounce Keys (similar to Key Repeat Rate sliders in Windows/etc.). This "should" apply to any key input, whether on screen, external, etc, tho I don't have an external keyboard for a phone to try it out;

If it doesn't, then try finding/using a different keyboard app which does have this setting directly within it (I should think most do? Google search it if needed), not just at the OS (Android) level.
> 0 votes

---
Tags: external-keyboard
---


# Question
Title: How to keep my Android phone asleep until I press the power button
When I am done with doing something on my Android phone, I put it asleep with the Power Button. I expect it to stay asleep until I press Power again, or perhaps until a phone call comes in. This is to minimize draining the battery.

However, the phone wakes up when putting it away, e.g. in my trouser bag. After several seconds the screen goes dark again. But why? Is this a 'feature'?

When walking in the dark, the phone backlight will shine through my clothes.

Is it possible to turn this 'feature' off?

I might be old fashioned, wanting to be in control in turning this thing on and off when I, the owner, want this.

This behaviour happened with my previous phone, Motorola Moto, with android 11, and with my current Moto E32s with Android 12.

# Answer
Kudo's to @Firelord: disabling Lift To Wake was very important, thanks!

In the same settings page I found Peek Display to be somewhat important, to keep the phone asleep. Peek shows the time on a black screen in small font every once in a while during sleep.

Both settings can be found by searching Settings for Lift, or by going to Settings, Display, Advanced.
> 2 votes

---
Tags: battery-life, android-12, sleep
---


title: Faster alternative to `input`?

text:
# Question
Title: Faster alternative to `input`?
I'm trying to automate a task on my (non-rooted) Android phone.

While I have it "working" using `input`, it is quite slow due to taking ~0.7s per event. (Basically, I just need to send a bunch of tap events, so what I have now is a sequence of `adb shell input tap $x $y`.)

I tried `sendevent`, but it gives me "permission denied". (I'm not sure why; the device is allegedly writable by the `input` group, of which the shell user is a member... and obviously, the `input` command can send events.)

Is there some trick to getting `sendevent` to work? Or some way to send multiple commands in a single invocation of `input`?

I'd prefer solutions that don't require installing third-party software...

# Answer
So... really crappy method: fork `adb`... as in, run it on the local shell in the background, using `&`. This is super-ugly and somewhat dependent on each instance executing with consistent timing (and probably not too polite to the android device, asking it to spin up all those Java processes), but it works.

Example:

```
tap() { adb shell input tap "$@" & sleep 0.02 }
tap 500 500
tap 600 600
tap 700 700

```

...will send tap events to (500, 500), (600, 600) and (700, 700) in fairly quick succession.
> 2 votes

# Answer
EDIT: Below you can find a way to use sendevent, however as I figured since posting, `sendevent` will not work on later Android devices, as access to input devices from shell has been explicitely disabled in SELinux policy. I don't know a way to work around this without rooting. The recommended way is to use `UiAutomation#injectInputEvent`. That's Java code, so one could write a service, which forwards events received on some interface. That leads far way beyond this question. Anyway, my sendevent solution you may still use on some devices.

---

You can find complete `sendevent` examples online (eg in this blog post), but none worked for me out of the box, so I had to tweak things a bit.

First of all, if you want to use `sendevent`, you should figure out the right event device first. `getevent` can be used to obtain this info, either `getevent -p` or `getevent -i` will tell you the event dev \<-\> device connections, so you can find the event associated with your touchscreen device.

You can also use `getevent` to see how a real tap event looks like on your device. Just run `adb shell`, start `getevent`, then tap on the screen (for some reason `adb shell getevent` didn't return the events):

```
/dev/input/event2: 0003 0039 000025e9
/dev/input/event2: 0001 014a 00000001
/dev/input/event2: 0003 0035 00000320
/dev/input/event2: 0003 0036 000002ae
/dev/input/event2: 0000 0000 00000000
/dev/input/event2: 0003 0030 00000005
/dev/input/event2: 0000 0000 00000000
/dev/input/event2: 0003 0039 ffffffff
/dev/input/event2: 0001 014a 00000000
/dev/input/event2: 0000 0000 00000000

```

You get a bunch of hex codes. Try the same with `getevent -l`:

```
/dev/input/event2: EV_ABS       ABS_MT_TRACKING_ID   000025e8
/dev/input/event2: EV_KEY       BTN_TOUCH            DOWN
/dev/input/event2: EV_ABS       ABS_MT_POSITION_X    000002f8
/dev/input/event2: EV_ABS       ABS_MT_POSITION_Y    000002f2
/dev/input/event2: EV_ABS       ABS_MT_TOUCH_MAJOR   00000005
/dev/input/event2: EV_ABS       ABS_MT_TOUCH_MINOR   00000004
/dev/input/event2: EV_SYN       SYN_REPORT           00000000
/dev/input/event2: EV_ABS       ABS_MT_TRACKING_ID   ffffffff
/dev/input/event2: EV_KEY       BTN_TOUCH            UP
/dev/input/event2: EV_SYN       SYN_REPORT           00000000

```

and you will see the labels for the codes (where applicable), so you can match the codes with the labels. If you don't want a generic solution, just want it to work on your own device, then you only have to recreate the tap sequence you've just seen. (Be careful with the hex codes, getevent prints hex, but sendevent expects decimal.)

This is the code I use in one of my scripts:

```
EV_SYN=0
EV_KEY=1
EV_ABS=3
BTN_TOUCH=330
BTN_TOUCH_DOWN=1
BTN_TOUCH_UP=0
SYN_REPORT=0

ABS_MT_TRACKING_ID=57
ABS_MT_POSITION_X=53
ABS_MT_POSITION_Y=54
ABS_MT_TOUCH_MAJOR=48
ABS_MT_TOUCH_MINOR=49

event_dev=`adb shell getevent -pl 2>/dev/null | sed -e ':a;N;$!ba;s/\n / /g' | awk '/ABS_MT_TOUCH/{print \$4}'`

tracking_id=1111
POS_X=600
POS_Y=800

adb shell "
        sendevent $event_dev $EV_ABS $ABS_MT_TRACKING_ID   $tracking_id
        sendevent $event_dev $EV_KEY $BTN_TOUCH            $BTN_TOUCH_DOWN
        sendevent $event_dev $EV_ABS $ABS_MT_POSITION_X    $POS_X
        sendevent $event_dev $EV_ABS $ABS_MT_POSITION_Y    $POS_Y
        sendevent $event_dev $EV_ABS $ABS_MT_TOUCH_MAJOR   5
        sendevent $event_dev $EV_ABS $ABS_MT_TOUCH_MINOR   4
        sendevent $event_dev $EV_SYN $SYN_REPORT           0
"

adb shell "
        sendevent $event_dev $EV_ABS $ABS_MT_TRACKING_ID   -1
        sendevent $event_dev $EV_KEY $BTN_TOUCH            $BTN_TOUCH_UP
        sendevent $event_dev $EV_SYN $SYN_REPORT           0
"

```

It works on my non-rooted device, but you may have to tweak it to match your device codes and sequences.
> 0 votes

---
Tags: usb-debugging, shell
---