title: Connecting to WiFi via ADB Shell

text:
# Question
Title: Connecting to WiFi via ADB Shell
I've tried all publicly discussed methods I could find to connect to WiFi via ADB on a phone with a broken screen (no display/no touch). The closest I have got is via `wpa_cli` using the method #1 described below.

Other methods that I tried are also mentioned but with no success. My goal for this broken phone is to use it as a headless server either via LinuxDeploy or native apps for Android, and for that I need to get VNC running and for that I need to connect to Wifi somehow.

Solutions for connecting to Wifi OR otherwise getting VNC access to the Android display (using ADB usb only) are welcome. I don't have a USB-C Network card so using that isn't an option at this stage.

### Method #1 - Using WPA\_CLI

In this case I leave /data/misc/wifi/wpa\_supplicant.conf and /data/misc/wifi/WifiConfigStore.xml untouched and just pop into `wpa_cli` using `adb shell`

### wpa\_cli Setup

```
> add_network
0
> set_network 0 scan_ssid 1
OK
> set_network 0 ssid "my_ssid"
OK
> set_network 0 key_mgmt WPA-PSK
OK
> set_network 0 psk "my_wifi_pass"
OK
> enable_network 0
OK
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:00:00:00:00:00 SSID=
<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>Trying to associate with SSID 'fy-huawei-m9'
<3>CTRL-EVENT-STATE-CHANGE id=-1 state=5 BSSID=00:00:00:00:00:00 SSID=
<3>CTRL-EVENT-STATE-CHANGE id=0 state=6 BSSID=00:00:00:00:00:00 SSID=fy-huawei-m9
<3>Associated with 50:01:d9:41:d7:00
<3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
<3>CTRL-EVENT-STATE-CHANGE id=0 state=7 BSSID=50:01:d9:41:d7:00 SSID=fy-huawei-m9
<3>CTRL-EVENT-STATE-CHANGE id=0 state=8 BSSID=50:01:d9:41:d7:00 SSID=fy-huawei-m9
<3>WPA: Key negotiation completed with 50:01:d9:41:d7:00 [PTK=CCMP GTK=CCMP]
<3>CTRL-EVENT-CONNECTED - Connection to 50:01:d9:41:d7:00 completed [id=0 id_str=]
<3>CTRL-EVENT-STATE-CHANGE id=0 state=9 BSSID=50:01:d9:41:d7:00 SSID=fy-huawei-m9
<3>CTRL-EVENT-DISCONNECTED bssid=50:01:d9:41:d7:00 reason=3 locally_generated=1
<3>CTRL-EVENT-STATE-CHANGE id=0 state=0 BSSID=50:01:d9:41:d7:00 SSID=fy-huawei-m9
<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS

```

Looks like the wifi interface associates momentarily with the SSID but then immediately disconnects.

Logcat Output
```
01-01 00:16:25.358  1074  1913 D WifiService: setWifiEnabled: true pid=2849, uid=0, package=com.android.shell
01-01 00:16:25.358  1074  1913 I WifiService: setWifiEnabled package=com.android.shell uid=0 enable=true
01-01 00:16:25.362   756   756 I android.hardware.wifi@1.0-service: Wifi HAL started
01-01 00:16:25.371   756   756 I android.hardware.wifi@1.0-service: Wifi driver is ready: Success
01-01 00:16:25.625   756   756 I WifiHAL : Initializing wifi
01-01 00:16:25.625   951   963 I LOWI-8.5.0.3.a: [LOWIController] isWifiEnabled: Wifi is now enabled
01-01 00:16:25.635   756   756 I WifiHAL : mpdu_size_threshold : 128, aggressive_statistics_gathering : 0
01-01 00:16:25.636  1074  1675 I WifiVendorHal: Vendor Hal started successfully
01-01 00:16:25.636  1074  1675 D WificondControl: Setting up driver for client mode
01-01 00:16:25.770  1074  1675 D WifiStateMachine: Setting OUI to DA-A1-19
01-01 00:16:25.772   756   756 E WifiHAL : wifi_set_scanning_mac_oui: requestResponse Error:-1
01-01 00:16:25.774  1074  1675 E WifiVendorHal: setScanningMacOui(l.1445) failed {.code = ERROR_UNKNOWN, .description = unknown}
01-01 00:16:25.784  1074  1675 I WifiVendorHal: Driver: 5.1.1.28U Firmware: FW:1.0.0.133.0 HW:WCN3990_V2.1
01-01 00:16:25.799  1074  1110 I WifiService: requestActivityInfo uid=1000
01-01 00:16:25.799  1074  1110 I WifiService: reportActivityInfo uid=1000
01-01 00:16:25.799  1074  1110 I WifiService: getSupportedFeatures uid=1000
01-01 00:16:25.835  1074  1675 D WifiConnectivityHelper: Firmware supported feature set: 48931bf
01-01 00:16:25.836  1074  1677 I WifiScanningService: wifi driver loaded with scan capabilities: max buckets=6
01-01 00:16:25.840  1074  1675 D WifiConnectivityHelper: Firmware roaming supported with capabilities: max num blacklist bssid=16 max num whitelist ssid=4
01-01 00:16:25.841  1074  1675 D WifiNative-wlan0: configureRoaming
01-01 00:16:25.842  1074  1675 I WifiStateMachine: disconnectedstate enter
01-01 00:16:25.844  1074  1675 D WifiStateMachine: resetting EAP-SIM/AKA/AKA' networks since SIM was changed
01-01 00:16:25.844  1074  1675 I chatty  : uid=1000(system) WifiStateMachin identical 2 lines
01-01 00:16:25.845  1074  1675 D WifiStateMachine: resetting EAP-SIM/AKA/AKA' networks since SIM was changed
01-01 00:16:25.854  1074  1110 I WifiService: requestActivityInfo uid=1000
01-01 00:16:25.854  1074  1110 I WifiService: reportActivityInfo uid=1000
01-01 00:16:25.854  1074  1110 I WifiService: getSupportedFeatures uid=1000
01-01 00:16:25.939  1835  1973 I QCNEJ/CndHalConnector: -> SND notifyWifiP2pStateChanged(5)
01-01 00:16:55.456  1074  1913 D WifiService: setWifiEnabled: true pid=2876, uid=0, package=com.android.shell
01-01 00:16:55.456  1074  1913 I WifiService: setWifiEnabled package=com.android.shell uid=0 enable=true
01-01 00:17:35.524  1074  1110 I WifiService: requestActivityInfo uid=1000
01-01 00:17:35.524  1074  1110 I WifiService: reportActivityInfo uid=1000
01-01 00:17:35.525  1074  1110 I WifiService: getSupportedFeatures uid=1000
01-01 00:19:35.647   756  2865 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0x6a
01-01 00:19:36.272   756  2865 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0x6b
01-01 00:19:36.441  1074  1675 W WifiConfigManager: Looking up network with invalid networkId -1
01-01 00:19:36.442  1074  1675 W WifiStateMachine: Connected to unknown networkId -1, disconnecting...
01-01 00:19:37.260   756  2865 E WifiHAL : Few pkt stats messages missed: rcvd = 0, prev = 0
01-01 00:19:37.260   756  2865 I WifiHAL : Fate Tx-Rx: Packet fate stats stop received
01-01 00:19:58.058  1074  1110 I WifiService: requestActivityInfo uid=1000
01-01 00:19:58.058  1074  1110 I WifiService: reportActivityInfo uid=1000
01-01 00:19:58.059  1074  1110 I WifiService: getSupportedFeatures uid=1000

```

The key line here are:

```
01-01 00:19:36.441  1074  1675 W WifiConfigManager: Looking up network with invalid networkId -1
01-01 00:19:36.442  1074  1675 W WifiStateMachine: Connected to unknown networkId -1, disconnecting...

```

Looks like the WifiConfigManager won't let me connect to a network which isn't defined in /data/misc/wifi/WifiConfigStore.xml

## Method #2 - Naive definition in wpa\_supplicant.conf

In this attempt I simply define the entwork in wpa\_supplicant.conf and don't touch /data/misc/wifi/WifiConfigStore.xml

Here is what my wpa\_supplicant.conf looks like:

### wpa\_supplicant.conf

```
update_config=1
ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi
eapol_version=1
ap_scan=1
fast_reauth=1

network={
    ssid="my_ssid"
    psk="my_wifi_pass"
    key_mgmt=WPA-PSK
    priority=241
}

```

I then proceed to disable and re-enable the wifi service using `svc wifi disable` and `svc wifi enable`, and even reboot the phone but in both cases it doesn't seem to even attempt connecting to the network. The `invalid networkId -1` message still pops up.

### Logcat Output:

```
01-01 00:00:06.649  1062  1062 D WifiService: resetting networks because SIM was removed
01-01 00:00:06.649  1062  1062 D WifiService: resetting country code because SIM is removed
01-01 00:00:06.649  1062  1062 D WifiService: resetting networks because SIM was removed
01-01 00:00:06.649  1062  1062 D WifiService: resetting country code because SIM is removed
01-01 00:00:06.649  1062  1670 D WifiStateMachine: resetting EAP-SIM/AKA/AKA' networks since SIM was changed
01-01 00:00:06.650  1062  1670 D WifiStateMachine: resetting EAP-SIM/AKA/AKA' networks since SIM was changed
01-01 00:00:07.055  1062  1073 D WificondControl: Scan result ready event
01-01 00:00:07.061  1062  1670 W WifiConfigManager: Looking up network with invalid networkId -1

```

## Method #3 - Copying WifiConfigStore.xml from a different phone connecting to this SSID

As a last ditch attempt, I restored the original wpa\_supplicant.conf and copied over WifiConfigStore.xml from a phone running the same Android version that successfully connects to the WiFi network in question. Then I rebooted the phone

### WifiConfigStore.xml

```
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<WifiConfigStoreData>
    <int name="Version" value="1" />
    <NetworkList>
        <Network>
            <WifiConfiguration>
                <string name="ConfigKey">"fy-huawei-m9"WPA_PSK</string>
                <string name="SSID">"fy-huawei-m9"</string>
                <null name="BSSID" />
                <string name="PreSharedKey">"THEFORTUNE"</string>
                <null name="WEPKeys" />
                <int name="WEPTxKeyIndex" value="0" />
                <boolean name="HiddenSSID" value="false" />
                <boolean name="RequirePMF" value="false" />
                <byte-array name="AllowedKeyMgmt" num="1">02</byte-array>
                <byte-array name="AllowedProtocols" num="1">0b</byte-array>
                <byte-array name="AllowedAuthAlgos" num="1">01</byte-array>
                <byte-array name="AllowedGroupCiphers" num="1">0f</byte-array>
                <byte-array name="AllowedPairwiseCiphers" num="1">06</byte-array>
                <boolean name="Shared" value="true" />
                <int name="Status" value="0" />
                <null name="FQDN" />
                <null name="ProviderFriendlyName" />
                <null name="LinkedNetworksList" />
                <null name="DefaultGwMacAddress" />
                <boolean name="ValidatedInternetAccess" value="true" />
                <boolean name="NoInternetAccessExpected" value="false" />
                <int name="UserApproved" value="0" />
                <boolean name="MeteredHint" value="false" />
                <int name="MeteredOverride" value="0" />
                <boolean name="UseExternalScores" value="false" />
                <int name="NumAssociation" value="22" />
                <int name="CreatorUid" value="1000" />
                <string name="CreatorName">android.uid.system:1000</string>
                <string name="CreationTime">time=08-02 08:39:20.369</string>
                <int name="LastUpdateUid" value="1000" />
                <string name="LastUpdateName">android.uid.system:1000</string>
                <int name="LastConnectUid" value="1000" />
                <boolean name="IsLegacyPasspointConfig" value="false" />
                <long-array name="RoamingConsortiumOIs" num="0" />
            </WifiConfiguration>
            <NetworkStatus>
                <string name="SelectionStatus">NETWORK_SELECTION_ENABLED</string>
                <string name="DisableReason">NETWORK_SELECTION_ENABLE</string>
                <string name="ConnectChoice">"fy-net-ac"WPA_PSK</string>
                <long name="ConnectChoiceTimeStamp" value="1534074466002" />
                <boolean name="HasEverConnected" value="true" />
            </NetworkStatus>
            <IpConfiguration>
                <string name="IpAssignment">DHCP</string>
                <string name="ProxySettings">NONE</string>
            </IpConfiguration>
        </Network>
    </NetworkList>
    <PasspointConfigData>
        <long name="ProviderIndex" value="0" />
    </PasspointConfigData>
</WifiConfigStoreData>

```

