# Question
Title: Firefox for Android doesn't autofill saved/synced paswords since installing and uninstalling external password manager
Firefox sync was working on all my devices as my logins and passwords were perfectly synced. The problem started when I was offered to install the Lockwise app on Android. Where logins were available in the Firefox for Android app they wouldn't sync with the Lockwise app, the syncing went in an infinite loop and did not sync anything. Reinstalling or rebooting did not help. From this moment Firefox for Android offered to fill in the passwords from the Lockwise app, but since there were no passwords synced, there were none to fill. So I decided to uninstall the Lockwise app and go back to Google Autofill service for my global Android password management. But in the Firefox for Android app (which I use the most) I still like to use the build-in Firefox Sync autofill feature like I used to before installing the Lockwise app. Firefox for Android does not offer to fill in any password information anymore. When I look in Tools \> Logins all my passwords are there, perfectly synced.

After some research I checked if the following about:config booleans were enabled: and yes they were.

```
signon.autofillForms
signon.autofillForms.autocompleteOff
signon.autofillForms.http

```

Firefox for Android version: 68.2.0

# Answer
> 2 votes
External autofill apps change a certain boolean in the Firefox for Android configuration variables, this "setting" can only set back to the old setting by completely uninstalling and reinstalling Firefox or (better) by changing a variable in: **about:config**

* goto **about:config**
* search for: **dom.forms.autocomplete.formautofill**
* set it back to **true**
* **refresh** your login window and... fixed!

---
Tags: firefox-for-android, auto-fill
---


# Question
Title: What private data can apps access without any specified permissions?
Let's say an app doesn't require any permissions at all. What could that app access that could be a potential privacy risk? Other app usage? List of installed apps? Check is my screen unlocked? Google Analytics?

# Answer
> 2 votes
Sourced from Izzy's blog (thanks)

\*Permissions *do not* define what all an app can access, which is covered in Irfan's answer. Also see Izzy's primer on permissions

* App description of XPrivacy Lua, which is an Xposed module, to protect privacy. Information below can be accessed *without* permissions (readers are welcome to add)

> * Use analytics (Fabric/Crashlytics, Facebook app events, Firebase Analytics, Google Analytic, Mixpanel, Segment)
> * Usetracking ( user agent for WebView only, Build properties, network/SIM country/operator)

---
Tags: applications, google-play-store, security
---


title: Strip /lib from installed apk

text:
# Question
Title: Strip /lib from installed apk
Most apks have a /lib dir inside with .so files that can be several megabytes. Some even come loaded with libs for different architectures (arm, mips, x86). Libs for relevant arch are copied in `/data/app-lib/[package name]` at install time, so they take double the space.

I tried to strip the apk from the /lib folder, rewrite, `zipalign` and put back to install location `/data/app` or `/system/app` or `/system/priv-app`to reclaim some space.

Tried with Chrome v78, it went from 45 mb apk to 15 mb... Other apps too. Everything seems to work.

Anyone thinks it's a bad idea? IMO the very Android system should perform this operation by default at install time...

***edit 13 Nov***

I wrote a script to automate the strip operation, just have to copy the apk to strip in a dir where this script resides, along with `zip` and `zipalign` binaries.

```
#!/system/bin/sh
for filename in `find . -name '*.apk'`
do
        ./zip -d $filename "lib/*"
        ./zipalign -fv 4 $filename $filename.new|tail
        mv $filename.new $filename
        chmod 644 $filename
done;

```

On my device I can swap original with stripped apks on the fly and they (usually) run fine without rebooting, even system apps.

# Answer
Based on my experience, modifying an APK file after the installation is not a big problem as long as you don't touch the DEX files. Especially the native libraries for other architectures than the one of your device can usually be stripped without problems as they are totally ignored after the installation.

However there are apps that implement extra security checks (usually banking, finance, streaming apps with DRM or otherwise extra hardened apps) that performs some sort of self-test to check whether they have been modified or not. Modifying those apps will end up in a non-working app.
> 5 votes

---
Tags: apk, editing
---


# Question
Title: How do I open an offline website on Android?
I have a directory with some `.html` files, some `.jpg`s, an `index.html` file, and some other stuff. If I drag the `index.html` into chrome (or other browsers) on my desktop PC this static/offline website will display in the browser and I can navigate the site without issues.

When I go to the same directory in Android Pie and open the same `index.html` file in Android-Chrome I get the error "file can't be found". I've tried other Android browsers with the same result.

In Android File Explorer the directory (and respective file) appear as:

```
/Internal Storage/my_site/index.html

```

How can I open a simple static offline HTML website on Android? Is there a specific app or browser I need to use?

# Answer
You need to enter in Chrome address bar `file:///path/to/file`. In case you aren't sure about the path use any file explorer that tells you the path.

In this case it is `file:///storage/emulated/0/my_site/index.html`

Also many file explorers including MiXplorer offer to open `.html` files with all supported apps (registered mime type):
> 2 votes

---
Tags: applications, chrome-for-android, browser, firefox-for-android, offline
---


# Question
Title: Android phone automatically deletes photos?
A quick rundown on the situation is this. I've just changed to a new phone just about a month ago, and there's something weird that I noticed - my phone automatically deletes the photos.

At first the deletion is small scaled - I noticed it when I lost about 3 photos about 2 weeks ago. However today I noticed something bigger - I lost almost 5 months worth of photos. It wasn't moved anywhere else as I couldn't find it even after a search on the SD card on my computer.

As you can see from the image below, the file names of the photos in my DCIM gallery simply jumped from 9 July 2016 to 12 December 2016. I'm pretty sure I several photos during the 5 months in between as there were quite a few major events and I took plenty of photos during them.

I know there's another similar thread on this matter, but the contents doesn't help as the approach in the thread doesn't apply to me. I've checked for the file they mentioned but it doesn't exist in the folder.

I'm running on Android 6.0.1.

If anyone knows what's going on, your assistance is much appreciated. Thank you!

# Answer
> 2 votes
Photos could be removed by a cloud sync/back up application.

One example is Google Photos. You may have chosen to remove photos which have already been backed up. You may not see them in the Gallery, but they will appear in Google Photos thumbnail.

Photos are removed from your device by tapping menu -\> Free up space.

If you did, you can still see your photos, including the ones removed, in the Google Photos app and http://photos.google.com.

# Answer
> 1 votes
I actually solved the problem. In Samsung device or take any Android, there is a feature called Storage Booster which automatically deletes unnecessary data as multiple same photos from the device, so you have to turn it off to keep your photos in your destined folder.

Just go to Settings \> Device care/maintenance \> Storage \> Storage booster \> Auto delete unnecessary data. Then unselect the last option i.e unselect "Auto delete unnecessary data".

I made a YouTube video for the demonstration: https://youtu.be/\_0TBev1HQ68

---
Tags: photos, gallery, delete
---


# Question
Title: Force stopping bloatware apps on android phone
I don't use Facebook and don't intend to. Can I force stop on android phone (LG Stylo 4) without destabilizing anything else? I have installed WhatsApp which I know is owned by Facebook but which I think (hope) functions independently and hopefully would not be impacted by stopping Facebook.

# Answer
Yes, WhatsApps runs separately from Facebook, despite them being owned by the same company. You can safely force stop Facebook.

If you don't intend to use Facebook, the more logical solution is to remove it, which will prevent it from doing anything and free up space.
> 1 votes

---
Tags: force-stop
---


# Question
Title: What is the folder called /storage/emulated/0/.photoShare/thumb/lcd
I have a folder named lcd or Icd (can't tell if it's a lowercase L or an uppercase letter i) which is inside the Hidden Folder called photoShare. It contains over 300Mbs of images, all of which seem to be duplicates of images elsewhere in my Android Phone (Honor 9 lite). There is a .thumbs folder beside it. It's 30 odd Mbs and is full of images too. Oddly, despite many Google searches using every combo of words possible, I can find no mention anywhere of a folder called lcd/Icd, not one mention anywhere. Question being,

Is it safe to delete the images inside /.photoShare/lcd/Icd?

# Answer
> **.photoShare** is a folder used by Huawei devices for it's Cloud service.

If Huawei's Cloud is enabled on your device, your gallery may have been synced to your Huawei's "personal" cloud storage.

You can turn off the cloud backup option for your photos, but maybe you need this service in case of emergency, where you accidentally deleted your pictures, at least you'll be able to restore what was synced before in the cloud service.

It's safe to delete the folder, but doing it from settings will be better to avoid any data loss if you're syncing your folder with the cloud service.
> 2 votes

---
Tags: file-management, hidden
---


title: Where do Android apps store data?

text:
# Question
Title: Where do Android apps store data?
Could you list all the possible directories where Android apps may store data? Can you also provide description of the kind of data stored in each directory?

# Answer
All apps (root or not) have a default data directory, which is `/data/data/<package_name>`. By default, the apps databases, settings, and all other data go here. This directory is "private" to the app – which means no other app and not even the user can access data in it (without root permissions).

If an app expects huge amounts of data to be stored, or for other reasons wants to "be nice to internal storage", there's a corresponding directory on the SDCard (`Android/data/<package_name>`).

Apart from that, all apps can store data anywhere on the SDCard, as there are no restrictions -- and many apps do so. They can use directory names freely (and they again do), which is what often makes it hard to decide what all that "junk" on the card is intended for, and what of it can be deleted.

Though, as Tom pointed out, root-apps could store their data almost everywhere on your device, they usually follow the same rules as other apps.

You can find a general explanation of the Android directory hierarchy in my answer here. For your specific question I might add some more details on the `/data/data/<package_name>` (and corresponding SD-part):

* `databases/`: here go the app's databases
* `lib/`: libraries and helpers for the app
* `files/`: other related files
* `shared_prefs/`: preferences and settings
* `cache/`: well, caches

