# Question
Title: Automatically switch to a saved wireless access point with the strongest signal
I have a wireless router (D-Link) in room A and a repeater (TP-Link WA750RE) in room B, *both having the same SSID*. Sometimes, when I go to room B and back into room A, my Nexus 5 (Android version 4.4.3) doesn't switch to the router although it has a stronger signal. It stays connected to the repeater instead.

The "Tplink" and "Dlink" are only aliases. Both actually have the same SSID.

When I switch the Wi-Fi off and on again, it connects to the router. which provides much better speed.

How can I force Android to always switch to the strongest signal? Is there a setting for it, or an app?

# Answer
> 5 votes
Android 4.x will connect to the strongest available network when first connecting, but, by default, once connected, it will not change networks unless it loses its connection first. This is presumably because switching would involve disconnecting existing connections, and a second or three of no network.

Turning on "Avoid poor connections" in the Advanced Wi-Fi settings will make Android switch if the network reaches a low enough signal to trigger this feature, instead of waiting until it is gone completely.

One solution might be to set up a single SSID with two access points that support hand-off, rather than two entirely separate Wi-Fi networks - which is the way that this sort of scenario is handled in large commercial settings - but this depends on the hardware that you have.

# Answer
> 3 votes
Most Android devices removed the auto-switch feature for APs having the same SSID because it is an Apple patent.

# Answer
> 2 votes
I have successfully used Wifi Roaming Fix to switch APs that have the same SSID (using repeaters), use

When the signal level drops below a set threshold, it automatically switches to the one with the strongest signal.

# Answer
> 1 votes
I use both apps: Wi-Fi Manager (which can give priority to 5Ghz network over 2.4Ghz) and Wifi Roaming Fix (which can choose best AP signal once roaming).

My main router is a dual-band A/N while the repeater is only N. The setup is:

* A band: use different SSID from N band so "Wifi Manager" can give priority to it.
* N band and its repeater: Same SSID and channel so "Wifi Roaming Fix" can do roaming one client moving around.

I test with the VoIP app and my mobile phone works smoothly all over the house without drop/reconnection.

# Answer
> 0 votes
SWIFI detects a weak Wi-Fi signal and automatically switches to a better network.

# Answer
> 0 votes
I seem to be having a similar but opposite problem with Fios, Orbi with 2 satellites, and an LG V10 phone. Orbi is set as an access point and everything has the same SSID. As soon as the signal strength falls even a little below -65, the LG drops out for 2 to 3 seconds and then finds its own way back to the strongest signal, which is usually the closest satellite. BUT this is just enough time to lose a phone call I'm in the middle of.

The Android app "Home Wifi Alert" provides good detail regarding signal strengths and a great deal more information about my network. Using this is how I was able to see exactly when/where the signal dropped and how totally sudden the drop is. I have found that if I "train" myself to race through the place where it drops, I'm likely to lose a few words but often can avoid dropping the call. Of course, this is less than an "ideal" solution :)

After carefully positioning the Orbi satellites using "Home Wifi Alert" as described above, I added SWIFI as recommended here. Since Orbi does allow for a Guest Network as well as the one SSID it creates, I added a Guest Network. Then SWIFI had two networks to switch between. With careful adjustment of SWIFI, I am now able to roam my house and SWIFI switches between the main Orbi SSID and the Guest SSID. Although I'm notified that a network has been disconnected, the other network has already been connected and I have not lost a call since.

# Answer
> 0 votes
Use WIFI Badger app instead of "Wifi Roaming Fix" for the same SSID with NetGear Orbi. Seems okay so far, although it would disconnect and reconnect when reaching a set dB from the router or satellite.

I found "Wifi Roaming Fix" disconnected for a longer period of time.

# Answer
> 0 votes
I have 2 routers, one is D-Link DIR-816 dual-band and the other is D-Link DIR-803. The 816 is used as a repeater and is connected with my neighbor's router with whom I am getting internet and the 803 is connected with the 816 as an AP.

The solution I found is to match the security on both routers. The 816 has the option of automatic AES and TKIP, but I set it to manual AES. Both SSID names and passwords are same.

I tried the same thing with TPLink TL-WA801ND as an access point and I got the same result. Even the 816 is set to 802.11 b/g/n while the 803 is set to 802.11 b/g, but matching security works.

The settings page' screenshots are attached:

Click the image for a larger variant

# Answer
> 0 votes
On Samsung Galaxy phones with the Samsung app "Routines" installed:

1. Create a new routine consisting of only the condition "Wifi signal strength"
2. Once this condition is selected and appears on the box, tap on it and choose the signal strength
3. Adjust this level on the slider. It starts by suggesting 40%. For me, 50% worked best
4. Next, under Actions, choose the following actions, in sequence: "Turn Wifi off"; and then add "Turn Wifi on"
5. Test it on various conditions, and if it does not work, adjust the signal strength level on the slider described above

It worked flawlessly for me.

---
Tags: wi-fi, automation
---


# Question
Title: how to store all mobile data in computer without touch mobile screen?? H
How to get my all data(Like contacts,messages,files,etc) when my mobile screen was broken.

I am used Galaxy j7.And I loss my mobile display by some reason.

My phone still working,but i see all things on screen but dont touch on scrren

call was incoming.

But when I connect my phone with my pc via samsung component .then

Please help me

How can I get all my data.

# Answer
> 1 votes
There are numerous ways for you to fetch the data.
A very easy way for you to control the screen is to **use a mouse**.
If you are familiar with **Android Debug Bridge (ADB)**, you can use it as well.

---
Tags: backup, broken-screen
---


title: Chrome: "Failed to add bookmark."

text:
# Question
Title: Chrome: "Failed to add bookmark."
I am running Google Chrome 56 on Android 4.4.4 and starting today I am no longer able to add bookmarks. Every time that I click the star a nessage pops up that says "Failed to add bookmark.". I do not know what is causing this.

Note that:

* I am NOT using syncing, so syncing is not the cause of this problem.
* I do not want to use syncing.
* I tried rebooting, but that did not fix it.

How do I fix this?

# Answer
I believe this issue is caused by using the same chrome login for both desktop and Android and adding a bookmark on desktop. That folder is used for subsequent bookmarks but for some reason, the Android app doesn't know where that is. It could be that it saves a booking folder that was deleted. Anyway, here's what I did to fix this issue on Android:

1) Load an existing bookmark.

2) Press the bookmark star.

3) Change the bookmark's folder to another folder that exists.

4) Change the bookmark back to the original folder.

5) Navigate to the site you were trying to bookmark.

6) Bookmark it. The previously-used folder should now be set correctly.
> 2 votes

# Answer
Have you tried clearing the app data? And since you're not syncing, try reinstalling it again or disable it and return the app to factory then enable it(and update).
> 1 votes

# Answer
I had the same problem. Lokked in a number of different sites with no answer. I saw something about it being a sync problem, so I turned it off. (Note: I don't know if that was part of the answer or not.)

I edited an existing bookmark in the top-level-Mobile-Bookmarks folder and changed it to another folder - just like so many of us do nearly everyday to keep our bookmarks organized.

Then I opened a page I wanted to bookmark and tried it.

VOILA! Problem solved.

I turned Sync back on and it still works. The "fix" was so stupifiyingly simple that it makes me wonder if there was something else I did on earlier attempts that made the difference. I dunno - - it just works now where it wasn't working before. ¯\_(ツ)\_/¯
> 0 votes

# Answer
i did it my self. just go to your Google chrome settings then privacy then click clear history. select everything caches history etc.its done .now your bookmarks can be add.
> 0 votes

---
Tags: chrome-for-android, bookmarks
---


# Question
Title: Sony Z3 can't transfer files by USB and isn't recognised by PC after update to 6.0.1
My Sony Xperia Z3 Compact was recently updated to android version 6.0.1 ("Marshmallow"?) using the Sony update tool, from version 5. Phone isn't rooted, no custom stuff, only ever updated via Sony updates, etc. UK based.

**Before the update**, if I connected it by USB to my (Windows 8.1) laptop, the following would happen:

* The SD card would appear on the PC as if it was USB pen drive
* The phone charges and I'd get a message on the phone asking if I wanted to "install" Sony software on the PC (every time, even if I'd agreed to "install" it last time)
* On saying Yes, the SD card would disappear and would be replaced by a Sony icon that let me access both the internal memory and SD card like they were two directories on a USB pen drive

**After the update**, the following happens. Basically I can never access the SD card or internal memory on the PC no matter what I choose:

* The PC doesn't react, nothing appears on the PC
* The phone charges and a menu pops up giving me four choices:

> ## Use USB for
>
> * **Charging only** Just charge this device
> * **Transfer files (MTP)** Transfer files to Windows or Mac (MTP)
> * **Mass storage mode (MSC)** Transfer data between phone SD card and a computer
> * **MIDI** Use device for musical instrument apps (MIDI input)

* Neither "**Transfer files (MTP)**" nor "**Mass storage mode (MSC)**" do anything when selected. If I select either of these, the menu disappears, but *nothing else happens* \- nothing appears on the PC (no drives or anything), nothing displays on the phone.

It behaves exactly the same as if I'd selected "**Charging only**".

How can I investigate why this isn't working? What do I need to do to make file transfer on 6.0.1 with a PC by USB work like it used to? Is there some special Sony-only thing I need to do?

---

I've looked at Marshmallow USB connection type. Various answers there suggest things like:

> Swipe down the notifications window with the device plugged into the computer, there should be a persistent notification for USB Mode

...there actually isn't any such persistant notification at all for me, no matter which mode I choose. Also, unlike the description of that question:

> Windows detects it, installs the drivers automatically and shows the device in My Computer...

...none of that happens for me. The computer is completely unaware of the phone, although the phone does react to being connected to the computer.

# Answer
This is bizarre. I connected the phone via a *different USB socket* on the computer (same cable), and this time it worked fine, in fact better than before:

* The Sony icon appeared without needing to "install" anything, and accesses both internal and SD memory like before
* The "Install software" Sony message pops up on the phone like before now
* The missing persistent notification on the phone appears:
> **USB for file transfer** Touch for more options

I wasn't aware of the computer having different types of USB socket, but it seems like **maybe there are some types of USB socket that an Android 6 phone will think work but actually don't**?

I thought it might maybe have been a driver install thing, but the "bad" USB socket still doesn't work even after successfully using the connection to the "good" socket.

---

To add to the mystery, I have actually used this "bad" USB socket on this computer with this phone before, mere days before the Android update. Somehow the USB socket appears to compatible with Android 5 but not Android 6?

The "bad" USB socket also has no problem working with USB pen drives.

If anyone happens to know how I can find out what the technical difference between the two identical-looking USB sockets on my PC is, please comment!
> 0 votes