### wpa\_supplicant.conf

```
01-01 00:00:05.424  1073  1637 D WifiConfigStore: Reading from user store completed in 4 ms.
01-01 00:00:05.440  1073  1637 D WifiConfigStore: Writing to stores completed in 16 ms.
01-01 00:00:05.440  1073  1637 D WIFI    : got request NetworkRequest [ TRACK_DEFAULT id=6, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.442  1073  1637 D WifiConnectivityHelper: Firmware supported feature set: 48931bf
01-01 00:00:05.442  1073  1637 D WifiConnectivityHelper: Firmware roaming supported with capabilities: max num blacklist bssid=16 max num whitelist ssid=4
01-01 00:00:05.443  1073  1637 D WifiNative-wlan0: configureRoaming
01-01 00:00:05.443  1073  1637 D WIFI    : got request NetworkRequest [ TRACK_DEFAULT id=3, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.443  1073  1637 D WIFI    : got request NetworkRequest [ TRACK_DEFAULT id=9, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.443  1073  1637 D WIFI    : got request NetworkRequest [ REQUEST id=1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.443  1073  1637 D WIFI_UT : got request NetworkRequest [ TRACK_DEFAULT id=6, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.443  1073  1637 D WIFI_UT : got request NetworkRequest [ TRACK_DEFAULT id=3, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.443  1073  1637 D WIFI_UT : got request NetworkRequest [ TRACK_DEFAULT id=9, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.443  1073  1637 D WIFI_UT : got request NetworkRequest [ REQUEST id=1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ] with score 0
01-01 00:00:05.445  1073  1676 I SupplicantP2pIfaceHal: Registering ISupplicant service ready callback.
01-01 00:00:05.447  1073  1689 I SupplicantP2pIfaceHal: IServiceNotification.onRegistration for: android.hardware.wifi.supplicant@1.0::ISupplicant, default preexisting=true
01-01 00:00:05.447  1073  1689 I zygote64: Looking for service android.hardware.wifi.supplicant@1.0::ISupplicant/default
01-01 00:00:05.449  1073  1689 D SupplicantP2pIfaceHal: entering getInterface()
01-01 00:00:05.449  1073  1689 D SupplicantP2pIfaceHal: getInterface() completed successfully.
01-01 00:00:05.449  1073  1689 D SupplicantP2pIfaceHal: leaving getInterface() with result = android.hardware.wifi.supplicant@1.0::ISupplicantP2pIface@Proxy
01-01 00:00:05.450  1073  1689 D SupplicantP2pIfaceHal: entering registerCallback()
01-01 00:00:05.450  1073  1689 D SupplicantP2pIfaceHal: registerCallback() completed successfully.
01-01 00:00:05.450  1073  1689 D SupplicantP2pIfaceHal: leaving registerCallback()
01-01 00:00:05.450  1073  1689 I SupplicantP2pIfaceHal: Completed initialization of ISupplicant interfaces.
01-01 00:00:05.484  1073  1632 I WifiService: getConfiguredNetworks uid=1000
01-01 00:00:05.543  1073  1073 D WifiService: resetting networks because SIM was removed
01-01 00:00:05.543  1073  1073 D WifiService: resetting country code because SIM is removed
01-01 00:00:05.543  1073  1637 D WifiStateMachine: resetting EAP-SIM/AKA/AKA' networks since SIM was changed
01-01 00:00:05.544  1073  1073 D WifiService: resetting networks because SIM was removed
01-01 00:00:05.544  1073  1073 D WifiService: resetting country code because SIM is removed
01-01 00:00:05.544  1073  1637 D WifiStateMachine: resetting EAP-SIM/AKA/AKA' networks since SIM was changed
01-01 00:00:05.556  1073  1676 D SupplicantP2pIfaceHal: entering setWpsDeviceName(Android_d3d3)
01-01 00:00:05.556  1073  1676 D SupplicantP2pIfaceHal: setWpsDeviceName(Android_d3d3) completed successfully.
01-01 00:00:05.556  1073  1676 D SupplicantP2pIfaceHal: leaving setWpsDeviceName(Android_d3d3)
01-01 00:00:05.556  1073  1676 D SupplicantP2pIfaceHal: entering setSsidPostfix(-Android_d3d3)
01-01 00:00:05.557  1073  1676 D SupplicantP2pIfaceHal: setSsidPostfix(-Android_d3d3) completed successfully.
01-01 00:00:05.557  1073  1676 D SupplicantP2pIfaceHal: leaving setSsidPostfix(-Android_d3d3)
01-01 00:00:05.557  1073  1676 D SupplicantP2pIfaceHal: entering setWpsDeviceType(10-0050F204-5)
01-01 00:00:05.557  1073  1676 D SupplicantP2pIfaceHal: setWpsDeviceType(10-0050F204-5) completed successfully.
01-01 00:00:05.558  1073  1676 D SupplicantP2pIfaceHal: leaving setWpsDeviceType(10-0050F204-5)
01-01 00:00:05.558  1073  1676 D SupplicantP2pIfaceHal: entering setWpsConfigMethods(virtual_push_button physical_display keypad)
01-01 00:00:05.558  1847  1956 I QCNEJ/CndHalConnector: -> SND notifyWifiP2pStateChanged(5)
01-01 00:00:05.559  1073  1676 D SupplicantP2pIfaceHal: setWpsConfigMethods(virtual_push_button physical_display keypad) completed successfully.
01-01 00:00:05.559  1073  1676 D SupplicantP2pIfaceHal: leaving setWpsConfigMethods(virtual_push_button physical_display keypad)
01-01 00:00:05.559  1073  1676 D SupplicantP2pIfaceHal: entering getDeviceAddress()
01-01 00:00:05.559  1073  1676 D SupplicantP2pIfaceHal: getDeviceAddress() completed successfully.
01-01 00:00:05.560  1073  1676 D SupplicantP2pIfaceHal: leaving getDeviceAddress() with result = 82:ad:16:7a:57:57
01-01 00:00:05.560  1073  1676 D SupplicantP2pIfaceHal: entering flush()
01-01 00:00:05.561  1073  1676 D SupplicantP2pIfaceHal: flush() completed successfully.
01-01 00:00:05.561  1073  1676 D SupplicantP2pIfaceHal: leaving flush()
01-01 00:00:05.561  1073  1676 D SupplicantP2pIfaceHal: entering serviceFlush()
01-01 00:00:05.561  1073  1676 D SupplicantP2pIfaceHal: serviceFlush() completed successfully.
01-01 00:00:05.561  1073  1676 D SupplicantP2pIfaceHal: leaving serviceFlush()
01-01 00:00:05.561  1073  1676 D SupplicantP2pIfaceHal: entering listNetworks()
01-01 00:00:05.562  1073  1676 D SupplicantP2pIfaceHal: listNetworks() completed successfully.
01-01 00:00:05.562  1073  1676 D SupplicantP2pIfaceHal: leaving listNetworks() with result = []
01-01 00:00:05.562  1073  1676 D SupplicantP2pIfaceHal: entering saveConfig()
01-01 00:00:05.569  1073  1676 D SupplicantP2pIfaceHal: saveConfig() completed successfully.
01-01 00:00:05.569  1073  1676 D SupplicantP2pIfaceHal: leaving saveConfig()
01-01 00:00:06.108  1073  1834 D WificondControl: Scan result ready event
01-01 00:00:06.113  1073  1637 W WifiConfigManager: Looking up network with invalid networkId -1

```

Still no luck. Don't know what else I can do at this point but not giving up just yet.

# Answer
> 1 votes
`svc wifi enable|disable` should work if it's only about turning WiFi ON and OFF. Or you can use `setWifiEnabled` method directly by calling service `wifi`. On Android 8.1 its code (order) is `24`, so you can do from `adb shell`:

```
~$ service call wifi s16 null i32 1    # Trun WiFi ON
~$ service call wifi s16 null i32 0    # Trun WiFi OFF

```

But since you also need to add new network to connect, it becomes difficult to go through Android APIs from commandline.

## CONNECTING TO WIFI FROM COMMANDLINE:

Another approach is to use `wpa_supplicant` (and optionally `wpa_cli`) directly from CLI, don't rely on pre-generated `WifiConfigStore.xml` or `wpa_supplicant.conf`.

The following script includes the simple steps:

```
#!/system/bin/sh

IFACE=wlan0                 # WiFi interface name
SSID=abcxyz                 # WiFi network name
PSK=foobarfoobar            # WiFi network password
DIR=/data/local/tmp/WIFI    # temporary directory
mkdir -p $DIR

if [ "$1" = stop ]
then
    pkill wpa_supplicant
    ip ru del lookup main
    ip r f table main
    ip a f dev $IFACE
    rm -rf $DIR
    ndc resolver setnetdns 0 '' 0.0.0.0
    exit
fi

# set interface up, add rule to lookup into 'main' table
svc wifi disable
for i in /sys/class/net/*; do ip link set down dev $(basename $i); done
ip link set dev lo up
ip link set dev $IFACE up
ip rule add lookup main

# destroy set network  if any
ndc network default set 0

# create configuration file
<<-CONF cat >$DIR/wpa_supplicant.conf
    network={
        ssid="$SSID"
        psk="$PSK"
        scan_ssid=1
    }
CONF

# scan WiFi and connect to access point
wpa_supplicant -B -i $IFACE -c $DIR/wpa_supplicant.conf
until iw dev $IFACE link | grep -q '^Connected to'; do sleep 1; done

# create 'udhcpc' script
<<-'SCRIPT' cat >$DIR/udhcpc_default.script
#!/system/bin/sh

[ "$1" = bound ] || exit 0

# set IP address, add gateway route and set DNS
ip address add $ip/$mask dev $interface
ip route add default via $router dev $interface
ndc resolver setnetdns 0 '' $dns
SCRIPT

# start DHCP client to obtain IP from server
chmod 0755 $DIR/udhcpc_default.script
busybox udhcpc -v -f -q -i $IFACE -s $DIR/udhcpc_default.script

```

