# Question
Title: What does Smallest width in Developer settings mean?
I was stumbling upon the "Smallest width" settings. It seems increasing this value will make everything show up smaller on the screen and vice versa.

What does it mean and what's its function?

# Answer
The propery `smallest width` is inversely proportional to the PPI setting (called `ro.sf.lcd_density`) that is specified in the file `/system/build.prop`. Meaning higher numbers for `smallest width` correspond to lower numbers for `ro.sf.lcd_density`.

The property `ro.sf.lcd_density` specifies the UI 'density': for lower numbers, it will render the same UI element using fewer pixels, making it smaller.

The upside of rendering the UI smaller is that it's just like using a higher resolution (or lower DPI setting) on a desktop computer: you have more space to put everything because smaller things means you can fit more of those things on your screen.

The downside is that the smaller UI makes it harder to read for people having difficulties reading small fonts or discerning small details.

Another downside is that your touches need to be very precise to hit the smaller UI elements. Unfortunately the resolution of the hardware touch-sensors doesn't scale along, so very precise touches are not that easy to achieve consistently, thus putting a lower limit to `ro.sf.lcd_density` for what you can comfortably use daily.
> 4 votes

# Answer
Here is the relevant excerpt from https://developer.android.com/training/multiscreen/screensizes.

> The "smallest width" or "minimum width" screen size qualifier allows you to provide alternative layouts for screens that have a minimum width measured in density-independent pixels (dp or dip).
>
> By describing the screen size as a measure of density-independent pixels, Android allows you to create layouts that are designed for very specific screen dimensions while avoiding any concerns you might have about different pixel densities.
>
> The smallest width qualifier specifies the smallest of the screen's two sides, regardless of the device's current orientation, so it's a simple way to specify the overall screen size available for your layout.
>
> Here's how other smallest width values correspond to typical screen sizes:
>
> ```
> 320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
> 480dp: a large phone screen ~5" (480x800 mdpi).
> 600dp: a 7” tablet (600x1024 mdpi).
> 720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
>
> ```
>
> Remember that all the figures for the smallest width qualifier are density-independent pixels, because what matters is the amount of screen space available after the system accounts for pixel density (not the raw pixel resolution).
> 2 votes

---
Tags: developer-options
---


# Question
Title: Folder seen as file when connected as MTP
I have Redmi 1S phone running Andriod 4.3 (MIUI v56). When connected to a PC (Windows 7 32Bit) in MTP mode, one of the folders named `Backup` (present in internal memory) is seen as a file and effectively inaccessible.

When connected through FTP, that folder is seen and accessible through an FTP client (can be downloaded as well to PC). Folder is accessible from within the File Manager app on phone as well.

I am clueless what is selectively causing this single folder being seen as a file when the device is connected in MTP mode! Any support to solve this would be great. Thanks.

# Answer
> 1 votes
Because of the different way files and folders are handled on Windows when compared to other operating systems, it could be that the folder is corrupted and Windows is seeing it as a file (which it really is in the Android filesystem). It may be possible to fix this problem by:

1. Creating a new folder,
2. Moving the contents of `Backup` into the new folder,
3. Removing `Backup`, and finally
4. Renaming the new folder to `Backup`

However, depending on what the underlying problem truly is, this may not fix it.

# Answer
> 1 votes
This is most likely cause by the path being incorrectly indexed as a file in the MediaStore. Only files scanned and added to the MediaStore shows up in Windows when the device is mounted in MTP mode. Try rescanning the path, to update the MediaStore with the correct path information.

If you have the ADT installed, use ADB:

```
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///mnt/sdcard/Backup

```

# Answer
> 0 votes
It is still relevant in 2021 since I just encoutered the problem.

Simple solution: rebuild media cache. Go to Applications, tap the three points in the upper right corner. Choose show processes. Find Media Storage. Clear cache and data. Reboot. So it seems Windows is the culprit?

---
Tags: mtp
---


title: USB C hub and charging at the same time

text:
# Question
Title: USB C hub and charging at the same time
I bought a USB C hub with charging integrated but as soon as I plug in the charging cable to the hub the other ports stop working and the phone only charges. The USB ports and Ethernet ports stop working while the hub gets external power.

Does anybody have a solution or know about a hub that works both for charging and OTG on Android 11 ?

# Answer
> 5 votes
It seams that my issue was One Plus's Oxygen OS didn't support this feature. I installed a few kernels hoping that one would fix it and it did. The kernel is called Dora based on nem0.

---
Tags: charging, usb-connection-mode, usb-on-the-go
---


# Question
Title: Why should I care about ROM size when buying a new 'phone?
RAM is clear enough, but why so many different ROM sizes & how much does a basic user need?

Basic == 'phone calls/WhatsApp/SMS/email/light browser use - no games, streaming, videos, music,

# Answer
As a prior post indicates you use a **Ulefone Armor X3**

A quick search brings up:

https://www.amazon.com/Smartphone-Ulefone-Armor-Waterproof-Shockproof/dp/B07VL28Y84

And in the description reads:

> 2GB RAM + 32GB ROM

This is an error in the description. It should read

> 2GB RAM + 32GB Flash storage

That Flash storage is the same as a hard drive and will contain the OS and apps/data/pictures/videos that you are using.
> 2 votes

---
Tags: rom
---


# Question
Title: Run PHP MySQL web application on Android
I want to run a PHP MySQL web application on an Android device. The device is not rooted.

Is there any way? If there isn't, can the device connect to a PC's localhost offline?

# Answer
**UPDATE AS OF JUNE 2, 2021

Option #1 ( Using CLI-based apks)
BEST OPTION**

1. Termux (Installation of PHP, MARIADB, PHPMYADMIN packages within termux)
2. Terminal Emulator
3. UserLand

**Option #2 (Using GUI-based apks)**

1. KSWEB
2. Servers Ultimate

**Summary:**

* The above-mentioned apks do not require rooted device.
* **CLI-based apks** are highly recommended because a user can use **UPDATED** version of *PHP*, *Apache*, and any other packages you want to install to. The **KickWeb apk** does support running .php files **BUT** ,unfortunately, it doesn't have the latest PHP VERSION. Using an outdated version of PHP makes some of your PHP code to throw errors or warnings etc.
> 2 votes

# Answer
I have tried KickWeb Server and it works as expected.
> 0 votes

---
Tags: web-server
---


# Question
Title: Certificate Install without mandatory PIN lockscreen
Google Support says:

> The type of lock that's acceptable may be predetermined by your system administrator.

Where I can define what's acceptable? I can regenerate the certificate if needed.

So I can use slide lockscreen again.