# Answer
if it helps: I have exactly the same problem. I do not think it has anything to do with the actual USB socket, even if my impression also was that just one USB 3.0 socket made the phone stop to ask about the USB connection all the time. My theory for the moment is that when I let the phone keep hangig for a long time, it stops asking about mode and all the beeps stops. So I suspect that it has to do with the current supply detection and how little is left in the battery. Perhaps one socket on the PC can deliver slightly higer current and that could make it look like this port only support the phone. Stamnia mode or not has no impact. In my PC, I have removed all Sony software due to full HD. It did not really add any value to me, but perhaps this new things requires the Sony SW on the computer? Never the less...a flaw that appeared after an update as you say
> 0 votes

# Answer
If you want to transfer files wirelessly, or if any of the above answers are too confusing or difficult to do, just search "Asus share link" in Google and install it on your PC. Install the same app on your phone through the google play store. Then just follow the directions in app. This will take longer to transfer files than via USB.
> 0 votes

# Answer
When you change to another USB socket on Windows, quite often the PC will re-scan the hardware and re-install drivers with different "instantiations". I have used this trick in the past to allocate more COM ports on a USB-Serial adapter driver, for instance.

You may have found that deleting all the Sony-related drivers off the PC, and using the same socket, would have had the same effect.
> 0 votes

---
Tags: 6.0-marshmallow, file-transfer, sony-xperia, sony-xperia-z3-compact
---


# Question
Title: Zenfone 5 a501cg soft bricked - can't mount /system /cache
I have a zenfone 5 which used to run on custom rom so i decided to revert it back to stock rom but when i wiped system cache and dalvik, it didn't go well and now i cannot start phone unless going into recovery. Twrp tells me those errors : unable to mount cache unable to mount system

Tried flashing custom rom again but it didn't work too. Any helps please :/

ps: my phone's usb is not working as a connector to pc i.e. pc cannot recognise the phone. please keep this in mind.

# Answer
It appears like when you first wiped your partitions, the process was possibly interrupted and you now have corrupt partitions which are not being recognised in TWRP.

* Please go to your TWRP settings and make sure that the *use rm -rf instead of formatting* option is not checked.
* Now go *Wipe**Advanced Wipe* section and try wiping all those partitions again which are currently giving *unable to mount* errors. Then reboot into TWRP and try again.
* It is recommended that you use a charger during the wipe process so that a battery failure will not interrupt the process.

> Tried flashing custom rom again but it didn't work too.

Please post the error that you get while flashing or at least a part of the error that appears, so that your problem can be understood properly.
> 0 votes

---
Tags: rom-flashing, twrp, unbricking, rom
---


# Question
Title: How to set default resolution in YouTube app?
Such that every time I open a YouTube video, it opens on that resolution. It is annoying when it changes automatically according to the network, and for every video, I have to change the resolution.

How to set default resolution in YouTube app?

# Answer
> 2 votes
YouTube app doesn't have this feature. However, YouTube Vanced comes with this feature. Go into its Settings - \> Vanced Settings - \> Video settings, and configure the resolution for both Wi-Fi and Mobile data separately.

# Answer
> 0 votes
According to the official YouTube product document, the video player do remember the settings done by user,

Below is the Note mentioned on the official page

> Note: Choosing lower video quality (such as 240p and 360p) will make videos start more quickly. The video player will remember this setting for future videos you watch.

So essentially, you need to follow the below steps...

To adjust video quality while watching on your mobile device:

In this page, it is only mentioned as Mobile device and it does not say the YouTube App.

However, I myself did tried the above steps, and I found that YouTube Player remembered my previously set video quality setting.

# Answer
> 0 votes
Except, what is not noted on the FAQ page is that "fully" closing the YouTube app by "home button then swiping it away", closing web browser and clearing cache, or restarting the device will revert YouTube back to its default behavior of:

1. The speed of your Internet connection
2. Video player/screen size: Higher quality videos generally play better on larger screens.
3. Quality of the original uploaded video: If the video was recorded in standard definition, it won’t be available in high definition.

Setting a persistent default video quality is no longer possible.

However, this setting has been added for Android to the custom YouTube Vanced app if you're brave enough to sideload apps in Android.

https://forum.xda-developers.com/android/apps-games/app-youtube-vanced-edition-t3758757

---
Tags: youtube
---


# Question
Title: After formatting SD card "as internal", can the partitions be downsized?
I've a 16 GB MicroSD card that's apparently faking its size. Using H2testw I found that only the first 7.8 GB are usable. Before buying a new one, I want to see if I can "fix" it. The idea is to have Android format the card "as internal", unmount it, and then either through a rooted Android or a Linux/Windows desktop downsize the three resulting partitions to fit inside the first 7.8 GB of the card.

Is there any reason why this wouldn't work? My only concern is that the Android phone might have its own record of the sector ranges of each partition, which I would be changing.

I'm not just trying it out, because I don't have a card reader on hand, and want to find out if it's likely to work, before I invest time into it.

# Answer
> 0 votes
I'm abandoning the project, since the card I was going to do this with is counterfeit and apparently unsalvageable (or at least not in the way I envisioned). To quote Robert: "because of wear-leveling algorithm the sd-card \[can\] reallocate the sectors at any time (and of course it can reallocate it into the non-existent flash part)".

Anyway, for people trying to find out how to work with these Android SD partitions, here's a few links from my research:

http://blog.sam.liddicott.com/2016/02/android-6-semi-adopted-storage.html

I want to split one MicroSD card into two parts: part adoptable storage, and part normal storage. How can I do this?

One of the tools used in the above posts is `adb shell sm` (or just `sm`). It can manipulate the partitions on the SD card. I didn't look into it further, but if I wanted to go through with this, the `sm` command is what I'd investigate next.

Of course, one of the things to know about working with Android's adoptable storage partitions is that one of them is encrypted, so unless you decrypt it, you can only manage it with the phone that encrypted it.

---
Tags: partitions, adoptable-storage
---


# Question
Title: Could a 64-bit hardware device run a 32-bit Android version?
This question comes from How can I tell if my installed Android version, not CPU, is a 64 bit or 32 bit one?

On desktop computers it is possible to install a **32-bit** operating system on a **64-bit** hardware device i.e. you can install Ubuntu Linux 32-bit on an AMD FX(tm)-9370 Eight-Core Processor (64-bit).

Does the same case happens for Android? Is there a **32-bit and a 64-bit version** for the same 64-bit device?

Some example links (like ROM downloads in 32 and 64 bits for the same Android device) would be welcome.

# Answer
It's not clearly mentioned but I assume you are talking about ARM architecture. ***“32-bit Android OS”*** means a 32-bit kernel and the collection of ELF binaries and libraries which are compiled to run on 32-bit processor. This middleware stack particularly includes `app_process` binary which runs with name `zygote` and hosts the complete application framework of Android. It forks Java Virtual Machines (for every app) in which Dalvik EXecutable (`.dex`) code runs which is neither 32-bit nor 64-bit. But the JVMs are native processes; either 32 or 64-bit depending on the JNI libraries the app contains.

We can run 32-bit OS on 64-bit device if 64-bit:

1. Processor supports running 32-bit code which is usually the case because backward compatibility is desired, but not always.
2. Kernel supports running 32-bit code because unlike bare-metal hypervisors we - the processes on Android - don't deal directly with hardware.

## PROCESSOR'S BITNESS

Every 64-bit processor's support for 32-bit execution isn't universal. For instance Samsumg Exynos 9 Series 982x SoCs contain Cortex-A55 and A75 which (are based on ARMv8.x and they) have support for `aarch64` and `aarch32`. On the other hand Qualcomm's Centriq 2400 SoCs and Cavium's Thunder X2 SoCs also include ARMv8.x processors but without `aarch32` support.

In order to find device architecture, we can read `/proc/cpuinfo` which exposes information from Main ID register of the processor.

```
~$ cat /proc/cpuinfo
...
CPU implementer : 0x41
CPU architecture: 8
...
CPU part        : 0xd03
...
Hardware        : Qualcomm Technologies, Inc MSM8953

```

But there in no direct information like `lm` flag to confirm 32/64-bit support. So we need to get technical details of hardware. As per the requirements from Google, `CPU architecture: 8` indicates that it's a `ARMv8` device. Also see this commit. And here is the hex to human readable decoding map which `lscpu` command uses.

```
~$ lscpu | grep -E 'Vendor |Model '
Vendor ID:           ARM
Model name:          Cortex-A53

```

Other possible ways to get SoC information:

```
~$ cat /sys/firmware/devicetree/base/model
Qualcomm Technologies, Inc. MSM8953 + PMI8950 QRD SKU3

```

```
~$ cat /sys/devices/soc0/{vendor,family,machine}
Qualcomm
Snapdragon
MSM8953

```

It's evident from technical specifications of Qualcomm Snapdragon 625 (MSM 8953) and Cortex-53 that it's based on ARMv8 architecture, which can process both instruction sets: `aarch64` and `aarch32`.

## KERNEL'S BITNESS

When `arm64` support was added to Linux kernel, 32-bit compatibility mode was also included. If kernel is built with `IKCONFIG_PROC`, confirm by:

```
~# zcat /proc/config.gz | grep -E 'CONFIG_ARM64=|CONFIG_COMPAT=|BINFMT'
CONFIG_ARM64=y
CONFIG_COMPAT=y
CONFIG_BINFMT_ELF=y
CONFIG_COMPAT_BINFMT_ELF=y
CONFIG_BINFMT_SCRIPT=y

```

So the 64-bit ELF files are executed natively with binfmt\_elf while 32-bit ELF files are executed with compat\_binfmt\_elf. See details in this answer.

Usually `uname -m` is used to find the architecture of device supported by kernel. It shows the persoanlity (execution domain) of the process which defaults to kernel's primary architecture (`PER_LINUX` ). But Linux kernel supports changing *persoanlity*, so this approach can be confusing:

```
~$ uname -m
aarch64
~$ setarch linux32 uname -m
armv8l

```

In latter command `uname` is running under 32-bit compatible personality. The same would happen if you use some app - like this \- which runs with `LINUX32` personality, no matter even if kernel and `uname` binaries are 64-bit. For details see this and this. `lscpu` also confirms CPU operation modes using same phenomenon.

## USERCODE BITNESS

Now coming to the userspace, `init` is the very first process run by kernel. Lets check its bitness. If the 5th byte is 1 it's 32-bit ELF file, if it's 2 the binary is 64-bit:

```
~# hexdump -n5 /proc/1/exe
0000000 457f 464c 0002

```

Or use `file` command:

```
~# file /proc/1/exe
/proc/1/exe: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked ...

```

Similarly check bitness of other vital OS binaries/libraries:

```
~$ file /system/lib*/libc.so
/system/lib/libc.so:   ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked ...
/system/lib64/libc.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked ...

```

```
~$ file /system/bin/linker*
/system/bin/linker:        ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked ...
/system/bin/linker64:      ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked ...

```