There might be several more directories in this place, or fewer -- it all depends on the app. In its own "home directory" (and that's what it basically is, spoken Linux-wise) they can place files where they want. Usually, these files and directories are only accessible by the app itself (and root, of course) -- other than those stored on the SDCard, which are accessible by all apps.
> 137 votes

# Answer
Some major changes occurred to storage in Android 4.4 (see Android's Storage Journey). So, the following is generally true for Android 4.4+ and particularly 6+.

This is from my detailed answer to How disk space is used on Android device?. Apps' files are saved (by the system and the app itself) to internal and external storage under different categories.

| Directory | Description/API |
| --- | --- |
| **App code** |  |
| `/data/app/<pkg>*` | (user apps installation directory) |
| `/data/app/<pkg>*/base.apk` | (original `.apk` file) |
| `/data/app/<pkg>*/lib/<arch>/*.so` | (shared libraries) |
| `/data/app/<pkg>*/oat/<arch>/base.[art|odex|vdex]` | (compiled executable code) |
| `/data/dalvik-cache/<arch>/*.[art|dex|oat|vdex]` | (compiled executable code, only for system apps) |
| `/data/misc/profiles/cur/<user_id>/<pkg>/primary.prof` | (ART profile) |
| `/data/misc/profiles/ref/<pkg>/primary.prof` | (ART profile) |
| **Internal storage** |  |
| `/data/user[_de]/<user_id>/<pkg>` | `getDataDir` |
| `/data/user[_de]/<user_id>/<pkg>/files` | `getFilesDir` |
| `/data/user[_de]/<user_id>/<pkg>/[code_]cache` | `getCacheDir` or `getCodeCacheDir` |
| `/data/user[_de]/<user_id>/<pkg>/databases` | `getDatabasePath` |
| `/data/user[_de]/<user_id>/<pkg>/no_backup` | `getNoBackupFilesDir` |
| `/data/user[_de]/<user_id>/<pkg>/shared_prefs` | `getSharedPreferences` |
| **External storage** |  |
| `/storage/emulated/obb/<pkg>/*.obb` | (shared by multi-users, exposed in following view) |
| `/storage/emulated/<user_id>/Android/obb/<pkg>/*.<pkg>.obb` | `getObbDirs` |
| `/storage/emulated/<user_id>/Android/media/<pkg>` | `getExternalMediaDirs` |
| `/storage/emulated/<user_id>/Android/data/<pkg>/` | `getExternalFilesDirs` |
| `/storage/emulated/<user_id>/Android/data/<pkg>/files` | `getExternalFilesDirs` |
| `/storage/emulated/<user_id>/Android/data/<pkg>/[code_]cache` | `getExternalCacheDirs` |

* All of the above paths on internal and external storage (primary and secondary) are the app's private directories which are accessible to the respective app without requesting any permission. Apps can also create other directories (not explicitly available through APIs) in their private storage. All of these directories belonging to an app are deleted when the app is uninstalled.
* Additionally, apps can put their data anywhere on primary external storage (including some standard directories and other apps' private directories) if `WRITE_EXTERNAL_STORAGE` permission is granted (`getExternalStorageDirectory` returns `/storage/emulated/<user_id>`). For secondary external storage and removable storage, SAF is used. See details in How to save files to external SD card?.

However, in Android 10, writing directly to primary external shared storage is deprecated (`getExternalStorageDirectory` and `getExternalStoragePublicDirectory` are no more available). Apps need to use one of Android's built-in content providers; either ***MediaStore*** (for media files) or ***SAF*** (for any other type of files).
* `/data` paths may get replaced with `/mnt/expand/[UUID]` when using Adoptable Storage. `/storage/emulated` gets replaced with `/storage/[UUID]` when using secondary external storage (like an SD card).
* For multiple users/profiles, `<user_id>` is different, the device owner is always `0`. `/data/user/0` is a symlink to `/data/data` for historical reasons. Secondary external storage is only available to the device owner.
* OBB directory is shared among users/profiles (up to Android 9) to save space. FUSE/`sdcardfs` always exposes `/storage/emulated/obb` as `/storage/emulated/<user_id>/Android/obb`.
* `/data/user_de` is the Device Encrypted storage on FBE devices which lets certain apps run on boot without asking for user credentials.
* `/data/misc/profiles` are used by ART for profile-guided compilation of app code.
* Description of each directory is somewhat evident from names, details can be seen in API documentation.
* Caches are cleared by OS when running low on storage, keeping apps exceeding the allotted quota on top.
* Apps' private `files` directories in external storage aren't automatically scanned by MediaScanner but `media` directories are.
* Caches and `no_backup` directories are not backed up to the cloud. See official documentation.
> 33 votes

# Answer
The answer to your question you are asking is too big. I can, however, give you a basic answer which covers the basics.
There are two kinds of apps:
**Root** and **non-root**.

**Root** apps can basically store/modify files wherever they want.
**Non-root** apps can only store/modify files here: `/sdcard/` and every folder what comes after.
Mostly, the installed apps store themselves at `/sdcard/Android/data` or `/sdcard/Android/obb`.
Some apps store their save games/configuration data files on `/sdcard/APPNAME/`, or just on the `/sdcard/`
To be able to use **root** apps, you'll need to have rooted your Android device and have given permission from one of the superuser apps.
> 10 votes

---
Tags: applications
---


# Question
Title: Is SIM network unlocking using app normal if phone simply expects a code?
I bought a rare version of Galaxy S10 which was out-of-stock in my country so the distributor got it for me from another country. But by mistake the phone is locked to original network operator in the country of origin. I was offered to send the phone back for unlocking/change but it can take a few weeks. So I decided to try online unlocking service. All looks good except of the requirement to do the unlocking via side-loaded app instead of entering the code directly. **Is it normal that the 8-digit unlock code does not work directly in unlock screen but it needs a helper app?**

Their e-mail after purchase of unlocking code contained instructions similar to these:

> Please make sure that your phone is on the stock factory firmware. Unlock code will work correctly only on the stock factory firmware.
>
> 1. Connect your phone to Wi-Fi network and download and install official Unlocker tool:
> `https://www.htconlineunlock.net/---path-was-removed---`
> 2. Power off the phone by long pressing power button and then Power off icon.
> 3. Remove the sim card from the phone and switch on the phone.
> 4. Run the Unlocker tool you installed.
> 5. Tap 'Proceed' button. Wait until your phone communicates with servers.
> 6. The phone will ask you to enter SIM Network Unlock Pin. Enter the code, tap 'Unlock' button and wait for result.
> 7. Message "Your device is now unlocked" appears. Long press the power button, choose 'Restart' and confirm.

They claim they bought the code directly from the operator. So why direct unlock does not work (I made one attempt) but I am instructed to run an app?

# Answer
Such unlock apps aren't *official*.

They employ various methods of unlocking based on the information they gather from the app installed and querying from supposedly authentic database of unlock codes.

I have personally used an unlock service for an iPhone which was locked to a carrier. I needed to supply device information and within a few hours they reverted with the code, which worked. All at a pittance of $10. I chatted with them and they revealed their modus operandi. Official unlock codes are obtained (read stolen) from the carrier database and these operators pay to obtain these. Payment is done only after unlocking is successful.

Bottom line is that there is nothing official or expected in such methods. If it works, good, else ask for refund
> 3 votes

---
Tags: sim-unlocking, side-loading, samsung-galaxy-s-10
---


title: Switch "Google page" off on Android

text:
# Question
Title: Switch "Google page" off on Android
I got Huawei P30 lite with Android 9. There is a page on the main screen (if you swipe right from Home) which looks like combination of Google assistant, search, news, weather etc..

What is it called and how to remove it?

# Answer
Here are the instruction from Huaweihub on how to disable Google Feed on the P30 Lite

1. Hold your finger on an area of blank space on the Homescreen.
2. Select Homescreen Settings.
3. Locate Google Feed, then swipe the adjacent toggle from On to Off.

Original article here: How to disable Google Feed on the Huawei P30
> 2 votes

---
Tags: google-now, home-screen
---


title: No download link for Adblock Plus

text:
# Question
Title: No download link for Adblock Plus
The page https://adblockplus.org/android-about from the Adblock Plus website discusses Adblock Plus for android. It clearly refers to the version that runs in the background and blocks all ads (and is not in the Play store), *not* any of the browser versions for Android that are available in the Play store.

Clicking the link on that page for ''installation instructions'' takes you to https://adblockplus.org/en/android-install, which is an almost blank page displaying ''**Want an ad blocker for your Android smartphone or tablet?**'' and a button which redirects you to the android store (to install a broswer ad blocker).

I can't find any discussion of this online, and everyone seems to be able to download and install the correct version from the Adblock Plus website. Am I supposed to find it somewhere else? Why doesn't Adblock Plus provide it themselves?

# Answer
Adblock forums says

> this product is outdated (not maintained anymore), eventually use adblock browser for android

Also, see this post

> see what said an eyeo moderator: "Unfortunately at the moment we have no Android developer, therefore solving real issues is kind of difficult."

That's probably why all links on the official site are dead. They haven't bothered to update the home page.

It's not available on F-droid too but alternative stores seem to have it but obviously there won't be any support.
> 9 votes

---
Tags: apk, ads, adblock-plus
---


# Question
Title: How to install Google Play on Kindle Fire 7" (2016)?
I'm trying to install Google Play (and rest of Google services) on my Kindle Fire 7" model 2016. I've done little bit of research and noticed that things change rapidly. I'm looking for verified and latest way of getting this installed without rooting my Kindle, is that possible? I'm trying to be able to install any Android app from the Google Play Store.

# Answer
> 2 votes
This android police article describes how to do it without root. In short:

Enable install of "Apps from Unknown Sources" in Settings.

Install in order:

1. Google Account Manager APK
2. Google Services Framework APK
3. Google Play Services APK
4. Google Play Store APK

...profit!

---
Tags: google-play-store, google-play-services, amazon-kindle-fire
---


title: Hangouts Face icons dim to bright

text:
# Question
Title: Hangouts Face icons dim to bright
Help me understand icons under messages going from live then back to dim under message. When I send a message on hangouts the contact face shows live under the message, then reverts back to dim above the message.

# Answer
> 0 votes
So, you know how when you receive a message, there's a notification at the top of your screen? (When the icon is bright, it means person in question is looking at your message) Maybe it means that they have seen the notification, but have not yet responded and continued doing what they had been doing.

---
Tags: google-hangouts
---


# Question
Title: How do I find the Mac address of a paired device?
There is a Bluetooth Headphone which paired to my Android Device.

I want to know what is the Mac Address of the Headphone.

Is there any way to find the Mac Address of the paired device?

# Answer
> 3 votes
if your `Bluetooth Headphone` *Paired* with Device, you can find Mac Address with this Apps :

Bluetooth Finder

or

Bluetooth Address Finder

# Answer
> 0 votes
I was trying to find the MAC address of a device that was already in the paired list, but was not currently connected. The app Bluetooth Mac Finder worked for me. It has 3 tabs at the top: Discover | Paired | My Device The Paired tab will show the friendly name and the address of all items in your paired list. The other two tabs do as you would expect. Discover will scan for devices and My Device shows you the MAC address of your phone.

---
Tags: 4.4-kitkat, bluetooth, headphones, mac-address
---


# Question
Title: Huawei P9 lite enter bootloader without volume keys and access to system/recovery
About phone: Huawei P9 lite VNS-L21C432B161 (central Europe)

First modifications A long time ago i unlocked bootloader and successfully rooted the phone. I turned off OEM unlock option in settings after rooting, because someone said i should do so for security. Then came EMUI 5 OTA. It somehow updated itself without me agreeing. Android nougat detected, that the bootloader was unlocked and so it assumed that OEM unlock option was also ENABLED when it really wasn't, making me unable to re-enable the option. So i used the https://forum.xda-developers.com/huawei-p9lite/how-to/tutorial-rollback-n-to-mm-c432-devices-t3563955432-devices-t3563955" \<-- official rollback package and installed stock ROM through dload.

Here is the part where i messed up horribly Now i wanted to update to android 7 again, but updater wasn't giving it to me and i was unable to flash it through TWRP. I installed the rollback package again through download mode as it said it allows any ROM to be installed, hoping i could then install android 7 through Download mode, which would in turn allowed me to install newer version of TWRP to then install a nougat based custom ROM.

***Huawei's Erecovery and download mode***

**Erecovery**: Accessed by pressing volume up during boot for 3 seconds, is supposed to download a working ROM for your phone, is saved in different place than recovery

**Downlaod mode** By placing a folder with name 'dload' with *supported OS* on sd card in a form of UPDATE.APP, download mode installs this version, relocks bootloader and rewrites recovery with a normal one. (Relocking bootloader with custom recovery probably broke it, still doesn't explain why i can't access fastboot or download mode itself at all.)

Now i am stuck at the 'Your device has been unlocked and can't be trusted. Can't access bootloader, **phone doesn't seem to be detecting the Power+Volume down combination \< not the case in duplicate post.** **Recovery doesn't boot at all, it just goes straight to the normal boot dialog**

Using the Power + VolumeUp + Volume Down combination to enter the download mode yields a slightly different warning but still gets stuck at it as well.

I think that the only way to fix it may be to **dead flash** it with stock ROM. I found a program (IDT) for this but it requires a "image xml file" and i don't know where to find it. Goal: to get to bootloader without using volume keys( it just doesnt work for some reason) and without entering system/recovery/erecovery as these broke as well.

Thanks in advance

# Answer
Nevermind i fixed it. I could access bootloader by pressing on volume down REALLY HARD. For whatever reason, light press and hold was enough for download mode but not enough for bootloader. Now i should be able to flash all the parts individually after extracting the UPDATE.APP. Thanks for help.
> 1 votes

---
Tags: bootloader, unbricking
---


# Question
Title: How to assign Mobile Data's public IP to host connected on hotspot?
I've looked around but found nothing on this subject.

I have an Android phone with a public IP given by sprint. Tethering on Android uses NAT, so if I want to access any of the devices behind the phone I have to use port forwarding (Which I'd really rather not do). Is it possible to set tethering to bridged (Disable NAT), so the device behind the phone will be given the public IP?

# Answer
> 5 votes
Let's say `rmnet_data1` is your Mobile Data interface (on Qualcomm devices) and `wlan0` is WiFi interface. When you switch on Mobile Data, your ISP assigns `rmnet_data1` an IP address, possibly dynamic and not necessarily a public IP (see details in this answer), but let's assume it is a static public IP - say `1.2.3.10`. When you switch on tethering, `wlan0` is turned into AP mode and a static IP is assigned (used to be `192.168.43.1` but is randomized since Pie). A DHCP/DNS server (`dnsmasq`) is listening on this interface to assign dynamic IP addresses to any hosts which join the local network.

Now phone is essentially a router connecting two networks (different subnets) at gateways (`rmnet_data1` for external/public network i.e. WAN and `wlan0` for local/private network i.e. WLAN). Since only one IP is assigned by the ISP to your phone, phone is doing NAT (at OSI layer 3) to make internet accessible for all local clients. As in your case the only connected host (router) is assigned address, let's say, `192.168.43.10`. You'll have to do specific Port Forwarding or DMZ to access the router from internet.

## BRIDGING ON LINUX / ANDROID:

What you want to do is assign address `1.2.3.10` to the router using Ethernet bridge as you stated in comment:

> I only want to connect one device behind the phone, and I want the phones public IP to be given to it.

If you want to retain current network configuration on device, Ethernet bridging - which is an alternative to NAT for internet sharing \- doesn't seem to be an option at all, unless you get a whole subnet (e.g. `/30`) from ISP instead of a single IP address. See **Appendix A** for reasons.

## BRIDGING ON MODEM / ROUTER:

That said, what you are looking for is called **Half Bridge Mode**; a feature provided in many modem/router combo devices to avoid the problem of double NAT. It's also called *IP Pass-through*, *IP Extension*, *DHCP Spoofing* or *True DMZ* by different manufacturers. Other operation modes on ISP provided combo devices are **NAT** and **Full Bridge**.

We can use some workaround to expose the public IP to connected host. It involves changing IP configurations and kernel routing policy/tables, so it breaks internet connectivity on Android device. That's not a problem on modems/routers, but on Android it is. So we have to use NAT for Android's internal traffic (see **Appendix B**).

## HOW TO TURN ANDROID INTO HALF-BRIDGED MODEM / ROUTER?

ISPs doing CGNAT usually create small subnets for connected clients, in case of public IP it could be even `/8`. In our case, let's say, the network ID is `1.2.3.8/30`, so `1.2.3.9` will be the ISP's gateway address. There are different approaches we can go with, see **Appendix C**.

Rest of the details are given in the following script which can be executed followed by `dhcp`, `static`, `arp` or `stop` argument:

```
#!/system/bin/sh
set -e

[ "$(id -u)" = 0 ] || { echo 'Not running as root!' >&2; exit 1; }

# internal filed separator
IFS=$' \t\n'

##########################
# define / get variables #
##########################
SSID=MyAP                           # set this to your desired string (avoid spaces and non-ascii characters)
PASSCODE=foobarfoobar               # set this to your desired string (8 to 63 characters)
PUB_IFACE=rmnet_data                # set this according to your device (Qualcomm SoCs use 'rmne_data[N]')
WIFI_IFACE=wlan0                    # set this according to your device (check with 'lshw' or 'ip link show')
AP_IFACE=${WIFI_IFACE}-AP           # we'll create new WiFi interface for hotspot
DIR=/data/local/tmp/$AP_IFACE       # where to put config files
LOCAL_SUBNET=192.168.1              # for public interface
PST_RT_CHN=my_chain                 # to define source NAT for local packets
DNS1=1.1.1.1
DNS2=1.0.0.1

# read public interface name, IP and mask
read -r PUB_IFACE PUB_IP MASK <<< \
    $(ip -4 -o a | tr -s ' ' | awk -F'[ /]' '/'"$PUB_IFACE"'/ {print $2,$4,$5}')

# read ISP's default gateway
GW=$(ip r s t all | awk '/^default/ && /'"$PUB_IFACE"'/ {print $3}')

# ip for WiFi hotspot interface in public subnet
AP_IP=$GW/$MASK

############################
# start / stop bridge mode #
############################
STOP()
(
    echo 'Cleaning up...'

    # ignore errors
    set +e

    # don't print error messages
    exec >/dev/null 2>&1

    # hope there are no other instances of same daemons
        pkill -15 hostapd
        pkill -15 dnsmasq
    # remove local IP from public interface
        ip address del ${LOCAL_SUBNET}.1 dev $PUB_IFACE
    # remove rule and clear RPDB cache
        ip rule del lookup main
        ip route flush cache
    # flush main table
        ip route flush table main
    # disable forwarding
        printf 0 >/proc/sys/net/ipv4/ip_forward
        iptables -D FORWARD -i $AP_IFACE -o $PUB_IFACE -j ACCEPT
        iptables -D FORWARD -o $AP_IFACE -i $PUB_IFACE -j ACCEPT
    # stop listening on DHCP port
        iptables -D INPUT -i $AP_IFACE -p udp -m udp --dport 67 -j ACCEPT
    # stop local NAT
        iptables -t nat -D POSTROUTING -j $PST_RT_CHN
        iptables -t nat -F $PST_RT_CHN
        iptables -t nat -X $PST_RT_CHN
    # delete AP interface
        iw $AP_IFACE del
    # delete config directory
        rm -rf $DIR
)

if [ "$1" = stop ]
then
    STOP
    exit

elif [ "$1" != dhcp -a "$1" != static -a "$1" != arp ]
then
    echo 'Usage:' >&2
    printf '\t%s\n' "$(basename "$0") dhcp|static|arp|stop" >&2
    exit 1
fi

################
# basic checks #
################
if [ -z $PUB_IP ]
then
    echo 'Turn on Mobile Data first.' >&2
    exit 1
fi

if ! iw phy | grep -A10 'Supported interface modes:' | grep -q '\*[ ]*AP'
then
    echo 'AP mode not supported.' >&2
    exit 1
fi

if ! iw dev $WIFI_IFACE link | grep -q '^Not connected'
then
    echo 'First disconnect form Wi-Fi.' >&2
    exit 1
fi

##########################
# clear previous configs #
##########################
STOP

# clean up if error occurs
trap '[ $? = 0 ] || STOP' EXIT

#####################################
# create virtual wireless interface #
#####################################
if ! iw dev $WIFI_IFACE interface add $AP_IFACE type __ap
then
    echo "Couldn't create AP interface." >&2
    exit 1
fi

####################################
# configure interfaces and routing #
####################################
echo 'Configuring network...'

# add local IP to public interface and delete public IP
ip address add ${LOCAL_SUBNET}.1/30 dev $PUB_IFACE
ip address del $PUB_IP/$MASK dev $PUB_IFACE

# activate the WLAN interface
ip link set dev $AP_IFACE up

if [ "$1" = dhcp ]
then
    # assign ip in public subnet to WiFi hotspot interface
    ip address add $AP_IP dev $AP_IFACE

elif [ "$1" = static ]
then
    # assign ip in local subnet to WiFi hostspot interface
    ip address add ${LOCAL_SUBNET}.2/30 dev $AP_IFACE

else
    # start proxying ARP queries both ways
    printf 1 >/proc/sys/net/ipv4/conf/$AP_IFACE/proxy_arp
fi

# clear auto added routes and add new
ip route flush table main
ip route add $PUB_IP dev $AP_IFACE
ip route add default via $GW dev $PUB_IFACE
ip route flush cache

# Android doesn't look up into main table by default
ip rule add lookup main

# let packets be forwarded
printf 1 >/proc/sys/net/ipv4/ip_forward
iptables -I FORWARD -i $AP_IFACE -o $PUB_IFACE -j ACCEPT
iptables -I FORWARD -o $AP_IFACE -i $PUB_IFACE -j ACCEPT

# apply source NAT on internally generated packets
iptables -t nat -N $PST_RT_CHN
iptables -t nat -I POSTROUTING -j $PST_RT_CHN
iptables -t nat -I $PST_RT_CHN -o $PUB_IFACE ! -s $PUB_IP -j SNAT --to-source $PUB_IP

#######################
# access point daemon #
#######################
# create configuration file
mkdir -p $DIR
cat <<-HOSTAPD >$DIR/hostapd.conf
    # network name
    ssid=$SSID
    # passphrase to use for protected access
    wpa_passphrase=$PASSCODE

    # maximum STA clients allowed to connect
    max_num_sta=1

    # network interface to listen on
    interface=$AP_IFACE
    # wi-fi driver
    driver=nl80211

    # set operation mode, 'g' for 2.4GHz band
    hw_mode=g
    # WLAN frequency channel to use
    channel=1

    # key management protocol; use pre-share key
    wpa_key_mgmt=WPA-PSK
    # enforce WPA2
    wpa=2
HOSTAPD

echo 'Starting hostapd...'
hostapd -B $DIR/hostapd.conf

##########################################
# IP assignment; manually or dynamically #
##########################################
if [ "$1" = dhcp ]
then
    # create configuration file
    cat <<-DNSMASQ >$DIR/dnsmasq.conf
        # we dont want DNS server, only DHCP
        port=0

        # network interface to listen on
        interface=$AP_IFACE
        bind-interfaces

        # nameservers to be sent to clients
        dhcp-option=6,$DNS1,$DNS2

        # range of IPs to make available to wlan devices and when to renew IP
        dhcp-range=$PUB_IP,$PUB_IP,24h
        # where to save leases
        dhcp-leasefile=$DIR/dnsmasq.leases

        # respond to requests from a different IP broadcast subnet
        dhcp-authoritative

        # log extra information about DHCP handshakes
        log-dhcp
    DNSMASQ

    # open listening port for dnsmasq
    iptables -I INPUT -i $AP_IFACE -p udp -m udp --dport 67 -j ACCEPT

    echo 'Starting DHCP server...'
    dnsmasq -C $DIR/dnsmasq.conf </dev/null

else
    echo
    echo 'On connected host disable DHCP, set DNS and do:'
    echo 'ip a f dev <wifi>'
    echo "ip a a $PUB_IP dev <wifi>"
    echo 'ip r f t main'

    if [ "$1" = static ]
    then
        echo "ip r a ${LOCAL_SUBNET}.2 dev <wifi>"
        echo "ip r a default via ${LOCAL_SUBNET}.2 dev <wifi>"

    else
        echo 'ip r a default dev <wifi>'
        echo 'ip n f dev <wifi>'
    fi

    echo
fi

echo Done.

```

**NOTE:**

* All of the required binaries (`iw`,`ip`, `iptables`, `hostapd`, `dnsmasq`) are available on Android but `hostapd` doesn't work on command-line. I used a static built binary, tested on Pie.
* Based on the factors discussed here, your ISP may figure out (and mind) that your traffic is not originating from Android device.
* After stopping half bridge mode, you need to turn Mobile Data OFF and ON to resume normal working because routes are cleared. Also on device boot you may need to switch on WiFi once so that `wlan0` interface is created.
* ISP's nameservers - if needed - (and default gateway) can also be obtained by:

```
~$ dumpsys connectivity | grep CONNECTED | grep -o 'Routes: .* DnsAddresses: [^ ]*'
Routes: [0.0.0.0/0 -> 1.2.3.9 rmnet_data1,1.2.3.8/30 -> 0.0.0.0 rmnet_data1,] DnsAddresses: [1.1.1.1,8.8.8.8,]

```

---

**VERIFICATION:**

Your configuration should look like this:

```
1. Routing
==========
~$ ip rule show
0:  from all lookup local
9999:   from all lookup main

~$ ip route show table main
default via 1.2.3.9 dev rmnet_data1
1.2.3.10 dev wlan0-AP

2. Forwarding
=============
~$ cat /proc/sys/net/ipv4/ip_forward
1

~# iptables -S
-A FORWARD -i rmnet_data1 -o wlan0-AP -j ACCEPT
-A FORWARD -i wlan0-AP -o rmnet_data1 -j ACCEPT

3. Source NAT
=============
~$ ip -4 -o address
rmnet_data1    inet 192.168.1.1/30

~# iptables -t nat -S
-A POSTROUTING -j my_chain
-A my_chain ! -s 1.2.3.10/32 -o rmnet_data1 -j SNAT --to-source 1.2.3.10

4. Access Point Daemon
======================
~# iw dev
        Interface wlan0-AP
                ssid MyAP
                type AP

5 (a). DHCP Server
==================
~$ ip -4 -o address
wlan0-AP    inet 1.2.3.9/30

~# netstat -lup
Proto    Local Address   Foreign Address  PID/Program name
udp      1.2.3.9:67      0.0.0.0:*        23693/dnsmasq

~# iptables -S
-A INPUT -i wlan0-AP -p udp -m udp --dport 67 -j ACCEPT

5 (b). Static IP
================
~$ ip -4 -o address
wlan0-AP    inet 192.168.1.2/30

5 (c). Proxy ARP
================
~$ cat /proc/sys/net/ipv4/conf/wlan0-AP/proxy_arp
1

```

---

## APPENDIX A:

**Why Ethernet bridging isn't a straightforward option on Android:**

* There are at least two hosts on your local network; phone and router, but only one IP address is received from ISP. Two hosts on same network can't have same IP address.
* If you transparently bridge `rmnet_data1` and `wlan0`, both can have same IP address i.e. `1.2.3.10` but router still needs to be assigned another IP address, either statically or by DHCP server from ISP side. If you don't assign full bridge an IP, internet connectivity will break on Android which can't work (see Appendix B).
* Ethernet bridging (which operates at OSI L2) doesn't work for WiFi interfaces in STA mode without WDS / 4addr support (on both sides of WiFi) which isn't supported by all physical interfaces. In AP mode, however, WiFi interface supports bridging, but 3G/4G interfaces don't. A recent patch to `rmnet` adds bridging support only for interfaces which can send MAP data.
* An alternative to Ethernet bridging is proxy ARP (at OSI L3) or something like wlan\_kabel which can be applied to both interfaces. But again you need three or at least two IP addresses; one for phone and one for router.

## APPENDIX B:

**Why NAT is required on device?**

Modems have their own processors - called baseband or communication processor (BP or CP) on Android devices - and they run their own minimal RTOS. On small devices like phones they are integrated in SoCs. Communication with modem is done using a set of standard control protocol. AT commands is the traditional one used with PPP (, ), but manufacturers have developed new methods (e.g. QMI (, , ) / RmNet (, ) on Qualcomm devices).

The closed source vendor specific control/data modem protocols used on Android devices are not (or at least well) documented. Vendors provide native RIL Daemon as a binary blob which communicates with modem through `RILJ` and telephony framework in Java stack. When we turn on Mobile Data, these components work together to authenticate with MNO (by reading SIM data, APN settings etc.) and then configure the network stack (IP, DNS, route etc.) to make internet connectivity possible. So the modem is available to Android OS as in full bridge mode (no NAT involved on device).

Using methods explained above we assign public IP to connected host, so Android device itself loses internet connection. As soon as we make a change to the IP configuration, Android's telephony stack detects disconnections and sends a reset command to modem (through RILD) and whole network stack is refreshed with new (or same) IP settings received from MNO.

So to set Android device in Half Bridge mode, a more reliable approach is to take full control of communication with modem by altering the telephony framework (which isn't a simple task). As a workaround we do source NATing for internally generated packets on Android device so that it's not disconnected from internet. While the public IP is routed without any NAT to the only host connected to `wlan0` interface, so that it's accessible from internet.

## APPENDIX C:

**Routing Methods for Half Bridge Mode on Android:**

* **DHCP:**
Assign `1.2.3.10` to your router using DHCP server, `1.2.3.9` to `wlan0` and `192.168.1.1/30` (or any other private IP) to `rmnet_data1`. It's also possible to create a hypothetical `1.2.3.0/X` network and assign random IP from that hypothetical network to `wlan0`. But public IP address must not conflict with subnet ID or broadcast address in the faked subnet. It becomes difficult to achieve if IP is assigned dynamically, particularly if IP class and subnet mask keep on changing from ISP.
In this way AP interface and router appear on same local network, and `wlan0` IP is set as default gateway (next hop) for router. Here we are faking an IP address (at OSI L3).
* **Static Route:**
Setting IP/DNS on router manually allows you to assign local IP address to AP interface instead of using pseudo IP address. Add AP's IP address as default gateway on router. However router might have problem using default gateway on different subnet.
* **ProxyARP:**
Another option when not using DHCP is ProxyARP (, , 10). If `wlan0` has no IP address, we need to add a static route without IP address as default gateway. So router can't query gateway's MAC address and thus keeps asking `wlan0` (in global broadcasts) where an internet address (next hop) is. It's because target of ARP queries is always the IP address, either of a local host or of default gateway (if destination IP is on another network).

Due to ProxyARP, `wlan0` provides its own MAC address for every ARP query received from connected host. ARP queries from `rmnet_data1` (for `1.2.3.10`'s MAC address) are forwarded/received by `wlan0` to/from connected host. `rmnet_data1` itself doesn't have a MAC address (like PPP). A side effect of this approach is that the connected router will pollute its ARP cache by associating every visited internet address to AP's MAC address. Here we are faking a MAC address (at OSI L2).

---

**CREDITS:**

# Answer
> 2 votes
Have a look at this thread about using open VPN. Here you can give public IPs to devices using Open VPN, I think.

Or you could find another tethering app which supports this such as PdaNet+ which may have more control.

---
Tags: networking, wifi-hotspot, tethering, dhcp, ip-address
---


# Question
Title: integrate Google Photos with android system
I use ios for long time recently switched to android. my whole photo library in google photos but when i need to upload somewhere i need to download it first to device and proceed to upload its irritating is there any way to link google photos to gallery like ios icloud photos when i use ios i can select icloud photo directly and it download & upload automatically. why google can't do that?

# Answer
Google Drive *was* the integrating factor till July this year. It was possible to sync photos with Drive. Drive also works with ios.

Now that it is discontinued, there is no automatic way to upload but from Photos settings you enable sync to drive (tap on the cloud icon) or using the share option upload to third party cloud/messaging/mail options.
> 1 votes

---
Tags: google, photos
---


# Question
Title: Why are superuser permissions needed to acess /data partition?
The default account is normal user, and I used it to install Google Play Store APK (to `/data`). Then Google Play Store was opened using my current user's permissions, and it is used to download and install other APKs to `/data`. That means I have full access to the `/data` partition.

Why are file manager apps unable to view that partition without root permissions?

# Answer
First to clarify only `root` (UID `0`) isn't enough to get access to `/data` at least since Android 5. Discretionary Access Control based on traditional UNIX UIDs/GIDs alone doesn't fulfill the needs of modern complex OSes like Android. DAC is supplemented by Mandatory Access Control (MAC); SELinux in case of Android. So to access `/data` your process/user must have an allowed policy explicitly defined.

> Google Play Store was opened under my current user permission

This isn't correct. Concept of *“users”* is different on Android than on normal Linuxes. On Android every app is assigned a unique UID (from range 10000 to 19999) and it runs under its own user. Privileges are then controlled through Android's permission framework. At filesystem level every app is bound to a few directories (private and shared), that too subject to some permissions. For details see Where Android apps store data?

So there is no human user which could run its all programs under current user/UID.

> it downloaded and installed other APKs to /data. That means I have full access to the `/data` partition.

Play Store doesn't install `apk` files, it just performs a few verifications and downloads the file using Download Manager (`com.android.providers.downloads`) which runs under its own UID. App installation to `/data/app` and other relevant directories is mainly handled by **Package Manager** service running under UID `1000` (`system_server` process) in Java stack and **`installd`** running under UID `0` in native stack. **Package Installer** (`com.android.packageinstaller`) is the system app - running under its own UID - which provides user interface to (un)install apps manually. See more details here. Similarly all apps and processes have their own SELinux contexts to allow access to required processes and files. There are a number of APIs and IPCs involved in this whole process.

> Why superuser permission is needed for accessing `/data` partition?

Simply put, it's protection. As you need root access to change `/etc` directory on Linux OSes and as you need Administrator rights to open Registry Editor on Windows. This restriction is to isolate and protect every app's process in a confined environment. Other than **DAC** and **MAC**, other phenomena like Linux **capabilities**, **namespaces**, **cgroups** and **seccomp** filters are also used for this sandboxing. It also enforces apps' limited access to resources and makes auditing easy.

A few common reasons from my answer to How do I access `$HOME/storage` outside of Termux?:

`/data` partition also contains system settings including sensitive data like password databases (though not saved as plain text), contacts, call logs and apps statistics. So `/data` isn't accessible without root in order to:

* Protect apps' private data from other apps
* Protect system data and settings from bad apps and malware
* Isolate users/profiles from other users/profiles
* Not let apps access shared storage without Storage permission granted
* Enforce APIs by Android framework so that apps can't use system resources and read/manipulate device information and settings without proper permissions

And possibly there are other reasons. For more details see Are multiple-users protected from each other differently than apps?
> 15 votes

---
Tags: root-access, partitions
---


title: In call volume root modify

text:
# Question
Title: In call volume root modify
I have a HTC One m7 international. It has root access. Android lollipop 5.0.2

The in call volume is too low despite being on max volume.

Which file in the root system should I modify to increase the max volume? What line of code corresponds to this setting?

Thanks vm

# Answer
> 5 votes
This approach achieves desired functionality by communicating with Android APIs at AIDL level making use of ADB

---

Run the command:

```
adb shell service call audio 7 i32 3 i32 0 i32 1

```

Here, the service `call` refers to `IAudioService`. Click here for more info.

* `7` is the function named `setStreamVolume`. It is the 7th in the list of functions in the interface `IAudioService`. Verify it here. (`setStreamVolume` takes 3 parameters `streamType`, `index`, `flag`)
* `i32` is to write the integer INT into the send parcel. (Alternatively we can make use of `s16` for UTF-16 string)
* `3` is `streamType`value. (Value `1` → phone, `3` → speaker, `4` → alarm, `6` → bluetooth)
* `0` is `index` value and `1` is `flag` value

See the source here.

# Answer
> 1 votes
**For Android 10**

```
adb shell media volume --show --stream 1 --set 1

```

**example :**

```
/ $ media volume --show --stream 4 --set 1
[v] will control stream=4 (STREAM_ALARM)
[v] will set volume to index=1
[v] Connecting to AudioService

```

Specific usage

```
usage: media [subcommand] [options]
       media dispatch KEY
       media list-sessions
       media monitor <tag>
       media volume [options]

media dispatch: dispatch a media key to the system.
                KEY may be: play, pause, play-pause, mute, headsethook,
                stop, next, previous, rewind, record, fast-forword.
media list-sessions: print a list of the current sessions.
media monitor: monitor updates to the specified session.
                       Use the tag from list-sessions.
media volume:  the options are as follows:
                --stream STREAM selects the stream to control, see AudioManager.STREAM_*
                                controls AudioManager.STREAM_MUSIC if no stream is specified
                --set INDEX     sets the volume index value
                --adj DIRECTION adjusts the volume, use raise|same|lower for the direction
                --get           outputs the current volume
                --show          shows the UI during the volume change
        examples:
                adb shell media volume --show --stream 3 --set 11
                adb shell media volume --stream 0 --adj lower
                adb shell media volume --stream 3 --get

```

---
Tags: root-access, htc-one, volume
---


title: Fastboot stuck on sending system

text:
# Question
Title: Fastboot stuck on sending system
I feel my old mobile with android 2 or 3 got bricked as it get stuck on boot logo each time but I can easily got into fastboot mode but in fastboot mode I can complete following commands like:

```
fastboot devices
fastboot flash recovery recovery.img
fastboot flash splash splash.img
fastboot flash userdata userdata.img

```

But each time I run the following command

```
fastboot flash system system.img

```

The fastboot command stuck on

> Sending 'system' (124183 KB)

I can easily erase the system but cannot flash it.

# Answer
boot in recovery from fastboot, once in twrp enter adb shell, or use -\> Advanced -\> Terminal

```
fastboot boot recovery.img
adb shell

```

be careful with `dd` especially double check partition name and partition size.

in your `/etc/recovery.fstab` there might be just a symlink but no worry you can use it `dd` will targeting the real partition.

```
cat /etc/recovery.fstab
ls -l /dev/block/bootdevice/by-name/system
dd if=/external_sd/system.img of=/dev/block/mmcblk0p99

```

> if the file size is bigger than partition size it is strongly recommended to add parameters block size and count to limit the write process to maximum partition size, otherwise your cache and userdata partition may be destroyed.

beware files bigger than 4 GiB can not copied to MicroSD Card, so instead adb push

```
adb push system.img /dev/block/mmcblk0p99

```

How can I view the Android internal partition table?

if you are not sure about your system.img is sparsed image or LZ compressed, you can check the header for file system type / partition magic
ext4: 0xEF53 at offset 0x438
f2fs: 0xF2F52010 at offset 0x400

```
hexdump -C -n1088 system.img | grep 53.ef
hexdump -C -n1032 system.img | grep 10.20.f5.f2

```

if one of these magic is found the image can be loop mounted for testing, otherwise you need to convert file with `simg2img` or `sdat2img` first
> 0 votes

---
Tags: rom-flashing, fastboot
---


# Question
Title: Apps showing up as blank white screens in recent apps list when in landscape orientation
I've noticed some odd behavior on the recent apps screen on Android that I can't find an explanation for anywhere. When I open apps on a phone while in landscape view and switch to the recent apps screen all I see is a white square for that app, no preview thumbnail.

This is how it looks on a OnePlus 6 when I open Chrome in portrait mode and open the recent apps screen, and when I open Chrome while in landscape and then go to the recent apps screen

And similar behavior on a Pixel 3:

Opening Chrome in portrait and in landscape, then switching to recent apps

If I give the Pixel 3 some time it will eventually generate a thumbnail for the landscape app though about half the time it looks squished and the other half it isn't up to date with what was actually being shown on the screen.

My question is why does Android seem to struggle with generating landscape preview thumbnails for the recent apps screen? Has anyone else experienced this behavior or know of a fix for it?

# Answer
As an Android developer, the only thing I can be sure of is that **configuration changes force the activity to be restarted**. This includes screen orientation (portrait, landscape), so Chrome has to be destroyed and recreated, returning a blank/stale landscape content instead.

From Android Developers - Handle configuration changes

> ### Handle configuration changes
>
> Some device configurations can change during runtime (such as screen orientation, keyboard availability, and when the user enables multi-window mode). When such a change occurs, Android restarts the running `Activity` ( `onDestroy()` is called, followed by `onCreate()`). The restart behavior is designed to help your application adapt to new configurations by automatically reloading your application with alternative resources that match the new device configuration.
>
> To properly handle a restart, it is important that your activity restores its previous state. \[...\]

(Also, list of configuration changes)

I cannot reproduce this issue on my device\*, but from the screenshots, *the recent list is always shown in portrait mode*, so there is a change from landscape to portrait between triggering the "recent apps list" event and showing it. I'm not sure about the order of the events for screen rotated, app destroyed, and app recreated, but most possibly it is destroyed-rotated-recreated, thus the app is not ready yet to re-render the activity (since an activity also cannot run while on the background), returning a blank white screen or use its previous state (the stale landscape content) instead.

The "fix" ― if it is possible ― is to allow showing "recent apps list" in landscape mode.

---

\*The reason I cannot reproduce this issue is that my device allows showing "recent apps list" in landscape mode, so the thumbnail is shown correctly. However, when I rotate to portrait while on the list, the thumbnail will be shown squished as the screenshot.

Also, the restart may be observed more easily by rotating the screen while Chrome is active: after the rotation, Chrome will re-render the content to current available space.

Lastly, I do not know why the recent apps list is forced on portrait mode, but that is out of the question's scope.
> 1 votes

---
Tags: recents-screen
---


# Question
Title: Apps are crashing endlessly even after a factory reset, preventing me from doing anything
Some apps are crashing endlessly, and I can't do anything because they just keep giving me the same errors.

I've even done a wipe-out/factory reset, but the problem still persists.

This problem was first started long time ago when my battery had problem and my phone just shut down in the middle of work. When I replaced my battery and reset my phone all of my problems were solved. But recently, I mean 5-6 months after replacement, my contact and dialer app started to give me that error. I installed another dialer and contact app and I thought that if I do a reset it will fix it, and when finally I did a factory reset my setup wizard and social plugin and contact and some other apps just have this error.

My Android version is 6.0 and is stock official.

# Answer
> 0 votes
It seems like your firmware are broken, you can try to reflash the firmware, or Install a custom rom. Have also a look in xda in your phone thread maybe this problem has anyone before you.

---
Tags: crashes, force-stop
---


# Question
Title: How to share the file names of all the files in a folder in Android?
It is being surprisingly hard to achieve. I've tried so far:

* Download file manager apps from Google Play. Unfortunately, "share" shares the files, not the file names. None of them had a option like copy file names
* Download backup apps. Unfortunately, none of them backup the file names of a folder.

Any idea to copy to the clipboard or share the file names of all the files of a folder?

# Answer
* Install Termux
* Grant Storage permission
* Do:
```
~$ find /sdcard/Music/ -type f >/sdcard/list_of_files.txt

```

Replace Music directory with whatever you want.
> 2 votes

---
Tags: backup, file-transfer, file-management, share-menu, backup-manager
---


# Question
Title: How does update_engine validate a differential update-image with dm-verity enabled?
I am working with Android 8, Android verified boot with dm-verity, and block-based differential seamless A/B updates. To my understanding, the Android update\_engine performs some validations of the received update image before it proceeds to write the target partitions. AFAIK, update\_engine checks if the differential update can be installed atop the current partitions. How is this check performed?

I can imagine two possibilities, but I haven't found authoritative documentation of either hypothesis:

1. The differential update package contains a linear hash of the source partition. On the device, update\_enigne computes a SHA-256 hash of the entire partition on top of which the differential update is to be applied. It compares this value with the one provided as part of the update package and proceeds only if the two values agree.
2. The differential update package contains the dm-verity root hash of the Merkle-Tree used for block-wise validation with dm-verity. The update\_engine compares this target root-hash with the one provided on the device in the vbmeta structure. Only if the two match, it proceeds to install the update.

Is either one of these hypotheses correct, or am I missing something? Similarly, how does the update\_engine validate the target partitions once they have been written? Via a linear hash, or using the root hash? Or otherwise?

# Answer
> Is either one of these hypotheses correct?

I haven't experimented with A/B device so far but what I understand from official documentation and source code is that it's both. SHA-256 hash of target partition is checked against the one received from update server. And after reboot `dm-verity` check is performed.

From Life of an A/B update:

> *"5. The whole partitions are re-read and verified against the expected hash."*

Additionally implementer can put extra post-installation checks. And:

> *"After rebooting, `update_verifier` triggers the integrity check using `dm-verity`"*.
> ...
> *"After the check completes, `update_verifier` marks the boot successful."*

.

> Android `update_engine` performs some validations of the received update image before it proceeds to write the target partitions

A/B updates differ from old non-A/B recovery-based updates. In latter case update package is verified twice against public keys in `/system/etc/security/otacerts.zip` (normal boot) and `/res/keys` (recovery boot). In case of Block-Based OTAs `dm-verity` is an additional check. But A/B updates have support for **streaming updates**:

> *"Updates can be streamed to A/B devices, removing the need to download the package before installing it. Streaming means it's not necessary for the user to have enough free space to store the update package on `/data` or `/cache`
...
`update_engine` will update the raw blocks on the currently unused partition as it streams the update package."*

So it's not always possible to verify the integrity of whole update package (payload) before flashing. Instead integrity of update package is verified after updating. If something goes wrong, the older partition slot is still intact as a fallback while the updated slot is marked *unbootable* until next update.

.

> Does that mean that `update_engine` computes a complete linear SHA-256 hash of all source-partitions that it is supposed to update?

*"During incremental or delta updates, the binary data from the current slot is used to generate the data in the new slot"*. But `update_engine` computes hashes of all *target partitions* after those are updated. From source code:

> *"This action will hash all the partitions of the target slot involved in the update. The hashes are then verified against the ones in the `InstallPlan`. If the target hash does not match, the action will fail."*

.

> `dm-verity` does not perform an exhaustive check on every boot, because that would take way too long. That's why I assume that `update_verifier`, in contrast, does the exhaustive verification upon a reboot after a successful installation

From the details found in Implementing dm-verity, hash of every 4k block is pre-calculated and appended at the end of `system.img` (or `vendor.img`) in `dm-verity` table (metablock; slightly different details in case of AVB) which is signed by OEM's private key. Public key is saved to kernel's system keyring (on A/B devices) which kernel uses to verify the integrity of verity table on every boot.

> *"One way of verifying a block device is to directly hash its contents and compare them to a stored value. However, attempting to verify an entire block device can take an extended period and consume much of a device's power.
...
Instead, `dm-verity` verifies blocks individually and only when each one is accessed. When read into memory, the block is hashed in parallel. The hash is then verified up the tree. And since reading the block is such an expensive operation, the latency introduced by this block-level verification is comparatively nominal.
...
If verification fails, the device generates an I/O error indicating the block cannot be read."*

`update_verifier` reads a list of blocks on next reboot. No I/O error means new `system.img` is signed by genuine key and the updated slot is marked successful.

> for a very small differential update, only the blocks that have changed are checked. For a full update, all blocks are re-read. Is this assumption correct?

Documentation says:

> *"`update_verifier` will read only the blocks listed in `/data/ota_package/care_map.txt`, which is included in an A/B OTA package"*

It won't read other blocks whether updated or not.
> 3 votes

---
Tags: ota-update, ab-partition, dm-verity
---


title: recover WiFi password file Android Pie

text:
# Question
Title: recover WiFi password file Android Pie
I know that Android (at least Pie) uses a file WifiConfigStore.xml to store WiFi access points and passwords. It is located in /data/misc/wifi/.

I saved it before wipe and reinstall everything. The idea was to copy it back to this location. While the phone is on/powered it seems not to uses the information from this new file. But after reboot it is gone and overwritten.

So my question: is there a special trick? Or is this not the proper location? Is there some backup file stored somewhere else?

(I have a rooted LineageOS 16 device with Magisk. I even tried to change the file in TWRP with not better result.)

Edit: Found that this file is also located in /data/misc\_ce/0/wifi, /sbin/.magisk/mirror/data/misc/wifi and /sbin/.magisk/mirror/data/misc\_ce/wifi

And there are also files WifiConfigStore.xml.encrypted-checksum. From naming it sounds like there it is including a checksum to avoid errors in xml? This file I have not saved. Am I lost now? Can I delete this and it will be created than?

What is function of this misc\_ce folders?

Thanks!

# Answer
It seems that the magisk folder is just a link. Not sure about the misc\_ce folder. I copied WifiConfigStore.xml, changed properties and owners and renamed the checksum file. After reboot the checksum was recreated and the xml gets valid...
> 1 votes

---
Tags: wi-fi, 9.0-pie, magisk
---


# Question
Title: How MIUI releases based on different Android versions have same features?
I would like to know how MIUI can provide features on all devices that have the same version of MIUI on it, without the same Android version?

# Answer
Android version is mainly developed by Google. OEMs like Xiaomi modify AOSP to inject their own features. Other OEMs like Samsung, Huawei also do the same but they don't make visual changes as much as Xiaomi does. Even community based ROMs like Lineage, Omni and their offshoots like AOSP Extended, Resurrection Remix also have an almost standard set of modifications which they do to every AOSP release.

You can also customize AOSP to build a ROM of your own choice with required features.
> 1 votes

---
Tags: rom, android-versions, miui
---


# Question
Title: Can't downgrade from EMUI 9.1 with dload
I used the dload method to upgrade my dual-SIM Huawei P20 Lite (ANE-LX3 C605) with bootloader locked from EMUI 8.1 to 9.1. It is actually the first time I ever do something to this phone, so I am not completely sure how this works.

I think my phone was rebranded to C432 because the name of the firmware I downloaded is `Huawei P20 Lite ANE-LX1 ANE-L01 ANE-L21 hw eu Anne-L01 Anne-L21 9.1.0.132(C432E5R1P7T8) Firmware 9.0.0 r3 EMUI9.1.0 05014YWN 05014YXX.zip`.

EMUI 9.1 works like a charm, but I want to downgrade to EMUI 8 in order to have an earlier version of Google Play services.

I have download a few different firmware from androidhost.ru:

1. Huawei P20 Lite ANE-LX3 ANE-L23 claro la Anne-L23 8.0.0.152(C605) Firmware 8.0.0 r1 EMUI8.0 05015ATQ
2. Huawei P20 Lite ANE-LX1 ANE-L21 hw eu Anne-L21 8.0.0.150(C432) Firmware 8.0.0 r1 EMUI8.0 05014YWN
3. Huawei P20 Lite ANE-LX1 ANE-L21 hw eu HLRCF Anne-L21 8.0.0.180(C432) Firmware 8.0.0 r1 EMUI8.0 05014YXX

With 1. and 3. it says "Software install failed! Get help from www.emui.com" With 2. it says that the software package is not compatible with the current version .

I have attached a couple of screenshots with info on the version and build number as seen currently.

Any help with this matter would be much appreciated, thanks in advance.

# Answer
> 0 votes
I read about that, you need to downgrade one by one. Emui 9.1 To Emui 9.0, then Emui 9.0 to Emui 8.0.

---
Tags: huawei, emui, huawei-p20
---


# Question
Title: Using mobile data on sim card 1 and sim card 2 for calls and messages?
Can I use both sim cards in order to use internet and handling calls? For example, while browsing on the internet on sim card 1, can I get calls to sim card 2 and also call to somebody else?

# Answer
> while browsing on the internet on sim card 1, can I get calls to sim card 2 and also call to somebody else?

You can call someone/receive calls in SIM 2, but you won't be able to use the internet from SIM 1 during the call. But if you call someone/receive a call on SIM 1, you can still use the internet from SIM 1 during the call.
> 0 votes

---
Tags: 6.0-marshmallow, sms, calls, mobile-data, dual-sim
---


# Question
Title: How do I bypass the RSA authentication dialog box to enable controlling phone from adb?
My phone is Samsung Galaxy S4 SHV-E330S with a broken screen (cannot see or touch anything)

For more context please see my old questions here and here.

I have already tried these:

Can I enable USB debugging using adb?

https://stackoverflow.com/questions/26213954/how-to-solve-adb-device-unauthorized-in-android-adb-host-device

Nothing seems to work. I have pushed the adbkey.pub file in .android folder in the PC to `/data/misc/adb/adb_keys` in the phone while in recovery. On rebooting to android it was still unauthorized. I am pretty sure that before the screen c\broke AI had developer mode and USB debugging enabled on this phone. regardless, I executed the commands shown here

```
adb shell mount /system
abd shell

echo "persist.service.adb.enable=1" >> default.prop
echo "persist.service.debuggable=1" >> default.prop
echo "persist.sys.usb.config=mtp,adb" >> default.prop
echo "persist.service.adb.enable=1" >> /system/build.prop
echo "persist.service.debuggable=1" >> /system/build.prop
echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop

```

since I found out that the above lines of text were not in the original `default.prop` and `/system/build.prop` (even though I am pretty sure I had enabled USB debugging before the screen broke). Even after adding these lines, the phone is still unauthorized when I reboot to android. Since then I have recovered the original `default.prop` and `/system/build.prop` into the phone.

What else can I try now to bypass the RSA authentication dialog box? I have another rooted android phone (different model and OS version) which I have full access to through adb, but it does not even have an `adb_keys` folder inside `/data/misc/adb/adb_keys`, so I can't just copy over from that phone to this phone either.

What else can I do to bypass the RSA authentication dialog box on this phone?

# Answer
> 1 votes
This was solved using clues from this post

> If you only need to authorize one computer:
> Simply copy the adbkey.pub
> onto the device location:
> /data/misc/adb/ and rename it from
> adbkey.pub to adb\_keys
> chmod 0644 and then reboot.

I forgot to do the chmod but still works.

---
Tags: adb, recovery-mode, authentication
---


title: Can disk quotas be disabled?

text:
# Question
Title: Can disk quotas be disabled?
```
$ cp a b
Cannot write to 'b' (Quota exceeded).
# df -h .
Filesystem     Size  Used  Avail Use% Mounted on
/data/media    110G  102G  7.8G  93%  /storage/emulated

```

I can copy the file perfectly fine in the app's filesystem so it isn't a hardware failure

`/dev/block/dm-2 /data`

# Answer
Android introduced filesystem quotas in Android 8 to get Faster Storage Statistics i.e. to make auditing and enforcing space usage limits to apps easy:

> *"This quota feature also improves system stability by preventing any single app from using more than 90% of disk space or 50% of inodes."*

Particular usage is to clear apps' cached data files as the storage runs short and apps exceed their limits. OS calculates these limits based on different criteria and saves to file `/data/system/cachequota.xml`.

Disk Quotas is Linux kernel's feature which can be controlled from userspace using tools like quota-tools. They also work on Android:

```
~# quota -s -u 2000
Disk quotas for user #2000 (uid 2000):
     Filesystem   space   quota   limit   grace   files   quota   limit   grace
     /dev/loop1      4K  20480K  20480K               1       0       0

```

```
~# dd if=/dev/zero of=mountpoint/filler status=none bs=1M count=21
dd: error writing 'test/filler': Quota exceeded

```

However on Android *"The quota feature is part of the default implementation of `installd`"* \- the daemon which handles (un)installation of apps at back end. If `quota` option is found in `fstab` file for `userdata` partition, quota mount options are enabled when `init` mounts the partition on boot. So in order to disable filesystem quota on Android, you need to remove `quota` option from `fstab`. See What is default “fstab” file in Android?

Simple approach is to delete unnecessary files the app is holding in storage. Or you can use a different app (with different UID) for copying as quotas are allotted on per UID basis.
> 4 votes

---
Tags: file-system, storage
---


# Question
Title: Go to recovery mode on device without volume key
Is there a universal way to enter recovery mode on an Android device **with only one turn on/off button**? I have a tablet (Navon Raptor 7) like this and I can't figure it out. An other problem is that although it can boot and get to the launcher, basically I can't start any application or get to the settings (it says 'xy application stopped' etc.) so **I can't even activate debug mode** and use adb to achieve this. That's why I want to do a hard reset from recovery...

# Answer
> 1 votes
You can use apps like Quick Boot or Rebooter or some root apps have this feature to go to recovery mode.. Use them

# Answer
> 1 votes
You can use the following command from an adb prompt to enter into your devices recovery mode without using a physical button during restart.

1) Start adb prompt on your PC / MAC / Linux

2) Make sure adb is running `adb start-server`

2) Make sure the device is present when you run: `adb devices`

3) Now run `adb reboot bootloader` and your device will restart into recovery mode

---
Tags: adb, recovery-mode, tablet
---


# Question
Title: Is it possible to use same modem firmware on different phones?
Can I flash a modem file of a phone to another model? If we can't flash the modem file can you tell me what hardware or software the modem file depend so that it is different for different phone?

You might be wondering why I want to flash modem file even if everything is working fine is that I got volte by using this method.

As login is required to view the link I will explain how I got volte. I download the firmware of yuphoria 5010a which is mostly similar to my phone's specifications. And also downloaded the stock rom of yuphoria 5010a. After that I flashed firmware, rom on my phone using fastboot. I then updated the volte patch which the phone manufacturer released for that phone and installed it and I got volte working on my device.

But the only downside was that I am only able to use volte with 32 bit rom not the 64 bit rom.

Also can you tell me how to clone or backup my entire device (including the critical file such as modem, boot,etc) so that while I would be doing lot of fiddling I can restore my device to its current state without losing anything including the volte which I obtained by flashing the modem file?

My Device : Yu Yuphoria (5010)

ROM : MIUI 8.1(android 5.1)

# Answer
**No, you can't** flash firmware designed to work with one android device to another one.

There are some bizzare situations where this does work because devices have identical hardware (Coolpad F1 and Micromax A310), but this is very unlikely to happen and you shouldn't try it.

As for a device backup, you can make a nandroid backup using CWM or TWRP and copy it to your computer.
> 2 votes

# Answer
> If we can't flash the modem file can you tell me what hardware or software the modem file depend so that it is different for different phone?

**Modem** itself is hardware, so which modem file (firmware) is to be used depends on modem. Usually it's embedded with SoC - the central chip which contains CPU, RAM and other critical components. So if two phones have same modem, there are chances the same firmware works for both. Most of the times same modem means same SoC - it's Snapdragon 410 on your device.

Modem has its own processor called baseband (BP), totally isolated from Android OS which runs on Application Processor (AP) - the one we usually call CPU. In userspace telephony stack (Java) talks to RILD (native vendor specific binary blob) which depends on Linux kernel for communication with modem. Kernel has special implementation from OEM/SoC vendor to create communication channel between AP and BP.

Additionally the firmware may also contain software related to other components interacting with BP like Digital Signal Processor (DSP), SIM card and SIM reader etc. So all of the relevant details must be exactly identical on both phones for same firmware to work.
> 0 votes

---
Tags: custom-roms, mobile-network, micromax-yu-yuphoria
---


# Question
Title: How do I activate Screen Mirroring on a Samsung Galaxy S5 running Marshmallow?
I have an Amazon Fire TV stick, and I'd like to mirror my Samsung Galaxy S5's display to it.

**It works fine with my old Galaxy S4** (just tried it right now), but I cannot get it to work with my Galaxy S5: The "Screen Mirroring" option just does not seem to be available anywhere on the phone.

It's a non-rooted Samsung Galaxy S5 with the latest OTA update (Marshmallow) installed.

---

**What I've tried:** I already googled for `s5 marshmallow screen mirroring missing` and tried the following recommendations:

* Pull down the notification shade, click `Edit` and activate the Screen Mirroring option. On my device, *there is no such option*.
* Click "Quick Connect" on the notification shade and register the TV stick as a TV device. Tried that, but the only option I have is to *"Share content"*. It does not offer to share my screen.

Here are two a screen shots as proof. I'm sure I'm missing something obvious...

# Answer
> 0 votes
You did not mention this in your question, but your screenshot shows that you are using the Galaxy S5 **Neo**.

Unfortunately, that's one of the subtle differences between the Galaxy S5 and the Galaxy S5 Neo: On the Neo, Samsung silently dropped support for the screen mirroring feature.

I could not find any official sources for this, but there seems to be consensus in the community that screen mirroring (MiraCast) is just not available on the Neo <sub>(Source 1, Source 2: German, see Community Question section)</sub>.

If you check the list of MiraCast certified devices, you will notice that the S5 (SM-G900F) is listed, but the S5 Neo (SM-903F) is not.

# Answer
> 0 votes
Actually if you want Mira cast it does come enabled on the s5 neo stock Canadian version anyway and if not your always able to install custom Roms like both lineage os 15.1 and 14.1 works flawless with Mira cast even had a controller hooked up playing games lol Samsung put a chipset capable of it just didn't enable them in some countries or os's it seems

---
Tags: 6.0-marshmallow, samsung-galaxy-s-5, screen-sharing, miracast, amazon-fire-tv
---


# Question
Title: Using a keyboard to send Volume Up signal to confirm flash on device without volume rocker?
# Background

I have a tablet that I am trying to fastboot flash a custom ROM on. The problem is this tablet has no volume rocker. In order to flash, fastboot requires you to press volume on the device up to confirm the flash. My question to bypass this is in a different post.

Device is very obscure: An `Eewrite (manufactured by Alps) e-pad pro by Wisky (sold by novadealshop)` bought from Hong Kong, running Android 7.1.1 with a Type-C adapter, a physical home and power button.

# Question

Would it be possible to send the volume up signal using a usb-c splitter/hub and a keyboard that has a volume up button?

I want to ask before I buy the keyboard and thunderbolt-3 hub. I am also worried that many of these hubs might not be recognized by the lowlevel stock recovery environment.

# Answer
Fastboot is implemented in bootloader (like `aboot` or LK) i.e. in boot chain it loads even before the first process (kernel) of main OS. It has its own very minimal kernel which doesn't recognize any hardware components (even on device) except those necessarily required at this stage (processor, memory, display, flash storage etc.). Communication with PC over USB is only acceptable through `fastboot` protocol which doesn't have support to accept keystrokes or other input events (at least I never heard of such functionality). So it won't receive your
> 1 votes

---
Tags: rom-flashing, recovery-mode, fastboot, usb-debugging, usb-c
---


# Question
Title: Bypass T-Mobile Hotspot Tethering Limit by using the phone's unlimited plan?
I have the 10gb hotspot plan for tmobile but I also have unlimited data when I'm on my phone. Is there a way to bypass the hotspot limit by using the unlimited data from my phone instead? I have the nexus 6 on android version 6.

# Answer
> 5 votes
You could make your phone to act as a VPN Gateway

**Requirements:**

* root
* vpn server (can obtain any free openVPN from playstore)

Using a VPN gateway will make tethered traffic to go through the VPN.

Steps

* Turn on portable hotspot
* Open terminal as root and enter the following codes (you can paste them)

```
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61

```

Edit

If you are not rooted you can use PdaNet+.

# Answer
> 0 votes
To make this work, I had to add the following VPN forward route: 0.0.0.0/0 in my L2TP client on the phone, and from terminal, I only typed this much:

```
su
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev ppp0 scope link table 61

```

And it immediately came on line. During the terminal session, I had the PC connected to the phone tethering Hotspot all the time, and for each line typed, I checked the tunnel. As far as I understand, what these commands actually do, is to set up a NAT routing on the phone - correct?

---
Tags: wifi-hotspot, 4g, t-mobile, nexus
---


title: How can I disable chat heads?

text:
# Question
Title: How can I disable chat heads?
My grandmother has a Motorola Droid Maxx 2 running Android 6.0.1 and she would like to disable chat heads entirely, for text messages and Messenger. A preliminary search through her notification settings, Google, and this site yielded no results. How can she do this?

# Answer
> 1 votes
There should be a menu called "Advanced Features". Tap on that and then you will find something about smart pop-ups. Find the messaging app and disable it from there.

On my Samsung A50:

---
Tags: 6.0-marshmallow, notifications, chat
---


# Question
Title: Removing apk of inbuilt apps completely (without rooting)
I'm working on Samsung Galaxy On7, Android 6.0.1-Marshmallow.

My internal memory is 8 GB, due to which I have disabled several inbuilt apps which I do not need at all.

The problem is that, these disabled apps are still taking up space, even though they are disabled and replaced by their factory versions.

Is there any way I can completely free up the space the Google apps are using up (like Facebook and its Manager, which are taking up almost no space):

<sub>(Click the image to enlarge it)</sub>

***Please note that I do not want to root my phone. I had previously rooted my other phone with kingo root, but could never unroot it.***

# Answer
> 13 votes
Unfortunately, that is just not possible. The apk of system apps resides within system partition. The privileges (access rights) required to make changes in system partition are not given to ordinary users. We can only gain such higher privilege through rooting.

That said, if you are dealing with space issues than you are looking at wrong front. System partition has nothing to do with those space issues since only a system wide update/upgrade makes changes in it. They are caused by data partition. It is possible that you may have updated some system apps, so now, they would be having an apk in system partition and another apk (the latest update) in the data partition (now that is one precious space). You can delete the ones in data partition by disabling that system app. When you attempt to do that you would get something like this:

OK, and the apk from the data partition would get deleted.

# Answer
> 0 votes
You could argue that this is like single-boot rooting, but you could boot into a recovery image that will allow you write access to the system partition. You'll need to have an unlocked bootloader (look up a guide for your system—note that this is different from rooting and carrier unlocking), and doing this will take some familiarity with adb and fastboot. If your concern is just space, I would stick with Firelord's advice, as doing this would be a lot of effort for very little space saving.

# Answer
> 0 votes
Some apps like Ghost Commander off the Play Store can allow you to get Root Access within the Root Folder without having to Root your phone, but I don't exactly know if it could delete such files within the root folder, but it might be able to.

# Answer
> -1 votes
try sd maid, it will find large files, eg it found thumbnails from 'gallery ' . I also changed to camera360 app that dont leave thumbnails so large in size.

use osmonitor app, it will find the apps that at are using up ram , and you can remove them.

Finally use a firewall, i use 'no root firewall' and it disables access to the internet by app, you whitelist the apps you need to access internet. eg Gallery was pinging the net, and why? photos are local

---
Tags: 6.0-marshmallow, uninstallation, system-apps
---


title: Potentially Malicious APKs

text:
# Question
Title: Potentially Malicious APKs
In theory, should it be possible to root your device with an APK file? Or possibly create a potential harmful application?

I know that APKs can be used as apps you can install offline, but I'm assuming it could be used to be malicious. But what all could it do? How destructive could it be? And is there even a limit; a system to protect you from stuff like this?

# Answer
Rooting a device with an APK file is definitely possible.

In reality it depends on two factors:

1. The age of the device software
2. The amount of money you are willing to pay to for exploit software

The device software age is important as usually you can say the older the device the more security vulnerabilities it has and therefore there is a higher chance to get a combination that allows you to root the device.

For example the very old devices can all be rooted using the TowelRoot app (which uses AFAIR an kernel exploit).

The price you are willing to pay for an exploit is important as you can buy exploits (even zero day exploits that are not known to Google or the device manufacturer).

Once a malicious APK has been installed it can use the incorporated exploits to attack your system. Once it managed to find a working exploit to get root it can do anything you could do with root permissions, too. This includes installing code persistently into your system, redirecting traffic, extract passwords and other secrets, ...
> 1 votes

---
Tags: apk
---


title: Disable xposed from TWRP

text:
# Question
Title: Disable xposed from TWRP
An xposed module screwed my interface. It's all black.

I can't access /data/data from within TWRP due to some stupid encription problem.

Is there another way to disable xposed ?

Losing data is out of the question.

Can't access data through ADB either: debugging is disabled

---

**Update:**

**Too late.**

Did something on TWRP and lost everything. Even the ROM got corrupted. Had to reflash EVERYTHING

Chaos was going on: the screen was not only black, but completely irresponsible. The only dialog available was the Turn Off/Reboot. Safe mode useless. TWRP showed Internal and External storages as 0MB. Couldn't mount either. Not even system could be mounted. Written... even less.

Maybe all this had something to do with encryption. I could never disable encryption on this phone (apparently it is impossible)

If it still has some use:

XT1925-5 (Moto G6)

TWRP 3.3.1.0

Boot, Xposed and Magisc were all flashed by either fastboot or TWRP

I can't remember the exposed version. The module was something like P-fy (change appearance of Oreo to look like Pie. Stay away from this crap)

---

**Update 2:**

There seems to be a way to disable xposed by machine gunning any hardware button after logo during boot. Can't test now. I was trying to cripple xposed by modding something at data/data/. Hard way it seems.

---

**Finally:** For the reasons above, I can't evaluate the answers of those who attempted to help. Hope it helps the next guy. By me, the thread can be deleted.

# Answer
> 0 votes
There is an Xposed disabler zip file that can be found on this thread from Xda-developers. In case you installed the systemless Xposed, I am not sure if it will be disable. You need to install the zip from TWRP as you would for other zip files.

# Answer
> 0 votes
If it is systemless root (most likely) , a couple of methods mentioned in the last part of my answer How to install EdXposed on Android 10 without triggering safety net. It's a repetition but it may help those seeking a specific answer for this :

1. Magisk Manager for Recovery Mode (mm). This module can be installed directly from Magisk but *it will not work* because it hasn't been updated to support Magisk versions beyond 19. You need to boot into TWRP (if TWRP is not permanently installed) and sideload the module. Next,from the recovery terminal run `mm or sh /sdcard/mm` and disable all modules or the offending module and reboot. (Tip: double click for *enter*)
2. Grant shell privileges to Magisk (this would have security implications, I guess) . Source

> The best way is to grant shell su privileges with magisk in advanced by doing `adb shell` then `su` . Magisk will then ask to grant root to shell and you can use it even while bootlooping. If you were to bootloop you'd then run `adb shell` then `touch /data/adb/modules/riru_edxposed_sandhook/disable` (or YAHFA ).

---
Tags: adb, twrp, xposed-framework
---


title: Disable Call Waiting

text:
# Question
Title: Disable Call Waiting
Is there a way on Android to disable call waiting?

Quite often I'll be in a conference call and suddenly one of my friends tries to call me when I'm in the middle of discussing something quite complicated.

The phone will start blipping at me to indicate the second call is coming in. I'm really not great at multi-tasking and this completely throws me from the discussion I'm already in.

Is there a way to set the phone to redirect the secondary caller straight to voicemail?

I'm using a Motorola One Vision.

# Answer
So I've discovered there is a way of doing this. I found this answer on Quora:

https://www.quora.com/Where-is-the-call-waiting-option-on-Android-7

There's a video there and the answer is essentially :

* Open the phone app Press the Menu button (3 dots top right)
* Press Settings
* Press Calling Accounts
* Press on your call Operator (Was EE in my case)
* Press Additional Settings
* Slide Call Waiting to disabled
> 2 votes

---
Tags: calls, call-waiting
---


# Question
Title: Does Airplane Mode allow GPS location to pass through?
This is what I saw when my plane was taxing to the runway at CDG:

Airplane mode was on and all other transmissions (except Location), including WiFi, mobile data, NFC and Bluetooth were off. *Location **was not** manually turned on by me, after I enabled Airplane Mode. It remained turned on*.

What am I missing? Is GPS now so widely accepted on-board planes that Android changed its configuration to let this kind of signal/communication to pass through Airplane mode "block"?

I believe that this three year old answer isn't a duplicate, because at that time (2016) *Location* was generally "included" in Airplane mode and was turned off by enabling it.

# Answer
GPS is a receive-only technology. There are satellites in orbit around the planet and these satellites transmit. Your device receives these signals, but does not communicate back to the satellites. Using your device with GPS is no more dangerous than using it without GPS.

Airplane mode is basically equivalent to "turn off transmitters", though you can also reenable WiFi and Bluetooth. Using GPS is completely consistent with transmitters being disabled.

Assisted GPS is a way of improving the time to first fix. Your device communicates to local non-satellite infrastructure (a cell tower) and receives information about what satellites are currently in view for the local area and orbit corrections. Satellites also communicate this information, but it is much faster to receive this from a local data connection. Without assisted GPS, your time to first fix may be ~12.5 minutes (obviously longer if you cannot receive a good signal). With assisted GPS, this can be reduced to seconds. Once you have a fix, assisted GPS is equivalent to unassisted GPS.

With airplane mode enabled, your device will not use assisted GPS because it cannot communicate with the assisted GPS infrastructure. It will use the standalone mode. This is why people may suggest to acquire a GPS fix on the ground before you start your flight; it's easier for your device to acquire a fix with a data connection and preserve a state where you get location updates than it is to cold start in-flight.
> 84 votes

---
Tags: gps, airplane-mode
---


# Question
Title: Samsung Note 5: Heimdall recovery flash completes, but device stuck "Downloading..."
I downloaded TWRP from twrp.me, and ran

`heimdall flash --RECOVERY recovery.img --no-reboot`

On my Samsung S5 that was in Download Mode. `heimdall` seems to have completed successfully:

```
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Releasing device interface...

```

But the phone remains in this state:

Notice the download bar is about 99% of the way there. Forcing a reboot to the phone from this state makes it stuck on the "Samsung" loading screen.

Edit: Product name is `SM-N920C`, CA\_ type is `CA_2`.

How might I fix this?

# Answer
> 0 votes
This seems to happen if you download the wrong `twrp` \- I had downloaded the S5 twrp. The only other thing to note is when in the stuck `Downloading...` screen, you can hold Power + Volume Down button to turn off the device.

---
Tags: samsung, recovery-mode, twrp, lineageos, heimdall
---


title: Samsung 7 active, #*#*4636#*#*?

text:
# Question
Title: Samsung 7 active, #*#*4636#*#*?
Hello when putting this code into the phone dialer ,under the usage time ,is that total time used or just that time?anyone know,thanks in advance

# Answer
The usage time is the total time when the app is/was in the foreground; meaning the total time when you are/were interacting with an app. When the app is in the background, although in use (for example, a music app), that time is not included in the total time under "usage time".
> 1 votes

---
Tags: samsung
---