(I'm using CM9 RC1, Android 4.0.4)

# Answer
The problem with disabling the lockscreen security using the toggle/profile is that the lockscreen widgets don't appear either so you can't slide to unlock. Also, when you reboot your phone the buttons don't work until you retoggle the setting again.

Another way is to install the certificate as usual then backup the /data/misc/keychain and keystore directories using something that preserves the ACLs such as Root Explorer to a location that supports ACLs. I suggest copying them to /tmp. Then clear the credentials from Settings and enable Slide To Unlock. Then copy back the folders from /tmp. The CA will be installed.
> 3 votes

# Answer
I've described how to do exacly this on my page, "Installing CAcert certificates on Android as 'system' credentials without lockscreen - instructions" at http://wiki.pcprobleemloos.nl/android/cacert

I've also posted it on the cyanogenmod forum: http://forum.cyanogenmod.com/topic/82875-installing-cacert-certificates-on-android-as-system-credentials-without-lockscreen/

Basically, the commands are:

```
openssl x509 -inform PEM -subject_hash_old -in root.crt | head -1

```

To get the correct filename, then convert the certificate:

```
cat root.crt > 5ed36f99.0
openssl x509 -inform PEM -text -in root.crt -out /dev/null >> 5ed36f99.0

```

Copy them to /system/etc/security/cacerts/ and chmod the new .0 files to '644'. Reboot and verify. On your android device select 'Clear cerficates' and you are able to remove the pin (by entering the pin and changing your lockscreen to 'none' or 'wipe'

Here I used the CAcert root certificate, but you probably want the class3.crt certificate as well, or use your own certificates.
> 9 votes

# Answer
I've discovered a solution that works without additional software or manual file copying:

1. Set your lock screen to "pattern". Enter a pattern and an unlock PIN. Remember the unlock PIN.
2. Install your user certificate.
3. Turn the screen off and on.
4. Enter the pattern wrongly a few times, until the "Forgot pattern?" option appears.
5. Click "Forgot pattern?", scroll down, enter the unlock PIN and confirm with "OK".
6. Close the "Screen unlock settings" window with the back button *without selecting an option*.

The system is now set to "Swipe unlock", but the user certificate is still usable (tested with the web browser and a custom app using DefaultHttpClient).

Tested on an Android 4.1.2 on a Galaxy Tab 2 10.1.
> 5 votes

# Answer
Just wanted to add an answer that's a variant of guttermonk's for one particular use case: installing a certificate on a Bluestacks instance. At this writing the setting app for Bluestacks has been modified so that setting a pin or password is impossible, and so adding a user certificate is impossible also. But we can get a root certificate into the system with guttermonk's approach plus some other steps. I was able to install a certificate without a pin or password and without ever installing it in the user's certificate store.

Prerequisites:

* Root privileges on the Bluestacks instance
* openssl (on the host, e.g. as provided with Git Bash)
* A terminal app in Bluestacks (e.g. Termux)

In my case, I had downloaded the cert file within Bluestacks and didn't have openssl available there. We can copy the file to the directory shared with Windows:

`cp /sdcard/Download/mycert.cer /sdcard/windows/BstSharedFolder`

In Windows we can use the openssl to get the hash of the certificate (I assume that's what this is).

```
cd C:\ProgramData\BlueStacks\Engine\UserData\SharedFolder # in CMD
cd /c/ProgramData/BlueStacks/Engine/UserData/SharedFolder # in Bash

openssl x509 -inform PEM -subject_hash_old -in mycert.cer | head -1
# e.g. abcd1234

```

Back in Android, we can make the system partition writable, copy the certificate to the system certificates directory, and fix up its permissions and ownership. Mount the system partition read only afterward, for safety.

```
mount -o rw,remount /system

cd /system/etc/security/cacerts/
cp /sdcard/Download/mycert.cer ./abcd1234.0
chmod 644 abcd1234.0
chown system:system abcd1234.0

mount -o ro,remount /system

```
> 1 votes

# Answer
* You can make use of CyanogenMod's **profiles**.
(For other readers: this needs the custom CyanogenMod Rom version 9+)

Just create or modify an existing profile and switch off "screen lock" there.

It's: System Settings-\>Profiles-\>Default-\>Lock screen mode-\>Disabled
* Integrate your certificate into the standard Android keystore file

See CAcert's excellent howto here

I'm not sure however if you can do this with a self-signed cert (you might have to switch to a self-made CA maybe (use tinyca for a nice gui-tool on \*nix)).
> 0 votes

# Answer
I found a way to solve the problem, but it requires root and may only work with root, self-signed, or intermediate CAs.

If you have a certificate that is not trusted by Android, when you add it, it goes in the personal cert store. When you add a cert in this personal cert store, the system requires a higher security level to unlock the device. But if you manage to add your cert to the system store then you don't have this requirement. Obviously, root is required to add a certificate to the system store, but it is quiet easy.

Here is how to do it :

1 - Add your cert normally. For example, my cert was called `some.crt`. It will be stored in your personal store and android will ask you a pin/password... Proceed.

2 - With a file manager with root capabilities, browse files in `/data/misc/keychain/cacerts-added` or `/data/misc/keystore`. You should see a file here called `1000_USRCERT_some` it's the certificate you have added in step 1.

3 - Move this file to `system/etc/security/cacerts` **(you will need to mount the system partition r/w)**

4 - Reboot the phone

5 - You are now able to clear the pin/password you have set to unlock the device.

Worked for me with a self-signed cert on Android 4.4.2. Hope it helps!
> 0 votes

---
Tags: security, lock-screens, certificates
---


# Question
Title: Stopped receiving AIB bank code notifications
I have recently stopped receiving notifications from my bank and one card company when they send me codes to log on to their sites on the PC. I have a Huawei PSmart 9 phone and I am on 02 network. Both the bank and 02 are saying that it is not their end causing the problem. I have searched through the internet and tried every thing on my phone settings but nothing works.

# Answer
After 9 months of having this problem I was finally given a solution today from a lovely gentleman in AIB. I had tried everything!!! I rang them every month, called into the branch, checked with phone provider etc. It was a case of change my phone or my bank. Here’s what worked for me. Go to your messages. In the top right hand corner there should be three dots. Click on them. There will be a selection of options. Click on spam and blocked. My AIB messages were coming up as blocked. There were about 50 of them there. Click that AIB is not spam. Best of luck
> 1 votes

---
Tags: notifications
---


title: Nokia 7.1 recovery mode adb shell

text:
# Question
Title: Nokia 7.1 recovery mode adb shell
Recently, my Nokia 7.1 stopped booting properly. When I turn it on, it just goes to the "android one" scree, then stops. I managed to boot into recovery mode, and I got the following options:

```
Reboot system now
Reboot to bootloader
Apply update from ADB
Apply update from SD card
Wipe data/factory reset
Mount /system
View recovery logs
Run graphics test
Run locale test
Power off

```

When I try to connect to my phone with "adb shell", I get the following error message:

```
error: no devices/emulators found

```

Is there a way to connect to my phone from ADB, running on my Linux computer, so I can recover data from it?

# Answer
The stock recovery can only make use of ADB for sideloading of packages under the "Apply update from ADB" option in recovery. You cannot perform any other adb tasks.

Also, the issue that you are facing is mostly related to emmc which has gone into a r/o mode probably due to its lifecycle being all used up. As such, it is impossible to mount the emmc and recover any data. There may be some possibilities with desoldering of emmc and advanced read/write tools, but that's some advanced engineering thing.
> 1 votes

---
Tags: adb, recovery-mode, data-recovery, linux, nokia-7.1
---


# Question
Title: How do I disable Javascript in the stable version of Firefox in Android?
Sometimes I need to disable Javascript on some webpages for various reasons. From a rather old post on Mozilla Support and some other sources, I learned that it is done through `about:config`.

However, from the answer on this question on SE Android, I learned that `about:config` is no longer accessible on the stable version of Firefox for Android.

So I am back to the square 1, how do I disable Javascript in Firefox on Android?

I have the following constraints in roughly the order of decreasing concern. Please keep these constraints in consideration while answering the question, but I am still welcome to learn about solutions that violate some of these constraints.

1. I do not want to use nightly or beta versions. They might have security vulnerabilities or unexpected behavior.
2. I do not want to change any Firefox configuration files on the file system, unless from within Firefox. I don't know much about Android application and I am afraid I might break something while messing with files.
3. I do not want to install any add-on on Firefox unless it is opensource or is widely known to be trustworthy.

# Answer
> 2 votes
> I do not want to install any add-on on Firefox unless it is opensource or is widely known to be trustworthy.

You're in luck today. Install NoScript Security Suite addon by Giorgio Maone. It is a GNU GPL 2.0 licensed addon. Has more than a decade of history of development, support and trust. It is a "Recommended" extension from Mozilla. It is also bundled with Tor Browser.

As per Firefox Help, meaning of Recommended extension is:

> Recommended extensions are editorially curated extensions that meet the highest standards of security, functionality, and user experience. Firefox staff, along with community participation, selects each extension and manually reviews them for security and policy compliance before they receive Recommended status.

Your desired usage of web browser is in contrast to what NoScript offers. As such you need to configure this addon.

As I see it, you want all of your websites to work "with javascript enabled", except a few where you need "javascript disabled". To achieve that, install that addon in your Firefox for Android. Open NoScript page (three-dots line in Firefox status bar -\> Addons -\> NoScript)

Click on the icon (with a small wrench) next to green colored Reload icon. Below in that page, in "General", under "Default" tick/check all items. This is needed so that websites don't break for you, because this is desirable in your question.

Load the website in your browser where you want javascript disabled. Open Noscript page again. To the website names/entries listed there, press CUSTOM and uncheck/untick *script* This would disable javascript for the entry/domain you selected.

If you have many websites where you don't want to repeat this procedure, go into Noscript settings, under "Per-site Permissions", add your domains and configure "CUSTOM" settings there.

This is a one-time only effort, but should work for long.

---
Tags: settings, firefox-for-android, javascript
---


title: Mass uninstall apps

text:
# Question
Title: Mass uninstall apps
My phone is massively cluttered - I've got something on the order of 50 (!) apps I am not using at all. I could manually uninstall them, but the wait for the uninstallation to finish between selecting the next one would drive me crazy.

Is there a way to, at least, create a list of apps to be uninstalled all together? I'm not afraid of using ADB, but don't want to root the phone. I'd also prefer not to use 3rd party apps.

My phone is Xiaomi Mi A3 (Android One), with Android 9.

Order of preference for methods:

1. Google Play on PC (website)
2. Phone settings or similar (no 3rd party app)
3. ADB or other debug interface, without rooting
4. 3rd party app

# Answer
> 2 votes
I would approach this from a different direction, to backup the data from the phone you want to keep, then do a factory reset which will effectively remove all the apps and allow you to reinstall what you now require. It will also remove any orphaned data and folders that uninstalling the apps could leave behind.

# Answer
> 2 votes
Using the python tool AMDH, that use ADB, with the option '-l' (list applications) with the argument '-t e' (list all enabled applications, including system apps) will list numbered installed applications by package name. You can select applications numbers separated by comma and choose the action uninstall ('u'). **Uninstalling some system apps can break your system**, you can use disable action instead of uninstall if you are not sure that the application is mandatory for the system.

---
Tags: applications, uninstallation
---


# Question
Title: How to "undo" Android cats easter egg and remove cat power controls on MIUI 12
I have enabled Android 11 easter egg by dialing 3 times and unlocking "11" now I have cat controls enabled when I slide down settings shortcut menu on my Poco F2 Pro (MIUI 12 - 12.2.4), and I do not know how to disable this. I honestly don't mind having these controls there, but my UI became very laggy since I've done this (there were no POCO launcher updates or any updates for that matter hence, "cats" are the main suspect). Anyone knows how to disable them?

# Answer
> 3 votes
1. Go to Settings, then About phone, then Android version.
2. Open the logo by pressing it several times, then reverse the regulator.
3. A sign will show, and done.

# Answer
> 5 votes
I finally found it. You need to go to settings, then Notifications & Control centre, then under Smart home choose None instead of Android R Easter Egg.

---
Tags: xiaomi, android-11, lagging, easter-egg
---


# Question
Title: Disabling Chrome tab groups in Chrome v91
A while back, I asked this question about disabling tab groups in Chrome v85. And that worked.

Now in Chrome version 91 they're back, with a vengeance. Trouble is, the flag that let me solve it last time is gone. The only flag that relates to tab groups is Tab Groups Continuation. And that's still disabled.

Is there a way of disabling them hiding away somewhere, or is this a lost cause?

# Answer
> 3 votes
This link detailed the following procedure, which worked:

1. Go to `chrome://flags`
2. Disable the flags `Temporarily expire M89 flags` and `Temporarily expire M90 flags`. This makes the flags in the next point appear.
3. After relaunching browser, search for the option `Tab Groups` and disable. Finally, search for the option `Tab Groups UI Improvements` and set it to disabled too.

Another two relaunches was necessary, but I once again seem to be group-less.

---
Tags: chrome-for-android, browser-tabs
---


title: Use external mouse with Limbo

text:
# Question
Title: Use external mouse with Limbo
I'm using the Limbo PC Emulator on my Samsung I9305 running rooted stock 4.4.4.

If I plug in an external mouse through USB OTG or (I presume) Bluetooth, there are two cursors on the screen. Limbo's cursor, and the Android cursor. In order to move the Limbo cursor, I have to click and drag with the mouse just as I would have had to using the touch screen.

Is it possible to just have once cursor, that responds directly to the external mouse?

# Answer
> 0 votes
Yes, later versions add a feature that captures external mouse movement and actions and hides the android mouse.

---
Tags: usb-on-the-go
---


# Question
Title: Whatsapp - Cannot restore from a local backup
today I made a mistake on my Samsung Galaxy note 10+ Phone: my daughter deleted the app. When I took the phone back, I noticed that whatsapp was no longer more installed on my phone.

When I reinstalled it from play store, activated, it can't find any backup, even if I have daily backup on my phone.

I've a lot of files in my whatsapp chat history and I reinstalled several times, following also the steps described in this guide: WhatsApp doesn't prompt to restore from local storage, but none of the solutions provided (permissions, etc.) works.

At first startup, Whatsapp asks for the permission to access google drive and then, it asks for the name to display, skipping the backup. Please note that i never changed my phone number, etc.

I tried also on Xiaomi Redmi Note 7, that I just initialized for this purpose. I copied all the whatsapp data folder, renamed the appropriate msgstore.db.crypt14 but whatsapp didn't ask for any restore.

At this point, after several retries, Whatsapp activation system let me wait 24 hours or days to receive a new activation code by text message or call.

I've all of my working history and backed up whatsapp folder several times, during years but I never experienced a behaviour like that.

Any help would be really appreciated. Thanks in advance

Digitalchild

# Answer
With A11 WhatsApp new location is

```
/sdcard/Android/media/com.whatsapp/WhatsApp/DataBases

```

Try to copy DBs to here
> 2 votes

---
Tags: backup, whatsapp-messenger, restore
---


# Question
Title: Custom ringtones at the second WhatsApp account?
On my Galaxy A70 (dual SIM card) I installed via Dual Messenger a second WhatsApp account for my private SIM card. Unfortunately the new account contains only the default ringtones. How I can add the custom ringtones to this account?

# Answer
You can send the ringtone you want as mp3 or ogg file attached to a WhatsApp message from your primary WhatsApp account to your secondary Whatsapp account. In the secondary WhatsApp save it to the folder `Ringtones` on the internal sd-card section (should be path `/sd-card/Ringtones`).

Afterwards your system should be able to detect and use the saved ringtone. May be a reboot is required if the ringtone does not directly appear in the ringtone list.
> 0 votes

---
Tags: whatsapp-messenger, ringtone, samsung-dual-messenger
---


# Question
Title: Whatsapp not doing local backup restore! (not Google Drive)
Today I decided to reset the phone. I got all my backups. At the same time, I copied all the files of WhatsApp to my computer completely. now i copied Whatsapp folder to phone memory. I installed Whatsapp, I got a message on my number, then I gave permission to google drive for backups (I only store my backups locally, not on google drive) .. but no restore notification came. I don't have any messages! please help me what should i do

EDIT When I uninstall and reinstall WhatsApp, the question 'Do you have a backup in google drive' appears. my whatsapp chat backup is locally on my phone. I tried every way. after installing i removed all google accounts, i copied whatsapp backups folder to both sd card and internal storage but it doesn't look at local backups... please we need urgent support!

# Answer
Please install WhatsApp version 2.21.8.17 and try again. It did the job for me.
> 0 votes

---
Tags: backup, whatsapp-messenger, restore
---


# Question
Title: Why does the Google Photo App (not storage of photos) take up 0.92 GB? Samsung S 7
I've 'freed up space' so that the actual photo storage should be entirely empty, yet my phone shows 0.92 gb of storage taken up. As far as I can tell, this has nothing to do with the images on my phone; I've checked in all the other folders and there's nothing that would indicate why this amount of space would be taken up by the app itself.

I've tried googling the problem, but all of the answers point to stories about how Photos stores your photos in the cloud, how that policy is changing, how to 'free up space' by uploading, etc.

I've done all that! And the app is still too huge.

Maybe it's got it's own hidden cache or something that I can clear? (I've already cleared the cache via the app management tools in settings.)

# Answer
> 2 votes
User @alecks answered this for me: the 'trash' folder in Google Photos was the culprit of taking up space.

I had one video file in there from my phone accidentally captured 3 minutes of video in my pocket, taking up hundreds of MB. I deleted it (and a bunch of other photos) and now the app is taking up 400+ MB instead of 0.97 GB.

TL;DR - if your Google Photos seems to take up too much space and you've already uploaded all of your photos off your phone, the trash bin may be holding a lot of files or a few big ones. They clear after 60 days, for what that's worth!

---
Tags: photos, google-photos
---


# Question
Title: does "adb install"overwrite or skips when the apk is already installed?
i just want to have more clarity in what adb does by default .

when i run adb install for an apk that is already installed the cmd only shows :

```
Performing Streamed Install
Success

```

it does not specify if it is skipping the install or if overwriting.

and is there a verbose option for adb for it to be more clear of what is doing ?

# Answer
> 3 votes
# General restrictions

You can only install an APK file that has the same package name as an already installed app if the following two requirements are met.

1. The installed app and the APK file you want to install must be signed by the same developer key, otherwise you will get the rror `INSTALL_FAILED_UPDATE_INCOMPATIBLE Package <packagename> signatures do not match previously installed version; ignoring!`
2. There is a app down-grade protection which means the `versionCode` (specified in `AndroidManifest.xml`) of the app to be installed have to be equals or greater than those of the already installed app. Otherwise you will get the error `INSTALL_FAILED_VERSION_DOWNGRADE`. This can only be bypassed for apps that have the `debuggable` flag set. Then you can add the adb option `-d` to bypass this restriction.

The last factor is the Android version. The behavior of `adb install` seems to be dependent on the Android version.

# Android 10+

On Android 10 and 11 I was able to observer that Android does not care if an app is already installed or not.

Therefore as long as the new APK file signed with the same developer key you can simply execute `adb install` to install an updated app version.

# Android 9 and lower

On Android 9 and before however by default the simple `adb install` command will just fail with the error `INSTALL_FAILED_ALREADY_EXISTS` if an app with the same package name is already installed. The specified APK file will not be installed in such a case.

Only if you use `adb install -r` an existing app that has the same package name as the one you want to install can be replaced but there are two restrictions.

---
Tags: adb
---


# Question
Title: How to cancel an announced Android System update
I wrongly click the button to book a update for Android System.

How can I cancel it before Nov 22 after 02:00

# Answer
You can not cancel the update itself because it has already been applied.

Modern Android devices have the system partition twice (called A/B partition). One that is currently active and one that can be used for installing updates "seamless" (so called by Google). Which partition is currently active on next boot can be changed.

The screen you show means that an update has been downloaded and installed on the non-active partition. The only step left is rebooting into the updated partition.

I am not sure if you do the reboot but not switch to the updated partition. No matter even if you would manage to do so I assume that the system would start to download and re-apply the update again on the other partition and then ask for rebooting into it to finish the update.

### Prevent updates via Developer options

Edit: Even if it is too late for you I stumbled over a settings that might be helpful in similar situations:

On a Pixel 3a running Android 11 I saw in the **Developer options** and entry called **Automatic system updates** \- Apply updates when device restarts

Therefore if you have such an option and disable it while there is already a pending update plus a scheduled reboot you can cancel the update installation.

If you decide later to install the update you can do that by manually triggering it in the Android system settings.
> 3 votes

# Answer
Reboot into bootloader/fastboot mode.

```
$ fastboot getvar all | grep current-slot
$ fastboot --set-active=a
$ fastboot reboot

```

You can set the active slot to be `a` or `b` depending on which slot is currently used, from the output of the first command. For example, if you see `(bootloader) current-slot:b`, you set `a` as active instead. You can rerun the first command to verify that the change was made successfully.

Once you reboot, you will see a notification saying that the update has failed, which is what you want.
> 2 votes

# Answer
There is one simple solution to this thing, I have not experimented on Google Pixel. If the Install later option is showing then you can choose the option to stop the software from being upgraded or the download files will be present in the download folder. From thereafter file gets downloaded you can go there and delete the file before installing it.

I have done this experiment on the Samsung Galaxy Phone.
> 0 votes

---
Tags: updates, ota-update, system, android-11
---


# Question
Title: WhatsApp crashes on chat with business accounts
When I start a conversation against a business account, WhatsApp crashes.

I can briefly see the profile picture of the contact, but it crashes before I can start writing anything.

I can see the contact's information, like address and map location, but no chat.

Tried even wiping data.

# Answer
> 1 votes
It was a bug caused by WA Tweaker xposed module

More specifically, when the user chooses to hide the Video or Audio call button

The bug was fixed on the latest release (V 1.6.2, 160106028armeabi-v7a)

---
Tags: whatsapp-messenger
---


# Question
Title: How to stop microphone or app on screen lock?
Discord talk channel stays **broadcasting indefinitely in background** even if the screen is locked.

*Note that I write "background" from the user's point of view. The app has a persistent notification so that makes it technically non-background on Android.*

I would like to know if there is a setting or app that could be used to prevent this privacy issue.

For example to stop apps on screen lock, or to auto-disable microphone after some time.

# Answer
There is no definite solution to your problem AFAIK, but I can share my thoughts on it.

From documentation:

> If your app is running in the background on a device running Android 9... it cannot access the microphone

Furthermore since Android 9 you can force an app to use microphone (and other operations) only in foreground:

```
~$ appops set com.discord RECORD_AUDIO foreground

```

Both of the above are applicable only if the app is not running a foreground service i.e. not showing a persistent notification.

In case of older Android version or if the app is running a foreground service you can try to make use of some automation apps to revoke `RECORD_AUDIO` permission and/or operation as soon as screen is locked:

```
~$ pm revoke org.lineageos.recorder android.permission.RECORD_AUDIO
~$ appops set com.discord RECORD_AUDIO ignore

```

And do the inverse when screen is unlocked.

However Android framework mostly kills/restarts the app/service when a permission is revoked. Or the app may continue using the previous state of permission unless it's manually restarted. So the approach is not reliable but may work for some apps under certain circumstances.

> For example to stop apps on screen lock, or to auto-disable microphone after some time.

Stock Android doesn't provide any such feature to auto-disable or disable mic from lock screen, though a custom ROM developer or OEM may provide e.g. a "Turn Mic Off" tile. Some ROMs add "Kill app" button to notification (on long press). But that may require unlocking the screen. Again you can automate to kill the app on screen lock. But some apps may also start a service on broadcast events.
> 2 votes

# Answer
Navigate to Settings/Apps/Advanced/Default Apps/Digital Assistant, then change from Voice to Google speech recognition. That should replace the mic symbol with the phone symbol.

-or-

You could try denying the Google app's mic permission or both.
> 1 votes

---
Tags: lock-screens, privacy, microphone, background-process
---


# Question
Title: Decrypt Android 10 File Based Encryption (FBE) data
Device: Xiaomi Mi 9

ROM: \[\[ROM\]\[10.0\]\[Xiaomi Mi 9\]\[UNOFFICIAL\]Pixel Experience AOSP\[2020/04/11\], ROM for the Xiaomi Mi 9

Hi, I tried to upgrade my ROM from an older to a newer version with a clean install whilst keeping the Internal storage of my Mi9. The Device has been encrypted with FBE protected with a pattern. While performing the upgrade TWRP did sucessfully decrypt the data. Now after performing the update the phone was only able to boot into TWRP (3.3.1-62) and wasn't able to decrypt /data/media/0 I also tried do decrypt via adb shell with `twrp decrypt 563258` following the TWRP commandline guide

```
[123]  [⭘↓←]
[456]  [⭘↦↑]
[789]  [⭘⭳⭘]

```

but this also failed.

Only way to make the phone boot again was to format data partition in TWRP. Unfortunately I did not save my backups on a different device, so to say all my backups and data is on the encrypted drive, which I can't access anymore. Before wiping I saved an image of /dev/block/sda31 which is the data partition I'd like to recover. I am also able to access the keys or data at following locations:

```
/data/misc/vold/keystore/
/data/misc/vold/user_keys/ce
/data/misc/vold/user_keys/de
/data/unencrypted/key
/data/system_de/0/spblob

```

So my question now is how to regain access to my data. So far I tried several approaches, none of these lead to success. My hope is that there is a possibility to mount the image, using the available encryption keys. But that's at this point beyond my technical skills, so maybe here is someone with another idea how to do this.

# Answer
If I'm not mistaken, each element in the grid is only used once, therefore your PIN should be `56328` because the last `5` isn't actually used.
> 2 votes

---
Tags: data-recovery, encryption, xiaomi, android-10
---


# Question
Title: How to restore an image of android partition from my linux PC
I created an image of my flash disk of my Nexus 4 as described in this question by doing

```
# adb pull /dev/block/mmcblk0 mmcblk0.img

```

The image is fully functional but I would like to push this image back to my phone and the inverse command is not working since stays there forever and no change is done.

```
# adb push mmcblk0.img /dev/block/mmcblk0

```

How can I push this image back to my phone?

# Answer
> 5 votes
I had this problem trying to push back a backup of my Samsung Galaxy S2, using ADB with the CWM (clockworkmod) recovery tool. When pushing to a device file, ADB simply deletes the block device file and creates a regular file in its place, and thus no data actually ends up on the mmcblk0 device.

Unfortunately, piping the output of a command into "adb shell" is not implemented either, and the "adb forward" unix sockets feature also doesn't seem to work, so it's difficult to get the backup back into the device.

The solution is to pipe the image file to netcat, and use ADB's TCP port forwarding to direct the stream into your device. However, if your CWM/busybox doesn't have network tools, you'll also need to download the arm-v7 static binary version of busybox with all the applets from http://www.busybox.net/downloads/binaries/latest/ to be able to run netcat on your device.

```
# wget "http://www.busybox.net/downloads/binaries/latest/busybox-armv7l"

# adb push busybox-armv7l /tmp/busybox

# adb forward tcp:6789 tcp:9876

# adb shell

~ # chmod +x /tmp/busybox

~ # /tmp/busybox nc -l -p 9876 > /dev/block/mmcblk0

```

Then, in a new shell:

```
# dd if=your-image-file.img | nc localhost 6789 &

```

"dd" is better than "cat" because you can check the copy's progress at intervals (replace 5647 with the PID of the DD command):

```
# kill -USR1 5647

48+0 records in
47+0 records out
49283072 bytes (49 MB) copied, 17.6145 s, 2.8 MB/s

```

Beware that writing to mmcblk0 (or the equivalent on your Android device) will obliterate even the boot and recovery partitions so is a great way to brick your device. For the record, my restore worked fine ;-)

# Answer
> 2 votes
I found a solution. You need to have root access to do it. The best would be to boot your Nexus using a boot insecure image.

1) I broke the image in smaller chunks in this way:

```
# dd bs=4096 count=983040 if=mmcblk0.img of=mmcblk0-0.img
# dd bs=4096 count=983040 skip=983040 if=mmcblk0.img of=mmcblk0-1.img
# dd bs=4096 count=983040 skip=1966080 if=mmcblk0.img of=mmcblk0-2.img
# dd bs=4096 skip=2949120 if=mmcblk0.img of=mmcblk0-3.img

```

2) I bzip2ed all chunks:

```
# bzip2 -k mmcblk0-0.img
# bzip2 -k mmcblk0-1.img
# bzip2 -k mmcblk0-2.img
# bzip2 -k mmcblk0-3.img

```

3) I created a ramdisk in my Nexus 4:

```
# adb shell mount -o size=1G -t tmpfs tmpfs /dev/ramdisk

```

4) I copied dd and bunzip2 into /dev/ramdisk/