OS maintains 64-bit as well as 32-bit libraries and dynamic linker because apps may contain both types of binary code (though the major part must be Java/Dalvik bytecode). For instance the `dnsmasq` program which serves as DHCP server on hotspot is a 64 bit binary while Google Play Services uses a 32-bit library:

```
~# readelf -a /system/bin/dnsmasq
  Class:                             ELF64
  Type:                              DYN (Shared object file)
  Machine:                           AArch64
      [Requesting program interpreter: /system/bin/linker64]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so]

```

```
~# readelf -a /data/data/com.google.android.gms/app_vision/ocr/libs/armeabi-v7a/libocr.so
  Class:                             ELF32
  Type:                              DYN (Shared object file)
  Machine:                           ARM
      [Requesting program interpreter: /system/bin/linker]
 0x00000001 (NEEDED)                     Shared library: [libc.so]

```

Similarly it's not uncommon to have 32-bit binary blobs from OEMs / SoC vendors on 64-bit ROMs. Even some basic components of AOSP aren't 64-bit supported. Take example of `audioserver`.
To see all processes running in 32-bit mode:

```
~# for p in $(ps -p 2 --ppid 2 --deselect -o pid=); do grep -qE '^.{8}[^-]' /proc/$p/maps || echo $p; done | xargs ps f -o pid,cmd -p
  PID CMD
 3359 /system/bin/mediaserver
 3358 /system/bin/cameraserver
 3357 /system/bin/audioserver
 3356 zygote
 5081  \_ webview_zygote
20824  |   \_ com.android.webview:sandboxed_process0
18609  \_ it.colucciweb.vpnclient
 3354 /vendor/bin/hw/android.hardware.audio@2.0-service
 2665 /vendor/bin/hw/android.hardware.camera.provider@2.4-service
 2335 /vendor/bin/mm-qcamera-daemon
 2278 /vendor/bin/wifidisplayhalservice
 2277 media.codec hw/android.hardware.media.omx@1.0-service
 2244 /system/bin/drmserver
  777 /vendor/bin/hw/android.hardware.drm@1.1-service.widevine
  773 /vendor/bin/hw/android.hardware.cas@1.0-service

```

Out of these only one is a VPN app, rest are OS processes.

## CONCLUSION

So it's clear that even if core OS is 64-bit, there are possibly large number of processes running as 32-bit, though each process and its linked libraries have to be be homogeneous; either 32 or 64-bit. And there's no constraint if the OS doesn't include 64-bit code at all, but you won't find many instances because OEMs ship 64-bit devices with 64-bit binary code. It's more about business than performance; that's what a user pays for. However exceptions do exist where business isn't that much involved: Raspberry Pi 3 has 64-bit CPU, but 32-bit Raspbian OS. Android phones examples from past include Galaxy E5, LG G Stylo, Moto G5 Plus, Lenovo A6000 Plus and MT6735 devices. But now Android is moving towards 64-bit and some devices may drop 32-bit support gradually.

> Does the same case happens for Android? Is there a 32-bit and a 64-bit version for the same 64-bit device?

Yes, take example of Moto G4 Plus.

---

**RELATED:** Android apps for “armeabi-v7a” and “x86” architecture: SoC vs. Processor vs. ABI
> 4 votes

# Answer
Answer is yes. You can run 32bit android on 64 bit chipsets without much hassles. But it shouldn't really matter what version you're on because as of now 90% of all apps that are available are 32bit and won't make use of the 64 bit hardware.
> 0 votes

# Answer
Yes you can. Infact, Some early devices did exactly that. Its similar to what we have in desktop computing side. Moto E2 is one example of 64-bit processor running 32-bit OS.
> 0 votes

---
Tags: hardware
---


# Question
Title: Make an Android app keep its spot on the home screen on uninstall/reinstall
When developing Android apps, I will often end up reinstalling the app I'm working on (deliberately after uninstalling it, or when the build signatures are different).

It's bothersome to always put this app back on the home screen where I want it. And if I don't, I either have to type its name in the app directory (which can take a few letters depending on how similar its name is to other apps) or scroll to find it.

Has anyone found a way to have an app find it's previous spot on a reinstall, or something that would make finding it easier ?

I'm familiar with Tasker and Llama, but couldn't find such options.

# Answer
Not quite what you asked for, but you could put a Tasker shortcut on the home screen, and have that task just open the app. You could also have that task try different package names in order to support both your debug and release versions.
> 3 votes

---
Tags: installation, home-screen-shortcuts, development
---


# Question
Title: SwiftKey Select/Copy/Cut/Paste/other shortcuts
`Swype` has a great feature of sliding between the `Swype` key and:

* `a` \- Select all
* `c` \- Copy
* `x` \- Cut
* `v` \- Paste
* `m` \- Open selection in Google Maps
* `g` \- Google for selection

It's much quicker than long-pressing and then (for example) going into the `More` menu for `Select All`.

Can SwiftKey do something like this?

(Feel free to tell me any other killer shortcuts while you're at it)

# Answer
3 years later and Swype being unfortunately dead my solution was to switch back to Gboard.

Apparently Swiftkey doesn't give a s\**t to customers needs.
> 2 votes

---
Tags: swiftkey
---


# Question
Title: How to login to Oneplus OxygenOS after motherboard change with 2-step verification?
Last time, I had a similar issue with Oneplus 2, I troubleshooted the problem with OnePlus 2-level tech support (nicely organized by Amazon) and they decided after 3rd try that nothing to be done possible. Google said last time that the problem is OnePlus, because not pure Android. I have now troubleshooted the problem with 1-level Oneplus tech support, but they cannot diagnose the problem enough, but they note that it is not possible to setup the phone with 2-step verification at all.

I cannot disable the 2-step verification because of security reasons. The phone does not accept my password to my Gmail account, neither accept app specific passwords. I repeated the steps now at least 50 times now. I can login into pure Android phone with my login details at the moment: Samsung Galaxy S8.

I suspect that there is something corrupted in the hardware. Initially, the problem in the phone was that the sound was broken: crumbless, regardless if you use loudspeaker or headsets. So oneplus tech support decided to change the motherboard. Now, the motherboard is new but I cannot anymore login to the phone.

I think to get the warranty is the only way to go or have 2-level tech support troubleshoot the phone.

Waiting 15 minutes, I get the screen

> Something went wrong
> Sorry, something went wrong there. Try again.

Then, pressing "next", it gives the login screen again where you have to put your email address again. I do it and give the password. It goes back to the loop where it says the password is wrong, although is not wrong.

The 1-level tech support decides to do the second motherboard switch. I am waiting for it and then troubleshooting.

Phone: OnePlus 6T
OS: the newest 10.10.2019 version

# Answer
> 0 votes
Other tech senior proposed to change the motherboard 2nd time OR to have a new phone. I accepted the latter.

---
Tags: troubleshooting, oneplus6t
---


title: Unlocking bootloader on HTC Desire 320

text:
# Question
Title: Unlocking bootloader on HTC Desire 320
I am trying to unlock bootloader on Desire 320, but failing on retrieving the OEM number:

```
$ fastboot oem get_identifier_token
...
FAILED (remote: unknown command)
finished. total time: 0.004s

```

I've also tried flashing recovery with TWRP directly using

```
$ fastboot flash recovery <recovery.img>

```

But that failed with security deny, error code 0x2017. I've rooted the phone using KingoRoot but that did not change anything.

I've even tried an automated application HTC Bootloader Unlocker, but this app failed on the same step as I did. Also, after investigating its logs, this app tried to read various variables using fastboot and could not read any of them.

I've also tried to update ROM directly from stock recovery using both SD card and ADB sideload, but both installations were canceled (but sideload on itself works).

The phone specs and prerequisities:

* android 4.4.2, core version 3.4.67
* Developer mode unlocked, USB debugging enabled (was able to send adb/fastboot commands)
* Unverified applications can be installed (was able to install KingoRoot)
* Cannot enable OEM Unlocking option as many guides suggest (**this option does not exist in my phone**)
* Cannot use RUU (my phone does not have a carrier)

**The question:**

* Am I screwed or is possible to unlock this device (and how?)

# Answer
> 0 votes
There seems to be an **issue with USB3.0 and Fastboot**. Fastboot commands won't work on a phone which is conencted via a USB3.0 port. In order to investigate further and look for the solutions, I need you to crosscheck this first. Try running other fastboot commands such as:

```
fastboot reboot

```

and see if it works.

---
Tags: fastboot, htc-desire, bootloader-lock
---


# Question
Title: How can /proc/sys values be changed at boot (sysctl.conf does this on normal Linuxes)?
How can `/proc/sys` values be changed at boot?

`sysctl.conf` doesn't exist on Android and echoing values to the `proc` files isn't persistent.

# Answer
> 4 votes
Use `init`'s `write` command in `/init.rc` or any other `.rc` file. You may also create your own:

```
# /system/etc/init/custom.rc

on property:sys.boot_completed=1
    write /proc/sys/kernel/hostname MyDroid

```

Set permissions and reboot device.

```
~# chown 0.0 /system/etc/init/custom.rc
~# chmod 0644 /system/etc/init/custom.rc
~# chcon u:object_r:system_file:s0 /system/etc/init/custom.rc

```

You may also use some early trigger like `on init` or `on boot` but your value may get overwritten by some later trigger.

Also some values aren't allowed by SELinux to be written by `init`. E.g. `/proc/sys/vm/drop_caches` and `/proc/sys/vm/dirty_ratio` are writable only by `vold`. In this case you can use `exec` command which allows changing SELinux label before command execution.

```
# /data/sysctl.conf

kernel.hostname=MyDroid
vm.dirty_ratio=20

```

```
# /system/etc/init/custom.rc

on property:sys.boot_completed=1
    exec u:r:magisk:s0 -- /system/bin/sysctl -p /data/sysctl.conf

```

<sup>* `sysctl` is `toybox` applet. Or you may use `busybox`.</sup>

For other options see this answer. Some apps may also provide similar functionality but I never used one.

---
Tags: system, 9.0-pie, kernel, init.d, omnirom
---


# Question
Title: Recover deleted video in Google Photos app
In Google Photos I deleted permanently a video (before it was backed-up). Is there any way that I can recover it? It's very important to me.

# Answer
> 0 votes
You can only recover videos and photos which aren't permanently deleted. But if you have mistakenly permanently deleted the video you can contact Google Drive Support regarding this issue. They might help you with this. But I believe it will be more difficult to recover since Google has removed the Google Drive Support for Google Photos.

Link to Google Drive Support

---
Tags: data-recovery, google-photos
---


# Question
Title: Architectural details of Android VPN service : How tun0 gets created?
I would like to know how android creates a VPN tun0 interface. After I call establish from VPNService, Builder, the ServiceManager takes up the process and create the tun0. For that it uses parcels to send to Binder, but I am kind of confused as to what it does after that. I want to understand in detail how an interface gets created.

I have tried using strace on the application to see what kind of system calls get executed, but I did not see any ioctl calls from the application pid, but saw them on the system\_Server pid. I understand that system\_Server is what creates the interface, but how does Binder talk to system\_Server asking to create an interface. Kindly point to any source code . It would be really helpful .

# Answer
This is more like a development related question but what I know is that binder is inter-process communication (IPC) mechanism (like sockets) which processes use by opening `/dev/*binder` character devices. Binder IPC is used by Android's Java framework (for JNI communication) as well as native processes (e.g. for communication with vendor's binary blobs).

