title: GPS only works with WiFi

text:
# Question
Title: GPS only works with WiFi
On my Blackview Crown with Android 4.4.2 my position is only ever available when I am logged in to a WiFi network. Using google maps outside works in general, but unless there is a working WiFi connection it just stays where it last had one or does not seem to find my position at all.

I've tried all three possible GPS settings (phone only, with mobile Internet, and with WiFi and mobile Internet) and they don't make a difference when outside. Connected to a network only the one using WiFi works, and does so instantly. It is not enough to have it turned on, I actually have to be connected.

The phone is a bit less than a year old and used mostly as an MP3 player, for playing free games, and, well, as a phone. I don't know a lot about Android and GPS in general and I'm running out of ideas.

# Answer
> 0 votes
Basic GPS can take 12.5 minutes to get a first fix from a cold start. Yes, this is slow, which is why most systems are built with other features to speed up the time to first fix.

1. With a data connection, your device will try to use assisted GPS to get a fix faster. Your device uses local infrastructure to learn which satellites are in view for the current location and corrections. The time to first fix can be reduced to seconds.
2. With WiFi, normally the first location fix is based on WiFi location; your device queries a large global database for the MAC addresses of WiFi infrastructure and gets back a answer quickly. WiFi location accuracy is worse than GPS, but it is much faster. Once you have this WiFi position fix, it can be faster to get a GPS fix.

# Answer
> -1 votes
It seems to me that the GPS antenna/hardware is just too slow to find a GPS fix that fast.

I would recommend using an app like GPS Test to see how many sattelites your phone detects.

So just switch to "high accuracy" or "gps only" mode under Location Settings and open the app. There should be some grey bars at first and after a while these bars should become colored. Each bar stands for one sattelite. You need at least 4 sattelites "in view" to get a GPS fix ("in use").

Well, based on your description about your experiences with Google Maps it may indeed take some minutes until you get a fix.

This may be either caused by a bad hardware or bad/misconfigured software - especially "china phones" sometimes have GPS software configured for eastern countries. There is a file with these settings under /system/etc/gps.conf (by googleing you can find a lot about this topic). But you need root privileges to edit it. Alternatively, you can also try the option "Update aGPS" in the menu of the "GPS Test" app.

If that all does not improve your first-fix-time, theres basically not so much anymore you can do.

---
Tags: wi-fi, 4.4-kitkat, gps
---


title: Turning on with ADB and SDK tools?

text:
# Question
Title: Turning on with ADB and SDK tools?
My samsung mobile is switched off with busted power button, and the "Volume down+main button with charger" process is also not working..is there a way I can restart it using adb and sdk tools??

# Answer
> 0 votes
download magisk manager and exact variant of boot.img to any other android device. patch boot.img with advanced - keep force encryption + keep avb/dm-verity

install Odin and drivers. flash magisk\_patched.tar in AP slot. set the auto reboot option

unlock device and install magisk manager. you are rooted

**edit:** now modify your device for auto boot each time charger is plugged in, see Irfan Latif's answer on Automatically power on Android when the charger is connected

now dump your para partition and inspect with hex editor. if you find the off mode charge string you can modify value. flash the modified para partition. this will make your device auto boot each time charger is plugged in

if the changes aren't persistent for some reason, install some start-up script which executes the mod directly

> `sed -i '0,/off-mode-charge=1/s/off-mode-charge=1/off-mode-charge=0/' $(find /dev/block -name by-name)/para`

---
Tags: samsung
---


# Question
Title: How can I change the default browser on MIUI 10.x?
I've read this question:

How can I change the default browser?

but the instructions there don't fit my Xiaomi phone, which has the MIUI 10 interface. How can I change the default browser there?

# Answer
> 0 votes
1. In your Settings application, navigate to `System Applications` `Browser`.
2. You get a prompt saying:

> **Set as default browser?**
>
> MIUI Browser is really great blah blah blah
> blah blah blah blah blah blah.
>
> No Thanks | Set
3. Tap "No Thanks".
4. Make sure "Set as default browser" is in the off position (grayed dot, not blue dot).
5. Open some application with web links.
6. Click a web link.
7. You will now get the dialog for choosing the app with which to open the link.
8. Tap "Remember my choice" or some equivalent wording before choosing your new default browser.

---
Tags: browser, default-applications, miui, miui-10
---


# Question
Title: Automatically power on Android when the charger is connected
Is it possible to automatically power on the device once the charger is connected given that the device is initially turned off?

# Answer
The battery charging graphic is displayed by `/system/bin/playlpm` file on Samsung devices.

If you are root, you can edit this file to:

```
#!/system/bin/sh
/system/bin/reboot

```

And be sure to add those permissions to the file:

```
chmod 0755 /system/bin/playlpm
chown root.shell /system/bin/playlpm

```

Your device will now boot when plugged
> 12 votes

# Answer
`fastboot oem off-mode-charge 0` is the genuine method if your device supports. It's Google's recommended method but not all OEMs/vendors implement the command in bootloader. Or on some devices it's reset on next reboot. If `off-mode-charge` is disabled, bootloader won't pass `androidboot.mode=charger` commandline parameter to kernel when charger is inserted, so device boots normally.

Otherwise when `ro.bootmode` property is set to `charger` on boot, `init` doesn't continue the normal boot process. Instead limited number of services are started and charging animation is displayed. So you can instruct `init` to reboot the device whenever charger mode is detected. Create a new `.rc` file or edit any existing one:

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

on charger
    setprop sys.powerctl reboot,leaving-off-mode-charging

```

Or execute `reboot` binary:

```
on charger
    exec - -- /system/bin/reboot leaving-off-mode-charging

```

But if SELinux is enforcing, stock policy may not let `init` execute `/system/bin/reboot`. So use Magisk's context (or whatever rooting solution you use):

```
on charger
    exec u:r:magisk:s0 -- /system/bin/reboot

```

Don't forget to set permissions on `*.rc` file (`chown 0.0`, `chmod 0644`, `chcon u:object_r:system_file:s0`).

It's also possible to continue boot process instead of restarting the device by replacing `class_start charger` with `trigger late-init` in `/init.rc` file:

```
on charger
    #class_start charger
    trigger late-init

```

Or by setting property `sys.boot_from_charger_mode`:

```
on charger
    setprop sys.boot_from_charger_mode 1

```
* This method should work on all devices irrespective of OEM as it doesn't depend on vendor-specific charging binaries like `playlpm`, `battery_charging`, `chargeonlymode`, `zchgd`, `kpoc_charger` and so on.
* Also replacing binaries of important services like `healthd` \- which take care of a lot of things related to battery, storage etc. - is not a good idea. In this case if the service runs both in `charger` and `normal` mode, device may get into bootloop.
* On non-System-as-Root devices it's not necessary to modify `/system` partition (e.g. if you don't want to break `dm-verity` for OTA updates to work). Simply unpack `boot.img` and edit `/init.rc` file in `ramdisk`.
* Though unnecessary, it's also possible to execute an `init.d` script from `.rc` file. For reference see How to run an executable on boot? and How to power off when charger is removed?.

---

**RELATED:**
> 12 votes

# Answer
So, there are many ways to do so. The most proper one, as always supported by Google (and more and more by others, e.g. nvidia from nougat) is this fastboot command

```
fastboot oem off-mode-charge 0

```

Otherwise, you can either hijack the charging binary (not guaranteed to be possible on all devices, but just requires root) or patch your ramdisk (theoretically universal, but will require an unlocked bootloader).

For the first solution, you'll have to find somewhere in your system partition (usually the *bin* folder) where the program in charge of the battery animation and all resides. Some common names:

* Motorola: `charge_only_mode`
* Mediatek: `kpoc_charger` or `ipod`
* Htc: `chargemon` or `zchgd`
* Samsung: `playlpm` or `lpm`
* Sony: `chargemon` or `battery_charging`
* Most(?) AOSP-based roms: `healthd`

Once found, you can just replace it with a script such as that above by IET\_DEMO.

Touching the kernel is instead something I don't feel like explaining and recommending if you don't know what you are doing.

Just for the records then, I'd just like to underline that offline charging exists because the boot process is fairly energy intensive, and especially on older phones without even fast charging the power draw from the system could be higher than that on the plug.
> 4 votes

# Answer
Just got this working for ZTE Force (Boost Force, Sprint Force, etc).

I used IET\_DEMO's answer, but replaced the file located at `/system/bin/battery_charging` with this code:

```
#!/system/bin/sh
/system/bin/reboot

```
> 3 votes

# Answer
For some older Samsung devices, this can be accomplished through NoMoarPowah!:

> NoMoarPowah! can automatically reboot into Android when charging is done. Either when fully charged, or when the battery level reaches 15% and Android has enough juice to run.

You need root and you probably don't want to do it unless you really know what you're doing, since I would expect this to modify important system files.

---

It looks like this has been removed from the Play Store, but you can probably find the APK hosted elsewhere. (I don't have a trusted link offhand.)
> 2 votes

# Answer
Kernel is loaded at a later stage in the boot-up process, so any modifications to it would not have any effect for when the device is powered off.

This functionality really depends on each device's hardware, most likely in the bootloader (more knowledgeable editors feel free to correct me.) For example, my Motorola Atrix 4G phone begins booting up when I connect a charger, while my Samsung Galaxy Tab does not - it displays the "Battery Charging" graphic and requires being powered on manually.
> 0 votes

---
Tags: charging, power-on
---


# Question
Title: Does flashing the stock ROM repartition the device internal memory?
After I have repartitioned my tablet I wonder what would happen if I flashed the stock ROM again.

# Answer
> 1 votes
A full firmware from the manufacturer can do that. You can see the flash sequence has a file similar to `gpt_both` or anything with GPT in the filename and is flashed to the partition **partition**. For example: `fastboot flash partition gpt_both.bin`

If there's no such file you can find, then the flash sequence is most likely not rebuilding the partition structure.

---
Tags: rom-flashing, partitions
---


title: How can I determine the SD card's path?

text:
# Question
Title: How can I determine the SD card's path?
I'm on a Thinkpad with Android 4.0.2 trying to open an HTML file on an SD card, using the default browser. Answers here have indicated you should access `file:///mnt/sdcard`, `file:///mnt/sdcard-ext`, `file:///sdcard`, and many other combinations, but none of them work for me: I just get "Webpage not available".

Apparently different machines mount the SD card to a different path. How can I find out which path my SD card is mounted to? Or if that's not the problem, what is?

# Answer
> 7 votes
`adb shell 'echo ${SECONDARY_STORAGE%%:*}'`