5) I pushed, bunzip2ed and wrote the image chunks into the partition in pieces

```
# adb push mmcblk0-0.img.bz2 /dev/ramdisk
# adb shell "/dev/ramdisk/bunzip2 -c /dev/ramdisk/mmcblk0-0.img.bz2 | /dev/ramdisk/dd bs=4096 conv=notrunc of=/dev/block/mmcblk0"
# adb shell rm /dev/ramdisk/mmcblk0-0.img.bz2

# adb push mmcblk0-1.img.bz2 /dev/ramdisk
# adb shell "/dev/ramdisk/bunzip2 -c /dev/ramdisk/mmcblk0-1.img.bz2 | /dev/ramdisk/dd bs=4096 seek=983040 conv=notrunc of=/dev/block/mmcblk0"
# adb shell rm /dev/ramdisk/mmcblk0-1.img.bz2

# adb push mmcblk0-2.img.bz2 /dev/ramdisk
# adb shell "/dev/ramdisk/bunzip2 -c /dev/ramdisk/mmcblk0-2.img.bz2 | /dev/ramdisk/dd bs=4096 seek=1966080 conv=notrunc of=/dev/block/mmcblk0"
# adb shell rm /dev/ramdisk/mmcblk0-2.img.bz2

# adb push mmcblk0-3.img.bz2 /dev/ramdisk
# adb shell "/dev/ramdisk/bunzip2 -c /dev/ramdisk/mmcblk0-3.img.bz2 | /dev/ramdisk/dd bs=4096 seek=2949120 conv=notrunc of=/dev/block/mmcblk0"
# adb shell rm /dev/ramdisk/mmcblk0-3.img.bz2

```