`tun` is Ethernet-like virtual network interface created by kernel (provided that it's built with `tuntap` support) so that a program can directly read/write IP packets from/to this interface. Creating `tun` needs ioctl `TUNSETIFF` be sent to kernel over `/dev/net/tun` character device (it's `/dev/tun` on Android). Manually you can do:

```
~# ip tuntap add dev tun0 mode tun

```

Android's VPN service uses `binder` to call native code for `tun` creation.

**RESOURCES:**
> 2 votes

---
Tags: vpn
---


# Question
Title: Error "FAILED (data transfer failure (Value too large for defined data type))" While Flashing Nexus 4
I have a Nexus 4 that was soft bricked during an OTA update. I have tried to flash several factory images to it and every time it gave me the error "FAILED (data transfer failure (Value too large for defined data type))". When I tried to flash Occam 4.4 it seemed to finish without any problems. Now when I try to boot it up it doesn't get past the Google screen. I have left it on the Google screen for over an hour and tried wiping the cache and factory reseting it but it is still stuck on the Google screen. Also I tried to flash Occam 4.4 again but the same error displayed when I tried. The bootloader on the phone is unlocked. Can anyone help me either with getting past the Google screen or re-installing Occam on it? I run Windows 7 and Ubuntu 16.04

**Note** USB De-bugging is not activated

# Answer
Regarding the message `FAILED (data transfer failure (Value too large for defined data type))`, in my case the issue was resolved using another USB cable (first one was from a Samsung Galaxy tablet, second one from a Nexus 7 tablet)
> 1 votes

# Answer
I was using adb from an Armv7 device and trying to sideload a ROM, where I got this error (`adb sideload ROM`).

Frustrated, I tried pushing the ROM (`adb push ROM` and make sure the phone is NOT in the sideload state) and got the exact same error.

This turned out to be the fault of the USB driver, and was nothing to do with adb nor the ROM.

I have heard that USB 2 ports are better for flashing, but my laptop only has USB 3 ports.

So what could I do?

Well, the android shell provided by TWRP contains the `cat` command. So I `split -b 100M <ROM.ext> rom-parts-` on my laptop, to split the ROM into several parts, and then did `adb push rom-parts-* /sdcard/`.

This transferred the files fine. I could then do `adb shell` to get access to the android shell on the device, and then did `cat rom-parts-* > <ROM.ext>` and then verified it was the same file by doing an md5sum or sha256sum and comparing with the original file online.

In TWRP I was then able to install the image easily.
> 0 votes

---
Tags: nexus-4, fastboot, bootloader, ota-update
---


# Question
Title: How to grant an app a permission that isn't in its manifest for audio recording?
Non rooted Moto G6 Play running Android 9.

I'm using Termux and would like to use Sox's `rec` command to record audio from the terminal. Unfortunately, since Termux doesn't request the mic permission, it just records silence. I can't grant Termux the permission in Settings because...well, it doesn't request it. It's not in the app manifest, therefore Android (understandably) assumes it wouldn't know what to do with the permission if it had it and doesn't list "record audio" as an option.

Is there a way I can force Android to grant an app a permission it never asked for?

# Answer
***Not possible without root but even with root SoX recording might not work.***

---

**Android Manifest Permissions**

Android permission system has different **Protection Levels** <sup>(, )</sup>; ***Normal*** permissions are granted to any app without user interaction while ***Signature|Privileged*** (SignatureOrSystem) permissions (whitelisted in `/etc/permissions/privapp-permissions-*.xml`) are granted only to system apps. Both are granted when app is installed or on first startup (if system app) and configuration is saved in `/data/system/packages.xml` file. Some signature permissions can be granted to non-system apps after user's approval using `appops`.

***Dangerous*** permissions are those which require user's approval to be granted or denied. User's choice is saved in `/data/system/users/<User_ID>/runtime-permissions.xml` where device owner's User\_ID is `0` (don't confuse it with UNIX DAC's UID).

Most of the manifest permissions are enforced by Android framework (`system_server`) but some are mapped to GIDs; hence enforced by kernel. Permission to GID mapping is stored in `/data/system/packages.list`.

**How to Grant an App Unrequested Permission**

You can modify above mentioned files to grant a permission which isn't requested by an app in its *Manifest*. I haven't tested with all permissions but this trick works (at least up to Pie) because Android framework doesn't verify the saved permission configuration vs. apps manifest files on every reboot (may be the changes are reverted back to actual during a scheduled maintenance task or when some app is installed or updated; I'm not sure).

In our case we want to grant `android.permission.RECORD_AUDIO` to Termux which is a dangerous permission, so this is how you should edit your `runtime-permissions.xml` followed by an immediate reboot:

```
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<runtime-permissions fingerprint="...">
  ...
  <shared-user name="com.termux">
    <item name="android.permission.READ_EXTERNAL_STORAGE" granted="true" flags="0" />
    <item name="android.permission.WRITE_EXTERNAL_STORAGE" granted="true" flags="0" />
    <item name="android.permission.RECORD_AUDIO" granted="true" flags="0" />
  </shared-user>
  ...
</runtime-permissions>

```

To confirm:

```
~$ pm dump com.termux | grep -A3 'runtime permissions:'
      runtime permissions:
        android.permission.READ_EXTERNAL_STORAGE: granted=true
        android.permission.WRITE_EXTERNAL_STORAGE: granted=true
        android.permission.RECORD_AUDIO: granted=true

```

---

**Why SoX won't work?**

That said, still SoX won't be able to record audio because (AFAIK) it's not using Android's Java APIs (`android.media`) or native APIs (`aaudio`/`opensles`). It uses ALSA/OSS driver directly or through `PulseAudio` which needs direct access to device interfaces in `/dev/snd/` or `/dev/{audio,dsp*}` and proc tree in `/proc/asound/`. For details see Android Audio Architecture.

However direct kernel level access isn't a norm on Android, so you need root access. Apps with `android.permission.MANAGE_VOICE_KEYPHRASES` are allowed to read `/dev/snd/*` devices. It's a privileged signature level permission which is mapped to GID `audio` (`1005`). You can edit `packages.xml` to get this permission granted:

```
    <package name="com.termux" ... >
        <perms>
            <item name="android.permission.MANAGE_VOICE_KEYPHRASES" granted="true" flags="0" />
        </perms>
    </package>

    <shared-user name="com.termux" ...>
        <perms>
            <item name="android.permission.MANAGE_VOICE_KEYPHRASES" granted="true" flags="0" />
        </perms>
    </shared-user>

```

And `packages.list`:

```
com.termux ... 0 /data/user/0/com.termux default:targetSdkVersion=28... 1005,3003

```

But SELinux allows only privileged apps (having context `priv_app`) to read files in `/dev/snd` while `/proc/asound/` isn't readable by apps at all, so you need to patch `sepolicy` as well.

And even after that, configuring SoX to use ALSA/OSS/PA is up to you.

---

**Non-Root Solutions**

Instead of using ALSA directly, PulseAudio can also be configured to stream audio over TCP or UDP or UNIX sockets. That's how media playback works on Termux. See this issue. However capturing audio only work through Android APIs. You can install `termux-api` package to use `termux-microphone-record` command for audio recording. It uses `MediaRecorder` class of Java API, or you may consider *modifying* SoX source to use Android's native APIs.

---

**RELATED**
> 6 votes

# Answer
There are two ways:

1. Termux is an open-source app on Github. Therefore you just need the Android development tools and git for cloning and building a custom version (may be with a different package name so you can have both your version and the official installed).
2. As your device is rooted you can try to add the permission to the list of registered permissions of an installed Termux. As far as I know the relevant data should `/data/system/packages.list` or `/data/system/packages.xml`. After modifying those files you should reboot the device to activate the changes. For more details see also this answer. Note: I am not sure what happens to these modifications in case an update of Termux is installed. I assume that the update will revert your changes.
> 0 votes

---
Tags: permissions, 9.0-pie, motorola, termux, audio-recording
---


# Question
Title: How does SuperSu provide root privilege?
Has a write-up ever been released on exactly how SuperSu works? After searching around for a while I found mostly guides on how to use the app, not the implementation details.

I did, however, find this resource that is mostly directed at explaining how to use the root privileges programmatically, but explained things fairly well. The article gives information about SELinux, but not so much how its enforcement is circumvented.

There appears to be a lot of context switching to allow execution of certain events (from the point of view of those *using* SuperSu) otherwise denied under SELinux, but how did SuperSu get to the point at which it was able to "*legally*", as far as SELinux is concerned, patch SELpolicies?

It seems that the objective is to force the init process to spawn a new shell that runs the su daemon, but there does not appear to be any patching of the *init* process, but from the article linked:

> On firmwares that use SELinux, su is generally implemented as a proxy to a daemon started from init

and

> You might wonder why - if we're already running as the init context, as the root user ..

---

**tl;dr**; How does SuperSu execute in the context of the init process?

Given as:

```
u:r:init:s0          - Highest init context
u:r:init_shell:s0    - Shell started from init

```

# Answer
> 10 votes
SuperSU is no more actively developed, the new prevailing standard is Magisk which was originally based on SuperSU (ideas and perhaps some code too) but now it has moved far ahead. So better go for a new actively maintained open-source solution wherever possible. Or if you want some adventure, try this: How to manually root a phone?.

My answer to How Magisk works? covers almost all internals of SuperSU, also some extra details which aren't applicable to SuperSU. Let's keep it simple.

## ROOT USER (UID `0`):

Android is based on Linux kernel which, when starts at device boot, runs as root user. *Kernel space* is invisible to us - the *userspace*. `init` is the first process started by kernel which we can see, it also runs with root access. It starts many services/daemons (the OS), many of them also run with root privileges. Finally when all required processes are up, `init` drops us to a non-root (unprivileged) process - a *shell* on standard Linux OSes, a *Launcher app* or *Lock Screen* (which is also *System UI* app) on Android. Root is kernel's dear user - the ***Super User*** \- identified by **U**ser**ID** `0`. Kernel never restricts him doing any harm or good to anything on device. Non-privileged users are assigned UIDs `1` to `65534` (usually). Android divides these UIDs for different categories of apps and processes as explained here. Every process and every file has a **UID**, **G**roup**ID**, supplementary **groups** and permission **mode**. These four parameters govern how a process accesses other processes and files. This whole phenomenon is called **D**iscretionary **A**ccess **C**ontrol.