# Answer
> 1 votes
On most devices, the SDCard is either mounted or at least linked to either `/mnt/sdcard` or `/sdcard`. However, when the device features both, an internal and external SDCard, the latter usually is to be found "inside" the former, e.g. at `/sdcard/external_sd`. Alternatively, it may be mounted at `/mnt/extSdCard` or `/storage/extSdCard`. Note the capitals. Android filenames are case-sensitive.

For a user, the easiest way to figure out where it is (or in your case, rather where your ''file'' is located), is using a file manager which allows you to not only browse your SDCard, but the entire system. I for example use ES File Explorer: If I start the app, it automatically places me on my sdcard (I didn't configure it such, so I assume that is as it always works). The path is displayed at the top of the display, so you'd see it immediately. If it's too long to be displayed there (even if you switch to landscape), you still can "navigate up" until you only see `/` there, and note all steps – so you would end up with the complete path.

# Answer
> 1 votes
Just six years later...

I am using the android app sshelper (https://play.google.com/store/apps/details?id=com.arachnoid.sshelper) on the android device. It acts as an SSH server on the smartphone and allows me to login via ssh.

This allowed me to dig around and find my sd card by: \- automatically beeing sent to SDCard somewhere is a linux filesystem \- finding out that this directory points to /storage/emulated/0 by using `ls -lha` \- finding out that this is the internal storage by browsing the content \- finding out that /storage/ contains a strange directory like "5674-9865" which was the entry to my sd card.

---
Tags: sd-card, stock-browser, lenovo-thinkpad-tablet
---


# Question
Title: Suspicious notification from "Find My Mobile"
I just received a notification from Samsungs "Find My Mobile" service, without having triggered anything. The same thing happened to my work mate today morning.

As I almost never use my Samsung account, and never even configured this service, I assume one of the following:

* Someone hijacked my Samsung account
* Someone hijacked the Samsung system, affecting multiple user accounts
* The responsible api call is lacking a permission check
* Samsung itself did a test which went wrong

Does anyone know more about this?

# Answer
> 40 votes
Samsung probably wanted to quickly refresh their internal user locations database ;)

https://twitter.com/SamsungHelpUK/status/1230430326687780865

> @SamsungHelpUK
>
> Recently, a notification about “Find My Mobile 1” occurred on a limited number of Galaxy devices. This was sent unintentionally during an internal test and there is no effect on your device. We apologize for any inconvenience this may have caused our customers. ^LF

http://www.google.com/search?tbm=nws&q=find+my+mobile

**edit:** against some news, this notification was not the result of a Samsung data breach.

https://www.sammobile.com/news/samsung-data-leaked-mystery-find-my-mobile-notification

> Samsung has clarified that, while a data breach did happen around the same time, it's not related to the “Find my Mobile” notification. this technical error affected only Samsung's UK website and it only affected about 150 users in total.

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


# Question
Title: Android stops/pauses execution of my background script?
# Short version:

**Why is my bash script (running in the background, started via SSHD) not running every ~30 seconds when it should?** (NOTE: SSHD and the script are running as **root**!)

---

I have a script that I start using `nohup bash script.sh &` so that it runs in the background.

The script is supposed to check whether a specific app is connected using `netstat` and if not it automatically reconnects using `am start` and `input keyevent`. (This turns out to be irrelevant though).

I've noticed that even though the script should check every 30 seconds (roughly of course), sometimes it takes minutes to check. I couldn't really figure out why and it seemed completely random (note that the phone's screen is off most of the time and everything is running in the background.), so I made a testscript which is what the question should focus on for simplicity:

```
#!/bin/sh
while : ; do
    echo "$(date +'%Y-%m-%d %H:%M:%S')"
    sleep 30
done

```

That's it. Started via `nohup bash script.sh &` using SSHD. The script does nothing but print the current datetime and thanks to nohup writes it to a file. I left this running for a while and then wrote another script to check on the results and print the amount of seconds whenever it's above 30. Result:

```
134
127
115
127
88
113
116
99
110
116
54
44
70
75
62
82
94
68
429
62
81
126
144
39
467
71
62

```

This is from the output of a script that ran for only 4:20 hours, so quite a lot of times where execution must have been delayed, the sleep was longer than 30 seconds, or whatever is going on....

Can someone explain this? And is there a solution to this?

I suspect this might have something to do with memory or power management pausing the script but really it shouldn't happen and I would like my script to run in the background and to sleep for exactly 30 seconds and not be paused or delayed. In this testrun, the highest was 467 seconds, but the highest I've seen with the main script so far was a little over **20 minutes**. This is rare, but 5-10 minutes of a delay happens a few times a day.

# Answer
> 5 votes
Android turns off some of CPUs and/or don't let apps use them when it's dozing. It's achieved through Linux kernel's Control Groups. One of the `cgroups` is `cpuset` that controls which CPU is assigned to which processes. Android creates multiple descendant `cgroups` in `cpuset` e.g. `background`, `foreground`, `system-background`, `top-apps` etc.

Apps are normally in `background` category which can use least no. of CPUs - usually one or two. Core native services like `vold`, `zygote` (and `system_server`), telephony services, and apps which run a foreground service (e.g. notification) or those exempted from Battery Optimization or those having privileges like `allow-in-power-save` are put in `foreground` group which can use CPUs even when device is in sleep mode.

So you need to add the script to `foreground` `cgroup` in order to keep it alive. From within script:

```
~# echo -n $$ >/dev/cpuset/foreground/tasks

```

Going even more aggressive, you can hold a wake lock so that device doesn't suspend:

```
~# echo -n my_script >/sys/power/wake_lock

```

Don't forget to release it (`echo -n my_script >/sys/power/wake_unlock`) after stopping the script.

Please note that both of these measures can adversely affect your battery performance, particularly the latter. Android's warning:

> Creating and holding wake locks can have a dramatic impact on the host device's battery life

---
Tags: shell, ssh, scripts, bash
---


title: Push Empty Directories with ADB

text:
# Question
Title: Push Empty Directories with ADB
**What do I want?**

I want to push some directories from my desktop to my android phone. The directories are empty, but the folder name contains important meta-data. The structure is not changeable.

**What is the Issue?**

If I try to push via adb, I get the following warning:

```
adb: warning: skipping empty directory

```

**What have I tried?**

As a workaround I could use the MTP protocol. But this protocol is not stable and crashes a lot, especially if you want to copy multiple files. I can't get it work on linux anyways, so adb seems to be the best choice.

**My Questions**

1. What is the reasoning to skip empty directories? It seems like an arbitrary (and annoying) design choice for me.
2. Is there a flag to NOT skip empty directories?
3. Is there a workaround?

# Answer
> 1 votes
I don't see a way to get around this limitation of adb in the adb source code. The sad part is that there is already a bug ticket mentioned to change this behavior (the comment was added Nov 2015).

For pushing empty directories I would try to build a TAR archive (e.g. `my.tar`), and execute tar extraction on-device via `adb shell` providing the TAR archive via stdin:

```
adb shell tar xv -C /storage/emulated/0 < my.tar

```

If the tar files contains empty directories they will be correctly extracted on device.

---
Tags: adb
---


# Question
Title: How to see the boot progress messages (akin to dmesg) when booting LineageOS?
After the last OTA update my phone (OnePlus 3) seems to be stuck for about half an hour on the boot animation.

Since updates usually take ages to install, how do I know that the update process is stuck?

On my desktop I can always see `dmesg` message during the boot, and it is relatively easy to troubleshoot problems. Is there a tool that allows me to see the diagnostic messages while the phone is booting?

# Answer
Finally I've managed to do that without any 3rd party addons. The key is to get `boot.img`, and modify the file `default.prop` that is living in the root folder inside the `img-ramdisk.gz`:

You have to do three modifications:

1. `persist.sys.usb.config=none` -\> `persist.sys.usb.config=mtp,adb`
2. `ro.secure=1` -\> `ro.secure=0`
3. `ro.adb.secure=1` -\> `ro.adb.secure=0`

You can get the `boot.img` if you extract the flash image with the OS you are currently using, or by extracting it from the device directly.

After that, the `adb logcat` **will** collect the live boot messages when you connect your laptop to the phone when it boots.

With adb secure on '1', it will give you 'unauthorized' message when you attempt to adb.

`ro.secure=0` allows adb to have root privileges (see more here https://android.googlesource.com/platform/system/core/+/master/adb/daemon/main.cpp)

---

All credits go to the IRC users LuK1337 and razorloves from the LineageOS Discord/IRC channel.
> 2 votes

---
Tags: boot, lineageos
---


# Question
Title: How can I tell if an app can be a "link" target?
I have a couple of Bible apps on my phone. Sometimes, other apps link to a Bible verse, but they usually either embed a Bible viewer in the app or only work with a particular app.

I would like to be prompted for an app in the same way that one is prompted for a browser when clicking a link. But this doesn't happen. Why?

Is it the fault of:

1. The app generating the link;
2. The Bible app(s) I have installed;
3. Android itself; or
4. Some combination of the above?

I'm running Android 4.0.1 (MIUI) on an HTC/Google Nexus One.

# Answer
> 10 votes
**Short and put in lay terms:**

There's no standard defined on how to pass this information between apps, so there are no two apps who can interact the way you want.

**Longer and with some more detailed information:**

The app-selection menu for e.g. a browser or a homescreen only appears when multiple apps announce their being-available for a certain service, and only when this service is called (to put it in easy words; the longer and more technical variant talks about intents and listerners). While web-browsers and homescreens are somehow "generic services" existing on all Android devices, there are standard "intents" defined (see e.g. this question on stackoverflow for opening a page in a browser -- or this question here which probably explains it even better).

As long as there is no corresponding intent (with a defined API for how to pass it the specific chapter:verse to show), your wish can not be fulfilled. Moreover, application developers must implement this into their apps before you can use it.

As to my knowledge neither such API exists nor is it implemented -- there cannot exist any programs acting according to your wishes (except, of course, both are from the same developer; if two or more agreed on terms of how to handle this, that already would mean defining an API).

# Answer
> 0 votes
In addition to @Izzy 's excellent answer, I've had some observations of my own over the years:

* You can copy an application (through ADB *or* a file manager such as X-plore) to your desktop and rename extension to .zip (or in X-plore, you can long-press and directly open-as .zip). Extract if necessary, then look for a file called `AndroidManifest.xml`. Open this file with your preferred text editor (I use Notepad++), and you'll see a bunch of text. Generally, some (or even most) may be obfuscated, but there will generally be blocks of text that are human-readable (you may need to scroll down). If you used X-plore instead, open the file using the internal text editor, and choose to edit the text contents; this will launch the editor rather than the viewer, which will eliminate a lot of formatting characters and make the contents more readable. Among the contents, note that you'll see some intents being listed out, as well as different permissions flags, etc. This is one way to more directly examine possible intent calls.
* Another method, which also makes it possible to call upon these as shortcuts (where possible, compatible, and permissible), I'll be quoting my own answer from this post:
> 1) Go to G Play Market and install Nova Launcher.
> 2) Skip all the setup and go straight to Home screen with Nova as default launcher (since you're just testing functionality at this point)
> 3) Long press your background and select Widgets, then scroll down to Nova Launcher and find the "Activity" widget (for me it's the second widget); long-press then drag to an empty space on Home Screen
> 4) Once you let go to set the widget, an overlay prompt will come into focus and start loading. Depending on your device and number of apps installed, this may take a minute or two, so don't be alarmed. Once it finishes loading, scroll down to your app and locate the activity thread you're looking for and select it (you can long-press them one by one to test the function as well, it will return you back to the previous overlay prompt if the thread didn't cause a crash...if it does, you'll have to restart from step 3.
> ... NOTE: I am enrolled in the Beta, and have the Prime (paid) version, so I'm not sure if that might affect this specific function or not. You can likely purchase for testing and request refund if necessary.
* Another neat feature of X-plore (not sure if this is universal to other file explorer apps as well or not), you can attempt to share any file or list entry and choose to attempt to `open-as` a) specific MIME type, e.g., Video, Picture, Document, etc; or b) `open-as` wildcard (\*), and see all possible choices. Keep in mind though, this is technically circumventing the intended usage scenarios the developers typically anticipate, and can sometimes not work where it should *or* work where it it should not (and in the case of the latter, I bear no liability for what may ensue). From what I've experienced, if you throw archive containers (e.g., .rar) and/or SMB file access into the mix, some unexpected behavior may also occur. Just to even things out though, here's an example of a positive use case: having a media app (e.g., MX Player) that doesn't natively support a particular extension (e.g., `.gif`) -- when added manually through settings, MX Player will remove the entry on refresh -- successfully play the file regardless (NOTE: in this example, HW and HW+ video decoders seem not to work but SW does).