# Answer
> 2 votes
The initial adb pull/push by-partition-id pattern in the question has merit for **recovery environments**. Though I didn't test for the whole of the flash ("mmcblk0"), a backup and restore by userdata partition did work in an adb activated within a lineage and "/e/" recovery.

Device is a moto-g4-play "harpia" with full disk encryption of the userdata partition and an Android 6 era partition schema (no A/B partitions). The crypto footer lives in the last bytes of the partition and the key is hardware derived, so this can only be used for backup/restore of the one device.

Activate adb in the recovery "Advanced Menu", then

```
adb shell ls -l /dev/block/by-name
# note down links for your partition
adb pull /dev/block/by-name/userdata userdata.img
# ... more partitions
# restore userdata again
adb push userdata.img /dev/block/mmcblk0p41

```

Pushing on /dev/block/by-name/ paths will run into a "No space left on device" message as soon as the tmpfs size is reached. I needed to address the proper partition-id directly.

---
Tags: nexus-4, restore, partitions
---


title: Tasker Volume does not work

text:
# Question
Title: Tasker Volume does not work
I use the latest version of tasker.

I created a simple task Category Audio and then Media volume and system volume.

I set both of them to the maximum (15). However, when I run the tasks, the volume does not change. ideas?

FYI I'm using a Samsung SG10 and android 11.

# Answer
> 0 votes
OK. I found a solution. seem to be a bug in Tasker.

Action 1: Set the Volume.

***Action 2: Add 1 Second Wait***

Now volume changes!

Note: I have not tweaked Wait times, it could be possible it can be optimized.

---
Tags: tasker
---


# Question
Title: Salvage Android Phone as Linux-Server (radio/wifi hardware broken)
My device has hardware problems with radio/wifi. Hence it's not possible to use sim-card or wifi. That also makes it restart frequently. Now it's useless as a phone. So I am trying to turn it in a desk computer (mini-server linuxdeploy). Simple air-plane mode isn't enough to solve these reboots.

### How I figure out its wifi/radio components were broken (tentative)

I have an OnePlus 6 enchilada.

### Deeper disable wifi/radio than simple air-plane mode

Is it possible to somehow to disable the WIFI/radio somehow **deeper than simple air-plane mode**? So I can use it as a desk mini-server. Installing linuxdeploy or any other software like that and use reverse tethering.

I tried many solutions around internet (including *android.stackexchange*) but none really works.

If someone could give me any tip or advice I would greatly appreciate!!

# Answer
> 3 votes
I solved by myself so I'm sharing so it might be useful for others.

### Deeper disable wifi/radio = recompile android Linux Kernel disabling wifi/radio drivers

First I tested the Lineage OS custom ROM for my device.

From that I got access to fully rebuild my Custom Lineage ROM. They have all source code for all supported devices including the source for the linux kernel for my mobile board (Qualcomm SDM845 Snapdragon 845 SoC).

When the kernel is built It should be decided if It will load driver modules (all SoC board component needs a driver) or have driver modules statically built in it. In either case the driver must be enabled during the kernel build. For configuring the linux kernel build a `.config` file is used.

After studying a lot more about linux kernel building. Found from here that QDSP6V5 from OnePlus 6 SoC SDM845 board was mandatory for mobile-data and WIFI when building the kernel.

Using Lineage OS docs and more research and 250 GB of source code and almost 12 hours of download (`repo sync` \+ `brunch enchilada`) I managed to build my custom Lineage OS 16.0 ROM after modifying the kernel `.config` fragment (`enchilada_defconfig`) from android\lineage\kernel\oneplus\sdm845\arch\arm64\configs\enchilada\_defconfig.

Setting `CONFIG_MSM_PIL_MSS_QDSP6V5` from `y` to `n`(NO).

*Note:* When building LOS I had to disable `dashd` since I couldn't find this file while extracting proprietary blobs. Comment it out on `~/android/lineage/vendor/oneplus/sdm845-common/Android.mk`

```
#include $(CLEAR_VARS)
#LOCAL_MODULE := dashd
#LOCAL_MODULE_OWNER := oneplus
#LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
#LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
#LOCAL_SRC_FILES := proprietary/rootfs/sbin/dashd
#LOCAL_MODULE_TAGS := optional
#LOCAL_MODULE_CLASS := EXECUTABLES
#include $(BUILD_PREBUILT)

```

and deleting it from  `PRODUCT_PACKAGES +=` list on `sdm845-common-vendor.mk` on same folder.

### Eureka!!

Wifi and Mobile not working at all.

No more reboots and internet working flawlessly from usb reverse tethering.

Hilariously solution is exactly like @Robert commented. *I had to spent almost an year of exploration to find that by myself.* \`-)

---
Tags: wi-fi, custom-roms, reboot, kernel, cellular-radio
---


title: How to disable proximity sensor

text:
# Question
Title: How to disable proximity sensor
I dropped my Motorola Charm (Android 2.1) and the proximity sensor doesn't work which is annoying, it makes the the touchscreen disabled when I dial anything (super annoying).

I would rather like to disable the proximity sensor, so it will never disable the touch screen.

Does anybody know how I can do so?

In case of absence of any ready made solutions, I am even willing to write my own app for that (there are programs that do that but for Android 2.2).

# Answer
Motorola CHARM has a proximity sensor located on the upper left corner; as stated in Motorola CHARM product support site, external lighting conditions will affect this sensor.

My suggestion is: each time you need to use the touchscreeen while making a call, try to "trick" the proximity sensor illuminating it with a flashlight or LED, so the sensor "thinks" that you've moved away the smartphone, thus re-enabling the touchscreen circuits.

If you don't have any of these items on hand, look for a place with bright light toward which to move yourself/your phone.
> 1 votes

# Answer
We have come a long way.

Almost a decade later, Android 10 comes with a Quick Setting Title to disable all sensors temporarily.

1. Enable Developer Options. If you don't know how to do it, check the steps here on my blog.
2. Tap on Quick settings developer tiles
3. Enable "Sensors off"
4. Swipe down to open notifications shade and you will find the "Sensors off" title.

You can now toggle the "Sensors off" title to enable and disable all sensors on your device including the proximity sensor
> 1 votes

---
Tags: proximity-sensor
---


title: Forbid phone from using Mobile Data

text:
# Question
Title: Forbid phone from using Mobile Data
**TL/DR:**

How do I forbid the phone from using ANY mobile data ?

---

If I use a single byte of mobile data, my plan charges me.

Turns out, the phone used data by itself some days ago.

**And NO, before you ask: it did NOT turn on the mobile data function.**

Yet, I was charged.

The standard *network usage graph* is useless to spot what app used the data, and certainly won't tell how it used data without enabling the mobile data function.

Guess all I can do is forbid the phone altogether to access mobile data

Is there a way to do that ?

A prompt, with password, would be great

**Thank you all for the solutions so far**

---

* Rarely, it DOES turn on mobile data itself, but it stays that way, so I can see and revert. (Happens in some reboots, or when I unplug the SIM, while handling the SD card, etc)
* The carrier said it's the phone's fault, obviously
* I can't remember the last time I HAD to use mobile data. So, if the solution makes it hard to enable it, won't be a problem.

---

I'm gonna try and sabotage my APNs

# Answer
It can be done by:

* Setting "data limit" to "0 MB" (Settings-\> Network and Internet -\> Mobile network -\> "YOUR\_MOBILE\_NETWORK" -\> Data warning and limit)
* Setting 2G as preferred Network (Settings-\> Network and Internet -\> Mobile network -\> "YOUR\_MOBILE\_NETWORK" -\> Advanced -\> Preferred network type)
* Using ADB:

```
adb shell settings set global mobile_data 0
adb shell settings set global mobile_data_always_on 0