## HOW APPS GET ROOT ACCESS?

If an unprivileged process wants to access some file or perform some action which is only allowed to root user, the former has to switch to the latter. It's done by executing a file (usually `su`) which is either **set-user-id-root** or has `setuid`/`segid` **file** **capabilities**. A capability is a subset of root user's authorities. Executed file makes **`setuid`** **syscall** so the kernel elevates unprivileged state to privileged. This is a simplification, in actual there are multiple other factors involved. But on Android, apps are run by dropping all capabilities and privileges in such a way that they can't elevate their privileges in any way (excluding vulnerabilities). So the unprivileged app requests some other already running privileged process to perform the privileged task on former's behalf. The privileged process is named `daemonsu` (or `magiskd`) and the request is forwarded when an app executes special `su` binary which interacts with SuperSU app to ask the human user for granting permission.

## SELINUX:

In addition to DAC, Android also makes use of **SELinux** \- a **M**andatory **A**ccess **C**ontrol. Like DAC, every process and every file is labeled with a SELinux context and a policy is defined to allow a wide range of interactions between contexts/labels. Policy contains no ***Super Context***, so every process (even running with UID `0`) has some limitations. But `daemonsu` needs to be run with a completely unrestricted context which has to be defined before SELinux is set `enforcing` (by `init` at very early boot stage) because after that there is no way to set it `permissive` or modify policy. Some vendors build their kernels without `SECURITY_SELINUX_DEVELOP`, so SELinux is enforced by kernel - even earlier. In this case kernel needs to be rebuilt/patched. See details in this answer.

## ROOTING PROCESS

When SuperSU.zip is flashed:

* It patches `/sepolicy` file with fully permissive `u:r:supersu:s0` context (`supersu` can be different, I can't recall what SuperSU used in last releases, Magisk now uses `u:r:magisk:s0`).
* It injects a custom `init` service to `/init.rc` file which starts `daemonsu` with UID/GID `0` and SELinux context `u:r:supersu:s0` after `/data` is mounted (or even before).

Both `sepolicy` and `init.rc` files have been part of `ramdisk` inside `boot.img` (which also contains kernel binary), but with Treble, SAR and `A/B` Partitions they might be on different locations. So Magisk uses different approaches for different devices but the concept is same.

Both steps may also be substituted by replacing the actual `/init` binary with a custom `init` which takes over boot process, patches `sepolicy` and starts service on the go before executing actual `init`.

Other things which are directly related to rooting process include bootloader unlocking, `boot.img` unpacking/repacking, disabling Verified Boot (`dm-verity`) and FDE/FBE, patching kernel to boot different `init` (or to disable vendor specific security mechanisms), systemless rooting, (un)setting Android properties, bind-mounting directories, isolating mount namespaces etc.

---
Tags: rooting, superuser, selinux
---


# Question
Title: My newly updated Droid rings at max volume even when ringtone is muted
I was forced to install a mandatory update (Droid version 9, Kernel version 3.18.91-16068741) for my Samsung Galaxy J7 around 2 weeks ago. Since then, there have been six (6) incidents where my phone rings EVEN IF MY RINGTONE IS SET TO MUTE. Is this a bug with the new update or did the change break a setting? As a last resort, how do I downgrade?

# Answer
> 1 votes
Try using do not disturb, that usually helps by going to **Settings \> Sounds and notifications** and check that the following are selected to how you want. There are two options:

* Volume: To adjust the volume level for music and videos, system sounds, call ringtones, and notifications.
* Do not disturb: **Mute incoming call and notification sounds**, except for **allowed exceptions.**

> For the **Do not Disturb** option, check that you are not leaving an exception for incoming calls before enabling because that could be one of the problems too.

Also, as a last resort like you said, you can also flash your phone using this well-explained guide by clicking the link here (don't mind the title, the process of flashing can either upgrade(which you don't want) or downgrade(which, of course, you want) ) which will provide all the resources you need to properly flash your phone.

> **REMEMBER:** I am **not** responsible if you brick your phone if you follow these instructions incorrectly. **MAKE SURE** you select your correct device along with the correct ROM you want to use on the SamMobile website, meaning, since you want to downgrade, select a firmware other than the 9.0 Pie firmware, so an older one like one back in 2017. If you don't know how to use Odin, follow this link which will provide you with instructions of how to use it.
> **ALSO NOTE:** To avoid the stress of you permanently bricking your phone, install a custom recovery like TWRP, which will make life easier when you have to deal with a bricked phone.

I hope these instructions were helpful and wish you the best of luck.
Cheers,
Joe

---
Tags: updates, samsung-galaxy-j7
---


# Question
Title: Uninstall TWRP application without PlayStore?
I accidentally agreed to the annoying TWRP application (me.twrp.twrpapp: the android application that keeps TWRP Recovery up to date.). Is it possible to remove this application from the install? Is there an uninstaller? The "App Info" screen only gives me the option to Disable and Force Stop.

When I try to remove it with `pm uninstall`, I get an error,

```
$ pm uninstall me.twrp.twrpapp
Failure [DELETE_FAILED_INTERNAL_ERROR]

```

The device is rooted, and uninstalling as root didn't seem to help

```
$ adb root
restarting adbd as root
$ adb shell
n1awifi:/ # pm uninstall me.twrp.twrpapp
Failure [DELETE_FAILED_INTERNAL_ERROR]

```

# Answer
> 1 votes
Uninstalling TWRP is very easy if you are on the latest version of TWRP Recovery,

Go to TWRP Recovery via Reboot, Mount System and other partitions

Now go to Advanced -\> Uninstall TWRP APP (Checkbox)

and SWIPE to uninstall

# Answer
> 1 votes
First you have to connect to your device as root. When you do this you should see the `#` prompt,

```
adb kill-shell
adb root
adb shell

```

Now you need to remount `/system` as rw and then you can remove all copies of `twrpapp`

```
mount -o remount,rw /system
find / -name '*twrpapp*' -print -exec rm {} \; 2>/dev/null

```

---
Tags: twrp, uninstallation
---


# Question
Title: Is there a way to reset the phone without re-enabling the disabled apps and services?
My phone's system UI has become laggier and slow lately. I want to reset the phone which is running Android Pie/ One UI and even though OneUI is a hell of a good UI experience it has a mega tonne of bull crap that I disabled through adb. These include a lotta Samsung services (like samsung pass, keyboard and stickers) and it took a lotta work. Is there a way I can reset the phone without re-enabling the apps? I don't care about the settings getting reset. If not, so is there a way I can clear all of the phones *app data* (i am not talking about app cache)? There are hundreds of apps in a phone (including system ones) and I just wanted to know if there was a way I could reset all of them at once through adb or some app that doesn't require root access.

# Answer
> Is there a way I can clear all of the phones app data (I am not talking about app cache)?

From `adb shell` do:

```
~$ pm list packages | sed 's/^package://' | xargs -I {} pm clear '{}'

```

This will clear all apps's data and cache.

> Is there a way I can reset the phone without re-enabling the apps?

No. But as @Firelord suggested in comment, create a list of disabled packages with:

```
~$ pm list packages -d | sed 's/^package://' >disabled_pkgs.txt

```

Keep backup of `.txt` file and after factory reset do:

```
~$ cat disabled_pkgs.txt | xargs -I {} pm disable '{}'

```

If you are using multiple profiles, you also need to use `--user` option with package manager.
> 1 votes

---
Tags: root-access, stock-android
---


# Question
Title: Is it possible to fix hard bricked device?
I'm working in electronic repair store as technician and I started 4-5 years ago but something really bothers me .

Why we can't fix hard bricked devices ? Like device's hardware completely fine . Is there some kind of device for that problem ?

I have 5-10 devices just laying dead because of hard brick because some amateur tried flash a ROM without any experience

Also I don't know if here is correct place to ask this question , I'm basically trying to flash a android ROM but if it isn't right place for it I can delete my question and please if you're not %100 sure don't write "you can't fix hard bricked devices" , I heard&said that for a long time

# Answer
In a softbricked device, critical partitions like a recovery partition is usually preserved which helps to easily recover from the condition, but in a hardbricked device all the software interfaces that provide access to the hardware are unavailable, that means there is no method for you to communicate with the hardware. As Robert has rightly said, you need to physically access the hardware in order to flash a software, which in case of integrated hardware is very difficult. To circumvent a hardbrick situation, Snapdragons have an Emergency Download Mode (EDL).
> 2 votes

---
Tags: rom-flashing
---


# Question
Title: How to bypass system dialog asking to allow access to tablet data on Android tablets, specially those by Samsung?
I am developing an Android application, which connects with a Raspberry Pi hardware via the USB port. The issue is that this system dialog (as shown in the picture above) pops up every time I connect it. Requiring to tap on 'Allow' every time is resulting in bad user experience. If the user taps to 'Deny' or dismisses the dialog, the Raspberry Pi is unable to detect the connected Android device.

Is there a way to bypass this? Note that I'm using a non-root Samsung tablet powered by Android.