<sup> * Omit the DHCP part if you want to set IP, route and DNS manually.
* I use my own built `wpa_supplicant` binary. `udhcpc` is a busybox applet, `ip`, `iw` and `ndc` are part of stock Android.
* For further options see `wpa_supplicant.conf` and `udhcpc` samples. </sup>

**DNS:**

Apps built with Android SDK depend on Bionic libc resolver for DNS queries, so we need to set DNS servers through native APIs. But still the Java network stack is down, so some apps depending on Android APIs may not behave normally. Programs linked against other C libraries may require `resolv.conf` to exist. See details in How to configure DNS? and How does Android OS do DNS name resolution?

**WIFI DRIVER AND FIRMWARE:**

Another problem could be to load WiFi in-kernel driver (as module) and firmware on boot. This is handled by vendor specific `wcnss_service` which runs in combination with `android.hardware.wifi@1.0-service` HAL. For instance on my device with *Qualcomm Atheros Prima* WLAN module the service loads firmware (`WCNSS_qcom_cfg.ini` and related `WCNSS_*`) files from `/vendor/firmware/wlan/prima/` or `/persist`.

Once you turn on WiFi after boot, all services are started (including `wificond`) and firmware is loaded. You can check using `rfkill` or `iw phy` commands or directly from `/sys/class/rfkill`. To manually load driver:

```
~# echo -n sta >/sys/module/wlan/parameters/fwpath

```

Some more details can be found here, here and here.

When loading driver/firmware WiFi interface should already be created. Check using `iw dev` or `ip link`. Or you can manually create:

```
~# iw $(busybox rfkill -no device list wifi) interface add $IFACE type managed

```

---
Tags: wi-fi, adb, shell, broken-screen, wpa-supplicant
---


# Question
Title: Is data transfer from a Pixel 3a XL possible via USB 3?
The Google Pixel 3a XL has a USB C port.

Is it possible to connect it to a computer that only has a USB 3 port to transfer data between the computer and the Pixel 3a XL?

# Answer
> 2 votes
According to GSM arena the Google Pixel 3a has an USB 2.0 type-C connector.

Note that the USB transfer speed is independent of the used USB connector type.

Therefore USB 3.0 is not supported by the Pixel 3a - you can only use USB 2.0 connections for data transfer.

---
Tags: usb, usb-connection-mode, data-transfer, usb-c, google-pixel-3a-xl
---


# Question
Title: Install arbitrary apk from filesystem on Android 10?
Looks like in Android 10, "install from unknown sources" was changed from a global setting to a per-app permission. Apparently in order to install APKs now I need to whitelist each app that I'm trying to do this from. However, none of the apps I actually need to do this from (default system "Files" browser and Root Browser) even have this setting. Root Browser has a context menu to open with Package Installer but it doesn't work?

Do I need to get another third-party app just to install APKs from the filesystem? This is so lame. Thanks.

Edit: I am on a Pixel 3 running stock Android 10.0.

# Answer
> 2 votes
To disable /enable this permission :

Settings → notifications→ Special app access→ Install unknown apps →*your app*

AFAIR, this change came about from Oreo (Android 8)

Solid explorer and Mixplorer are the one's I use and they both install apk's (OnePlus 7, Android 10)

(From Mixplorer - click to enlarge)

---
Tags: apk, side-loading, android-10
---


# Question
Title: Fix ERR_PROXY_CONNECTION_FAILED due to a change in global proxy by mobile security framework through adb shell on non rooted phone
The problem in a non rooted Samsung Galaxy S7 smartphone:

* ERR\_PROXY\_CONNECTION\_FAILED in Google Chrome
* No internet access on cellphone wireless settings
* No internet access on cellphone mobile data setting
* only working Whatsapp or Google Duo

# Answer
> 3 votes
**The cause**

```
[INFO] Creating Dynamic Analysis Environment
[ERROR] Error Running ADB Command
[INFO] Android Version identified as 8.0
[INFO] Environment MobSFyed Check
[WARNING] This Android instance is not MobSfyed.
MobSFying the android runtime environment
[INFO] Android Version identified as 8.0
[ERROR] Make sure a Genymotion Android x86instance is running
[INFO] Installing MobSF RootCA
[ERROR] Error Running ADB Command
[INFO] Installing MobSF Clipboard Dumper
[ERROR] Error Running ADB Command
[INFO] MobSFying Completed!
[INFO] Starting HTTPs Proxy on 1337
[INFO] Enabling ADB Reverse TCP on 1337
[INFO] Setting Global Proxy for Android VM
[INFO] Starting Clipboard Monitor
[INFO] Getting screen resolution
[INFO] Testing Environment is Ready!

```
* As non rooted device, MobSF fails (`[ERROR] Error Running ADB Command`) but it succedded in changing the global proxy setting (`[INFO] Setting Global Proxy for Android VM`)

**The solution**

```
adb shell settings put global http_proxy :0

```
* In spite of the wifi configuration or mobile data configuration (through APN) is set to proxy none, this global configuration is onlye change through adb shell

---
Tags: adb, proxy
---


# Question
Title: Prevent outgoing international calls except when made through Google voice
Is there any way to prevent outgoing international calls except when made through Google voice, and without having to ask the mobile network carrier to block them?

I am the way of Is there a way/app to block outgoing international calls, without activating the network provider's International Call Barring? but I still want to go voice to be able to make international calls.

# Answer
> 0 votes
Here is how you can set up such configuration:

1. Go to **Outgoing calls** setting in GV preferences

2. Tick **International calls only** inside this menu

---
Tags: samsung-galaxy-s-3, calls, google-voice
---


# Question
Title: Installed LineageOs16 on oneplus5 but I get black due to wrong firmware update how I can fix it?
On my Oneplus5 I attempted to install twrp and lineageOS rom. The steps I followed were:

1. Unlocked my bootloader
2. Installed latest twrp (3.3.x)
3. Installed firmware version 3.1.4
4. Installed lineage OS 16

But instead of installing the firmware for lineageos16 I installed the firmware for lineageos 15 (firmware 5.4.1), so on boot I get a black screen.

How I can reset my phone in order to get it back and start all over again? If there's a way without reset back to square one I would appriciate that.

**Edit1:** After managing to boot into revovery again by using an older twrp version, I installed the firmware version `9.0.9` and rebooted though I still get black screen.

I managed to boot into recovery following these steps:

1. I downloaded the oldest twrp version I could find (v 3.1.1)
2. By pressing `Power Up`+Start button I placed the device into fastboot mode.
3. I run `fastboot boot twrp-3.1.1-0-cheeseburger.img` ( `twrp-3.1.1-0-cheeseburger.img` is the twrp version 3.1.1) I temporarily booted into the older version of twrp.
4. I side loaded the firmware version `9.0.9`.

# Answer
You are close to fix the issue and have the lineageOS in your device. The only thing left to do in order to fix the issue is to boot into the recovery once again ( As far as I understand the twrp v3.3.1 is installed and temporaly booted into the oldest one).

Please follow the following steps:

1. Boot into recovery mode via pressig `Volume Down` \+ `Power`
2. Then on twrp enable the sideload.
3. Run `adb sideload lineage-16.0-20191220-nightly-cheeseburger-signed.zip` (`lineage-16.0-20191220-nightly-cheeseburger-signed.zip` is the latest one for now please replace it with the build of lineageos you desire as long as it is the version 16 of it)

So in other words you just need to reflash the lineageos using the latest twrp version you installed.
> 0 votes

---
Tags: twrp, lineageos
---


# Question
Title: LineageOS / bardockpro / recent LineageOS installation package do not work
I have been happily using and occasionally upgrading a bardockpro device for many months.

However, in summer 2019 the device stopped booting into upgrades that were released after July. The most recent build that works, insofar as I know, is the 20190710 nightly build.

Since then occasionally I tried newer builds - never successfully. I habve also flashed stock rom. and then retried recent lineageos builds. No success.

The problem, in my reading of an issue is that the device is not critically unlocked. Therefore not all parts can effectively can be flashed.

so, one question was: how to get

```
Device critical unlocked: false

```

to

```
Device critical unlocked: true

```

?

However, my reading of the issue was misleading - and this was not the question. The question was way less specific: how to get the device working with the updated builds?

# Answer
Well, the solution emerged in a conversation in the German Android-Hilfe. The solution was to

* flash an older Stock ROM version.
* let the Stock ROM update itself, and in that process, seemingly, get all the partitions "right".

Afterwards I was able to install recent Lineage OS builds following the standard installation instructions.
> 1 votes

---
Tags: rom-flashing, lineageos, bootloader-lock, builds
---


# Question
Title: Displaying the saved name for self-phone number in WhatsApp
I have my own WhatsApp account's number stored as a contact in my mobile.

Theoretically, WhatsApp should detect my own number from the contacts list and show the name of the contact as set in the list of chats if I send myself a message.

The following screenshot shows the chat thread with my own phone number even though it's already saved in the contact.

Is it possible to display the name from the saved contact instead?

# Answer
> 3 votes
Theoretically, it should. However, WhatsApp doesn't allow that. So, whilst you can still *somehow* start a chat with your own number and send messages, there's no way to make WhatsApp see it as a contact and show it with a name. I have tried saving it in different ways to no avail. I often use the self chat to save important messages and to take notes without having to send the message to a random contact. And for that I just type in my number to quickly get it there.

---
Tags: contacts, whatsapp-messenger
---


# Question
Title: Can you show advanced settings in android by default?
In almost all settings sub-menus in newer android versions, there is a item in the list called "Advanced" closest to the bottom, that shows additional settings when pressed. This is apparently a design goal called Progressive disclosure, according to Android Settings Design Guidelines

I am wondering if the "Progressive disclosure" feature can be disabled somehow, so that I am shown all settings in sub-menus by default.

# Answer
It is how the developer of that Android ROM designs the settings screen. There is no user-end setting to decide how the settings show up and /or to sort them in different ways. As it is a Google instruction to hide less used settings inside the "Advanced" menu, most developers will decide on pushing additional settings behind that menu item. In fact my current phone did that even when there weren't at least 3 items in the advanced menu.

Short answer: It is not possible to show the settings outside of the "Advanced" sub-menu. There's no way for users to disable the use of Progressive Disclosures.

Root and modification can help in adjusting the priority/place of that setting item. But that's probably too much effort to achieve much lesser.
> 2 votes

---
Tags: settings, menu
---


title: How to flash android AOSP 10 to device?

text:
# Question
Title: How to flash android AOSP 10 to device?
I used to run Android AOSP 6.1 on my Nexus 5 by manually flashing the boot, cache, system, userdata, recovery images one by one using fastboot. I managed to successfully flash Android 6.1 on my Nexus 5 following this tutorial https://www.youtube.com/watch?v=m5BMfvO9Xi0

I have managed to build Android AOSP 10 and my goal is to flash it to my Pixel 2. First thing I noticed is that the output dir looks a bit different now. There are a few different images and there is no more recovery.img. The Android 10 Factory 10 dir contains this images:

I tried to manually flash the boot, dtbo, system\_other, system, vbmeta & vendor images but the device ends up in a boot loop.

Does anyone know how to flash the Android 10 AOSP images to a device?

Thank you in advance!

# Answer
> 1 votes
The recovery is now built into the boot image instead of having a separate partition. So, a separate recovery image does not exist. The files you have are supposed to be flashed to their respective partitions:

Boot to boot, System to system, Vendor to vendor, Vbmeta to vbmeta, Dtbo to dtbo

You can avoid the system\_other as it is to build a dummy into your inactive boot slot. It isn't actually used. But if you want, you can flash it to the inactive slot. You check current active slot by using this command: `fastboot getvar current-slot`. Then flash to that slot by adding the slot suffix (example: If current slot is a, flash it to b - `fastboot flash system_b system_other.img`

Remember that you need to perform a wipe of internal storage from either fastboot (`fastboot -w`) or by going into the Android Recovery mode.

---
Tags: aosp, android-10
---


# Question
Title: Android automatically deletes content of my Downloads folder
Previously I had a Nokia 7.1 (Android 9) when I started to notice this issue. Every few time, the older images I had on my Download folder disappeared without I doing nothing. From time to time it happened again. I let this pass. Every time that ocurred, I manually download the images again, because I needed to have those images there.

Today, I have another smartphone (Multilaser MS50X, a brazilian cellphone with Android 8.1) and exactly after a month of started using it, the older images of my Download folder disappeared again!!!

I've checked some apps that I think it could be doing something like that:
* Google Chrome (downloads data to this folder)
* Google Photos (sync and backup images)
* File Manager + (access to data and folders)
* Quickpic (gallery app)

But no one have an option to "automatically delete Download folders content after a while".

I don't have any Clean App, neither use the function "Free up space" of Android. Also none of those cellphones had an option like "storage booster" or "smart storage" like state on this thread: Android phone automatically deletes photos?

Any clue where can I look? It's annoying

Regards