```
> 0 votes

# Answer
If the SIM is plugged in, data will be used. The Android OS does lots of things in the background that use data, even if you disable data. Some things that will use dara: Synchronise (turn it off) App Background Data (all apps off, OS will still xfer) Location (will instantly try many methods to get accurate location data) Bluetooth (Nearby devices names/mac addresses get recorded and transmitted over internet) Maybe Aeroplane Mode would cut down a lot.

It is very frustrating, but almost every setting you can "turn on/off" Android will quietly ignore your choice, and do it in the background anyway. Only a rooted device could put in place a root user level firewall to only allow traffic on device wifi, deny all others (3G, 4G, LTE)
> 0 votes

---
Tags: mobile-data
---


# Question
Title: WhatsApp sending videos with low quality
Using a Samsung Galaxy A30s and the WhatsApp Messenger (Beta) version 2.21.12.15.

Anytime I send a video, be that filmed within the app or externally, it loses all the image quality.

What can be done to fix it? For clarity, a few days ago this was working fine.

# Answer
I followed the approach mentioned by Caomhin

> If you are using a Beta version of WhatsApp, backup your chats and try Uninstalling WhatsApp and revert to an earlier Stable version.
>
> Also while chats are backed up clear the WhatsApp App info Cache and App info Storage as well.
>
> Log back in and see if that can help.

In order to do the backups,

1. Open WhatsApp
2. More options
3. Settings
4. Chats
5. Chat backup (without videos, or else it'd take too long in my case)

Then, uninstalled the app and left the Beta program.

After I installed the normal version, restored the backup and now it's working fine.
> 1 votes

---
Tags: samsung, whatsapp-messenger, video
---


# Question
Title: How to use phone as camera and microphone for PC via ADB?
There are many previous questions asking about how to use the phone as camera and microphone for PC. For example:

However, all the answer involve installing an app in the phone. In my experience, DroidCam and IP Webcam are way too lagged. I cannot use them for online conversations, like using with Zoom. I think if there is a way to do that via ADB, then it will be much faster. We have such solutions for projecting phone's screen.

Is there a way to do so? If no, then why is that?

My Android version is 7.1 (SDK 25).

# Answer
> -1 votes
You can use the combination of `scrcpy` and `sndcpy`. both uses adb.
scrcpy github: https://github.com/Genymobile/scrcpy
sndcpy github: https://github.com/rom1v/sndcpy

---
Tags: adb, camera, microphone
---


# Question
Title: Secure boot requires PIN (2 tries left untill factory reset the phone)
I have a situation where I recently set PIN, activated Secure boot and booted up my phone and entered the PIN incorrectly 28 times. Now I have two times to enter the PIN correctly else the phone will be reset to factory defaults (images, all data deleted) which I want to avoid.

Do you think it's possible to reset the number of tries again to 30 for secure boot if I already used 28 times? The phone which I am using is Samsung S9+.

# Answer
> 0 votes
secure startup means android is not booted therefore FindMyMobile not available. counter can be reset in crypto footer but that requires raw access via chip-off method (or samsung signed firehose programmer if your device is qualcomm usa model)

---
Tags: boot
---


# Question
Title: How to import an existing mmssms.db to an Android Virtual Device?
I've downgraded from Cyanogenmod 13 (Android 6.0.1) to Android stock 5.1.1, and kept my previous mmssms.db file, but it is incompatible with older Android versions. I would like to import this database in an Android Virtual Device running Android 6.0, back it up using SMS Save & Restore, then restore the .xml file produced by that app on my device.

However, when I copy my old **com.android.providers.telephony** directory in the **/data/data/** directory of the AVD, neither the Messenger app, nor SMS Backup & Restore see any message. The directory and its contents are owned by the **radio** user, belong to the radio group, and have **chmod** set to 771.

How can I check what is preventing the system from accessing my database?

Or how else can I retrieve my sms ?

# Answer
> 2 votes
I've finally managed to restore the contents of my previous database on my current device and I will explain how.

The idea was to copy the backup of **/data/data/com.android.providers.telephony** from my previous installation, to an Android Virtual Device, back it up there using SMS Backup & Restore in XML format, then restore that XML backup on my device. SMS Backup & Restore merged the messages from the backup with the current device's messages so I didn't have to merge the two databases by hand.

In my question, the AVD running 6.0.0 wouldn't read the contents of my database because it was created on CM 13 which is based on Android 6.0.1. But Google doesn't seem to provide an emulator image based on Android 6.0.1, so I still used an AVD running 6.0.0. For performance reasons I've configured it to emulate an **Intel Atom (x86)** CPU and installed Intel HAXM driver on my PC (I've followed this answer to do that).

The mmssms.db database holds properties about itself, especially version numbers, so I've edited them to make Android believe that it dealt with a database of a version it could deal with. I've opened mmssms.db in SQLite Expert, clicked on the "Database" tab, and in the property list, found the following lines:

* schema\_version
* user\_version

I've downgraded these to 44 and 60, respectively.

Then I transferred my backup of **/data/data/com.android.providers.telephony** to the AVD using **adb push**, after making sure that location was already empty there. Using **adb shell** I've set the owner and group of everything in this directory and its subdirectories to **radio**, and in the **database** subdirectory the **chmod** value to 660.

I've rebooted the device.

I've installed SMS Backup & Restore on the AVD through ADB. (The .apk of that app can be found on an existing device in /data/app on a device where it is already installed. I didn't bother installing Google Play Services on the emulator to get it from the Play Store, but you can do that.)

I've backed up the messages and copied the resulting .xml over to my real device, where I've used SMS Backup & Restore to restore it. Voilà.

# Answer
> 2 votes
I had to do an extra step compared to @Cutter answer to get it working with LineageOS 14.1 (original `mmssms.db` came from Android 5.1).

Change the `user_version` from `64` to `68`:

```
sqlite3 mmssms.db
PRAGMA user_version;
PRAGMA user_version = 68;
.q

```

In recovery mode (`adb reboot recovery`):

```
adb push mmssms.db /data/user_de/0/com.android.providers.telephony/databases/
adb shell chown radio:radio /data/user_de/0/com.android.providers.telephony/databases/mmssms.db
adb shell chmod 660 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db
adb shell chcon u:object_r:radio_data_file:s0 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db
adb shell ls -alZ /data/user_de/0/com.android.providers.telephony/databases/mmssms.db

```

The important thing was to additionally change the file SELinux security context with `chcon`.

And after rebooting the old SMS messages were finally recognized!

# Answer
> 0 votes
jansohn's solution works for me.

I pulled the mmssms.db file from a previous NANDROID backup of my phone and was able to restore all the old SMS messages from it by doing those commands in an adb shell.

It didn't work until I used: `adb shell chcon u:object_r:radio_data_file:s0 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db`

---
Tags: sms, nexus-4, 5.1-lollipop, 6.0-marshmallow
---


# Question
Title: Extract sms and other personal data from Android Backups without device (ADB, Nandroid, ODIN Backup [.tar.md5])
I have some old backups of my older phones (samsung galaxy S4 / i9500). One of them is a Nandroid backup, one is ADB, and i guess the third one is an Android Image created most probably by ODIN (.tar.md5 file). Since I dont have the mobile device with me anymore, is there a way i can extract my personal data (especially sms) from those backups directly in my Windows 10 Home edition PC ?

My Nandroid backup has the following files:

```
boot.img, cache.ext4.tar, data.ext4.tar, efs.ext4.tar, modem.img,
nandroid.md5, preload.ext4.tar, recovery.img, recovery.log, system.ext4.tar