(Reposted the question here as suggested by someone in the comments. OP here: https://stackoverflow.com/questions/58371723/how-to-bypass-system-dialog-asking-to-allow-access-to-tablet-data-on-android-tab)

# Answer
The dialog "Allow access to tablet data" is a security dialog, therefore from within an app it is not possible to "bypass" this dialog. As it is currently not yet possible to identify a PC via USB and MTP protocol (may be this is possible in future by authenticated USB) there is also no option available like "always allow this computer to access my files".

Otherwise anybody with access to an unlocked Android device could simply copy e.g. all photos and videos fro the device using USB.

The only known way is to enable the "Developer Options dialog and permanently set the option "USB configuration" to "MTP / file sharing"

Alternatively you could use Android Debug Bridge (adb) ADB instead. On adb level there is a computer authentication which allows to allow a computer permanent access to the device via USB. Of course ADB is disable by default, therefore the user first has to enable the Development menu and the enable adb.
> 2 votes

---
Tags: usb
---


# Question
Title: How To Enable Debug Mode From ADB Shell or ADB Via Terminal In Linux
so far I have put my android device in ftm mode i have tried from `adb sideload` now i am trying with `busybox ash`

I'm able to run `ls` but anything else says permission denied or error:closed.

```
/ $ ls
acct
cache
charger
config
d
data
default.prop
dev
etc
file_contexts
firmware
fstab.qcom
icon_ftm.png
init
init.class_main.sh
init.environ.rc
init.ftm.rc
init.mdm.sh
init.offcharge.rc
init.qcom.bms.sh
init.qcom.class_core.sh
init.qcom.early_boot.sh
init.qcom.factory.rc
init.qcom.ftm.rc
init.qcom.rc
init.qcom.sh
init.qcom.syspart_fixup.sh
init.qcom.usb.rc
init.qcom.usb.sh
init.rc
init.target.ftm.rc
init.target.rc
init.trace.rc
init.usb.rc
init.vendor.rc
init.zygote32.rc
mnt
persist
proc
property_contexts
res
root
sbin
sdcard
seapp_contexts
selinux_version
sepolicy
service_contexts
storage
sys
system
tombstones
ueventd.qcom.rc
ueventd.rc
vendor
verity_key

```

# Answer
You **can't** make use of ADB without turning on the Debugging mode. There is one way to access partitions via ADB even if you don't have ADB turned on. If you want to run **ls** on restricted partitions, like **cd data**, you need to boot (not flash) into a custom recovery. Asssuming that you have an unlocked device, run `fastboot boot <recovery.img>`. Now that you have successfully booted into a custom recovery, **mount** relevant partitions and run adb commands.
> 0 votes

---
Tags: adb, linux, shell, terminal, debug
---


# Question
Title: Which file has the saved contact data in android? How to get this file in an unrooted phone?
My android phone's screen is damaged and only shows a white pixelated background and does not recognise any touch input (although it does recognise when I swipe on the initial lock screen after I restart the phone, I know this because I can hear the audio feedback). However everything seems intact internally, as I can charge it normally, pull out the battery and put it back in and restart it, the audio feedback when I put in the charger and pull it out work, and I can browse the internal memory by connecting it to the computer.

However, a big problem is that the phone is unrooted. I cannot connect the phone using adb either, since I cannot see the adb authorization dialog box, and just guessing where the OK button should be and pressing there is not working either. Since I can still the internal memory from computer, I have taken most of the basic data backup (pictures, audio recordings, etc) but I am not sure what to do about the contacts.

Is there any way to recover the contacts file from this phone, given that it is not rooted? The contacts are not backed up in google. The phone is Samsung Galaxy S4 with Android 4.4

Edit:

Create backup using
adb exec-out dd if=/dev/block/(bootdevice/)mmcblk0 \> emmc-backup.img

How to take full image backup of partitions or eMMC?

From the image file extract userdata.image. This contains data/data. This will take a while. During this time command prompt will not give any indication something is happening.

# Answer
There is a possibility that the contacts would have been saved on your sim.

Try putting the sim on another phone and importing.
> 0 votes

---
Tags: contacts, data-recovery, broken-screen
---


# Question
Title: where does the official, "non-custom firmware" Android os look for version updates?
When the "new update is available" popup appears on the screen, does the os go to the manufacturer's server or the google's servers to download the update? in other words who is the main version update publisher that the os looks for updates from?

# Answer
The OS looks for updates from the manufacturer's site for a newer version. When you click download on your phone it download the latest update usually as "update.zip".
> 2 votes

---
Tags: updates, operating-system
---


# Question
Title: Why must my device be compatible with a certain ROM before I flash it to my device?
This it the explanation telling me not to install a custom ROM without checking the device's compatibility. "Now, be careful as each custom ROM comes with a version that is suitable only with one device; you can’t install the same variant of firmware on all the Android devices as the same is not compatible."

But, I'm using a HP Slate 7, there isn't an official thread for this device on XDA Developers, and the furthest I can go is to root my tablet. Other than that, there are no custom ROMs specifically for this device.

My question is, why can't I install a custom ROM if I follow all the correct processes for flashing a custom ROM, even if my device is unsupported? Is it purely because of the bootloader? Or the kernel? I'm fairly new to Android, but I've been reading up on new terms, so can I have some guidance?

# Answer
> 3 votes
No long explanation needed, the reason is quite simple: Different devices come with different hardware components, such as the camera or sound "chips". Those require special drivers, which are in most cases proprietary and not part of AOSP (which is the "Android base code").

This means, each ROM must include device specific code, and thus is specific to the device it is created for.

# Answer
> 1 votes
In order to understand **why specificity is important** we must understand the structure of a device, both software structure and hardware structure. **Different devices have different structure**. **Two devices having different models don't have similar hardware and even the slightest of difference in hardware is enough for the software to cause compatibility issues.** An **operating system (or a kernel) has code specifically written for particular hardware**, and it shall never work on another hardware.
Now, from a software point-of-view, a device has a kernel and some middleware which provides an interface between hardware and software. You may have noticed different partitions of your device, like recovery, and firmware. These partitions vary with devices as well. **If you flash incompatible software, you will most likely end up with a bricked device.**
That's why it is advised to use ROM from a nearly-identical device (hardware) when porting ROMs.

# Answer
> -1 votes
As far as my understanding goes when you say you are flashing a new custom ROM onto your device you are essentially changing your android version flavor(whatever goes into your `/system` partition) and most importantly the kernel(`/boot` contains kernel and bootloader). More on Android Partitions.

Now when you flash a ROM onto your device you generally use a application installed on your machine. Then you enable USB debugging on your device, connect it to your machine and run your application to flash the ROM. First thing here is that the application must recognize the existing ROM/Kernel so that it can replace it with corresponding custom ROM(Eg `CyanogenMod`). So your device must be in the list of devices supported by the flashing application. If you have a STOCK ROM than generally all application recognize it and should not be a problem. But if you already have a custom ROM and trying to flash another then it might be a problem.You may wan to read How to Pick the Right ROM for Your Device?

```
Is it purely because of the bootloader?

```

As far as CyanogenMod Installer in concerned it does not care if your bootloader is locked or not. It will unlock it for you. Other may require rooted device(How to root your Android device? ).

```
Or the kernel?

```

This should not be a problem either because finally it is a Linux kernel on which the android runs(As long as versions are same).

```
So what is the problem then?

```

This is my personal understanding. Please correct me if I have mistaken. Kernel is that piece of code that interacts use programs with the device hardware. Now it is very much possible that you have an old device(outdated hardware). Now if you say I am flashing the new ROM that has come to market... it will have a kernel that may require upgraded hardware(Not all things are backward compatible). So even if you flash it on your device some functionality wont wonk. Worst case your phone may get bricked. Hence it is essential to do some research about the ROM you are flashing whether it is compatible with your device.

---
Tags: rom-flashing
---


# Question
Title: how to transfer files to new external sdcard
I have an old 64 GB sdcard and a new 128 GB sdcard, how do I copy over all files from my old card to my new in a way that makes android treat the new card just as the old card.

I tried simply copy-pasting over my DCIM folder, then I put the new sdcard in and rebooted my phone, on startup the phone recreated the /Android folder and all apps had rights to their new folders.

**Ways I tried to move the files:**

1)

* dd old card to disk
* dd to new card
    + after this the card works but is seen as having 64 GB instead of 128 GB space
* use gparted to resize partition
    + this makes android see the card as having used 64 GB space but with no files or folders

2)

* dd old card to disk to disk
* dd to new card
* use fdisk resize partition
    + this makes android see the card as having only empty folders, but still used 64 GB space

3)

* create 128 GB partition
    + this I have tried with both FAT32 and exFAT
* mount via mtp
    + **Update:** I have also tried to copy paste all the files and folders directly to the sdcard from the old card via the cp comand on linux (that was the very first thing I tried... I only tried all the other things because this did not work)
* rsync all files and folders to the sdcard
    + this seems to make android see all the folders and files, but now my apps can't write to their own folders
    + eg the problem in all of the above cases is that android eigher a) does not see the file, simply sees the card as a file with 64 GB used space but it cannot see any of the folders, or it does copy it over but the apps does not have 'access' to their own directories eg Android/data/com.bambuna.podcastaddict/files/podcast/ is where my podcasts are, but the app podcastaddict does not have write premissions for the folder.

so in short... how do I copy over all my files from the old sdcard to the new one... or do I have to factory reset my phone and redownload all my apps such that all the folders and appropriate premissions are created by android... which seems to be my only option

additional information

* my phone is a unrooted z5 compact
    + it runs android 5.1
* I have access to a Linux and windows computer, but would prefer Linux solutions.
* I don't care what file system is on my external SD card.
* I am familiar with the command line and would prefer solution listing a few commands I need to copy-paste

As Firelord suggested, rebooting the phone makes android "display" the DCIM folder, so this one can be copied over, however it still seems that the /Android/data/com.company.app/ folders have to be created by the apps themselves, otherwise they cannot write to them, but you can subsequently copy files into these folders

Factory reset and restore from backup did this for me... it is an ugly solution... but at least it works.

I erroneously assumed that file permissions werehidden somewhere on the SD card and therefore tried to find the 'correct way' to copy, but it seems that the folder permission is saved on the internal card, or they are tied to the application in some non-trival way.

I restarted my phone again, and then some of my apps lost permissions to write to their SD card folders?!?!, ie podcastaddict which had downloaded 300 podcasts overnight could not write to `sdcard1/Android/data/com.bambuna.podcastaddict/files/podcasts`

By deleting and reinstalling podcastadditc it regenerated its folder and it has been working since.

# Answer
> 1 votes
I got a real 128 gb card, here I simply copy pasted over my DCIM folder, then I put the new sdcard in and rebooted my phone, on startup the phone recreated the /Android folder and all apps had rights to their new folders.

so my method:

1. backup and delete all aps that use the SD card
2. format the sd card
3. take a photo to generate the DCIM folder
4. insert SD card in your compuer
5. delete the /Android folder (it will be regenerated when you insert the card in your phone)
6. move relevant files to the DCIM folder
7. insert sdcard in phone
8. restart phone
9. reinstall aps from backup
10. do something that makes them regenerate their folders (ie down load a file, take a picture ect)
11. restart the phone
12. for all aps that cannot write to their own folder, delete he app and delete their /Android/data/com.company.app\_name folder then go to 8

# Answer
> 1 votes
# TLDR

* copy the **volume id** of old card to new card
* then **copy** the whole content of **old card** to **new card** (or copy it first to a harddisk and then from the harddisk to the new card, doesn’t make a difference).

# Step by step

I used my *Fedora linux* computer to do this, as it is a Thinkpad with SD-card slot.

1. First I looked what the **volume id** of the old sd-card was. I haven’t found a commandline tool for this, yet. So I used (KDE) `partitionmanager` (as `gparted` is not supporting *extfat*). Installed it with

```
dnf install kde-partitionmanager

```
2. Then I inserted the new sd-card and formatted it adding the volume id of the old sd-card. For that I had to install several exfat tools.

```
dnf install -y fuse-exfat exfat-utils

```

Then I formated new card with the old **volume id** (in the example the volume id is `01234567`)

```
mkfs.exfat -i 01234567 /dev/mmcblk0p1

```
3. I then tried to copy from old to new sd-card with `rsync -aP` but astonishingly that didn’t work (data rate was really low (20–40 MB/s) and it seamed that only some files were copied to the new card, I have no idea why that happened, first time to see that, but as I didn’t have time, I didn’t further investigate). Then I just copied it with `cp -a`, which was at a rate of 100+ MB/s.