Update: When I open Google Photos, go to 'Photos on device', and select 'Download', I can see all the deleted images (the images that should be on that folder and it doesn't)

# Answer
> 0 votes
Check if you have storage manager enabled. It will automatically start deleting backed up photos and videos after they cross the selected timeline.

You can locate it in *Settings \> Storage \> Internal Storage \> Storage Manager*.

---
Tags: applications, backup, storage, delete
---


# Question
Title: SD applications return to Internal Memory
I have a Samsung J7 prime with Android 8.1, the issue is that my applications can be moved normally to external storage, but then it appears again in the internal memory. (when google play store updates the apps). Is there any way to avoid that?

# Answer
To avoid updating apps it can be changed in settings when updating is allowed. Or u can shut it down all together then manually run scans to pick and choose which app you want to update.
> 0 votes

---
Tags: sd-card, 8.1-oreo
---


# Question
Title: How can I turn on google maps speedometer alerts on exceeding the speed limits?
How can I turn on google maps speedometer alerts on exceeding the speed limits?

waze has a good system , it shows your speed and puts a red circle around it if you go over the speed limit.

But I don't see it on google maps

I am in the Uk and have read that google maps has rolled out that feature for the UK.. https://www.slashgear.com/google-maps-on-screen-speedometer-will-warn-you-if-youre-speeding-06579422/ "Aside from not being available on Android Auto yet, this new Google Maps feature is rolling out to users in limited markets rather slowly. Those include Argentina, Australia, Belgium, Brazil, Canada, Czech Republic, Germany, India, the Netherlands, Poland, Portugal, Sweden, the UK, and the US. No need to update anything as it seems to be a server-side switch that only Google can flip. The on-screen speedometer is just the most recent Waze feature added to Google Maps"

I see the speedometer, just not the alert when over the speed limit.

I see pictures on google images like

But not on my phone

I have gone to settings..navigation setings..driver options.. and I have speedometer turned on and 'driving notifications' turned on, they were on anyway by default. But still it doesn't show me speed limit.

As a workaround I wouldn't mine an app that shows the speed limit in the corner of the screen but I don't know of such a thing either. The closest I have is Waze which has the speedometer with alerts, and I can make google maps small and sit it in the middle of a waze window. But then google maps is very small. I don't like waze that much i'd rather not have to use it just for that.

# Answer
Both these apps appear to meet the requirements (not tested by me). I have requested OP to add/edit based on their tests.

> Features:
>
> • Automatically displays in any apps you choose (e.g. Google Maps)
>
> • Intelligent caching & fast refresh of speed limits
>
> • Sound alert when speed limit is exceeded
>
> • Speed limit tolerance: % and integer amounts
>
> • Transparency, size, and tap to hide setting

> Maps Speed Limits shows the current speed limit in Google Maps or any other app.
>
> Speed limit alert: play a sound when speeding

**Barlop / OP adds**

Looking at the screenshot below, you see on the left of the screenshot. (red circle aside), Velociraptor showing speed limit and speed.

Also on the left, you see the red circle, that's map speed limits. (not so necessary as Velociraptor shows both speed and speed limit anyway).

The speed mentioned on the very bottom is google maps saying that, google maps suddenly decided to state the speed!

I don't mind having both, sometimes the speed limits reported can differ, as the speed limits use a different database and they can update at different positions on the road. Velociraptor makes clear it uses OSM, and i'm not sure what database map speed limits uses.

They work internationally and have an option to switch between kph and mph.

Velocirapter also has quite comprehensive settings too and is pretty easy to navigate. And the google play app velociraptor page shows some screenshots of the settings it has too.

It is an overlay so google maps is open there, and any app showing the speed or speed limit is showing it as a floating overlay over it.

Here is another pic from here incase anybody doesn't believe that the above is google maps (it is). As is the pic below. And since its google maps it applies to works for whatever country you are in.
> 1 votes

---
Tags: google-maps-navigation
---


# Question
Title: Can an android phone be tracked on find my phone app etc if the sim has been removed and had an factory reset?
Can an android phone be tracked last location on find my phone app etc if the sim has been removed and had an factory reset?

# Answer
> 2 votes
Google help says

> To find, lock, or erase an Android phone, that phone must:
>
> Be turned on
>
> Be signed in to a Google Account
>
> Be connected to mobile data or Wi-Fi
>
> Be visible on Google Play
>
> Have Location turned on
>
> Have Find My Device turned on

After a factory reset, your account is removed from the phone and without SIM it's not connected to internet.

So **no**, it can't

---
Tags: applications
---


# Question
Title: Is it allowed to offer incentives for 5 star ratings on the Google Play app store?
I started using an Android app that is offering in-app incentives (unlocks) in return for 5 star ratings on the Google Play app store. Is this against Google Play's terms of service?

# Answer
> 45 votes
Highlighting one part of policy violation, related to what you say

> Here are some examples of common violations:
>
> Asking users to rate your app while offering an incentive

**Edit:**

# Answer
> 12 votes
It is against Google Policy, and also against The United States Federal Communications Commission's (FCC) advertising rules.

How to report such an app- You may have some luck by creating a post in https://support.google.com/googleplay/community. Don't be afraid to mention the app's name in there. The matter will be looked into by a moderator there who will then escalate the issue to Google staff.

I did the same thing in the Google Maps forum after an oil change place offered me a $10 discount for a 5 star review. He was taking the customer's cell phones and writing those reviews himself. He had over 500 reviews and after about a week they all disappeared.

---
Tags: google-play-store, app-ratings
---


# Question
Title: Are there ways wherein an app would think it's operating on a different phone?
That means the device ID, and IMEI and every information the app would be able to gather would be what I've pre-set.

It would, for all intents and purposes, be as if it's installed on a different phone and it wouldn't know anything about the phone where it's actually installed in.

Obviously this will require a phone to be rooted, which is the case already.

# Answer
> * Read identifiers (fake build serial number, Android ID, advertising ID, GSF ID)
> * Read network data (hide cell info, Wi-Fi networks, fake Wi-Fi network name)
> * Read telephony data (fake IMEI, MEI, SIM serial number, voicemail number, etc)
> * Read account name (fake name, mostly e-mail address)

* You can also use this Magisk module MagiskHide Props Config in addition to Xprivacy Lua if needed as a supplement . Primary purpose of the module is different and it is less potent compared to Xprivacy Lua because it is a Magisk module and unlike Xprivacy Lua cannot hook into app API's. I haven't used it , instead use Xprivacy Lua
> 1 votes

---
Tags: root-access, privacy
---


# Question
Title: missing 3gb of internal storage on samsung galaxy grand 2
I have a samsung galaxy grand 2 which uses android version 4.4.2. My phone says that i am running out of space and it keeps notifying me about it which is quite disturbing. In settings \> storage tab, it says in somewhere there are 2.37 gb of misc file but i cannot find them.

I have nearly tried every cleaning apps in google play and i am sure that my problem is not just simple as removing junk files or cleaning caches. After that , i used DiskUsage app to analyze and things get more interesting. It says there is only 5.17 gb internal storage in my phone, including system data.

There are no more photo to delete or no more app to clear. I just wonder where is my nearly 3gb of internal storage or what is this 2.37 gb of misc file. How can i regain that 3gb ? Can the reason of all this thing some sort of physical damage on my phone that i could never fix instead of software problems ?

# Answer
Files like downloads are included in misc. Try to click on misc the to view them. The misc items can also be seen from any file explorer. In the second image attached, the total storage is more than 5.17 gib. If you add the values visible, the total is 5.78 gib. From what I have seen, there is no missing storage.
> 0 votes

---
Tags: storage
---


title: Error - Insufficient storage - Nexus 7

text:
# Question
Title: Error - Insufficient storage - Nexus 7
```
Device: Nexus 7 (2013 WIFI)
ROM: AOKP_FLO_KITKAT_NIGHTLY_2014-07-31
Rooted: Yes
Recovery: TWRP (Not sure if this is needed)

```

I am posting this because I recently started getting "insufficient storage" error on my device. I've had this before and I knew exactly had to fix it because I had come back from a vacation then and there were a lot of pictures on the device; So it was a simple matter of moving all the pictures and videos off the device for it to start working again.

This time however it is a little confusing for me. I will start with some pictures:

*Settings \> Storage* / *ES File Explorer* \> Top\_left menu \> Tools drop-down \> SD Card Analyst (click images for larger variants)

So far everything looks fine, I seem to have a lot of space left to install one measly app right? Just to confirm, I used Clean Master to try to move some apps to device storage:

Clean Master \> App Manager \> Move

No gimmicks here, Clean Master sees that I only have one storage medium on my device. So why do I get these errors?

*Google play* (Trying to install an app that is less than 1MB in size) / AIDE (Trying to run an app)

I'm just confused about the whole thing. Everything else seems to be saying I **have** enough space, but apps are not being installed because I **don't have** enough. What can I do here?

EDIT: Even more weirdness, it won't let me install the 300Kb file with the image I posted above, but it lets me install a 3Mb file from the playstore. Basically I can install some apps but not others and it doesn't matter the size, my device just wants to make me crazy no problem. Ex. This app (2.6M) installed fine, but this one (2.1M) didn't due to "Not enough space".

**What I have tried:**

Couple observations:

--\> It let me install this App and still not letting me install the other apps I have tried with the insufficient memory message still showing

--\> The above pic shows that I have enough space left on the `/data` partition to install atleast A LOT of apps!

* Output of running the `df` command:

Note I have tried the solution posted at the "Possible Duplicate" link and it did not work nor did I expect it to. The problem here is not that I have insufficient space to install apps because as you can see, I have a lot of space and I am able to install some apps. The problem is deeper than that and probably has to do with the way files are installed on my tablet

# Answer
You might have needed to wipe the user cache, which I think happens automatically over time (hence the umpteen reboots solving the problem).
> 0 votes

# Answer
try to flash EBR to increase your system memory from phone memory. you can find about this in detail if you search with your phone model.

Warning ! this process might cause your phone DEAD! void warranty and boot-loops

this process is done with specific ROM flasher of that phone brand.
> 0 votes

# Answer
I had this issue with my phone and found that i had a lot of pictures/videos text messages voicemails taking up most of my storage once i deleted them the insufficient storage went away
> 0 votes

---
Tags: internal-storage, nexus-7, insufficient-memory
---


# Question
Title: How can I type special symbols on my Android device like ☺ or ♥ as a regular character?
How can I make special symbols on my Samsung Galaxy SII, like ☺ or ♥?

# Answer
These are actually Unicode characters you can easily reproduce on your computer: How can I get “WHITE SMILING FACE (U+263A)” with the keyboard?

The Android platform supports unicode and all its characters, however the soft keyboard that comes with your Android ROM probably won't carry all your desired symbols.

When long clicking on some symbols/characters on your soft keyboard you will see the key pop-up expanding to give you an additional choice of symbols, then drag and release your finger to print them.

Installing some 3rd party keyboards (such as GO-Keyboard) will give you access to more symbols.
> 16 votes

# Answer
The easiest, practical way is to Google Search the Unicode Names of these symbols and copy them (e.g. ☺ is WHITE SMILING FACE and ♥ is BLACK HEART SUIT). If you need to do this often though, you'd want to get an 3rd party keyboard.
> 7 votes

# Answer
There are dedicated Keyboards you can install. One of them is SymbolsKeyboard

See also (S2 relevant): How to switch Input Method / keyboard?
> 3 votes

# Answer
Activate keyboard (e.g by perfoming any type action)

Go to symbols.

Long-press this button ; you will see these: `♥♣♠♦♪`.
When you long-press `*`, you can type .
> 3 votes

# Answer
I use google keyboard for texting. For this keyboard, u just need to go symbols, on bottom right, there's a straight vertical line | (like this o e) below the brackets. Press that and the heart shape will appear...
> 2 votes

# Answer
make a note and save ★☆♥☏✹✃✈✉☺☻™✽ッツ♨✆ ★★★★★ ♥
> 1 votes

# Answer
I'm (still) using the average ICS (4.0.4) on a Motorola Atrix 2. If I go to the Symbols keyboards in the Standard Motorola keyboard input, and long press any symbol key, it will display a blue rectangle, showing the symbol, and whether there are other symbols available from that key. This is initially shown by an ellipsis (three dots: ...) to the bottom right of the symbol. If there are no other symbols, no ellipsis appears... Wait a bit longer and the other symbols will then be displayed in a new blue rectangle. Simply slide to the symbol you want. Most of the useful symbols are on the Second symbols keyboard, so press the \[?123\] key, then the \[=\\\<\] key, and Yes, the Heart (admittedly a black one) is under the • key.
> 1 votes

# Answer
For new versions of Android, the easiest way I have found is to use Character Pad - Symbols. It allows to add characters by

> Simply tap a character to copy it to your device's clipboard, open any other app, and paste it anywhere you like

It also has a search function to allow finding characters by their names.

**Disclaimer:** I am just a user of the app.
> 1 votes

# Answer
If I tip the keyboard to horizontal then hold down the microphone key - I get emoticons as an option. (Samsung G4)
> 0 votes

---
Tags: keyboard, text-input, special-chars
---


# Question
Title: Prevent automatic redirects in Mobile Firefox for Android
How can I turn disable redirects in Firefox for Android?

Here is a solution that works for desktop Firefox:

Prevent automatic redirects in Firefox

Unfortunately the **accessibility.blockautorefresh** option is not present in Firefox for Android.

# Answer
As noted in this answer from the same question you linked, you can use `network.http.redirection-limit` to block redirects. Start by setting it to `0` (instead of `1` as in the linked answer). It will will have the effects of blocking all redirects and even accessing any site.

Then increasing with the value will allow depending on the site to allow redirects (or clicking "Try again" when the redict was blocked).
> 1 votes

---
Tags: firefox-for-android
---


# Question
Title: How to install Vim text editor in Android?
How do I install Vim text editor in Android?

# Answer
DroidVim is a Vim clone text editor ported for Android. Vim 8 (huge version, multi language), grep, diff and ctags are ready to use.
> 2 votes

# Answer
Type "pkg install vim" in any Android emulator like termux.
> 0 votes

---
Tags: text-editor
---


# Question
Title: I want to copy a zero width space to the clipboard
I want to copy a zero width space to the clipboard and paste it somewhere else, but after selecting all, the selecting handle thing doesn't pop up. I'm trying on chrome on this site.

Edit: no, I wouldn't want to do it with a character map

# Answer
What do you mean here? Do you mean \- ONLY the zws \- zws WITH text

ONLY the zws? Go to Emojipedia - Zero Width Joiner (or click here). Then click on copy.

zws with text: *NO IDEA*
> 0 votes

---
Tags: copy-paste
---


# Question
Title: Stop WPS Office from recovering deleted files
Occasionally, I'd see a message that says WPS Office has recovered a deleted file or something like that. I suspect often times, WPS just does it without even letting me know it has recovered files. I really don't like it doing things for me without my consent. How do I stop WPS Office from recovering files? I have gone through the settings in WPS Office and found nothing of the sort.

This is on a Huawei GR5 2017.

# Answer
> 1 votes
WPS keeps discarded and deleted files in case you need to save or recover them in the future. You are correct that there is no setting related to recovered/retrieved files. However if you are the "Recents" tab, click on the 3-dot then "Retrieved documents", you will be able to see them.

The retrieved files can be found in `/path_Internal_Or_SdCard/Android/data/cn.wps.moffice_eng/.cache/KingsoftOffice/file/.recovery` folder. Inside the folder, filenames are in base64 except for `mapping.info` file which contains their status (real filenames, whether a file was not saved or deleted, etc).

---
Tags: applications
---


# Question
Title: How to efficiently install same apps on 2 phones?
I have a main phone and a backup phone. Main phone is functional and has a bunch of apps installed. How do I install all the same apps on the second phone while using same Google account?

# Answer
Transfer all **apk** files of apps to backup phone using any transfer app or Bluetooth. And install all that apk files in backup phone.

There is not required any internet data.
> 0 votes

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


title: How to update Huawei P20 to Android 9

text:
# Question
Title: How to update Huawei P20 to Android 9
I have recently bought a Huawei P20, but it cannot be updated to Android 9.

However, my old P10 has already been updated to Android 9 many months ago.

So how can the P20 be updated?

# Answer
Problem solved: It was necessary to insert a SIM card. (I had tried it only with WLAN without SIM).
> 0 votes

---
Tags: huawei, 9.0-pie, huawei-p20
---


# Question
Title: Google still detects my voice when I turn off Assistant
After I have disabled Google Assistant in the Google settings the phone continues to show a black bar displayed with an icon of a microphone, with the words:

> Say "Hey Google"

If I say "Hey Google" it detects my voice and shows a new window. I was just wondering why this is happening if Assistant has been disabled.

# Answer
> 2 votes
Android Police blog fully disable OK Google listening android phone suggests a couple of ways :

1. Disable the Google Assistant and Voice Match

> .... doesn't actually stop your phone from listening for commands; it only prevents it from reacting to them

2. Deny Google microphone permission, which is a better option. Depending on your Android version, it will take some searching to find the app setting. It will throw up a warning, but that can be ignored. Note that Google related functionality using microphone may be affected.

---
Tags: google-assistant
---


# Question
Title: On an Android phone, how to create a shortcut to read new Gmail emails with a specific tag?
On my Android phone, to be specific a Google Pixel 2 XL, where I use Gmail app to receive and read emails, I'd like to have a shortcut to read new emails tagged with a specific tag. How to do it?

# Answer
1. On your home screen, long-press an empty space, then select widgets.
2. Look for "Gmail label". Add it to your screen. You might be prompted to select an account if you have multiple one.
3. Select the label, give it a name and click "Done".
4. A shortcut to emails with a particular label will be created on your home screen.
> 1 votes

---
Tags: email, gmail, home-screen-shortcuts
---


# Question
Title: Play Store app download 100% then starts over to 0%
I can successfully download small apps like solitaire, but when I try to download larger apps/games that are 65 MB large, it downloads 100% then it starts over until I go in and cancel the download.

I have plenty of room on my phone and it can download apps (like booster, cache cleaner, etc) from other websites. I also have restarted my phone.

What could it be?

# Answer
My suggestion is to clear your Play Store data, by accessing the app's info from your phone's **Settings**, and tapping on **Clear Data**. Please note that you'll have to reconfigure the Play Store's settings, afterwards.
> 1 votes

# Answer
You must clear cache of Playstore and download manager from Apps setting. and then restart your mobile. I have done through this way, bro.
> 0 votes

# Answer
The 65MB thing is the APK of the app. An APK is a type of file which we can install on our devices.

The other thing is the additional file or the OBB. We cannot install OBB on our devices because it is a huge file and it would not be able to run in most of the devices. Therefore, Play Store uses this method. This process is completely normal and happens with everybody.

Let's assume that you download an app of 300 MB. The first 100%, Play Store would download the APK of the app. The next 100%, it'll show you, "Additional File for: XYZGAME" where it actually downloads the OBB file.
> 0 votes

# Answer
1. There Probable Causes Of Your Issue :-
2. Your device doesn't have enough space
3. Your device is Lagging (e.g Lower RAM)
4. Playstore is Misbehaving

You can try :- 1. Clear Complete Cache Of Playstore and data and then do fresh sign in with your existing email or new. 2. And make sure PlayStore is Updated. 3. Try Force Stopping PlayStore, it may also help..

If none of above solutions work and you want that App badly then you can try some Populer and even better PlayStore alternetive like Amazon App Store, Uptodown App Store or several like this (Check on Google for more Stores)..
> 0 votes

# Answer
It's the Play Store itself. Either download an old update back in 2015 variant or try the newer ones for 8.1+ Android devices
> -3 votes

---
Tags: google-play-store, downloading, download-manager
---


title: Android Emulator appears in strange UI

text:
# Question
Title: Android Emulator appears in strange UI
I am trying to create and run an AVD from command line using Android's Command line tools.

This means I used the `sdkmanager` to download the following modules:

* platform-tools
* emulator
* build-tools;29.0.2
* platforms;android-29
* system-images;android-29;default;x86\_64

Afterwards I created an AVD using `call avdmanager create avd --name android29 --package "system-images;android-29;default;x86_64"` where I selected `no` for `Do you wish to create a custom hardware profile? [no]`.

When launching the AVD using `emulator @android29` and booting it up afterwards I get an old-fashioned bootscreen followed by an old-fashioned homescreen. The settings page however shows that Android 10 is in use.

What is the meaning or the reason of the old-fashioned looking UI?

# Answer
> 1 votes
This can be solved by using `system-images;android-29;google_apis;x86_64` instead of `"system-images;android-29;default;x86_64"`.

---
Tags: android-emulator, android-10
---


title: Nokia 6.1 stuck in "Download mode"

text:
# Question
Title: Nokia 6.1 stuck in "Download mode"
One day my Nokia 6.1 goes into "Download mode" and rebooting doesn't help.

Flashing TWRP doesn't work:

```
$ fastboot boot twrp-3.3.1-0-PL2.img
downloading 'boot.img'...
OKAY [  1.235s]
booting...
FAILED (remote: unlock device to use this command)
finished. total time: 1.236s

```

Unlocking doesn't work:

```
$ fastboot oem unlock
...
FAILED (remote: Flashing Unlock is not allowed
)
finished. total time: 0.000s
$ fastboot flashing unlock
...
FAILED (remote: Flashing Unlock is not allowed
)
finished. total time: 0.000s

```

Repeatedly calling `fastboot continue` just prints a bunch of system info on my phone screen (e.g. `DEVICE STATE = locked`).

How do I recover the phone?

# Answer
> 0 votes
# Factory reset

For some reason, my device was on slot b:

```
$ fastboot getvar current-slot
current-slot: b
finished. total time: 0.001s

```

After changing to slot a,

```
$ fastboot set_active a
Setting current slot to 'a'...
OKAY [  0.009s]
finished. total time: 0.010s
$ fastboot continue
resuming boot...
OKAY [  0.319s]
finished. total time: 0.319s

```

I got a menu offering a factory reset, after which the phone booted into the OS.

---
Tags: fastboot, android-one, nokia-6.1
---


# Question
Title: How to install a firmware without losing your data and restore the previous one in case it goes wrong?
I have a OnePlus 5T and I can't install OTA updates anymore because my firmware is too old. In addition to that I don't have a full backup of my device because I'm using encryption and TWRP doesn't understand it.

I would like to simply try the new firmware and revert in case anyhting goes wrong without losing any data. Is that possible?

I'm not exactly sure what `firmware` means in this context and where to get it, but looking at the website, there is this download for a zip file with the following contents:

I'm pretty sure that this is the complete stock ROM, meaning if I were to install it, it would wipe everything and replace my LineageOS with the stock ROM.

What I would like to do is to simply flash "the firmware" and only the firmware without losing data on my internal storage and also not my app data, contacts, sms, wifi passwords, bluetooth pairings etc etc.

And before that I would like to create a backup of my old firmware so that I can go back in case it goes wrong.

Can this be done? Can it be done with `fastboot`?

Maybe using `fastboot flash PARTITION [FILENAME]` and some other command to do the backup?

**Edit:**

The updater-script in `META-INF/com/google/android/update-script` contains the following code:

```
getprop("ro.display.series") == "OnePlus 5T" || abort("E3004: This package is for \"OnePlus 5T\" devices; this is a \"" + getprop("ro.display.series") + "\".");
is_part_existed("/dev/block/bootdevice/by-name/vendor") || abort("vendor partition is not existed, exit ota!!");
show_progress(0.650000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
  abort("E1001: Failed to update system image.");
show_progress(0.100000, 0);
ui_print("Patching vendor image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/vendor", package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat") ||
  abort("E2001: Failed to update vendor image.");
show_progress(0.050000, 10);
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
show_progress(0.200000, 10);
ui_print("Writing static_nvbk image...");
package_extract_file("RADIO/static_nvbk.bin", "/dev/block/bootdevice/by-name/oem_stanvbk");

# ---- radio update tasks ----

ui_print("Patching firmware images...");
ifelse(msm.boot_update("main"), (
package_extract_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64");
package_extract_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlib");
package_extract_file("firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hyp");
package_extract_file("firmware-update/pmic.elf", "/dev/block/bootdevice/by-name/pmic");
package_extract_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tz");
package_extract_file("firmware-update/abl.elf", "/dev/block/bootdevice/by-name/abl");
package_extract_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfg");
package_extract_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymaster");
package_extract_file("firmware-update/xbl.elf", "/dev/block/bootdevice/by-name/xbl");
package_extract_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpm");
), "");
ifelse(msm.boot_update("backup"), (
package_extract_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64bak");
package_extract_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlibbak");
package_extract_file("firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hypbak");
package_extract_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tzbak");
package_extract_file("firmware-update/abl.elf", "/dev/block/bootdevice/by-name/ablbak");
package_extract_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymasterbak");
package_extract_file("firmware-update/xbl.elf", "/dev/block/bootdevice/by-name/xblbak");
package_extract_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpmbak");
), "");
msm.boot_update("finalize");
package_extract_file("firmware-update/logo.bin", "/dev/block/bootdevice/by-name/LOGO");
package_extract_file("firmware-update/NON-HLOS.bin", "/dev/block/bootdevice/by-name/modem");
package_extract_file("firmware-update/adspso.bin", "/dev/block/bootdevice/by-name/dsp");
package_extract_file("firmware-update/BTFM.bin", "/dev/block/bootdevice/by-name/bluetooth");
set_progress(1.000000);

```

Should I just take the `msm.boot_update("main"),` and the `msm.boot_update("finalize"),` part and flash them like this?

```
# main
fastboot flash cmnlib64 ./firmware-update/cmnlib64.mbn
fastboot flash cmnlib ./firmware-update/cmnlib.mbn
fastboot flash hyp ./firmware-update/hyp.mbn
fastboot flash pmic ./firmware-update/pmic.mbn
fastboot flash tz ./firmware-update/tz.mbn
fastboot flash abl ./firmware-update/abl.elf
fastboot flash keymaster ./firmware-update/keymaster.mbn
fastboot flash xbl ./firmware-update/xbl.elf
fastboot flash rpm ./firmware-update/rpm.mbn

# finalize
fastboot flash LOGO ./firmware-update/logo.bin
fastboot flash modem ./firmware-update/NON-HLOS.bin
fastboot flash dsp ./firmware-update/adspso.bin
fastboot flash bluetooth ./firmware-update/BTFM.bin

```

Or would this already overwrite a partition that contains some sort of user data? Can I make a backup of these partitions first? And what about `RADIO/static_nvbk.bin`, `boot.bin`, `system.transfer.list`, `vendor.transfer.list` and all that `msm.boot_update("backup"),` stuff?

**Edit:** I ended up not being able to flash those firmware files via fastboot because it requires more than a "normal" unlocked bootloader. If I had done the necessary step to unlock the bootloader further it would have wiped all my data. Fortunately you can bypass that by creating a zip with the firmware files and a custom OpenRecoveryScript (updater-script). I found an awesome GitHub project that automates the whole process: https://github.com/angela-d/firmware\_oneplus

I simply sideloaded the generated zip via `adb sideload firmware-update-oneplus5T.zip` and finally I was able to install my OTA updates.

https://github.com/angela-d/firmware\_oneplus

# Answer
1) You can boot into TWRP recovery from fastboot