```

# Answer
> 1 votes
Probably not from the ADB Backup (to my experience, SMS are not backed up with that) – but from the Nandroid it should be possible. You'd need to extract that, find the messages database, and then you can access it using some SQLite client (depending on the OS your POC runs). The Nandroid should also hold all other personal data, but might lack your "internal SD card" data – which might be part of the ADB backup, depending on how that was run.

Some types of Nandroid do file-system images. But the default nowadays is a Tarball, i.e. a simple archive containing the directory structure and the files within. That's also the case with yours, as you confirmed – so you can open `data.ext4.tar` (which holds the contents of your `/data` partition) in e.g. WinRAR/WinZIP and see if it lists directory structures. I expect it does. You're after something in `data/com.android.providers.telephony/*`, where you should find a file named `mmssms.db` or similar (I don't remember the correct path and file name by heart). That's where your messages are in.

For completeness: would your Nandroid be an image file, you can e.g. use Testdisk to browse and extract contents from it.

As for other "personal data", depends what you're after. See our data-recovery tag for further hints.

# Answer
> 1 votes
I recently did this to restore and merge my SMS messages from a previous NANDROID backup stored on my Linux PC that I could no longer boot in to using my phone.

I extracted the file `/data/user_de/0/com.android.providers.telephony/databases/mmssms.db` from the data.ext4.win002 tar archive of my NANDROID backup.

I logged in to adb shell on my phone and made a copy of that same file on the phone to backup the existing SMSes.

Then I logged in to QKSMS (my SMS app) and made a backup of the 9 new messages since I replaced the ROM on my phone.

Then I used adb to push the mmssms.db file (that contained 2000+ old messages) from my PC to my phone and used root privileges to copy it to the same location as the existing (providers.telephony as above).

Then I just had to run these commands in adb shell:

```
adb shell chown radio:radio /data/user_de/0/com.android.providers.telephony/databases/mmssms.db

adb shell chmod 660 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db

adb shell chcon u:object_r:radio_data_file:s0 /data/user_de/0/com.android.providers.telephony/databases/mmssms.db

```

---
Tags: adb, 5.0-lollipop, backup, odin, nandroid
---


# Question
Title: Is it safe to remove "Google app" from android system completely?
I rooted my device and I removed some obvious bloat-ware, such as Cardio trainer (I bike to work, I definitely do not need that), some Google music, Google books, Google maps and many other Google XXX and Samsung XXX consumer applications.

Now, in second purge iteration, I'm looking at apps that are big but their purpose is not obviously blatant.

One of them is "Google app". The name isn't very informative. Does it manage my link between android and Google account? Or is it some search service? What is that app and what are the consequences of deleting it?

# Answer
Sure you can iff the Google app has the "G" logo, it is just a search app. I am on a custom ROM, Cyanogen Mod 13 and it doesn't come with bloatwares or Google apps.
> 1 votes

# Answer
I have removed Google App on several Orignal stock ROMs without any problems. It provides a Search Bar and some other functionality which is not required for their other apps to function (Maps, Gmail, Store etc). It's a resource hog. I think in the future they will make it harder to remove it by making it integral part of their framework, but for now it's ok to get rid of it.
> 1 votes

# Answer
You can remove various Google apps, but you should refrain from uninstalling Android System Webview. Once you do that, Google setting, Gmail etc. will stop working.
> 0 votes

---
Tags: root-access, bloatware
---


# Question
Title: How can I transfer photos to my Android Jelly Bean device while preserving the original timestamp?
I recently bought a Nexus 4 and I would like to transfer my photos of my previous device to it. My previous Android phone used the standard USB mass storage which gave 0 problems to copy back and forth stuff, but the Nexus 4, like many other modern Android phones I suppose, uses MTP instead, which has the interesting feature of refusing to copy the original dates/timestamps of the files, using instead the date at which the files are being copied.

This is obviously a huge bummer when it comes to photos; not only because one cannot check the original date at which the picture was taken while browsing on the phone, but also because they end up completely unsorted.

Is there a way to transfer photos to a Jelly Bean Android phone that doesn't support USB mass storage preserving the original timestamps?

Things I've tried so far:

* Transferring via USB MTP
* ADB push (both full folders and individual files)
* Transferring via SSH (using SSHDroid + WinSCP)
* Uploading and downloading from Dropbox
* Transferring a ZIP file via MTP and uncompress the file on the phone
* Transferring from the other phone via bluetooth
* QuickPic "fix date" function
* Local Sync
* Photo Date Correction
* FTPSyncX
* Smoke signals
* Yelling at the phone

None of them preserved the timestamp, and this is driving me insane.

(Also, I am not rooted yet, but if the only viable way requires root I would welcome that answer as well.)

# Answer
You can't, this is a current permission problem (bugreport here) of Android 4.0+'s /sdcard folder if it's not using FAT32 (but FUSE).

Reason: There's a transition away from FAT32 to unified user storage for both apps and media data (using ext4) on a single file system.

> We got tired of seeing OEMs include many GB of internal storage for music, while users were still running out of space for apps and data. This approach lets us merge everything on one volume, which is way better.
>
> -- Dan Morrill, Android engineer at Google

The old FAT32 properties are emulated using a FUSE layer to be compatible with existing apps. Also: /data/ and /sdcard on Google devices starting with the Nexus 7 use a single partition only (/data/media represents the "sdcard" content and is exposed using the FUSE layer to apps).

Here's CyanogenMod's implementation of the FUSE driver if you're interested in seeing the source. Looks like setting timestamp attributes is implemented, though.

EDIT: It only works with root.

Exact reason: All files are owned by root.sdcard\_rw (see here).

A caller withouth uid=0 can't call the utimensat() syscall, it fails in the VFS layer already (EPERM) for timestamps other than current:

> 1. the caller's effective user ID must match the owner of the file; or
> 2. the caller must have appropriate privileges.
>
> To make any change other than setting both timestamps to the current
> time (i.e., times is not NULL, and both tv\_nsec fields are not
> UTIME\_NOW and both tv\_nsec fields are not UTIME\_OMIT), either condition
> 2 or 3 above must apply.
> 10 votes

# Answer
I recently came across this issue on a Nexus 5 and tried most the solutions listed here with no luck. In my case, it looks to be caused by a recognized bug with stock Android (source).

My solution was as follows - I used Windows 8.1, but no reason this wouldn't work on OSX/Linux (root is required on device however).

1. **On your PC, create a .tar.gz archive of all the files you wish to transfer.**

* I used 7zip for this - It's worth mentioning on Windows, you'll need to create the .tar archive first, then apply the .gz compression.
2. **Transfer the archive to the device using FTP, ensuring the MFMT command is used.**

* FTP Server supports MFMT on the device side. Just install and enable, no extra configuration needed.
    * On the PC, I used Filezilla \- you do need to ensure *Transfer \> Preserve timestamps of transferred files* is checked.
3. **On the device, extract the archive in a shell as root.**

* Using Terminal Emulator, first ensure you have root access by using the `su` command. You may need to grant access if SuperSU pops up.
    * Navigate to the directory now containing the .tar.gz archive with the cd command e.g: `cd /sdcard/`
    * Extract the archive using the following: `tar -xvf ARCHIVE_NAME_HERE.tar.gz`
    * Note: For some reason, when I extracted directly to the `DCIM/Camera` directory, the pictures would not show up at all in the stock gallery app. If this happens to you, I suggest you extract to a different directory and then **move** (not copy) the files to your camera directory. I suspect this is caused by a permissions issue. You can use the terminal or your file manager of choice to move the files.
4. **Reboot for good measure.**

This allowed all the files 'date modified' attributes to remain intact, and left all photos in the correct order when viewed in the gallery app.
> 6 votes

# Answer
Check the EXIF data and see if there's a timestamp there.

If there is, Photo Date Correction will allow you to overwrite the botched file timestamp with the EXIF one, giving you back your proper sorting.
> 4 votes

# Answer
This is a question which really trouble me a lot when come across with devices which only have MTP but not the Mass storage mode. I also have concerns about it with exactly the same reasons with Mahn.

After some testing, I have find a temp solution which maybe able to preserve the timestamp.

It makes use of the excternal sdcard / OTG card reader and also the cp command with -a the timestamp will be able to preserve. But the requirement is the phone need to be rooted.

1. First copy the data to SDcard.
2. Read it with memory card slot / OTG card reader
3. use adb shell and acquire root permission (su)
4. cp -a * the data from card to internal memory.
> 4 votes

# Answer
As mentioned in another answer, on devices that use FUSE for SD card emulation (such as modern Nexus devices), only root can change timestamps of files in `/sdcard`. Since things like MTP and ADB don't run as root, you can't preserve the timestamps with these methods. However, if your device is rooted, you *can* fix the timestamps with a separate step afterward.

While restoring a full backup of `/sdcard` from a Linux PC to my tablet, I used this command to fix all the timestamps after uploading the files with `adb push`:

```
find . | while read file; do timestamp_stat=$(stat -c "%y" "$file"); timestamp=$(date +"%Y%m%d.%H%M%S" -d "$timestamp_stat"); echo "$timestamp: $file"; adb shell su -c "touch -t $timestamp \"/sdcard/$file\""; done

```

This should be run from the root of the directory on the PC that corresponds to `/sdcard` on the device. (Or, if you uploaded something other than a full `/sdcard` backup, change the path in the `touch` command near the end. But you should run this from whatever directory on the PC corresponds to the directory in the `touch` command.)

The way it works is that it goes through all the files on the PC side, gets the timestamp of each, and runs a `touch` command as root on the device to set the timestamp of the corresponding file there.

Note that this will run a separate `su` command for each individual file. If you have logging enabled in your root program (e.g. SuperSU), you may want to disable that to avoid producing large numbers of log entries. And if you have your device configured to prompt for confirmation on every `su` request, you'll probably want to change that temporarily. (It may be possible to come up with a variation that pipes a stream of `touch` commands into a single root shell on the device, but the straightforward way of doing that didn't work when I tried it, and I didn't want to spend much time on it.)

I've used this with success on a Nexus 10 running Android 5.1.
> 4 votes

# Answer
I have the exact same issue. It seems that it's being blocked by fuse on the Nexus 4 running Stock JellyBean 4.2.1.

```
SYMLINKS:
/sdcard -> /storage/emulated/legacy
/storage/emulated/legacy -> /mnt/shell/emulated/0

MOUNT POINT:
/mnt/shell /dev/fuse /mnt/shell/emulated fuse \
    rw,nosuid,nodev,relatime,user_id=****,group_id=****,default_permissions,allow_other 0 0

```

That info was taken via an adb shell session; I presume that fuse will be in the mix for *all* app-level accounts.

**TL;DR** From the looks of it, it can't be done without rooting the phone.
> 2 votes

# Answer
If you use the Google Photo app and you want your file to be listed in the right order there's a solution.

**The background of the issue**

This is an Android Bug. It does not allow non-root user to change the modification date of files (https://code.google.com/p/android/issues/detail?id=18624 since the introduction of multi-user / sandbox with FUSE filesystem). And does not preserve the timestamp when copying files with MTP protocol (https://code.google.com/p/android/issues/detail?id=92635).

**The workaround for Google Photo users**

Photos are ordered using the EXIF information if available, so you can just use any manners of setting the right EXIF data to them. Any camera should set this automatically for you, just make sure the date/time is correct in them.

For videos or if you do not want to set the EXIF data just go to https://photos.google.com/ and upload your video / photos from there. It preserve the modification timestamp you have on your computer and since it is synced with your device you'll see the photo in the app, correctly sorted, as soon as you are done with the upload.
> 2 votes

# Answer
Use a synchronization tool like e.g. FolderSync, which should take care for timestamps accordingly. Synchronization tools should be specialized in handling all aspects of really maintaining synchronous copies -- including time stamps, of course.
> 1 votes

# Answer
PRESERVING DATE MODIFIED ON NEXUS DEVICE --- NO ROOT NEEDED ---

* From Android to PC: Use MTP
* From PC to Android: Use Droid Explorer

cheers.. :)

it preserve Date Modified. I dont know how Droid Explorer does it. but it just works.

make sure USB Debuging checked before use Droid Explorer.

um.. there's one limitation though.. Droid Explorer only can transfer files, not folders.

* with Droid Explorer, copy files into android phone on some specific folder
* then with file manager inside android, move those files into folder we want, do not use copy because copy will alter date modified while cut doesn't.
> 1 votes

# Answer
Use PTP instead of MTP when connecting your phone by USB. It works for me, I use a Samsung Note 4 connected to Ubuntu 14.04 machine. However, connecting as PTP only allows copying of pictures/images. All other methods od copying files (bluetooth, WIFI, file manager) into an external drive will change the date.
> 1 votes

# Answer
You can use adb

1. Enable Developer mode on mobile.
2. Enable USG debugging on mobile.
3. Install ADB on your laptop.
4. Connect your mobile to your laptop using USB.
5. Open your laptop terminal and login to your mobile using below commands

adb devices adb shell
6. Find the exact path where you want to put your files.
7. Exit adb shell using the command exit.
8. Use below command to push files to from your laptop to mobile without any metadata (created/modified time) being affected

adb push source\_path target\_mobile\_path

You can push folders and multiple files using the `adb push` command in one go.

You can use the same procedure and command `adb pull source_mobile_path target_laptop_path` to copy files from mobile to laptop without affecting dates.
> 1 votes

# Answer
I have a Nexus 4 and had the same issue with time-stamp and photos (indeed all the files).

Here are the command lines (with a rooted phone) I used, thanks to a post on Ubuntu:

```
sudo apt-get install android-tools-adb

```

(on Ubuntu if Android SDK is not installed)

```
adb devices
cd /media/my_backup_folder_where_i_put_a_folder_with_all_my_data_named_"savandroid"_in_it

```

In order to go in my folder "backup" which contains the folder "savandroid"

```
adb root
adb push savandroid /sdcard

```

All files and folder that are in "saveandroid" are sent to SD card worked nicely with all time-stamps correct!

**Note**: On Cyanogenmod I had to select root for "apps and adb" in developers menu. By default it's only set on apps.
> 0 votes

# Answer
**My solution to preserve modification date during file copy on Android device with MTP:**

Tested on LG G2 stock (without root), Andorid 4.4.2 and HTC one M7, Andorid 4.4.2:

1. Network share of the folder to copy on the computer (Win 8)
2. Use SyncMe Wireless to copy files from computer to device

As far as I can see, the modification dates are fully preserved!
> 0 votes

# Answer
**Backup solution using "SanDisk Memory Zone" to preserve timestamp date. copy/moving files from Android device to external SDCard - Tested on Samsung Note 2, Note 3 and Mini SIII**

*Just backup your photo files to SDCard and move the card to other Android, PC, Apple or other device - if not used to backup your photo files, follow this simple 8 steeps instructions"*

1. Search on Google Play and install "SanDisk Memory Zone".
2. Start the App and wait for index file to finish.
3. Select Backup/Restore and change or mark settings.
4. Select Memory Card destination and what to backup (contacts, sms, photos, music, etc).
5. Verify required and available capacity, and go on CONTINUE botton.
6. Wait for the backup to complet.
7. Now you have a copy of the files in your SDCard on ".memoryzone\_backup/files/1"
8. Now you can move your SD Card files like photos to your Windows, Linux or other Android device preserving original Timestamp.
> 0 votes

# Answer
Quick and easy solution: simply use a PC or Mac to copy the files from the old SD Card (or PC) to the new SD Card. Use a PC/Mac with an SD Card reader/writer (there are USB-to-SD Card converters) which sees the card as a FAT32 USB storage. When you're done copying, re-insert the new card in your phone and reboot.
> 0 votes

# Answer
I moved to a Moto X 2014 and I had this problem.

I tried many things as well, a solution seemed to be "Motorola Migrate" to synchronize with WiFi two phones (an old gingerbread backflip). In the gallery, the situation was good (even in details), but strangely in file manager the date was changed, and after few hours even the gallery also shown the transfer date.

The workaround, if the files are not too many, could be manually copy one by one, changing each time the date and hour on the phone.
> 0 votes

# Answer
I will add my solution that worked on Ubuntu

First install simple-mtpfs and install fuse

```
cd ~
mkdir myphone
simple-mtpfs ~/myphone

```

Now you have your phone folders mounted on this directory, you can use `rsync -t` , or `cp -p` to copy the pictures and the created/modified/accessed times will not be changed.

Work for me :)
> 0 votes

# Answer
To copy files from your Android to your PC keeping timestamps:

```
adb shell tar c -C /storage/emulated/0/XXX . | tar xv

```

To restore them back to the Android:

```
tar c . | adb shell tar xv -C  /storage/emulated/0/XXX

```

This works by creating a tar file within the device, that is immediately extracted on your host, and viceversa.

The "v" lets you see the name of the file being copied.

Of course this assumes that you have "adb" installed, that the phone has USB debugging enabled, and that you already validated the debugging certificate.

```
sudo apt install adb

```
> 0 votes

# Answer
Try app "Bluetooth File Transfer" it preserves the modified date with move. And I believe with copy too but try with one file/ folder first to make sure. It can also explore the other device via bluebooth.
> -1 votes

# Answer
Use SyncMe Wireless and network share. The timestamps are preserved and the sync is quick. I was able to back up without a computer to SD Card in Kingston MobileLite Wireless in 20 minutes, re-sync instant.
> -1 votes

---
Tags: file-transfer, 4.2-jelly-bean, nexus-4, mtp, file-properties
---


# Question
Title: Android reacts to a headset button press with a lag or not at all
I have cheap wired headphones by JBL which have one button. The Huawei smartphone runs on Android 9. Audio apps react to a button press with a lag and sometimes don't react at all. I couldn't notice any pattern in their malfunctioning.

I'll appreciate advice.

# Answer
I solved the problem. It turned out that Google Assistant prevented the button signal to be read by other apps. Turning off Google Assistant didn't help. I had to turn off a device in a list of devices used by Google Assistant.
> 1 votes

---
Tags: headset
---


# Question
Title: Close tab and end current page in browser. When I restart FireFox, Chrome or other browser on Android phone or tablet, last page browsed comes up
On my Windows computer, if I close a browser page, the next time I launch the browser, it goes to my home location. This is true regardless of the browser so far as I can tell.

On my Android tablets (Samsung Galaxy 10, Amazon Fire Tablet) or phone if I close the browser and then reopen it, it returns to the last page browsed, not to a home page. I have to back out from the last page back to the original page to get to that.

How can I change this so that upon opening a fresh page, it goes to a home page?

# Answer
> 0 votes
In Firefox on Android as of 89.1.1:

1. Go into settings
2. Scroll down to `Delete browsing data on quit` under the `Privacy and security` header.
3. Enable `Delete browsing data on quit`.
4. **Untick**(!) everything *except* `Open tabs`.

...and now it should forget the previously opened tabs, and thus instead start the home page, after you quit the browser.

Unfortunately I can't help with Chrome.

# Answer
> 0 votes
Firefox \> settings\> advanced\> restore tabs

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


title: Android TVs and LINUX 4.9.118+

text:
# Question
Title: Android TVs and LINUX 4.9.118+
Perhaps an obvious question for some, but, is my Kogan brand Smart tv using Android and google play pre-installed apps running Linux 4.9.118+

# Answer
I'm guessing your doubt is about how an Android SmartTV have some info about Linux...

Surely you have saw this Linux info into Settings\>About TV and this info is about the Linux Kernel version built-in the device.

BR
> 3 votes

---
Tags: linux, smart-tv
---


title: Port forwarding to USB Tether

text:
# Question
Title: Port forwarding to USB Tether
I have RaspberryPi which connected to Android Phone via USB and USB Tethering is up. Android Phone is connected to Home Router (Wi-Fi). With this setup, my Raspberry Pi can reach the internet with USB-Android Phone-Home Router-Internet path. And I can reach my Raspberry with VX ConnectBot app in Android Phone. What I want to do is, I want to make ssh connection to Raspberry Pi with my laptop (which is also connected to Home Router). IS it possible to redirect incoming wi-fi packets to usb on Android phone?

To be clear, here is the path that I want;

Laptop (ssh connection) -\> Home Router -\> Android Phone -\> USB -\> Raspberry Pi

# Answer
> 5 votes
That should be possible and requires a reverse port forward, which can be setup with **adb**:

Run this command on your Raspberry Pi: `adb reverse tcp:<remote> tcp:<local>` where `<remote>` is the TCP port on your android phone and `<local>` the TCP port on your Raspberry Pi.

Example:

```
adb reverse tcp:2222 tcp:22

```

Let's say your Android phone has the WiFi IP 192.168.1.5. Now you should be able to connect from your laptop (or any device on the WiFi) to 192.168.1.5:2222 and end up port-forwarded to your Raspberry Pi's ssh on port 22.

You might need to build adb for Raspbian yourself, which is explained here. But recent Raspbian versions should include a recend adb client.

**2nd option:** you could forward (relay) the ports at the USB tethering subnet - usually 192.168.42.x, where 192.168.42.129 is your Android phone and the Raspberry Pi will have an interface `usb0` with the IP address assigned by the Android's DHCP. Understand that once USB tethering is enabled, your phone will have two active network interfaces: `wlan0` (which is your WiFi 192.168.1.x as usual) and `usb0` (which is 192.168.42.x). You need to know the usb0 IP on your Raspberry Pi, once it's connected to USB tethering. Now to make it all work you would need to use a tool like tcpxd on your Android phone:

```
tcpxd 192.168.1.5:2222 192.168.42.55:22

```

Where 192.168.42.55 is your `usb0` IP from your Raspberry Pi. Same as option 1: You should be able to connect from your laptop (or any device on the WiFi) to 192.168.1.5:2222 and end up port-forwarded (relayed) to your Raspberry Pi's ssh on port 22.

Both solutions should work without root.

# Answer
> -1 votes
Fwd: port forwarder app can forward both TCP and UDP ports.

The usage is straight forward:

1. Click the plus to add a new rule
2. Give it a title
3. Select protocol (TCP or UDP or both)
4. Select source interface and port
5. Provide target IP and Port

However, there are two limitations:

* You need to know the local IP address of the PC / RaspberryPi which probably changes each time you enable USB-tethering.
* The app does not create a real port forwarding at IP layer (this would require root privileges). Instead, the incoming data is forwarded to a new stream to the connected PC, similar to socat. This changes the sending IP address which is not acceptable for all use cases.

---
Tags: wi-fi, tethering, ssh, usb-tethering
---


title: How do I stop a download?

text:
# Question
Title: How do I stop a download?
I accidentally clicked on a download link and started a download. Once the download started, I didn't know how to cancel it. Later, it occurred to me that I could have ended the connection.

Either way, how do you stop a download once started?

I have a HTC Wildfire S, a v2.3.5 Android if that matters.

# Answer
> 0 votes
Click on the Download notification showing the progress and it will take you to Downloads app. There in app you can cancel the download.

# Answer
> 0 votes
I have an Asus Zenfone 2 still running Lollipop, and I've had the same problem for a long time. Force-stopping the Download Manager app and clearing the data usually works, but I recently stumbled upon a new way to cancel the download, making sure that it is permanently cancelled and doesn't pop up again annoyingly.

It merely involves going to the Storage section under Settings, and clicking on the Downloads tab. This brings up a list of previous and ongoing downloads. From here, long-pressing on a download lets you cancel it.

Hope this helps.

# Answer
> 0 votes
If you are using Google Chrome, then the download notification should appear on the screen. In case it doesn't, go to Setting \> Apps \> Google Chrome and force stop the app.

---
Tags: file-transfer, downloading
---


# Question
Title: Do WhatsApp photos need to be kept on the device in order to save them?
I have Google Drive backups turned on for WhatsApp, which I understand is for restoring lost conversation history. Android often prompts me to clear out my WhatsApp photos folder, though, to free up space. It makes me anxious because I may accidentally click yes, leaving me with my conversations but no photos.

If I clear the folder, are the photos gone forever?

If not, are they backed up in Google Drive along with the chats? Are they still shown in the app as thumbnails to download from the backup? How does it affect the user experience?

Once cleared, can the photos be accessed in another way? Either through a "preview" of my whole history (unlikely), or a folder in Drive with the photos (still unlikely since it's probably a hidden, app-specific folder)?

# Answer
> 0 votes
Google Drive backup is not linked in any manner to the WhatsApp folder of your device's internal storage. When you accidentally clear that folder, the media files gets deleted, and hence WhatsApp becomes unable to show those files. You can only see the chats, while the media files' thumbnails get blurred in the chats.

The way out is the following. Uninstall WhatsApp and then reinstall it. Make sure that the Drive account where your WhatsApp backup is stored is present in the device where you are installing WhatsApp. Now login to WhatsApp with your WhatsApp number, and WhatsApp will prompt you to download your chat backup. Accept that prompt, and your chats will be restored, along with all the deleted media files. The media files will even be restored in the WhatsApp folder of the internal storage.

Note: Three crucial points to remember:

1. After your media files get deleted accidentally, make sure WhatsApp doesn't perform any chat backup (if in case, the daily or weekly backup option is turned on in your account). If a new backup happens after deletion of media files, the previous Google Drive backup will be modified and a subsequent restoration through the process mentioned earlier won't be able to restore the media files.
2. After reinstallation of WhatsApp, if you don't accept the backup prompt, then you won't get any option to download backups later.
3. If WhatsApp doesn't prompt you with any backup message, it's probably because the Google Drive account isn't linked to your device (or maybe some other glitch). You will require to uninstall and reinstall WhatsApp again, and follow the mentioned procedure.

Hope this helps!

---
Tags: whatsapp-messenger
---


title: SSH tunnel with two hops

text:
# Question
Title: SSH tunnel with two hops
I would like to build an ssh tunnel from my android device (call it A) on port MMM to a machine C on port NNN. HOWEVER, A and C are not directly connected. They are only connected through machine B (which is also running an ssh server). Finally, port NNN is only open locally on machine C (which is also running an ssh server).

So, with openssh in unix, I can use the command line of ssh or the ProxyCommand argument in .ssh/config to archive this:

```
Host C-tunnel
   HostName C
   Port 22
   Use username
   IdentityFile ~/.ssh/myidentityfileforC.pem
   ProxyCommand ssh -e none -i /.ssh/myidentityfileforB.pem username@B nc -w 120 %h %p 2> /dev/null

```

I can then set up a tunnel straight from my localhost to C:NNN (through the connection above).

Is there an app for android that supports similar? I tried connectbot and ssh autotunnel. The later got close, as I could set up one tunnel from A to B and then another from A to C (through the tunnelled A-\>B connection), but initiating the latter brought both of them down. Setting up just the first tunnel and then using connectbot allows me to connect via ssh to C, but I cannot set up a port forward directly to C:NNN.

Any suggestions? Is there a direct port of openssh I've missed?

# Answer
> 2 votes
I would like to share info that JuiceSSH has the feature you're trying to achieve with just one click. I'm talking about its feature "connect 'via' other SSH connections." Even local port forwarding from the second server thru the first ssh connection works too.

# Answer
> 1 votes
Outside of stackexchange, I also asked some colleagues. One suggestion they had did work. In particular, instead of using ssh autotunnel for the tunnels, I used connectbot to connect and create tunnels. They can be layered. The only downside is that I leave a shell open.

More specifically:

1. I use connectbot to connect to B (ssh, port 22) and then add a forwarding from a port 2222 on A to port 22 on C. I leave this shell open.
2. Then I make a new different connection to port 2222 on A (which opens a shell on C) and add port forwarding from port 2NNN to "localhost:NNN" (which is actually C:NNN).

Now I can connect to A:2NNN (my localhost, port 2NNN) and get to C:NNN as if it were local. I have to leave the shells open, but it works well enough.

# Answer
> 0 votes
This is based on shelton's comments but they confused me, so here's how to do a "-J" hop using ConnectBot, e.g. via something like serveo:

* Add a connection to the Hop host (e.g serveo). This is purely a "man in the middle", and will be used to forward to the real host. E.g: "user@serveo.net". You can turn off "Start shell session".

+ Save the serveo connection.
    + "Hold" the serveo connection in your list of hosts, and choose edit port forwards.
    + Add a new port forward. Type: "Local", source port: "2222", destination "alias:22". This opens localhost:2222 when this serveo connection is made, which will forward/hop your connection to the target host.
* Add a new host, matching the port forward. E.g "user@localhost:2222".

The normal usage workflow will now be:

* Connect to the serveo host. This will start the tunnel. Close (but don't disconnect), so the tunnel stays active.
* Connect to the second (localhost:2222) host. This will run through the tunnel to your remote host. Authenticate as normal and voila!

---
Tags: ssh
---


# Question
Title: I have to triple tap everything on Galaxy Tab 10.1
I don't know how the settings were changed; my young daughter may have done it. Also, I just got the new update this morning. I have to touch, then double tap every time. Also, there is a yellow line around the screen and everthimg. I've checked all settings I know of, but I can't reverse this.

# Answer
> 1 votes
Sheryl found the answer herself. Quoting her comment:

> I finally found it.. My daughter must have been in the accessibiltiy settings. She had the talk back on. But I didnt realize because she also had turn off all sounds on. I dont know how that makes the tapping weird, but is fixed now.

If one has a similar effect (e.g. red borders shown), and it's not the *accessibility settings*, another place to look for is the *development settings*, which also has switches to highlight certain areas for "developer feedback" when testing an app.

# Answer
> 0 votes
Settings\>Accessibility\>Magnification Gestures.

I actually set this setting on myself so I could zoom into the screen whenever and where ever I wanted and when I did this, a yellow/orange line would border the screen to let me know I was in that magnification. However, I've been noticing a glitch with this tablet that's happening more frequently and this is whenever my finger is on the screen, all of a sudden it'll zoom in as if I triple tapped when I never took my finger off the screen. Well, I can't seem to do anything about the glitch so I wanted to stop the triple-tap-to-zoom feature just that I forgot how I turned it on. This post that I am replying to helped me figure out how to change it back. However, the previous answer wasn't very clear to me. I finally figured it out so I've decided to give the answer more clear for anyone that may have this problem in the future. Thank you. Take care.

# Answer
> 0 votes
I had a similar problem with a Galaxy S5 which drove me totally crazy. It was stuck in the talk back mode and required a tap followed by a quick double tap before any selection was activated.

None of the info I found online helped. I finally tried going to Accesibility → Hearing and noticed that Hearing aids was checked.

So I set turn off all sounds and unchecked hearing aids and the talk back stopped and the triple tapping ended. I went back in and set hearing aids and it still worked just fine.

I know, it doesn't make sense but that is what happened. My software version `G900PVPU1B0A6`, hardware versioin `G900P04`.

# Answer
> 0 votes
in Setting, type accessibility, click Filter accessibility event logging\> Explore by Touch, turn this off

this is for my S10, the talk back and triple tapping need to be turned off separately.

# Answer
> -1 votes
Go to settings \>\> accessibillity \>\> explore by touch see if that is turned on or off, if its on , **turn it off** and everything will be normal.

---
Tags: settings, samsung-galaxy-tab-10
---


# Question
Title: Block calls for everyone except for contacts
Is there a way to block (or mute) all calls except for those on my contact list?

I'm using android 4.1.2 on a Samsung Galaxy S3 Mini. Thanks in advance.

# Answer
The app Calls Blacklist mentions exactly that as one possible use:

> There are four block modes of call blocker:
>
> * Blacklist
> * All except the whitelist
> * **All except contacts**
> * All numbers

(emphasis mine). There are plenty other similar apps available, just search for "blacklist" or "call blocker" on the playstore.

\[Update 25/5/22\] In the free version the block behaviour is 'ignore', so the call still appears to ring for the person calling. In the pro version you can choose to immediately reject the call.
> 6 votes

# Answer
Although you mentioned using Android 4.1.2, I recently stumbled across this question and thought a more recent answer might be useful to others:

On Android 5.0 "Lollipop" and later this can be accomplished using the "Priority only" Do Not Disturb mode:

### Configure Do Not Disturb Priority Allowances

> 1. Open your device's **Settings** app.
> 2. Tap **Sound**, then **Do Not Disturb** preferences, then **Priority only allows**.
> 3. Set **Calls** to **From contacts only** and adjust any other preferences for this mode to your liking.

### Turn on Do Not Disturb "Priority only" mode

> 1. Swipe down from the top of your screen with 2 fingers.
> 2. Under **Do not disturb** or your current option, tap the Down arrow.
> 3. Turn on **Do not disturb**.
> 4. Pick **Priority only**.
> 5. Choose how long you want this setting to last.
> 6. Tap **Done**.
> 7 votes

# Answer
Not sure if it exists on the S3 mini, but on the regular S3 running 4.1 and later, there's a thing called Blocking Mode that will allow you to block incoming calls (and other notifications) from non-contacts, or limit it further to only favorite contacts or make a custom list of allowed callers.
> 1 votes

# Answer
It so often happens to me in all things Android, what worked yesterday may not work today… the above may be valid, but didn’t work on my phone. If your phone is rooted, or you can obtain and install a silent ringtone, the following has worked perfectly for me over several years and several versions of Android:

1. Download and copy a silent ringtone file to your phone’s ringtone library. (Google: SILENT OGG for a file)
2. Set your default Ringtone to use this file.
3. Set the individual contacts who can call you directly to any sound producing ringtone you want.

The neat thing about this is that if someone has not been assigned a sound producing ringtone, they can still leave a message for you and you can call them back if you want. If the call is from a telemarketer or a phone spammer, they will rarely, if ever leave you a message. Is that perfect or what?

Tip: If you want to occasionally receive a call from someone to whom you would normally not respond, e.g., the notification that “your table in the restaurant is now available,” create a dummy contact such as “Guest” and update this contact’s phone number as necessary.

PS: If any Android programmer has the spunk to do this, I’d like to help.
> 0 votes

# Answer
Android 10 upon selecting "Do not Disturb," will block all calls except those on your contact list. Happy days.
> 0 votes

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


title: WhatsApp backup to Google Drive

text:
# Question
Title: WhatsApp backup to Google Drive
I am planning to switch to a new phone. so on the old phone, I start WhatsApp backup to Google drive and I waited until it was completed. then I wanted to make sure that it is completed so I started the backup again and it showed me that it has some data and started uploading again.

I am now confused. are my chats backed up or not?

# Answer
> 1 votes
Well, even I have encountered such a weird problem. But no worries, your chats are already backed up. For further confirmation, visit your Google Drive account and go to the Backups section. You should see a backup listed, namely, WhatsApp Backup , along with the time when the backup was completed. Each time you do a new backup, the time gets renewed.

If such a backup isn't listed, then perform the backup again. If it is, you can conveniently proceed.

# Answer
> 1 votes
Every time you do a new backup, it will be uploaded to the Google Drive cloud. So, that's a cycle you'll forever keep on seeing. If one backup is complete, then you can switch to your new device. Just in case something goes wrong, the data will remain on your old device and you can re-login there using the SMS OTP. Once you're satisfied that all data is restored on the new device, you can wipe your old device.

---
Tags: whatsapp-messenger
---