```
cp -a /mnt/oldcard/. /mnt/newcard/

```

Inserted the new card in the phone, restarted it (didn’t have to, I think). Worked like a charm. Everything worked as before (Antennapod, Osmand, MapsMe, Aard 2 dictionary with offline Wikipedias, photos, etc.). Nothing was missing. But I have a lot more space left on the sd-card now. :-D

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


title: My S7 phone keypad

text:
# Question
Title: My S7 phone keypad
When I get a phone call and have to enter numbers for automated service, then when I mistype a number, I am not able to back space or see a delete icon. But if I were to make a call, I have a delete button. Very weird

# Answer
> 0 votes
Typing a phone number in your dialpad and typing a number in an ongoing-call/automated service is quite different. When you talk about automated service, it means that the 'automated service' is being hosted on some other computer that takes your input as final and processes it. You can't alter the input in any way. Unlike this, when you are dialling a number in your dial pad, the call is yet to be 'hosted' on a network so you are free to do whatever you want to.

---
Tags: settings, hardware
---


# Question
Title: What do I do when my phone is pitch black due the the dumb brightness system going all the way to 0
This has happened to me several times and this time I cannot get in turned back up.

# Answer
> 0 votes
Tell whatever voice assistant you have (Google Assistant, Bixby) to set brightness to %50 or such. There's no way to set a minimum brightness.

# Answer
> 0 votes
You can send this command via terminal, it will set brightness to near maximum (200 on 255)

```
adb shell settings put system screen_brightness 200

```

---
Tags: lock-screens
---


# Question
Title: Google chrome won't connect to the internet on mobile data
This site can’t be reached

m.facebook.com refused to connect

---

1. No issues browsing the net on Chrome using WiFi
2. No issues browsing the net on Firefox using mobile/WiFi
3. No issues installing app for the play store (I installed Firefox to test) using mobile/WiFi
4. Can receive non-SMS messages (example: WhatsApp) using mobile/WiFi
5. Can make phone calls
6. Clearing chrome data did not do anything
7. No VPN active right now

# Answer
> 0 votes
Consider reinstalling chrome. Because something it happens error while downloading . May be the script in there somewhere is corrupted. Sometimes reinstall help

---
Tags: chrome-for-android
---


# Question
Title: Remove second shutter button from S10e camera app
The stock camera app on my rooted Sampung S10e is working fine, but since a few days there is a second shutter:

I can move it, but it is useless and troublesome wherever I put it.

How to remove it? I only need the default shutter button.

# Answer
1. Touch the second shutter and hold it
2. Move it on top of the original shutter
3. Release it
4. The second shutter disappears

You can check that it really disappears by putting it a few pixels besides the original shutter, and see it disappear.

If you ever want this second shutter again, just hold then move the original shutter, it will create the secondary shutter. You can dispose of it again the same way.
> 1 votes

# Answer
If it was not there before, You can try clearing app data of camera. Long press Camera app -\> App Info -\> Storage -\> Clear Storage
> 1 votes

---
Tags: camera, samsung-galaxy-s-10
---


title: Unbrick pixel device

text:
# Question
Title: Unbrick pixel device
I accidentally flashed a Qualcomm rom to a Pixel device.
After which, neither does my device not boot and nor does power button work. It is most likely hard brick.

Running lsusb shows: `"Qualcomm, Inc. Gobi Wireless Modem (QDL mode)"`

Is there any solution to fix this issue?
Someone please help me out.

This is the script I ran to flash the rom.
Output printed during flash is available at here.

After some research on internet, I found this tutorial.
Now I am able to put device in EDL mode.
On a Windows machine, I could see device under COMMS as Qualcomm HS-USB QDLoader 9008 (COM11).

What should I do next?

# Answer
Yes. Qualcomm devices come with an Emergency Downloader EDL mode which helps to recover from a hardbrick. You need a Flashtool and Qualcomm EDL drivers. In order to access EDL mode, you need to use an EDL cable or short JTAG pins inside the phone.
> 2 votes

---
Tags: unbricking, google-pixel
---


title: Can application see all WIFI SSID?

text:
# Question
Title: Can application see all WIFI SSID?
I read the Wi-Fi scanning overview, but I am not sure if an application has the ability to read the Wifi access points around me.

I don't give location permissions.
I turn location service OFF.

The application manifest:

> This app has access to:
> Storage
> modify or delete the contents of your USB storage
> read the contents of your USB storage
> microphone
> record audio
> Location
> precise location (GPS and network-based)
> Device history and apps
> Retrieve running apps
> SMS
> receive text messages (SMS)
> Phone
> directly call phone numbers
> read phone status and identity
> Identity
> find accounts on the device
> read your own contact card
> Call and device ID information
> read phone status and identity
> Private Wi-Fi
> view Wi-Fi connections
> Camera
> take pictures and videos
> Images / Media / Files
> modify or delete the contents of your USB storage
> read the contents of your USB storage
> Contacts
> the find accounts on the device
> read your contacts
> Other
> receive data from Internet
> read frame buffer
> change screen orientation
> change your audio settings
> view network connections
> prevent device from sleeping
> pair with Bluetooth devices
> install shortcuts
> uninstall shortcuts
> connect and disconnect from Wi-Fi
> full network access
> control vibration
> run at startup
> read battery statistics
> access Bluetooth settings
> use accounts on the device

So it can:

* view network connections
* view Wi-Fi connections
* connect and disconnect from Wi-Fi
* full network access

Will it be able to read the WIFI SSIDs around?

I see Android 8 needs at least 1 of the permissions: CHANGE\_WIFI\_STATE
So will this be good enough?
On Android 10 will it also need location permissions?

So I understand correct ? In Android 8:  getScanResults() only by asking CHANGE\_WIFI\_STATE (which is not needed from user to approve ?)

# Answer
> 2 votes
**Yes, an app can see all surrounding WiFi SSIDs with correct permissions**.

This is the main use case for WiFi analyzer apps (not affiliated, just to show as an example, have been using one of the listed apps).

As for the permissions required, the already mentioned Wi-Fi scanning overview states:

1. Android 8.0 & Android 8.1: *any one* of
    * `ACCESS_FINE_LOCATION`
    * `ACCESS_COARSE_LOCATION`
    * `CHANGE_WIFI_STATE`
2. Android 9: **all** of
    * `ACCESS_FINE_LOCATION` or `ACCESS_COARSE_LOCATION`
    * `CHANGE_WIFI_STATE`
    * Enabled location services (under Settings \> Location)
3. Android 10: **all** of
    * `ACCESS_COARSE_LOCATION` or `ACCESS_FINE_LOCATION`
    * `CHANGE_WIFI_STATE`
    * `ACCESS_WIFI_STATE`
    * Enabled location services (under Settings \> Location)

---
Tags: permissions
---