```
fastboot boot twrp.img

```

2) Then you can backup your whole emmc from adb

```
adb pull /dev/block/mmcblk0

```

> Does /dev/block/mmcblk0 include my internal storage, my app data, contacts, sms, wifi passwords, bluetooth pairings, system settings etc? Have you personally tried that method on an encrypted device?

It is all stored in userdata partition. If TWRP is able to decrypt, you should pull `/dev/block/dm-0` (=userdata) to get the unencrypted backup.

Otherwise, you still can separate encrypted USERDATA partition (and correlated partition EFS/METADATA required for decryption) from `mmcblk0`

**Do a research how encryption works for your device, i can't help with which partitions are required!**

3) print partition table with start/size

`parted mmcblk0 unit B print`

```
Warning: Not all of the space available to mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 991 blocks) or continue with the current setting?
Fix/Ignore? i
Model:  (file)
Disk mmcblk0: 15300820992
Sector size (logical/physical): 512/512
Partition Table: gpt
Disk Flags:

Number  Start         End           Size          File system  Name         Flags
 1      524288        3670015       3145728                    proinfo      msftdata
 2      3670016       8912895       5242880                    nvram        msftdata
 3      8912896       19398655      10485760      ext4         protect1     msftdata
 4      19398656      29884415      10485760      ext4         protect2     msftdata
 5      29884416      30146559      262144                     seccfg       msftdata
 6      30146560      30539775      393216                     lk           msftdata
 7      30539776      47316991      16777216                   boot         msftdata
 8      47316992      64094207      16777216                   recovery     msftdata
 9      64094208      64618495      524288                     para         msftdata
10      64618496      73007103      8388608                    logo         msftdata
11      73007104      83492863      10485760                   expdb        msftdata
12      83492864      84541439      1048576                    frp          msftdata
13      84541440      118095871     33554432      ext4         nvdata       msftdata
14      118095872     159383551     41287680                   metadata     msftdata
15      159383552     161480703     2097152                    oemkeystore  msftdata
16      161480704     167772159     6291456                    secro        msftdata
17      167772160     176160767     8388608                    keystore     msftdata
18      176160768     2801795071    2625634304    ext4         system       msftdata
19      2801795072    3070230527    268435456     ext4         cache        msftdata
20      3070230528    15283519487   12213288960   ext4         userdata     msftdata
21      15283519488   15300296703   16777216                   flashinfo    msftdata

```

4) copy the partitions into single files (partitions vary for each device model, this is just example for FDE. sometimes metadata is a file located at EFS partition, sometimes encryption footer is concatenated to userdata partition itself)

```
dd if=mmcblk0 of=metadata.bin skip=118095872 count=41287680 bs=1
dd if=mmcblk0 of=userdata.img skip=3070230528 count=12213288960 bs=1

```

this is just example for better understanding and is very slow (10 kB/s). of course dd will copy faster when we increase block size, so calculate bytes into 8k blocks

`12213288960 / 8192 = 1490880`

```
dd if=mmcblk0 of=metadata.bin skip=14416 count=5040 bs=8k
dd if=mmcblk0 of=userdata.img skip=374784 count=1490880 bs=8k

```

5) repeat this for all required partitions. for successful decryption system and vendor may required too. beware you can only decrypt with correlating rom on this unique device itself. decryption on other device (even same model won't work)

6) for restoring you can flash this partition dumps from fastboot

```
fastboot flash userdata userdata.img
fastboot flash metadata metadata.bin

```

another method is restoring from adb

```
adb push userdata.img /dev/block/bootdevice/by-name/userdata
adb push metadata.bin /dev/block/bootdevice/by-name/metadata

```

or even from within twrp terminal

```
dd if=/external_sd/userdata.img of=/dev/block/bootdevice/by-name/userdata
dd if=/external_sd/metadata.bin of=/dev/block/bootdevice/by-name/metadata

```

**FIRMWARE UPDATE**

for firmware update i recommend to flash complete stock rom (you will lose all data), then flash LineageOS, then restore twrp backup `data.ext4.win*` (which of course you have created from working TWRP before)

another method is using `sdat2img` to convert system.new.dat and vendor.new.dat into ext4 images system.img and vendor.img, which you can flash along with other partitions from fastboot

please also read the questions from Android Enthusiasts **Linked** and **Related** section
> 5 votes

---
Tags: adb, fastboot, device-firmware, radio-firmware, oneplus-5t
---


title: Android TV full screen on 21:9 display

text:
# Question
Title: Android TV full screen on 21:9 display
Is there a way to display full screen video on Android TV on a wide screen 21:9 monitor?

I'm using the Xiaomi Mi box, if that's relevant in any way, as my understanding is that it must be a feature supported by the OS, not hardware.

This is a screenshot illustrating the problem.

# Answer
> 1 votes
## Clunky workarounds