---
Tags: applications, intents
---


# Question
Title: Shortcut to change value of the developer option
My case: during day to day phone (Samsung Galaxy S7) usage I have monochromatic color space turned on from developer options in 'Simulate color space'. But sometimes I would like to turn back to normal color space. Is there possibility to create shortcut to change that option directly from main screen or at least open Developer Options on certain position?

# Answer
You can open a settings page from your home screen by adding a **shortcut**.

Open the Widgets/Shortcuts on your launcher (I can do so by long-pressing an empty space on my home screen) and scroll down to Settings. Then tap the Settings shortcut and select the settings page you want that shortcut to open to. You will want to select Developer Options.

---

Also, some accessibility options are available in your Quick Settings (settings above your notifications). You may be able to edit your Quick Settings tiles to include color space (I have a Quick Setting tile named **Greyscale** which comes from Google's **Digital Wellbeing app**.
> 0 votes

---
Tags: home-screen-shortcuts
---


# Question
Title: How to send all internet traffic to a SOCKS5 proxy server in local network?
I got the inspiration here. It looks like AFWall+ is able to create a NAT forwarding policy to keep all traffic going through a SOCKS5 proxy and fool Google apps into thinking they are not connected via a VPN (Google apps implement additional security measures when connecting via `VPNService` and if you are in China you will not pass the security check - the security check requests don't go through VPN, so they will EOF because GFW will kill these requests, read more here).

So my question is, if let's say I have a socks5 server running at `192.168.1.1:1088` which tunnels all connections via `vmess` protocol (aka `V2Ray`) to remote servers in the US, how do I create my custom script? I have tried:

```
IP6TABLES=/system/bin/ip6tables
IPTABLES=/system/bin/iptables
ULIMIT=/system/bin/ulimit
PORT=1088
SERVER=192.168.1.1
$ULIMIT -n 4096
$IP6TABLES -F
$IP6TABLES -A INPUT -j DROP
$IP6TABLES -A OUTPUT -j DROP
$IPTABLES -t nat -F OUTPUT
$IPTABLES -t nat -A OUTPUT -o lo -j RETURN
$IPTABLES -t nat -A OUTPUT -d 127.0.0.1 -j RETURN
$IPTABLES -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination $SERVER:$PORT
$IPTABLES -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination $SERVER:$PORT
$IPTABLES -t nat -A OUTPUT -p tcp -j DNAT --to-destination $SERVER:$PORT
$IPTABLES -t nat -A OUTPUT -p udp -j DNAT --to-destination $SERVER:$PORT

```

This does not work. So:

1. Did I create a wrong script? How do I create a script that does what I want to do?
2. Are there other settings that I should enable first? I didn't tick any app so I assume that means all app go through custom script, right?

# Answer
The link you have provided is not setting up SOCKS but a **transparent proxy** i.e. it takes TCP/UDP traffic and *SOCKSify* it before sending through `shadowsocks` tunnel. But you need to make your traffic *SOCKS-aware* before directing towards SOCKS proxy. Either configure individual apps (which have built-in support for SOCKS) or enforce proxy system-wide transparently (what you are trying to do).

## LIMITATIONS OF SOCKS PROXY:

> It looks like AFWall+ is able to create a NAT forwarding policy

AFWall+ uses `iptables` at back end and it can execute your script on network changes. Enforcing global proxy is (at least partially) possible with ***proxifier*** apps like ProxyDroid (which is `iptables`-based) and SocksDroid (which is VPN/routing based). I have no affiliation with either.

If manually workig from CLI, you can use a transparent ***TCP/UDP-to-proxy redirector*** like `redsocks` in combination with `iptables`. `shadowsocks` provides its own similar tool (`ss-redir`), so does Tor.

> I didn't tick any app so I assume that means all app go through custom script, right?

No. The problem with the `iptables` approach is that SOCKS5 is a layer 5 protocol in OSI model. So it ***cannot carry whole traffic from all apps***. Most of the traffic generated by apps is TCP which works fine with SOCKS and is easy to setup. But some games, VoIP apps and above all the traditional DNS generate **UDP** traffic which is not supported by many SOCKS5 proxies. E.g. `openssh` and `tor` both don't, `shadowsocks` however does have UDP associate features. But it **doesn't work** with simple `DNAT` or `REDIRECT` (probably because `SO_ORIGINAL_DST` is not available for UDP sockets, I don't know the details). You can possibly redirect traffic only towards a fixed socket (IP:PORT) e.g. a DNS server or game server.

`TPROXY` is the alternative here, but the trouble is that it works only with `PREROUTING` chain i.e. the traffic coming from outside, not that generated on device. So you have to do extra setup to route your on-device traffic without NATing towards a local proxy server (usually default gateway) where you'll set up `TPROXY`.

Complicated? That's why **VPN** is preferred. Even if you need to use a proxy to circumvent firewalls, VPN tunneling through proxy **spares you from the traffic redirection complexities**. VPN operates at lower level in network stack (L2/L3 in OSI), so it flawlessly carries all IP traffic including ICMP echos (`ping`) etc. which can no way be sent through SOCKS. Another plus point is that VPN can be tunneled through **transparent proxies** \- like `shapeshifter-dispatcher` and `stunnel` \- or SOCKS proxies which are meant to **forward only single port** \- like `obfs4proxy`.

If not forwarding single port (tunneling), SOCKS5 must be an **application level proxy** i.e. it should be able to forward arbitrary ports from different apps like SSH dynamic port forwarding does.

**`tun2socks`** is another SOCKSification method which collects TCP/UDP traffic on a `tun` interface (same like a VPN, no NAT involved) and forwards it through a SOCKS proxy. It recently added UDP associate support. Previously used **UDP Gateway** method also worked quite fine but it requires running a separate daemon (`udpgw`) along with proxy server. `tun2socks` is a **non-root solution** because apps - like `SocksDroid` and many other firewalls, sniffers etc. - using this method rely on Android's VPN facilities.

> ... and fool Google apps into thinking they are not connected via a VPN (Google apps implement additional security measures when connecting via `VPNService` ...

With both above methods (VPN through tunnel and Tun-to-SOCKS) it's not necessary to use Android's VPNService API (if that's causing problems for you). On a rooted device you can get a static `openvpn` or `tun2socks` binary and run that through CLI. That's far less hassle than setting up proxy through `iptables`. In former case, though, you need a VPN server obviously.

## `SOCKS`IFY WHOLE DEVICE:

As you don't want to go with VPN/routing based solution, here is the simple `iptables`-based method.

First get `redsocks` binary for your device architecture (or try this one for `aarch64` or this one for `armeabi-v7a`). Create configuration file:

```
// redsocks.conf

// general configuration
base {
    redirector = iptables;
}

// for TCP
redsocks {
    local_ip = "127.0.0.1"; local_port = "12345";
    ip = "192.168.1.1"; port = "1088"; type = socks5;
}

// for UDP, assuming your SOCKS5 proxy supports UDP associate
redudp {
    local_ip = "127.0.0.1"; local_port = "12345";
    ip = "192.168.1.1"; port = "1088";
    dest_ip = "1.1.1.1"; dest_port = "53";  /* set whatever DNS server */
}

```

<sup> * See redsocks.conf.example for details and more options.</sup>

Run:

```
#!/system/bin/sh

IPTABLES="/system/bin/iptables -w5 -t nat"

# create new chain
$IPTABLES -N PROXY
$IPTABLES -I OUTPUT -j PROXY

# exclude local traffic, see: http://manpages.org/ss-redir
$IPTABLES -A PROXY -d 127.0.0.0/8 -j RETURN
$IPTABLES -A PROXY -d 192.168.0.0/16 -j RETURN

# socksify whole TCP traffic
$IPTABLES -A PROXY -p tcp -j DNAT --to 127.0.0.1:12345

# socksify only DNS UDP traffic
$IPTABLES -A PROXY -p udp --dport 53 -j DNAT --to 127.0.0.1:12345

echo "Ctrl^C to exit."
trap "$IPTABLES -D OUTPUT -j PROXY; $IPTABLES -F PROXY; $IPTABLES -X PROXY" EXIT

# run socksifier
redsocks -c /path/to/redsocks.conf

```

You can add custom `iptables` script to AFWall+. `redsocks` can be run as `init` service with non-root UID, dropped capabilities and restricted SELinux context. See How to run an executable on boot?

---

**RELATED:**
> 6 votes

---
Tags: networking, terminal, proxy, firewall, iptables
---


# Question
Title: Can an android phone be converted to SDR using its radio hardware interfaces?
I have recently been reading about SDRs and based on what I have understood so far SDR consists of a radio hardware capable of transmitting and/or receiving radio signals within a given radio spectrum range and a software backbone to control its radio operations, so I thought it should be possible to achieve similar operations using an android smartphone therefore I tried to search for projects in the internet and the closest I have found is SDR Touch which requires an external dedicated hardware. Now since a smartphone has so many radio interfaces (Cellular, Wi-Fi, Bluetooth, GPS etc.) is it somehow possible that I can make a project (using root or whatever) that utilizes smartphone's radio components and why isn't there any project that exists performing such functionalities?.

# Answer
It is very hard because usually radio drivers are proprietary

But there is Nexmon project that turn nexus 5 into SDR
> 1 votes

---
Tags: hardware, cellular-radio, radio-firmware
---


# Question
Title: How to clear/wipe an Android phone before selling it?
I have two phones, the LG GT540 optimus and Samsung GT-i5800, both using Android 2.1, and I intend to sell them in the near future.

Before selling (just like before selling a HDD), I want to wipe all the personal DATA from the phones.

**Question:**
Does a "factory reset" (from the Android phones "menu") surely wipe all the personal data? Or will there be something left to use? (ex.: contact list, Gmail password, etc.?)

# Answer
> 3 votes
By doing a factory reset and formatting the SD cards, I would say that it is safe enough to sell. If you want to be perfectly sure, flashing the original ROM with option of wiping the cache will make the phone as good as you got it when you purchased. Of course, still you have to format the SD card in that case as well.

To know how to flash the original ROM for you LG Optimus GT540, you can visit this page, which has a step by step instructions about this process. You should be able to find similar such page for your other Samsung device just with Google search.

**Update:** I found this web page, which explains about to how to downgrade i5800 to 2.1. By that process you can get the original ROM (watch out for the region) and safely sell.

# Answer
> 0 votes
It is an addition to the Narayanan\`s answer

There are two opposite researches about safely deleting data from flash-memory: safety of simple formatting and unsafety even after rewriting disk several times

If your device is using HDD, you must rewrite disk with 0 and 1(usind dd comand). It is possible(but very hard) to restore your data after first rewriting using magnetic force microscopes.

---
Tags: factory-reset
---


title: How to tell if phone mirrored or hacked

text:
# Question
Title: How to tell if phone mirrored or hacked
I keep having apps on phone I didn't install yet cannot disable. Phone screen keeps doing its own thing. Google maps timeline keeps being edited. Lots of unusual stuff like that.

# Answer
It usually can happen because of fall of the phone from height. Maybe your display touch is broken, so it's touching the apps or texting somethings by itself. Try to hard reset your phone. I am not sure but it can help you. Otherwise, you should give your phone to hardware repairer.
> 1 votes

---
Tags: stock-android
---


# Question
Title: Can I delete multiple emails with the standard Android email app?
I am using LG L3II E430 mobile with standard Android email app.

Can I delete multiple emails?

# Answer
*DISCLAIMER: This is based on the stock email app on a Samsung Galaxy S4.*

If you click on an email quickly, it opens that email.

If you long-press on an email, it selects that email without opening it. Then if you click another email, it also selects that. Now, you have two selected emails. You can then click the delete button to delete both emails.
> 4 votes

# Answer
Tap on the Contact icon or colored letter according to the Starting Letter of your mail Sender and select multiple mails that you want to delete it!
> 1 votes

# Answer
Go to e-mail and select one by clicking on icon on left. Then click on checkbox icon on top banner to select all. You can then delete all or reselect those that you want to keep.
> 0 votes

# Answer
Go to settings Long tap on the concerned account. Under "sync settins" you will find "number of emails to load" Long tap on this will give you a choice of 25, 50, 75, 100, 200 or all. Select all Then when you want to delete all just go to your inbox, select edit, select all, tap delete above reading pane. All your emails will be deleted You will have to repeat this in recycle bin to permanently delete them all
> 0 votes

---
Tags: stock-email-app
---


# Question
Title: Why root cannot access ".android_secure" directory on external SD card?
I have an Android 9 tablet, rooted by way of Magisk. It has an external SD card mounted as `sdfat` on `/mnt/media_rw/1234-5678` which is mounted on four other mount points, all as type `sdcardfs`, with some variation in owner and group.

From a terminal window I type `ls -al /storage/1234-5678`. Lots of files and directories are shown with one error message:

```
ls: permission denied: .android_secure

```

I try as root. I get the same result. Using `/mnt/media_rw/1234-5678` and root, I can see the entry for `.android_secure`. I'm told that `.android_secure` itself is empty.

1. The external SD card is FAT32. Anything on it has the same set of permissions. How is `.android_secure` different from everything else on the card?
2. Even if `.android_secure` has different permissions from the other files in the directory, why is that stopping me from *displaying* the directory entry?
3. I become root and I still can't even display the directory entry for `.android_secure`. How can that be?

I tried `stat`. I tried `lsattr`. Still: `permission denied`.

I have read What does /mnt/asec directory contain? but it doesn't answer my questions:

1. If I have the permissions needed to list some directory entries, how am I being forbidden to list a specific entry in that directory?
2. How is it ever possible to deny root the ability to list a directory entry? (And then change the protections on that entry.)

I can accept that the magic filesystem and/or SELinux makes it possible to have different protections on one file. I just can't understand root being unable to even see *what* those different protections are.

# Answer
A quick search reveals that there exist similar unanswered questions (this, this and this). Let me try to demystify it, starting with brief history.

## WHAT IS `.android_secure` DIRECTORY?

In order to solve the problem of space shortage in internal storage, `app2sd` (*Move to SD Card*) was Android's native feature up to Lollipop. With this method `.apk` files (or whole `/data/app/<pkg>/` directories) are moved as encrypted `.asec` files to `.android_secure` folder on external SD card or *internal* `sdcard` partition (mounted at `/mnt/sdcard/` or `/mnt/media_rw/sdcard[N]/`). On every boot `.android_secure` is bind mounted to `/mnt/secure/asec/` and the (`ext4`) filesystem containers (`.asec`) are decrypted (using `dm-crypt`) and mounted to individual directories (named after package names) in a temporary filesystem mounted at `/mnt/asec/` by `vold`. Symlinks from `/data/app/<pkg>/` and possibly `/data/data/<pkg>/lib/` are pointing towards `/mnt/asec/<pkg>/` and `/mnt/asec/<pkg>/lib/`.

## WHY ACCESS TO `.android_secure` IS RESTRICTED?

From the early days of Android, access to `android_secure` folder (which later became `.android_secure`) was restricted. The commit states:

> *In order to protect the `/android_secure` directory on VFAT removable media from being mucked with by 3rd party applications on the device, we hide the directory with a read-only, zero-sized `tmpfs` mounted on-top.*

Later in Android 4.4 when FUSE was started being used for emulating SD cards from original mount point (`/mnt/media_rw/sdcard1`) to user accessible path (`/storage/sdcard1/`), the zero-sized `tmpfs` functionality (*Ignore attempts to access security sensitive files*) was shifted to `sdcard` daemon which was used to mount FUSE. In Android 6 the `app2sd` method was abandoned in favor of Adoptable Storage (also filesystem UUID was included in mount points).

In Android 7 `sdcardfs` support was added in parallel to FUSE and the *"Always block security-sensitive files"* functionality was added to `sdcardfs` in kernel. In Android 9 FUSE was completely removed (from `sdcard` daemon) but the `sdcardfs` still blocks creation/deletion of `.android_secure` directories in the root of emulated filesystem. However as you noticed, it's possible to access the path through original non-emulated mount point i.e. `/mnt/media_rw/[UUID]/.android_secure`.

For details on filesystem emulation, see What is /storage/emulated/0/?

## WHY ROOT CAN'T ACCESS A DIRECTORY?

> How is it ever possible to deny root the ability to list a directory entry?

`root` is nothing but kernel's dear user. Kernel doesn't stop UID 0 from doing any harm or good. But there are things which are dearer to kernel than root. It includes SELinux 1, Linux capabilities 2 and obviously the filesystem restrictions like we see with FUSE 3 and `sdcardfs` 4. And like root cannot delete a file with `immutable` attribute 5. It's possible to remove any such restriction or add more by modifying kernel source.

---

1 See explanation and example.
2 A simple demonstration:

```
~# setpriv --bounding-set -sys_admin -- sh -c 'id; mount -o ro,remount /'
uid=0(root) gid=0(root) groups=0(root)
mount: permission denied (are you root?)

```

3 FUSE documentation:

> *"No other user (**including root**) can access the contents of the mounted filesystem"*

4 UID 0 is checked after filename (`.android_secure`) is checked.
5 Why can't I delete this file as root?

---

**RELATED:**
> 2 votes

---
Tags: security, external-sd, storage, app2sd, file-permissions
---


# Question
Title: Android 9 pie see if device is encrypted
I am trying to figure out if my Android (Pie) is encrypted.

Per Is there a way for a user to tell if their Android device is encrypted or not?, it says my phone will be reported as `phone encrypted`.

However, when I go `Settings` --\> `Lock screen & security` --\> `Encryption & credentials`, here is what I can see:

>

One can see that:

* My SD card is encrypted
* Credential protection: `Hardware-backed`

I see no mention of `phone encrypted`.

Does this mean my phone's contents (not my SD card) is actually encrypted?

---

**My Phone Specifics**

* LG-G710VM (aka LG G7 ThinQ for Verizon)
* Android 9 (Pie)
* Secure start-up is enabled

---

**\**2/24/2020 Edit\****

In an answer below, @beeshyams suggested verifying encryption by following the answer to this question: How can I find out if my device uses FBE or FDE?

Using Termux I ran `getprop ro.crypto.type`.

It output: `block`, which means my device uses Full Disk Encryption.

# Answer
> 3 votes
All devices that run Android 5 and beyond (out of the box) are encrypted. That's probably why you don't see a separate status for device encryption as you see for Ext.SD.

Encryption can be Full-Disk Encryption (FDE) or File-Based Encryption (FBE). The device is encrypted on first boot using default encryption and once the user sets up lock screen mechanism , that is used for encryption. Relevant extracts

> * FDE was introduced in Android 4.4 and is supported till Android 9.
> * Android 7.0 and higher supports file-based encryption (FBE).
> * For devices running Android 7.0–8.1, file-based encryption can't be used together with adoptable storage.
> * Devices running Android 9 and higher can use adoptable storage and file-based encryption
>
> > * For new devices running Android 10 and higher, file-based encryption is required.

Your device being Android 9 with secure start up, it's most likely FBE. You can verify `ro.crypto.type` on Terminal Emulator and it would show `file` ( See How can I find out if my device uses FBE or FDE?)

---
Tags: security, settings, encryption, 9.0-pie, disk-encryption
---


# Question
Title: ??My samsung s9 lost the OS when i did a factory reset??? HELP MEEE
CAN SOMEONE PLEASE HELP ME WITH A WAY TO REINSTALL THE OS TO MY S9, MY PHONE USES A PROGRAMMED APP CALLED "TEAM WIN RECOVERY PROJECT" AND IT IS THE ONLY THJING THAT WORKS ON MY S9 PLEASE HELP ME THANKS

# Answer
> 0 votes
TWRP is a custom recovery with many useful features, one of which is the ability to backup all partitions. If you have a system backup you could just flash it via TWRP. If by chance you don't you can search your specific carrier device on XDA and flash a custum rom. Contrary to popular belief, flashing a customer rom doesn't necessarily mean rooting your device.
Another option is to download the official factory firmware from Sammobile and flash it using a pc programe called Odin. You may also find official factory firmware avaliable for download from XDA links. Smart switch is another option you may consider looking into. I should warn that some updates may lock your bootloader or prevent downgrade to lower OS's.
Whether you choose custom or factory always use an Md5 checker to confirm the validity of your download.

---
Tags: samsung
---


# Question
Title: How to hide installed app from other app?
If app has storage access, how to hide other installed app from it? App consists of files in different locations. Maybe somehow I can make them unaccessible for other app? If I didn't give root right for detecting app, the only location should be in "Android" folder?

# Answer
> 1 votes
> If app has storage access, how to hide other installed app from it?

Without root access and without any permission (including Storage), any app can `getInstalledApplications` for current user/profile. You need a mod like XPrivacyLua to hide apps from other apps. Or isolate apps in user profiles (see Are multiple-users protected from each other differently than apps?).

> App consists of files in different locations. Maybe somehow I can make them inaccessible for other app? If I didn't give root right for detecting app, the only location should be in "Android" folder?

If I understand correctly you mean that apps private files are already inaccessible to other apps. With `Storage` permission granted apps can only see files created by other apps in shared storage (`/sdcard` and physically external SD card). So if an app creates it's private directory in `/sdcard/Android/`, it does indicate its presence on device. But hiding the private directory won't be helpful as explained earlier. You have to stop the app from using `getInstalledApplications` first.

After that, if you have to grant Storage permission because the app refuses to start otherwise, you can disable Storage access using `appops`:

```
~$ appops set <pkg> READ_EXTERNAL_STORAGE ignore
~$ appops set <pkg> WRITE_EXTERNAL_STORAGE ignore

```

If that doesn't work you have to go for a root solution like XPrivacyLua's `BlockGuardOs.open` hook or Storage Redirect (it's paid app). I've no affiliation with either. Also Scoped Storage on Android 10+ provides better storage isolation.

---
Tags: root-access, hidden
---


# Question
Title: VLC for Android -- resume from stopped position when clicking on History
Let's say I'm listening to a 14 hour long audiobook (on VLC for Android). I pause at the 5 hour point.

Then I don't use VLC for a week.

Then I go back, and go to History, and click on the title of that audiobook. In my experience, it starts playing from the start of that file. I want it to start playing from the 5 hour point. Is there a way to do this? (If not, it would be a nice feature to have.)

# Answer
Answering my own question:

I was unable to get VLC to do it, but I found the perfect alternative app for it:

Simple Audiobook Player:

https://play.google.com/store/apps/details?id=mdmt.sabp.free&hl=en\_US

It only plays audio (no video), however it can remember the "last played" history point for all my audio files.
> 3 votes

# Answer
I too was looking for this but I haven't found a direct answer for VLC on android. There is an option under `Settings -> Extra Setting -> Video -> Ask confirmation to resume`. But it appears to only work for video and there is currently no equivalent setting under the audio settings.

I did come across another app called Smart AudioBook Player which has this feature. Unfortunately it's not totally free like VLC but there is a free mode (I'm not 100% sure on the differences). The cool thing is it will remember your location in multiple books not just the last one you played.
> 7 votes

# Answer
I just found a way to do it (with VLC 3.0.13 and Android 7.1.2). When you are done listening to your audio file do not pause it, but quit VLC application by tapping on the cross in the notification pop-up.

\[

When reopening VLC, go to "history", select the audio file you were listening and that's it: it will resume at the point where you exited VLC app.

N.B.: You can listen to multiple audio files and VLC will keep in memory each quitting point.
> 2 votes

# Answer
Resume audio playback position does work in VLC-Android v3.2.7 when both these conditions are met

* the audio file's ID3 `genre` tag is one of `podcast`, `audiobooks`, `audiobook`, `speech`, `vocal` (or if the file is untagged and \> 15 minutes long) (source code)
* the last time the file was played playback ended with `stop` (longpress pause button)

Resume does *not* currently work if the last playing of the file ended with `pause` (tap pause button).
But a fix for that is in progress.
> 2 votes

---
Tags: history, vlc
---


# Question
Title: How to transfer files from an Android phone to a Ubuntu PC by using a USB cable?
Im completely new user and inexpert. I made a video with the phone. How do l transfer it to an ubuntu pc? I plugged in the usb cable but apparenntly my pc does not see the phone. Thanks for help

# Answer
> 10 votes
**First of all you don't need any USB cable.** You can transfer files from/to your android device with the Wi-Fi network of your device. Just install airdroid on your android device. Then activate wi-fi hotspot on your android and open the airdroid app. Next connect your pc to that hotspot, open any browser in your pc and enter the url provided by the airdroid app there. It will ask for your permission, click to connect. Done. The good news is that this technique works in any Linux distro as well, I tested it on Ubuntu 14.04.1. It just uses your android wi-fi device and there is no issue related to mobile data plan i.e. you can use it without the mobile data.

# Answer
> 6 votes
In Ubuntu 16+ all you need to do is click the swipe on the phone after plugging in the usb cord and select "File Transfer". The default mode is "USB Charging", and it will hide the file system from you.

When you do this, it creates an MTP mount, which automatically pops up on Nautilus, the file explorer. Tested on Android 11, Pixel 3a.

# Answer
> 3 votes
A bit late to reply to this post. You can use KDE Connect utility to transfer data from android phone to your Ubuntu. Its really easy to setup and works like a charm. You can easily find tutorials to setup KDE Connect to Ubuntu.

Installing KDE Connect on Ubuntu

```
sudo add-apt-repository ppa:vikoadi/ppa
sudo apt-get update
sudo apt-get install indicator-kdeconnect kdeconnect

```

Install KDE Connect app from playstore and open it. Send request from Desktop to pair with your phone(vice-versa doesn't work for some weird reason)

# Answer
> 3 votes
1. Just share or copy files in your phone via "ES File Explorer"
2. connect your phone (need cable) with computer and thats it

# Answer
> 2 votes
It can be done without cable in few ways.

One simplest way is to install “Dropbox” on your phone and then access the pictures from the Web. Given below link is for **"Ubuntu desktop platform"**:

https://www.dropbox.com/install?os=lnx

**Link for Android**

https://play.google.com/store/apps/details?id=com.dropbox.android&hl=en

After installing it on both the systems, sign in to your account (or create an account if account doesn’t exists) and start uploading all the pics on your phone.

*Let me know if this information will help you out.*

# Answer
> 1 votes
I figured it out real simple. No downloads. My Android phone (8.1, Moto G5 Plus) has an option in settings that allows me to mount the phone directly and see all the folders: **Settings \> Connected Devices \> USB**.

There you can pick "Charge this device", "Transfer files (MTP)", "Transfer photos (PTP)" or "Use device as MIDI".

I had to unmount and remount the phone in Nautilus/Files after changing the option in my settings. Worked without a hitch in Gnome 3.30/Ubuntu 18.10.

# Answer
> 0 votes
Adding another option for copying files to/from any Linux/BSD/etc pc and an Android device (in my case, Nexus 10 tablet):

* on the Android device, I installed "ES File Explorer", which comes with an ftp/sftp client;
* then, with normal sshd running on the Linux/Ubuntu host (make sure this is installed),
* *from the tablet* : select the files you want to copy, and paste into the linux/pc desired folder. (Or vice/versa.) All from the tablet. No cables necessary -- just wifi.

This is using the useful/flexible/free "ES File Explorer", but any Android-based file-transfer (sftp) client will work. (I'm open to other recommendations for this, especially any rsync tools.)

# Answer
> 0 votes
Assuming you have installed MTP on Ubuntu, you may still need to enable MTP transfer on your phone. There's an article here that covers this. Option 1's steps 1-3 were enough for my phone to appear in Ubuntu's "Files".

# Answer
> 0 votes
You can do this with a USB cable, this is faster and more secure than using your Wifi router. Just plug your phone in with USB-C or whatever, and you should be able to load the contents of the DCIM folder. I had to mess with this for a while, but just be patient when you open the DCIM folder and it should work. I tried AirDroid, but the USB solution seems much better (faster and more secure and don't have to download any 3rd party apps..).

# Answer
> 0 votes
The most foolproof technique is to install on your phone an FTP server ...

android app ftp server : Ftp Server by The Olive Tree

... launch this android app and click the red widget in middle top of app to enable server so widget turns green as in

then on your Ubuntu box connect over wifi using an FTP client

ubuntu ftp client : FileZilla install using

```
sudo apt-get install filezilla

```

launch filezilla on ubuntu ... enter values shown on your phone ftp server for following fields

Host: 192.168.0.133 Username: francis Password: francis Port: 2221

( your values may be different )

In filezilla on left side will be your ubuntu filesystem on right your phone filesystem ... now just drag and drop files between those systems

If you have just added a file to your phone you can view it using a File Manager app or the app called `Files`

# Answer
> -2 votes
Consider using `gmtp`. Although advertised as a media player, it is an effective tool for transferring files via MTP.

```
sudo apt-get -y install mtp-tools mtpfs gmtp

```

and try to use its GUI as necessary!

---
Tags: linux, usb-connection-mode
---


# Question
Title: Chinese character input is translated to emoji in WhatsApp
When inputting a Chinese character "" on WhatsApp for Android version 2.20.47, it is rendered as the emoji instead.

My first guess is the Unicode of the Chinese character and the emoji are the same? Is there any reason behind this?

FYI: The character is typed with ChangJie, and the input code is 竹人戈一弓 or HOIMN.

# Answer
> 2 votes
**This is because WhatsApp uses Apple's emoji set, which essentially uses SoftBank mapping for backward compatibility in a Private Use Area (PUA), long before emoji was standardized in the Unicode.**

The character "" (U+E409) is in the Basic Multilingual Plane's (U+E000 - U+F8FF) PUA. Since it is in the PUA, there is no standard definition for the character. While the character is supposedly rendered as , SoftBank (and Apple subsequently) apparently uses the PUA for their emoji, and U+E409 "coincidentally" renders .

Some other characters in the PUA that are rendered as emoji on WhatsApp (U+E400 - U+E40F):

> 

Note that this is entirely WhatsApp's doing. This also affects WhatsApp Web and also WhatsApp on PC. However, other apps/OSes may render the character differently or otherwise, fails to render.

---
Tags: whatsapp-messenger
---


# Question
Title: How to patch and sign android bootloader image to enable "volume_up" button?
Had trouble with it for a long time because manufacturer disabled the button to unlock the rooting functionality.

# Answer
I live in the U.S. and what was once the land of the free is now the land of the locked bootloader. Good luck

https://www.geektrouble.info/explore/android/view/218873

"OEMs/SoC vendors implement a Chain of Trust which must have a hardware-backed root of trust - a cryptographic key. On boot every software component verifies the integrity of the next component before loading it in memory. This chain of trust starts with BootROM (the very first executable code which runs on Power ON) and ends at /system and /vendor partitions. Everything in between - bootloaders, Device Tree, Linux kernel and Android OS code - is verified to be unaltered."
> 0 votes

---
Tags: bootloader, root-access
---


title: An Pixel XL phone shutdown by itself

text:
# Question
Title: An Pixel XL phone shutdown by itself
My Pixel XL phone rencently always turns off by itself. Most times it turned off just after starting up, a few times it worked longer and everything looks fine. when it happend, a "phone is shuting down"(maybe not exactly these words because my phone is not in english) dialog pop up and then shut down in a few seconds.

I tried restoring it to factory image, and tried replace a new battery, and had not fix this.

I got the log using "adb logcat", here is it : full log file

Now I think its because of a hardware part, but seems not battery. I want to find out which hardware part is it from the log file, but I don't know much about the log messages, can anyone help to find some clues about what cause the auto-shutdown? Thank you very much!

John.

# Answer
Based on the provided logcat it seems like the shutdown is initiated by the `healthd` that manages for example the battery status:

```
healthd : battery l=63 v=3913 t=72.7 h=3 st=2 c=5 chg=u

```

This line contains two values of interest:

1. `h=3` is the battery health value and the value 3 means BATTERY\_HEALTH\_OVERHEAT.
2. `t=72.7` is the battery temperature in Celsius. This value is quite high taking it as temperature in Celsius as Android does. Hence I would assume that the battery provides the temperature in Fahrenheit but the device expects a Celsius value and therefore thinks that the battery temperature is very high. The default shutdown temperature in Android is 68°C.

What I not really understand is that all healthd message contain the `h=3` value even if the temperature is lower. May be this value also reflects past temperature states.

Note: Internally Android does not directly use the temperature in Celsius, instead it uses Centigrade (Celsius * 10).

At the moment I would recommend to do the following test: Pack your phone into a water proof box and place it for some minutes in he refrigerator (make sure you use the part that has more than 0°C, you just want to cool down the device not freeze it!). Then get it out of the fridge and start it, and measure the run-time until it shuts down. The time should be larger than before.
> 1 votes

---
Tags: logging, google-pixel, shutdown
---


# Question
Title: command line language for Android tablet (wget equivalent)
I am a Linux enthusiast and probable expert, and using it since 1993 on the command line (today with zsh) (and Unix since 1987, SunOS3.2).

I personally have a Huawei tablet, details here. With an SD card.

I also have a Logitech Bluetooth keyboard case for that tablet.

I need to be able to read some PDF documents on the tablet without a working internet connection. (at my work at CEA/LIST \- a quite bureaucratic organization since indirectly related to French nuclear warheads, I have a powerful Dell workstation with `root` access & Ethernet connection to the Internet under Debian/Unstable - so sometimes Xorg does not work properly -, but no access to the corporate Wifi; for the clips-rule-gcc project I prefer to read the CLIPS documentation on my BYOD tablet).

If my tablet was good genuine Linux Debian system, I would just `wget http://clipsrules.sourceforge.net/documentation/v640/bpg.pdf` when Internet is available, and later `evince bpg.pdf` when it is not, taking advantage of `zsh` auto completion facilities.

What are the equivalent on Android 8 ?

My AppStore is google, and I was not yet able to root my tablet. Dreaming of that every day.

# Answer
Did you tried Termux? The terminal emulator for android, this does not require any root access either.

Edit: to install `wget` type `pkg install wget` and press enter.

For pdf viewer use native android one such as Mu Pdf or, Google pdf viewer

Once installed you can try `xdg-open filename.pdf` It will give you a list of the compatible app to open the file or else you can open the pdf viewer app to browse files of your choice.
> 2 votes

# Answer
the android cmd line language is MirBSD Korn Shell mksh and default core utilities are FreeBSD or toybox (and few android specific toolbox) applets

there is no dpkg or apt equivalent the closest is android package manager (commands `am` or `pm`)

default console is android debug bridge (like ssh) you need to enable usb-debugging in developer settings, connect to pc and install package `android-tools-adb` then you can start `adb shell` and authorize the ~/. android RSA-key by simply accept confirmation dialog on tablet
> 1 votes

---
Tags: applications, internal-storage
---


title: What is "GPUwatch Interceptor app"

text:
# Question
Title: What is "GPUwatch Interceptor app"
I was going through my settings today and I clicked on privacy then checked my special access and noticed something I've never seen before. An app called watch GPU interceptor it had full access permissions with no description. I turned it off went back to the main menu a few minutes later I went back to special access and it was still there and set to on, full access. I searched everywhere I could on my phone went through apps permissions I couldn't find it as an app. I found GPU watch which was in developer options, I turned off developer options then went back to special access and had to turn off ""GPU watch Interceptor "" again. I cannot find that exact phrase in Google search. I'd like to know if this was something that I turned on in developer options or if it was some sort of Hack / malware. I'm using a Samsung S10 Plus, with Android 10 on Verizon and home Wi-Fi I have added a screen capture of what I saw

Thank you

# Answer
## No, It doesn't a malware.

***GPUWatch*** aids developers in their monitoring and measurement of performance between Vulkan and OpenGL ES. It’s now packed with new features, such as overlaid measurement results and real-time information on-screen – all made possible without separate installation or PC connection. Samsung NewsRoom
How is showed in the smartphone screen :
*image retired from link GDC19*
For to deepen in GPUWatch I recommend to you two Youtube videos:
GDC19: A talk of HyoKeun Lee addressing about why use that tool.
GDC18: HyoKeun again, showing how to use GPUWatch.
> 1 votes

---
Tags: malware
---


title: Change orientation in androidx86

text:
# Question
Title: Change orientation in androidx86
How can I fully rotate my screen and not only resize it like in the picture?

In already tried several rotation apps in the play store. I tried via **root shell** the commands: `wm size`, `settings put system accelerometer_rotation 0` and `settings put system user_rotation 0` both are working fine on my phone, but not on my tablet.

# Answer
> 2 votes
You should try some rotation control app from play store, like Rotation Control which can rotate the screen in any direction you want (like reverse portrait) But you should also note that it's not possible with every app, because maybe the layout is not provided or the layout is forced to be in portrait mode, in that case no app can help you. There ain't much apps available specifically for xxhdpi & xxxhdpi screens and so you're not left with much choice but to work with the way it is....

# Answer
> 0 votes
I did not found any solution. I installed the new PhoenixOS. It works good, and the orientation sensor works too. Maybe we will find a solution for android x86 soon.

# Answer
> 0 votes
In latest version of Android x86\_64 8.1 Screen is rotating normally if you select in Grub ... \> Advanced Options ... \> Vulkan Support

# Answer
> 0 votes
I face same problem on chuwi Hi10 x. Reason was if your tablet orientation sensor is not recognized Or defined in Android it forces screen in one orientation To solve this Open init.sh file which in device root /etc/init.sh Find the following line "has\_sensors = false" and make it = true this tell android that you have orientation sensor even if it actually not recognized it Then reboot Now you can change orientation using any orientation app.

---
Tags: android-x86, android-pc
---


# Question
Title: Can I manually focus the camera on my Android phone?
Is there any way to manually focus the camera on my Android phone?

I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.

# Answer
I couldn't find a way to do it or an app that would do it. There were a couple out there that claimed to have manual focus but basically just did what you described as "assisted auto focus."

I found this thread at XDA where some people have been looking through the code to find a way to add the manual focus. From what they found it appears that it is possible but someone has to code it. Its worth keeping an eye on it: http://forum.xda-developers.com/showthread.php?t=630989
> 11 votes

# Answer
The new API for full control of the camera on android had been added to android version 5. Google added these features like iso ,manual focus and etc in android lollipop. I personally think to use this new API the camera hardware must support this features, However I didn't find any reference to claim this, but it makes sense to me that a hardware must be able to do such stuff.

you can use this app to check Manual Camera Compatibility.
> 8 votes

# Answer
There is a free android app that allows you to manually adjust focus (and more camera technical stuff for photographers) Its called open camera and can be found on playstore. (the one by mark harman) NOTE: it will only work if your device supports it. (aka if possible)

To get straight to using manual focous: install, open settings, near bottom of page turn "use camera2 API" on, then in camera mode (ready to take picture) click the "..." on the right side pannel, on the second row down of icons click the "m" (just above the "photo mode" words) (make sure your scolled to top, you can scroll down in that menu) It will then popup 'focus manual' and on the left side there is a big slider (above the zoom slider), you can drag that to manually focus your camera.

* someone who has had this app for a while. Your welcome.
> 6 votes

# Answer
My Hauwei Mate 9 has manual focus, ISO, and shutter speed options. I use it frequently for sunsets and stage lighting.
> 1 votes

# Answer
Only 8 years later, the Moment Pro Photo app can now do this. May not be available for every phone, but it works as advertised on mine, specifically the manual focus.

https://play.google.com/store/apps/details?id=com.shopmoment.momentprocamera
> 0 votes

---
Tags: camera
---


# Question
Title: What android icon app is this? Please advise
not sure what this icon is but any help would be greatly appreciated.

# Answer
This is the icon of Google Sheet file. It is visible in Google Drive for Google Sheet files. Google Sheet is an alternative to Microsoft Excel.
> 1 votes

---
Tags: app-icons
---


title: LG G2 proximity sensor

text:
# Question
Title: LG G2 proximity sensor
I found a big issue in my LG G2 proximity sensor. During a phone call the screen doesn't turn off and the automatic screen lightness doesn't work. This problems happened many times a day. I also tried to do an hard reset but I got the same issue just after the reset reboot (without any app). Sometimes also the gravity sensor holds (screen doesn't turn), but this not so often as proximity sensor problem. I installed a sensor test app and this app doesn't work too (sometimes got data sometimes not).

What can it be?

Firstly I thought about an software problem, after the hard reset I thought an hardware problem, but it is very strange all this trouble on a 2month old phone. These problems started 2 weeks ago.

Is there in android a system log or something like this?

# Answer
Had similar issue with G2 after display replacement. Unfortunately this could be solved only by replacing the proximity sensor itself (via warranty repair). From the information I found out on the web

The most disturbing issue was that I could not unlock the phone in dark light environment (the screen immediately turned off when I tried to go past the lockscreen).
> 1 votes

# Answer
If you're still experiencing the issue, I am making the assumption that you have an international LG G2 (D802) so you should try and diagnose the issue as you said by looking at some sort of log or even a test. Open the dialer and type this string into it and a service menu should appear.

```
3845#*802#

```

After this, click on "HW Device Test" and then "ALC Proximity Text". Let us know how you get on from there.
> 0 votes

# Answer
I had proximity detector issue when I replaced my LG G2 VS980 LCD and screen. I found that disconnecting it and removing it was a great solution for me. If I need to hold phone to my ear I simply push the power button to turn off screen. The other thing I noticed is that phone does not know its orientation but that will not matter for most people because, although phone does not know "what way it is pointed" it knows "where it is" so GPS works fine. Using apps to identify things in the sky like planes and stars will likely not work though.
> 0 votes

# Answer
my screen also bugs on my G2 D802 , on random unlocks and on all callls i cant open screen to end calls .

mike i will reply , the proximity test on what you said is NEAR with yellow letters and light is 0.00

\***my temporary solution is this : plug ANYTHING to your phone ! i usually go aorund with headphones so i am ok , but when not , i have a small jack ( 2 inputs 1 output ) and just plug it to open the screen :)
> 0 votes

---
Tags: lg-g2, proximity-sensor, hard-reset
---


# Question
Title: Force country code on known numbers to send an SMS
I've been looking on the internet for an answer, to no avail. I have a phone mostly used in France, I recently brought to the US with a US sim card. Unfortunately, most contacts were added with the default French format (ten-digit number starting by "06" or "07").

Unfortunately, here in the US, one would need to have the country code in front of the number (+336 instead of 06) for the text to go through the US network. And this is where Android shows its weaknesses.

Indeed, even if you:

1. delete a complete SMS conversation
2. add the country code to the contact, and then change one digit at the end of the contact so the number associated to the conversation should be removed from the system
3. reboot the phone
4. wait 1 day for anything delayed to take effect
5. change the digit back into the real number, this time with country code
6. try to send a text by explicitly typing in the number (not the contact name) with +33

Then, it does not matter that you have done steps 1-5, Android will still "snap" your complete number with country code, to the default one he had (and still remembers somehow), which was without.

It now comes to the extent that I especially pay attention when writing a new contact, to *always* add the country code, since the first time the system sees the number, so that it can never dream of removing that country code by itself.

I have tried installing a third-party SMS app like Pulse SMS, but it uses Android's built in SMS contact book, so same "snap" problem.

What I would like instead, would be an SMS app that ignores the contact book, or recreates its own from the real contact book (not the image of the contact book stored in the SMS app), so that I can finally "force" the country code onto the SMS app (or more simply, that adding the country code in the address book would add it in the SMS app, which would be normal behavior), so the SMS can be sent, otherwise, it can't!

Does anyone know of such a low-level SMS app, or of a way to trick the built-in app to finally use the country code?

Thanks!

# Answer
I confirm that the problem persists on a pixel 3a. But, it is kind of reversed. In my case it is a US number and the SMS messages are linked to the number *with* the country code. But, within the US the messages must be sent *without* the country code. I find the same as the OP, there is nothing I can do to prevent the country code from being added. Delete the SMS messages, delete the phone book entries. Android is smart enough to always link the number I enter with the old entry that included the country code, recalling it from oblivion. But, it is too dumb to know that the message must be sent without the country code.

Also the answers given are missing the point. There is nothing we can do to control whether the country code is added. You can delete the contacts or edit them any way you like, the original form of the number will always be retrieved, with the result that you cannot text that number.
> 0 votes

---
Tags: contacts, sms, 7.0-nougat, international-prefix
---


# Question
Title: Switch from micro USB to USB c, buy adapters or new cables?
Firt of I'm not a 100% sure this is the right site to ask this on but here we go.

So I will have to buy a new phone in the near future. With this I'll most likely get one with USB c instead of now micro USB.

I have quite a few cables for recharging (1-3 at home, at work, and one for my powerbank) all of those are micro USB and still work fine, some of them are long cables so they weren't that cheap.

My question now is: is there any downside to buying adapters and sticking them on my already owned cables or should I have replace them? (clearly not all of them as I still have other stuff that charges with micro USB)

# Answer
Personally I prefer cables without adapter. Especially when it comes to charging the adapter may reduce the maximum charging power (because it works like a resistor).

If you use an adapter I would strongly recommend to use an short adapter cable, not a small fixed adapter with a plug and a connector in a small case: The adapter without cable effectively extends the length of the plug and therefore also the force you apply onto the USB port on the phone's mainboard (because of the leverage effect). Hence using an adapter can decrease the lifetime of the USB-port.

Therefore I would replace the one or two most used cables for now. Others can still be used with adapter. In some months you know what you prefer and if it makes sense to buy more USB-C cables.
> 0 votes

---
Tags: sony-xperia-z
---


# Question
Title: Unable to transfer files on android 8.0 TV box to the USB
Unable to transfer files on android 8.0 TV box to the USB. I have tried many file transfer apps but none will transfer to my USB even though it shows my USB connection and any files that are on the USB. Can anyone help?

# Answer
> 1 votes
Have you tried TotalCommander? Its possible that the USB drive is mounted as read-only. In TotalCommander, If you copy to the USB drive and the USB drive is mounted as read-only: TotalCommander will automatically ask if you want to remount the drive as read-write, which is what you want. Say 'Yes', then it copies whatever files you want to your USB.

---
Tags: usb, android-tv
---


# Question
Title: How to disable calls but still receive texts
Is it possible through a setting or an app to receive only text messages and not phone calls?

Specifically I have an Samsung galaxy s3

# Answer
Not sure about the Galaxy S3, but my S5 has the option to disable just the calls. Open the Dialer → Settings → Call → Call → Rejection → Auto rejection mode →All incoming calls.
> 1 votes

# Answer
Use call forwarding. Forward to a number which is not in the network.
> 0 votes

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


title: How do you disable Ambient mode?

text:
# Question
Title: How do you disable Ambient mode?
I disabled Google Assistant on my phone\* but Google's Ambient mode kept showing up when my phone was on charge.

I didn't want Ambient mode (it wasted power and blocked me from accessing the lock screen); how do I make it go back to pre-Assistant behaviour?

Note: I *have* turned off Google Assistant; this had no effect.

* Mi2S with Mokee kernel (Android 8.1.0)

# Answer
I have successfully disabled Ambient mode.

... by turning *on* Google Assistant and then turning *off* all the options (including Ambient mode).

The Google Assistant options can be reached (on my phone at least) by traversing: Settings | Google | Account Services | Search, Assistant & Voice | Google Assistant | Assistant (tab) | Assistant Devices | {choose your device}.

I'd like to see Assistant **off** -\> Ambient **off**, but for now it's a solution...
> 1 votes

---
Tags: google
---


title: Unable to delete .apk file

text:
# Question
Title: Unable to delete .apk file
I downloaded a ROM file on my Google Pixel 3a XL and it left behind an APK file with the name of the game.

I am now unable to delete the file. When I try to, it just has a pop-up saying 'couldn't delete 1 file'.

If someone could please advise as I'm worried about having this file.

# Answer
You could try rebooting your phone and deleting the file. It's possible that a running app or service has that file handle open and won't let you delete it for that reason.

It's also possible that maybe the file is already deleted, it's just your app that you're using to view the file that needs to be refreshed. It can't delete a file that doesn't exist.

You could also use TotalCommander to delete the file.

If that doesn't work, you can always plug your phone up to your computer and use ADB.

```
adb shell rm "/storage/emulated/0/Download/Mario Party 7.apk"

```

(replace `/storage/emulated/0/Download` with actual file path)
> 2 votes

---
Tags: apk, files, delete
---


title: Getting started with emulator

text:
# Question
Title: Getting started with emulator
I'm sorry that this is almost certainly one of those "read the docs" questions, but I've been trying to do so for a while now, and my head is spinning. I suspect what I want is impossible, but would appreciate if someone can confirm/deny/point me in the right direction before I tear any more hair out.

I want to start to tinker with Android and determine whether I want to learn this environment or not. I have installed Android Studio on my Ubuntu Linux 18.04 primary development machine which has 32G RAM and an I7-4790 processor. However, I also have VirtualBox running and it's not an option to shut that down. Consequently, the emulator refuses to start.

My investigations then came across "genymotion", but their website seems to indicate that even a single dev license is over a hundred bucks a year. Am I right about this, or are they merely hiding a community edition somewhere? I'm not willing to pay for the tools at this stage of discovery.

So, my specific question: is there a zero money emulator that I can use on Linux, concurrently with VirtualBox?

EDIT: I took advantage of the need to do some upgrades and took VirtualBox down for ten minutes last night. I succeeded in proving that the emulator and the AndroingStudio installation work perfectly under these conditions.

# Answer
> 0 votes
Yes, in fact Android absolu has an emulator called `quemo` There are a couple of beautiful things about quemo. For one you just need to use your Linux machine to Git clone it in. Second, it is from the Android Google source code and you do not need to download Android Studio.

---
Tags: android-emulator, emulators
---


title: RCS Messaging Encryption

text:
# Question
Title: RCS Messaging Encryption
With the launch of Google's RCS messaging protocol, is there any reason as to why it doesn't support end-to-end encryption, or is it a feature that they intend to implement at a later time?

# Answer
> is there any reason as to why it doesn't support end to end encryption, or is it a feature that they intend to implement at a later time?

RCS improves the old SMS by bringing modern features. It provides client to server side encryption but not provide end to end encryption. According to What is RCS messaging? Everything you need to know about the SMS successor:

> But Chat is missing one critical element: While the original RCS protocol allowed the implementation of client-to-server encryption, Chat does not offer end-to-end encryption like iMessage or Signal. Rather, it retains the same legal intercept standards as its SMS predecessor.

Asked about the privacy issues related to RCS, Google's product management director for Android Messages replied:

> We fundamentally believe that communication, especially messaging, is highly personal and users have a right to privacy for their communications. And we’re fully committed to finding a solution for our users.

Google is working on it but no indication is given as to when end to end encryption will become a feature. In the meantime, when sending a message,

> It's encrypted in transit, but it’s not fully end-to-end encrypted, so your RCS provider can potentially see the contents of your messages, and turn them over to the government if properly asked. Google says it will delete them from its servers as soon as they’re delivered to your phone

Like for SMSes, the providers will be able to read your messages until Google decides to implement end to end encryption.
> 2 votes

# Answer
The issue here is that RCS is *not* a Google product/service. Google serves RCS via a service called Chat, and Google Messages (the pre-installed, default SMS app on most Android phones) supports RCS. *The Verge* are pretty bad at conflating the two but even they say (emphasis added):

> Google has been quietly corralling every major cellphone carrier on the planet into adopting technology to replace SMS. It’s going to be called “Chat,” and it’s *based on* a standard called the “Universal Profile for Rich Communication Services.”

But RCS is actually a "carrier-led" initiative organised by the GSM Association, which defines the "Universal Profile," and there are a lot of companies involved in supplying RCS products. Google has encouraged RCS, because it makes Android phones more appealing and competitive with iPhones and iMessage, but it doesn't "own" the initiative.

That means that RCS is actually provided by *mobile operators*, who are subject to legal intercept legislation. So when commentators say "Rich Communication Services is generally credited as being more secure" they are mainly talking about verified identities for businesses, which are supposed to reduce fraud. Because typically operators will need a point within their network where messages are unencrypted for when some law enforcement organisation requests access.
> 1 votes

---
Tags: sms, google, encryption, instant-messaging, rich-communication-services
---


# Question
Title: Screenshots taken in the work profile are saved in the personal profile
When taking a screenshot of any app in my work profile, the picture is saved to my personal profile.

Is this the default/expected behaviour ?

# Answer
> 3 votes
I'm not sure if it is or it should be the default behavior, but **it is** expected behavior.

Screenshots are taken (through command-line or key combination or tile) and saved by ***System UI*** (`com.android.systemui`) package which is part of stock Android. When deciding where to save the screenshot file, the path is decided (using `getExternalStoragePublicDirectory` API up to Android 9 or `MediaStore` on Android 10+) based on the **current `User_ID`** (not `UID`), which is `0` for device owner (personal profile) and `10`, `11`, `12` .... for secondary users/profiles.

Since **profiles** are not completely isolated users but associated to a parent user, separate instances of only essential apps and packages are run under new User\_ID. All display related things e.g. notifications, lock screen, status bar etc. in secondary profile are handled by primary user's *System UI* process which is running under User\_ID `0` e.g. with UID `10500`. So the screenshot is saved to primary profile's storage i.e. `/storage/emulated/0/Pictures/Screenshots/`.

However **Multiple Users** are more isolated than profiles and unlike latter, two users cannot share user interface. When you create and switch to a new user (not enabled on all ROMs by OEMs/developers), a separate instance of *System UI* app is run e.g. with UID `1010500`. So the new user has a separate lock screen and doesn't share notifications with primary user. Likewise a screenshot is saved to `/storage/emulated/10/Pictures/Screenshots/`.

---
Tags: profiles
---


# Question
Title: pm hide VS pm disable -- the identity crisis
What's the need of `pm disable` when `pm hide` already does its job?

I've compiled some information based on my search and research: click here to see the table (*edited*).

As you can see, `pm hide` can achieve what `pm disable` can, *but without needing root access*. Also, based on my tests, I've reached the conclusion that when `pm hide` is performed, unlike `pm disable`, no matter what, the app will not be loaded in the memory again.

I opine that *hide* descended from *block*. *Block* was first introduced in KitKat 4.4.0, remained till Android L Preview and was later superseded by *hide* in Android 5.0.0. It is not clear to me what lead to renaming of *block* to *hide* and why was it needed?

Regardless, if somebody without root access can achieve the functionality of *disable*, then why does *disable* exists at all?

Furthermore, why does *hide* exists? If *hide* was built supposedly to help users to get rid of anything they want, without un-installation and without rooting the device, then in the GUI we should be having a relevant option, but we've got only the disable option.

Intertwine questions:

* What are the merits and demerits of them, excluding those noted in my question?
* Why both of them exists and to what or whom do they serve?
* Is it technically true that *hide* surpasses the functionality of *disable* and ***can truly disable any app***, when executed on it?
* ***New***: Given findings of Andrew T. and my tests shown in the table, is component shown in *hide*'s usage an error or have I failed to understand latter's usage?

For historical purposes: *hide*'s usage as of now is shown as

```
  pm hide [--user USER_ID] PACKAGE_OR_COMPONENT

```

**Note:** The question does not, in any fashion, seeks unsubstantiated opinion but straight to-the-point answer(s). *If you must write an opinion, make sure to back it up using credible and technical sources with sound reasoning to make distinction between what is technical and real and what is speculative.*

---

Tests performed on Carbon ROM (Android 5.1.1) and COS12 (Android 5.0.2) for OnePlus One.

# Answer
I don't have enough points to comment yet.. This is not an answer... more like... information:

pm hide does this

pm disable does this and **if** it can find the component name then this.

I can see how some people may have thought that pm hide would do an uninstall.

ex. If you run this command after a pm hide

```
diff <(adb shell pm list packages -u) <(adb shell pm list packages)

```

You'll see your hidden package. -u is a list of previously uninstalled packages.

These pm commands below all invoke androids Intent class.

```
pm hide <package>
pm unhide <package>
pm enable <package>
pm disable <package>

```

This command below:

```
pm hide <package>

```

invokes:

```
android.intent.action.PACKAGE_REMOVED.

```

This below command:

```
pm unhide <package>

```

invokes:

```
android.intent.action.PACKAGE_ADDED.

```

pm disable and pm enable both invoke:

```
android.intent.action.PACKAGE_CHANGED.

```

Thanks @Irfan Latif for the corrections. I can verify what he was saying. Under Android Settings: If you look at installed apps, even after pm hide, you can still see the app is installed. Interestingly, with pm disable, the app disappears from installed apps. These commands don't seem to create any obvious filesystem changes.

These directories:

```
/mnt/sdcard/Android/data/
/data/data

```

and other misc directories...

One possible hypothesis... Maybe its best practice to always call both commands to disable any package:

```
pm disable <package>;pm hide <package>

```
> 3 votes

---
Tags: 5.0-lollipop, 5.1-lollipop, command-line
---


# Question
Title: A cat randomly appears and disapears from the Google Search bar. What is this?
It looks like the Cheshire cat but I was unable to find anything on the internet about it.

This is a Pixel 2 phone with stock android.

# Answer
> 3 votes
It's a doodle from Google related to Sir John Tenniel's 200th birthday. This is a **feature** for Google search app widget which you can also disable in Google app settings. You can read about the feature here.

---
Tags: google-pixel
---


title: Fastboot connection problem

text:
# Question
Title: Fastboot connection problem
I am trying to install Lineage OS 16.0 on my Moto 4X. I unlocked the OEM bootloader. But when I enter the command 'fastboot reboot bootloader' it shows '\< waiting for any device \>'. There it stays until I break.

The next day it suddenly worked and I booted TWRP, install Lineage OS, G-Apps 9.0 micro and started the phone following the instructions at https://wiki.lineageos.org/devices/payton/install.

Lineage seem to work fine, but the G-Apps are nowhere to be found. I remember during the installation there was an error like 'can't access date/media., such a Directory does not exist' but it worked, or I thought that it did. I wanted to reinstall it all. Now I have the same problem again.

```
C:\adb>adb devices
List of devices attached
ZY224KGGGC      device

C:\adb>fastboot reboot bootloader
< waiting for any device >

```

USB debugging is enabled, the drivers on the PC are the newest from the Motorola website.

I used every USB port on my PC.

I tried my PC and two other laptops, all Windows 10.

Also I tried CMD, Powershell, and GIT-Bash for the commands. It’s always the same response. So I don't know what to do right now.

Does someone know where that problem came from?

# Answer
You are mixing up `adb` and `fastboot`.

When a device is booted and visible via `adb` it can't be accessed via `fastboot` (and the other way around). Fastboot is only active while the bootloader is active.

Hence if your device is visible via `adb devices` you have to access it via `adb`.

If you want to switch to fastboot mode have to boot boot to bootloader mode by executing `adb reboot bootloader`.

Then you can use fastboot.
> 1 votes

---
Tags: adb, twrp, fastboot, lineageos, gapps
---


# Question
Title: Will phone of global market will have better coverage than others?
I have LG V20 (H990DS), it's global market's phone. Also there are AT&T, Sprint, Verizon. And I noticed that all models have different frequency bands. Is that mean that my phone will work better around the world and others are fixed to certain regions? If yes, other phones can be unlocked by rooting or something like that to work the same as "Global" phone?

# Answer
> 1 votes
> .... my phone will work better around the world and others are fixed to certain regions?

In theory, yes. That's the purpose of a *global* phone (also called international phone)

> ....other phones can be unlocked by rooting or something like that to work the same as "Global" phone?

No, since it requires changes at hardware (modem) and corresponding drivers. You can't change hardware by rooting

---
Tags: carriers
---


title: Deleting files from "My Files" folder

text:
# Question
Title: Deleting files from "My Files" folder
If I delete files from the "My Files" folder on a Samsung Galaxy S8, are the files permanently deleted?? My phone's internal memory says it is low and that I need to delete files from my files folder.

# Answer
> 1 votes
"My files" is a built-in file manager and explorer. Any files deleted using that are permanently deleted

As pointed out in comments by Arctiic, it appears some files get restored even after deletion. I wasn't aware of this

---
Tags: samsung
---