# Question
Title: How to remove the SIM Toolkit from my phone? (Without root or flashing any ROM)
This application is sending a lot of spam to my phone recently, two or three times a day. I deactivated broadcast messages, tried converting USSD pop-ups into notifications to avoid being interrupted (didn't work). Basically, everything I tried didn't work, so now I want to remove it from my phone. Is it possible to do it without root, with ADB or something? I'm not a power user but I have used ADB to give permissions to some apps before.

# Answer
1. Connect Your Phone to PC Using Data Cable.
2. Turn on USB Debugging
3. Setup ADB Connection
4. Type

```
adb shell

```
5. Hit Enter and type again this

```
pm uninstall -k --user 0 com.android.stk

```

or

```
pm uninstall -k --user 0 com.android.stk2

```

Application Remove Example Image
> 15 votes

# Answer
An app can be disabled without root by running

```
adb shell pm disable-user com.android.stk

```
> 5 votes

# Answer
If the app in question is stored in /system and it cannot be disabled then it's impossible to remove/disable without root. Android simply doesn't allow "user" to mess with system apps. That being said without knowing device specifics I've seen some cheap chinese phones include adb root which is a somewhat watered down root specific to adb (usually only for debug builds). To test have adb working on a pc and while connected to device and run adb root. If it works it should restart adb service with root perms. But again this is a longshot.

Assuming you get root (one way or another) and you know the name of the app in question find it in system/app or system/priv-app. Mount system as rw and remove the app (I'd recommend copying it to your pc as a backup just in case something breaks).
> -1 votes

---
Tags: adb, uninstallation, system-apps
---


title: Can't get rid of one text message

text:
# Question
Title: Can't get rid of one text message
I have had this single text message on my phone since June. It simply won't delete. It comes through my Twitter account and is sent to my SMS, but all other such texts delete easily.

# Answer
> 1 votes
Press your finger down on the message text until a menu comes up. Unlock the message - that's how I was able to delete a message that would not delete the regular way.

# Answer
> 0 votes
Deleting the cache and data of messaging app should help. Also, clean the cache of other SMS apps including Hangouts if you have installed them.

Is this SMS is moved to SIM for some reason? I always backup and then clean and never keep in SIM.

# Answer
> 0 votes
Try to send something on the same number/contact. It will add to the message thread. Then try to delete it.

---
Tags: sms
---


# Question
Title: Android-Studio in VM. Emulator: audio: Failed to create voice `goldfish_audio_in'
Hello, I am trying to setup **Android Studio 3.1.3** in a windows 10 x64 pro **VM**. I have installed `Android 6.0` in AVD for `ARM EABI` architecture on a Pixel.

However, when I try to launch the emulator I get

```
Emulator: audio: Failed to create voice `goldfish_audio_in'

Emulator: qemu-system-armel.exe: warning: opening audio input failed

```

and the emulator is just a black screen that does not respond to anything.

I have everything enabled in Virtual Box regarding hardware acceleration.

I checked these posts:

Is it possible to run Android Device Emulator (via Android Studio 2) on VMWare?

“emulator: warning: opening audio input failed” displayed in the console while AVD is launching

Android Emulator: Audio Input Failed

but doesnt seem to get me anywhere...

I have also tried to disable sound in `config.ini` or disable the microphone in windows 10 VM but didnt change anything.

**Am I missing something here?**

**Is it impossible to run android emulator for `ARM` architecture on a VM?**

# Answer
> 2 votes
Uninstall Intel x86 Emulator Accelerator from windows control panel. Then install it again in android studio.

Tools =\> Android =\> SDK manager =\> SDK tools =\> Intel x86 Emulator Accelerator (HAXM installer).

Then make sure that you plug a microphone or a line - in cable to the input socket of your pc.

This is how I got my own issue disappeared.

# Answer
> 0 votes
Try reinstalling Intel x86 emulator accelerator, you can find it on your control panel That should work,in case it doesn't work try reinstalling the entire android studio because sometimes it fails to download some plugins which causes this error.

---
Tags: audio, android-emulator, android-sdk, virtualbox
---


title: Update mksh to latest version

text:
# Question
Title: Update mksh to latest version
Android ships with `mksh` as shell, how can I upgrade to latest version (now R57, mine still on R43)?

Official site https://www.mirbsd.org/mksh.htm offers to compile from source, anyone building ready to run binaries?

# Answer
`mksh` developer here ☺

The problem with distributing binaries is that the binaries need to be built against the exact same `bionic` libc as your phone provides, which needs both the libc binaries (as shipped on your phone) and the development headers (only present in the AOSP source tree of the person who built your image).

If you wish to use a generic ARM mksh binary instead, you can use one statically compiled against another libc (such as `musl` (recommended), `dietlibc` or `klibc`). However, these will *differ in behaviour* from the one shipped by Android:

* Android has a different default `PATH`, using something like `/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin` instead of `/usr/bin:/bin`
* Android has different directories for `/etc` (`/system/etc`), `/tmp` (`/data/local`), and the locations of `~/.mkshrc` and default `EXECSHELL` differ

For these reasons I’d recommend to **keep your `/system/bin/sh` as is** and only add a `/system/bin/mksh` or even `/vendor/bin/mksh` executable with a newer version if you really need it and use that explicitly in scripts and/or interactively.

If you go to the Debian `mksh` package page you can download the Debian package for your architecture (`arm64` for 64-bit ARM systems, `armhf` for 32-bit ARMv7 or newer; it’s unlikely you’ll need older ones; 32-bit might work on 64-bit systems but not the other way round), then once downloaded to your local computer, you can extract the package as follows (I’ll use the 32-bit version for this example):

```
ar x mksh_57-2_armhf.deb
tar xaf data.tar.*
find usr/lib/ -name \*ksh -ls

```

The last command will list all possible statically-linked-against-not-GNU-libc binaries; for the version 57-2, the output is:

```
  2633594    184 -rwxr-xr-x   1 user   user     185584 Sep 26 00:52 usr/lib/arm-linux-musleabihf/bin/mksh
  2633596    124 -rwxr-xr-x   1 user   user     126816 Sep 26 00:52 usr/lib/klibc/bin/mksh
  2633595    152 -rwxr-xr-x   1 user   user     152716 Sep 26 00:52 usr/lib/diet/bin/mksh

```

So, you can choose any of these three binaries; I really recommend using the musl-compiled one (that is `usr/lib/arm-linux-musleabihf/bin/mksh`, the path differs for `arm64`) as it’s the most correct and complete C library.

```
adb push usr/lib/arm-linux-musleabihf/bin/mksh /sdcard/mksh-new
adb shell
su
mv /sdcard/mksh-new /vendor/bin/mksh
chown 0:0 /vendor/bin/mksh
chmod 555 /vendor/bin/mksh

```

Now, unless another `mksh` executable is in the `PATH` before `/vendor/bin/`, running `mksh script.sh` or just `mksh` (or `mksh -l` for a login shell) will start the newer binary (but not read `/system/etc/mkshrc` unless you start it as `env ENV=/system/etc/mkshrc mksh`), but the system boot process will keep using the version it was designed for and tested with. (Newer `mksh` versions may contain bugfixes that cause scripts relying on those bugs or older interpretations of the POSIX sh standard to fail.)

As I am also the Debian Developer maintaining the mksh package there, you can consider those packages as official Linux/ARM builds of newer mksh versions (although lacking the Android specifics).

If you *really* need a binary *with* the Android specifics, I can access a Debian/ARM porterbox and compile mksh from source, with the different definitions (as listed above), manually and provide it for downloading; contact me (by eMail or IRC) if you need that, as it’s manual effort and costs me extra time.
> 11 votes

---
Tags: mksh
---


# Question
Title: Why the "Sign-in error" notification appear on Xiaomi device?
Since yesterday, I've been getting this error message and I have no idea what application it is. I checked all of my installed apps and can't see it.

Can you help me identify this icon?

# Answer
You must be using Xiaomi device with stock ROM. When you first switched on device, you created an online Mi account like Google account. Now this device is attached to that Mi account to avoid misuse in case of phone theft. This phenomenon is similar to FRP implemented by other OEMs too.
Shown number `178...` is your Mi account ID. This error is appearing because device is unable to verify your identity online due to no internet access or something like that. Go to `Mi Account` in `Settings` and login again.

Be careful! If you are unable to login, you won't be able to access device on reboot.

See this to know a little bit about how FRP works.
> 3 votes

# Answer
You might have logged in from another device and changed the password of your google account. If it wasn't you, you can change the password again and then go to my accounts in Google and click the option log out from all devices and then sign-in in your required devices.
> 1 votes

---
Tags: notifications, xiaomi
---


# Question
Title: Apps aren't auto updating despite of setting and of notifications
Every morning I turn off the alarm on my phone, look at it, see there aren't any updates and unplug it.

A few seconds later I'll start to receive several notifications about apps that need updates. These updates will not automatically download or install even though I've set that option in the Play Store; instead they sit waiting until I manually go to the Play Store and hit "Update All."

My phone spends all night plugged in and on Wi-Fi; why aren't they updating then?

For reference, I'm running an LG V20, with Android version 7.0. Play Store is version 8.5.39. If it matters, my alarm is set for 3:45 am. I didn't see any option in the store to change the update time.

# Answer
This is an easy fix and the reason is pretty easy to determine. The reason is that Androids' "Optimize Battery Usage" feature puts Google Play Store or Google Play services to sleep and restricts background activity. This means that when your phone screen turns off, the app is put to sleep so it does not consume battery; or if the phone is charging, it doesn't have any background activity access.

To fix this, you need to go to Settings, Apps, and scroll until you find Google Play Services and Google Play Store. Check Google Play Store first, click it and then click "Battery". If you see that it says "optimized", click the "Optimize Battery Usage" button and it will take you to a list at the top change it from "Apps not optimized" to "All". Scroll down the list until you find Google Play Store and switch the toggle to off; repeat this process for Google Play Services (most likely this will not be optimized, but just in case, check).

Now that you have done this, your phone will update because the app will no longer be put to sleep and it will be allowed to work in the background while your phone is charging or on Wi-Fi and it will update your apps. I have fixed this issue on a few phones and if this does not work for you, there is something else wrong with your device or Android.
> 4 votes

---
Tags: google-play-store, application-autoupdate
---


# Question
Title: Setting's "Search" function doesn't work properly on Android N Preview 3
In settings of Android phone, there is a search button in the Action Bar and it cannot give me what I want to search. I find it works sometimes but 90% it doesn't. The 2nd image shows the very irrelevant results.

For example, I enter `battery` to search for battery settings, it gives me nothing.

My question is: how to fix it?

---

And result when enter `ba`:

# Answer
> 0 votes
May be the system bug. Try clearing **cache** and **dalvik cache**. If problem presist try **factory data reset**. If still presist, then its a Rom bug. If it is, then wait for the update for fix.

# Answer
> 5 votes
I cleared data and cache from settings app and it's worked for me. Not factory reset and clear cache from recovery. I went into settings\>apps\>allaps,settings\>storage and clear cache and data

# Answer
> 2 votes
What worked for me on Android 9 was: Find system app "Settings Suggestions", open app info, press force stop, press storage and hit clear cache and clear storage buttons.

# Answer
> 0 votes
It sounds like search may be disabled for you.

Go to your Settings \> Apps \> swipe to the “ALL” tab \> select “Google Search” \> press “Enable”.

---
Tags: settings, search, 7.0-nougat, developer-preview
---


# Question
Title: How to prevent navigation bar from being hidden, globally?
I know I can set some apps to not hide the navigation bar. But I would like to globally set that it should be shown **by default**. My Android is not rooted.

Basically I want the old behaviour back in Android 4.0 (Ice Cream Sandwich) where it was not removable unless you root the device. However, I don't mind being able to allow it to hide the navigation bar on a per application basis.

# Answer
Normally phone have navigation icons or bar so to hide you can have full screen mode/(depends upon brand its name changes) under it their will be settings to turn on full screen mode to all apps individually.so u enable(no navigations)/disable(with navigation) them.On turing on full screen mode no navigations will be there.you may have gesture navigation or swipe to show again the nav bar.in samsung devices there is an advanced option in navigation bar settings to show or hide bar
> 0 votes

---
Tags: navigation-bar
---


title: How to recover stored wifi password?

text:
# Question
Title: How to recover stored wifi password?
My Android device (A Samsung Galaxy S7 SM-G930F, version 6.0.1) has different wi-fi networks saved. I would like to recover some of the password it has stored. Browsing through the web I searched possible solutions but none of it has worked for me.

* Stored password in wpa\_supplicant.conf are encrypted, and even if I change the build properties "ro.securestorage.support" to false, old password remain encrypted or get deleted, and I would like to recover those.
* I know that wi-fi password usually get backed-up on google drive, but I have no idea how to recover them from the backup online.
* I heard about an Xposed module "Wifi password" which supposedly should show the wifi password instead of the normal dots, but I have a TouchWiz device and if I install the Xposed Framework i'm afraid it would wipe my data, included my wifi password.

I understand that encryption is meant to keep safe your password, but as far as I know, every time I try to connect to a wifi network it uses the real password, so they have to be stored somewhere or decrypted on the go.

Can anyone help me?

EDIT: As I said, if I change `ro.securestorage.support` property on `build.prop` file, my stored password either get deleted or they remain hashed.

If i delete `.system.wpa_supplicant`

> all saved WiFi hotspots will be lost for the first time.

Also as said in the comments, the password isn't encrypted so there's no "way" to decrypt it, but it's hashed and there should be a way to recover it

# Answer
The hex value you found in the `wpa_supplicant.conf` is the PMK (not the PSK directly but some intermediate value computing the PSK or something like this). This value is not encrypted, it is hashed as defined by WPA2 using PBKDF2 SHA-1 with 4096 iterations see Wikipedia.

SHA-1 is a one-way function, which means that it can not be reversed.

Wifi still works, because the PSK is the actual key Wifi requires to work. The passphrase is just for the "dumb humans who can't remember a simple 64 hex chars value" (aka user convenience).

Hence there is no "decrypt" function. The only way to retrieve the password back is to perform a brute force search on that password (trying all possible passwords). Depending on the length of the password and your hardware (CPU, GPU) this can take some days, weeks, months or years.

There is an issue on Github with indicates that the tool "hashcat" is able to break this value using mode 12000 (`-m 12000`):

See also Encryption algorithm used in WPA/WPA2
> 1 votes

# Answer
Reading on StackExchange this question Retrieve WiFi password the user "life-on-mars" answered that if you do a backup of the provider settings (com.android.provider.settings) with adb and extract that backup with `Android Backup Extractor` in the end you will obtain a file called `flattened-data` which has all the network saved in the same way as the `wpa_supplicant.conf` but with the actual passwords not hashed/encrypted.
> 1 votes

---
Tags: 6.0-marshmallow, encryption, samsung-galaxy-s7, wpa-supplicant, wifi-password
---