Given that there is no support on the OS side, here is a the workaround applicable only for local/LAN and network-streamable 21:9 videos that can be opened with VLC (or kodi):

1. In the monitor settings on-screen menu accessible via the physical buttons on the display select **Ratio** -\> **Wide** — this will distort the UI and stretch everything to take the full display width.
2. Open the video file/URL in VLC and in the three-dot menu repeatedly tap **Resize** until the **FILL** mode is selected. Given that VLC can browse LAN hosts over samba/FTP/SFTP/FTPS/NFS this can cover some but not all use cases.

Kodi can also be configured to change the video aspect ratio for videos so a similar effect can be achieved via the cogwheel click -\> **Video Settings** -\> **View Mode**.

With this workaround you get full-screen video with the correct aspect ratio, but horizontally over-stretched UI.

---
Tags: android-tv
---


# Question
Title: Twitter app: Is it possible to switch accounts while viewing a tweet?
I have the Twitter app for Android, and I use 2 accounts. Both are configured in the app.

How can I switch accounts while viewing a single tweet (if, for instance, I'm viewing a tweet in account A but want to retweet it from account B).

I used to be able to do it, but they seem to have removed it a few updates ago.

# Answer
> 1 votes
As of current version (Version 8.25.1-release.0 on Dec 20, 2019), **it is not possible to switch accounts while viewing a tweet on the official Twitter app**.

The only way to switch account is from the sidebar, and it is currently only accessible from the main screen.

Instead, to "retweet from another account", the native workaround is by sending a *direct message* to that account:

1. From a specific tweet, tap the "Share Tweet"
2. Choose "Send via Direct Message" and choose the target account
3. Go back to the main screen, then switch to another account
4. Navigate to "Messages" (mail icon on the bottom navigation bar), then open the conversation with another account
5. Open the tweet, then retweet.

(Note: to reduce the switching, it is recommended to bulk send the tweets first before switching)

---
Tags: twitter
---


# Question
Title: My messaging application sometimes closes itself while typing - How can I fix this?
When typing an SMS message, the messaging application will automatically close and the typed text is deleted, causing me to have to retype the text. It seems to happen after two or three messages. I have clear data of Messaging software from `Manage Applications->All->Messaging->Clear Data` but the problem persists. Is there a way I can fix this?

# Answer
> 4 votes
You can try to investigate this issue more deeply based on system logs. Install some application to grabbing logs from device (for example SendLog). When you application crashes, then grab system log in which should be placed callstack started in your application.

Getting logs should be done asap after crash, because these files rotate.

# Answer
> 0 votes
I would try going in to `Settings -> Applications -> Manage Applications -> All` and select the Messaging app. Then the Clear Data for the application. There may be something in the data that is corrupt and causing an issue.

I know this doesn't necessarily solve the problem, but you can try using another SMS application, like Handcent SMS for example. I personally never liked the Messaging application that comes in TouchWiz (Samsung's additions/changes to Android), which is why I moved to a custom ROM as soon as a stable one was made available. That is not the answer for everyone, but replacing the messaging app with a 3rd party app is "the next best thing".

# Answer
> 0 votes
It *is* possible, but unlikely, that it is being killed by the android automatic killer to free up ram, but as the Samsung Galaxy S2 has 1 GB of ram this is unlikely.

One other explanation is that you are accidentally pressing the home button while you type, or are pressing something on your keyboard that has the same effect.

If possible, install the drivers for your device, download adb + required dll's, and type into a command prompt:

```
logcat >> logcat.log

```

Then make it happen. This will dump all of the logs to the logcat.log file. You could then paste this into pastebin, for us to have a look at.

# Answer
> 0 votes
Just leave the damn app alone, it's black and uninviting anyway, and install a more appealing SMS app, try Go SMS or Handcent SMS.

# Answer
> 0 votes
You should probably try looking at what processes are running, you probably have a game or application with some services maybe even something with an SMS intent grabber to read when you have messages & alert you or whatever.

Avast is good for monitoring applications resources & uninstalling them if you don't like doing it in the settings. It also puts up applications by permissions which make it easy to see if something is grabbing SMS messages off the intent. It's free, you don't need to root, and as long as you don't do the admin mode easy enough to uninstall.

# Answer
> 0 votes
This is old question however answering now since I found solution on my device. It might help for anyone still facing the issue. There is Android system app "Aries" you need to give all permission to this app. After that none of the application are now minimizing for me.

My device is running on Andorid 7.

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


# Question
Title: Invoke /system/bin/sdcard manually via terminal
I am trying to mount an EXT4 formatted SD card under Cyanogenmod 13.1 (Android 6.0.1).

So far, I have setup scripts to mount the card at `/mnt/ext_sdcard` during boot. My current understanding is that the "sdcard" service must then be invoked to create a FUSE mount pointing to the real mount point which will eventually lead the media scanner to the newly mounted disk.

Following some older older documentation and forum threads lead me to this command in terminal:

```
service sdcard /system/bin/sdcard /mnt/ext_sdcard /mnt/test 1023 1023
    class late_start

```

When I run the command (as root of course), it fails with an exit status of `1` and no output/error messages.

My question: Am I doing something wrong, or is this command deprecated in 6.0.1 (the documents/forum thread seemed to relate to KitKat)? What is the correct syntax/arguments for using this command?

# Answer
Are you putting this command in an init.\*.rc file? My understanding is you would have this in a init.extmount.rc for example. This requires extracting and repacking the boot.img.

Since I had nothing better to do, I created this: https://github.com/BenBaltz/mountext

Its a recovery flashable zip to install your script by unpacking the boot.img and repacking it with the modifications.

EDIT Terminal commands

```
su -c mount -o bind /mnt/ext_sdcard /path/to/new/dir

```
> 0 votes

# Answer
In Android 6+ storage configuration:

> Mounting of physical external storage volumes is handled by `vold`, which performs staging operations to prepare the media before exposing it to apps.
> ...
> The hard-coded FUSE services have been removed from device-specific `init.rc` files and are instead forked dynamically from `vold` when needed.

So the `sdcard` services defined in `*.rc` files are no more required, neither `storage_list.xml` is maintained inside `framework-res.apk`. Instead `vold` completely manages the storage devices defined with flag `voldmanaged=` in `fstab`. See more details in Android's Storage Journey.

In Android 9 FUSE support was completely removed from `sdcard` binary replaced with `sdcardfs`. `sdcardfs` can be mounted directly using `mount` command, so `sdcard` isn't necessarily required. However from Android 6 to 8 `sdcard` binary should mount an emulated filesystem if executed with proper arguments. You can see the failure log in `logcat`.

Also you can use a third party FUSE-based tool `bindfs` to achieve the same. See details in How to bind mount a folder inside /sdcard with correct permissions?
> 0 votes

---
Tags: sd-card, mount, terminal, command-line, services
---


# Question
Title: Switching app with physical keyboard, with one click "alt + tab"
I love android's exensive support for keyboard, even "app switching" works almost exactly as in Windows/Mac OS/Some graphical Linux disitros.

When you click "alt+tab" it shows:

But what bothers me is that after you click "alt + tab" this window shows "actual app I used before" so you need to click

"Alt + tab, and then keeping alt pressed again tab" So those are 3 cliks instead of 2.

Is it customiazable ? Maybe I'm able change this behaviour?

Thanks in advance.

# Answer
> 1 votes
the only way this works is as follows:

alt-tab, use arrows keys to select app and than press enter, once app has switched only than release alt-tab.

Hope this helps.

---
Tags: external-keyboard, keyboard-shortcuts
---


# Question
Title: How to configure and Enable WiFi Hotspot through terminal without root
How can I configure and enable/disable the WiFi Hotspot using the terminal without `root`? Also I want to kick a user from my hotspot using the terminal.

# Answer
Setting and enabling hotspot (software access point) is possible by calling methods `setWifiApConfiguration` and `startSoftAp` of `wifi` service. But at least since Android 8, the former requires permission `OVERRIDE_WIFI_CONFIG` while the latter requires `NETWORK_STACK`. Both permissions have Protection Level `signature`, not to be used by third party apps. Neither `adb shell` has any of the both permissions. So it's not possible without root access.

A workaround is to simulate `tap`s and `keyevent`s using `adb shell input` command, though it's not a commandline solution in true sense.

---

**RELATED:**
> 3 votes

---
Tags: wifi-hotspot, terminal, wifi-tethering
---


# Question
Title: Getting "operation not permitted" error when trying to symlink a directory
After installing a custom ROM (Onecosmic's ICS 4.0.3 rc1) on my Samsung I9000 Galaxy S, the `external_sd` symlink is broken. So, I wanted to get this symlink back. I used the following code in Terminal Emulator (yes, I am rooted with SuperUser):

```
su (superuser asked for rights, allowed)
cd ./mnt/sdcard
ln -s ./mnt/emmc external_sd

```

But I got the following error:

> Operation not permitted.

How can I create the symlink now?

# Answer
What's the partition format of the SD card? FAT does not supports symlinks, although I believe it should be possible to create a symlink in ext3 that points to a FAT directory.

Also, there are operations that even root are not allowed to do, such as writing to a read-only drive or writable drives that are mounted read-only. What's the output of 'mount' command?

Also, your command looks fishy; try using absolute path (i.e. do not prepend the path with `./`, instead prepend with `/`):

```
$ su
# ln -s /mnt/emmc /mnt/sdcard/external_sd

```
> 1 votes

# Answer
The problem is not related to the FAT filesystem. On a EXT4 filesystem, for example, you can create links to FAT32 mounted partitions on linux as well as you do with links to EXT4 partitions, because the partition in which the link would be created (ext4) does support links.

The problem is that Android mounts its internal storage partitions with tmpfs. It uses fuse or something like that. If you type `mount` then you'll see that /mnt, /storage, /storage/emulated and others are mounted as tmpfs which does not support links. The correct message should be "operation not supported".

Unless we get a way to mount (or the path to the ext4 mountpoint to) these partitions without using the tmpfs, it won't be possible to create links like those.

There's a way to create links. Apps like Link2SD do that. But I still don't know how!
> 0 votes

---
Tags: file-system
---


# Question
Title: Connecting ipega 9037 Bluetooth gamepad via USB-OTG to smartphone
I have a problem with my device while pairing my ipega 9037 Bluetooth gamepad controller. The joysticks are working and also the D-pad, but I have thought that can I use this controller over USB OTG.

Does it damage the smartphone battery?

# Answer
If you are linking it trough the cable and not Bluetooth, it won't drain much more battery than pressing the volume buttons.

In other words, nothing you'll ever notice.
> 0 votes

# Answer
I had the same problem with the PS4 controller. When I use OTG, my phone battery goes down.

I open up my controller and disconnect the battery. Then when I connect via OTG, it doesn't charge the controller. No more, it's perfect.
> 0 votes

---
Tags: usb-on-the-go, game-controllers
---


# Question
Title: Where is the "android_id" stored and when does it change?
I want to build a `device_id` with `android_id`, any one knows the answer to these three questions?

* Where is the `android_id` value stored?
* When is the `android_id` value initialized, i.e. the first time the value is set?
* In which cases does the `android_id` value change?

# Answer
> 7 votes
> * Where is the `android_id` value stored?

On Android 5 and earlier this was stored in `secure` namespace of device Settings. So you can extract using:

```
~$ content query --uri content://settings/secure --projection value --where "name='android_id'"

```

Or:

```
~$ settings get secure android_id

```

Or directly read the `secure` table of `settings.db` database file. For device owner:

```
~# sqlite3 /data/user/0/com.android.providers.settings/databases/settings.db 'select * from secure where name="android_id"'

```

Since Android 6 settings are saved in `xml` files. For device owner:

```
~# grep android_id /data/system/users/0/settings_secure.xml

```

Since Android 8, `android_id` is *"unique to each combination of app-signing key, user, and device"* so as to deny *"developers the ability to track users across multiple applications"*. These unique IDs are stored in `/data/system/users/<User_ID>/settings_ssaid.xml`.

> * When `android_id` value init, the first time set the value?
> * Which case does the `android_id` value change?

As evident, `android_id` *"is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device"* unless a factory reset is performed which clears all settings.

On Android 8+ the app specific `android_id` *"value may change if a factory reset is performed on the device or if an APK signing key changes"*.

Keeping all in view it doesn't seem a good idea to build a `device_id` with `android_id`.

---
Tags: android-id
---


# Question
Title: Flashing stock firmware deletes everything from / (root) directory?
Hello i have a Xiaomi Mi 8 and i was playing with adb shell servies commands and now it shows "android phone service stop working" and it keeps rebooting.My question is when i flashing stock firmware from xiaomi tool, deletes everything from / (root) directory and installs new one folders/files?I want to check this to make sure if it's hardware or software problem

# Answer
> 0 votes
"when i flashing stock firmware from xiaomi tool, deletes everything from / (root) directory and installs new one folders/files?" Most likely yes, if there is no option to keep them in Xiaomi tool. All internal storage will be cleaned except external SD card if you have inserted it.

---
Tags: xiaomi
---


# Question
Title: No way to restore apps and data from Titanium Backup
Recently I switched from Lineage OS to Pixel Experience on my Xioami Mi 9t device. I made a backup of all my apps and data trough Titanium Backup and an update.zip file.

After flashing Pixel Experience and going through the setup I installed Titanium Backup on my phone and rebooted into TWRP to install the update.zip file. It flashed the zip file with no errors and automatically rebooted the phone into system.

However nothing happened and my apps and data were not restored. Then I wanted to restore them manually but trying to access my backup location on my external USB drive I found out I could not access my backup folder anymore, which was located at: `/storage/extSdCard/Android/data/com.keramidas.TitaniumBackup`

It is extremely frustrating knowing I have done everything to backup my apps and data but not being able to restore them anyway. If anyone knows a solution to this problem tell me, I would really appreciate your support.

# Answer
> 2 votes
Here is what worked for me. I booted into TWRP recovery. From there I copy pasted my backup files from my usb drive to internal memory. Then and only then I was able to access and restore my backups from Titanium Backup.

# Answer
> 0 votes
from Titanium Backup HOWTO:

* install desired app (from Play Store or apk)
* open the new app once
* enable “System data migration” in preferences
* Restore “data only”

(repeat this for each app)

---
Tags: backup, restore, titanium-backup
---


title: Wipe data from dead Android phone

text:
# Question
Title: Wipe data from dead Android phone
I have Samsung Galaxy A10s. Now its dead. No power on. I tried lots of combinations. I don't want anybody to get the data, messages or media files which is in internal memory. But as its not charging and not showing drive after connect through USB to PC, I can't delete data directly.

How can I delete media files specially from internal phone memory from my dead phone?

# Answer
> 1 votes
Further to what has already been suggested in the comments, if you're only interested in destroying the data and not recovering it, you could drill through eMMc to completely destroy it.

It is **HIGHLY** unadvised to do this without careful consideration as your phone contains a lithium ion battery and I shouldn't have to explain the dangers of damaging a battery.

You can follow this guide to remove the "motherboard" from the phone.

I'm not certain where the eMMc is located on the chip (the protective casing covers all the components and I've never done a teardown on the phone myself) but, at this point you can sort of just go crazy and destroy the whole thing.

# Answer
> 0 votes
you run latest (bootloader locked) android with all security features, there is no way to access data with any tools. Only way is try-and-error pin/pattern/password guessing. I don't think repair shop have time for this. there is Rate limiting one have to wait 30 secs after 10 unsuccessful tries. if attacker manage to repair your device, he could bruteforce a 4 digit pin in ~8 hours. security depends on weakness of your screen lock. a long alphanumeric password would take years. if screen lock is a pattern, data is wiped after 30x unsuccessful attempts.

you can remotely wipe your device/or change screen lock from Find My Device. as soon as it is connected to internet the changes will apply.

---
Tags: internal-storage, storage, hardware, delete
---


# Question
Title: How to decide which MicroSD card to buy for your Android device
You have an Android device running Android 5.0 "Marshmallow" or better, and it's running low on storage space.

Some modern Android devices don't have a slot for a MicroSD flash memory card. But yours does; it's hidden underneath the (removable) back cover.

You want to buy a MicroSD card; how can you decide which one to buy?

# Answer
This answer assumes that your phone is running Android 5.0 "Lollipop" or higher, and that your phone lets you move apps to a MicroSD card. (Most ancient Android 4.x phones, and even some modern Android phones, lack support for moving apps to MicroSD cards.)

---

# Choose a card good enough for fast app performance

It's quite possible that you'll eventually decide to store apps on your MicroSD card. Therefore, I recommend that you choose a MicroSD card which is good enough for fast app performance.

Lots of product-review websites offer recommendations. The Wirecutter's recommendation article is a fine choice; it looks like they've been periodically updating it for the past few years.

I'm reluctant to offer a specific recommendation here, because I may not return here to update this answer every few years.

# Don't be cheap: upgrades may be impossible

Before storing apps on a MicroSD card: Consider buying a card large enough so that you'll never need to upgrade your current phone to a larger card. This is because, once you've installed apps on a MicroSD card, it may be difficult or impossible to upgrade your phone to use a bigger card.

# MicroSD cards can fail

MicroSD cards store your data on a tiny flash-memory chip. Unfortunately, the profit margins on MicroSD cards can be razor-thin. To cut costs, manufacturers use low-grade flash-memory chips which may be far less reliable than the flash memory built into your phone. See, for example, this source.

MicroSD cards can fail irreparably, without prior warning.

If it only holds photos, music, and videos, a MicroSD card will probably last for years. If you store apps on the card, though, this puts more stress on the card, and it may fail significantly sooner.

If you plan to store any irreplaceable data on your MicroSD card, make regular backups. If the backups are encrypted, keep extra copies of the encryption key in two different places.

### High-endurance MicroSD cards

You can buy special "high-endurance" MicroSD cards. These may be more reliable, but are often slower. (Source.) I therefore assume it's probably unwise to store frequently-used apps on "high-endurance" cards.

# Avoiding counterfeit cards

Counterfeit cards can fail, permanently, within an hour or two of purchase. The Wirecutter offers some good advice on avoiding counterfeit cards. One good option is to shop in-person at a trustworthy local store.

### Detecting counterfeit cards

There are lots of tools which can tell you whether or not a card is counterfeit. Some such tools are very slow. The fastest tool is ChipGenius (for Windows). If its reported card capacity matches the advertised card capacity, then the card is genuine. Another reasonably-fast tool is FakeFlashTest (for Windows). These tools are freeware. (Source.)

### Dealing with counterfeit cards

If you bought a counterfeit card, you may or may not be able to get your money back. But it's worth trying.

* First, you can ask the retailer for a refund.

If that fails, you can try any of the following:

* If you bought the card from an online marketplace, contact the website operator.
* If you paid using a credit card, contact your credit-card issuer.
* Contact your local Better Business Bureau, if there is one.
* Contact your local small-claims court, if there is one. You don't need a lawyer.
* Contact another local court.
* Contact your government.

Speed matters. If you wait too long, it may be too late to try to get your money back.
> 0 votes

---
Tags: external-sd, storage, hardware, insufficient-memory, adoptable-storage
---


# Question
Title: Android Phone taking up more space than it should
I have a relatively new HTC ONE M8 running Android 5.0.1 (according to the settings page).

The phone is supposed to have 10.5 GB space according to Windows, but at the moment only 945 MB is free (again, according to Windows). However, when I select all of my files within and check properties it shows that they all take up only 5 GB of space, meaning another 4-5ish has disappeared. Any ideas how to fix this, as I'm trying to free up space for more music and pictures?

Screenshots from DiskInfo and DiskUsage:

# Answer
There are a few problems it could be (or a combination of):

1. The stock software is massively huge and HTC has a problem that an update will fix.
2. An app you've downloaded has installed Bloatware and clogged up your storage.
3. An app you've downloaded assumed you wanted to download other things (photos, videos, etc) without telling you.

I'd advise Storage Analyzer & Disk Usage to determine exactly what it is that is taking all that space. Happy hunting!
> 0 votes

# Answer
# Windows is wrong; DiskUsage is right

Based on your question, and on the comments on the question: It is clear that Windows cannot see all the information stored on your phone, but that DiskUsage can see it all.

# You need not do anything yet

> I'm trying to free up space for more music and pictures

You still have 1 GB free. If this remains true forever, it's no problem.

I suggest keeping an eye on your free space.

Once your free space falls to about 500 MB, you'll be unable to install new apps. I think you may also be unable to upgrade existing apps.

Once you become unable to upgrade existing apps, it's definitely wise to take action. This is because it's wise to always keep security-sensitive apps (such as Chrome and WebView) up to date.

# Buying a MicroSD card

Because your phone has a MicroSD card slot, consider buying and installing a MicroSD card and moving some stuff (music?) from your phone to the card. This will cost you money but may save you time.

### Choosing a MicroSD card

Another thread provides advice on how to buy a good (non-counterfeit) MicroSD card for your phone.

# OS upgrades

Perhaps you can upgrade your phone to an operating system which supports "adoptable storage". Such operating systems include:

* Android 6.0 "Marshmallow",
* or CyanogenMod 13.0 "Marshmallow",
* or LineageOS 13.0 "Marshmallow",
* or better.

Certain other "custom ROMs" also support "adoptable storage".

I do not know whether your phone supports any of these operating systems. I have not checked. To find out, you can do a Google search, or you can post another question.

If you can do such an upgrade, consider doing so before you insert the card for the first time. The operating system will offer to reformat the card for adoptable storage.

### Upgrade warning

Before upgrading your operating system, and especially before switching operating systems, I strongly recommend that you back up all your data. You can back it up to the cloud or elsewhere.
> 0 votes

---
Tags: internal-storage, htc, htc-one
---


# Question
Title: Change web browser and text message app in Huawei P30 Lite
On my Huamei P30 Lite, I am using Firefox as a web browser app and Silence as text message app. Although I changed the default app in the settings, I am not able to change the app in the bottom navigation bar, see circled icons in the attached image. I did it on my previous phones (LG GT540, LG Optimus L5 II and Samsung Galaxy S7 Edge). How can I change those apps?

# Answer
After two days, I finally figured this out. Long press on the icon only display a new menu. In order to change it, I pressed another upper icon, e.g. Play Store, then, dragged this icon into the lower bar, e.g. beside Chrome. Only then, one is able to drag icons away from the lower icon bar.
> 0 votes

---
Tags: huawei, default-applications, navigation-bar
---