# Question
Title: Will clearing Android Messages storage and cache cause lose of text messages?
I recently discovered that my Android Messages app (version: `messages.android_20240109_01_RCO4.phone_dynamic`, updated on Jan 25, 2024) in my Samsung Galaxy S20 FE 5G (SM-G781V, Android 13) has been displaying text messages with an obnoxious line height.

I found this solution on a Google support forum, but before I try it, I want to make sure I won't lose all my old text messages.

> Settings - applications - force stop then storage and cache - clear data then clear cache.

# Answer
> 1 votes
* It won't delete your MMS/SMS (the conventional messages) in any case if you clear data of the default Messaging app. I'm not exactly sure about RCS chats but technically they should also be not cleared.
* A more safer approach would be

1. Download another Messaging app (get a good 3rd part messaging app from Play Store)
    2. Make it the default messaging app
    3. See if all your messages (both SMS/MMS and RCS) are visible there
    4. Clear data of the original Messaging app you were refering to
    5. Once it's done, open it and make it the default Messaging app again
    6. After making sure all messages are back there, uninstall the third party app you installed

---
Tags: samsung, sms, google-messages
---


title: Unlock Unisoc bootloader on Linux

text:
# Question
Title: Unlock Unisoc bootloader on Linux
I need a Linux command to unlock my **Unisoc bootloader** using modified fastboot.

The command `./fastboot devices` keeps telling me permission is denied.

```
joseph@penguin:~/modified_fastboot$ ./fastboot devices
-bash: ./fastboot: Permission denied

```

Screenshot of terminal output

# Answer
* Temporary fix: run the command as root
```
sudo ./fastboot devices

```
* Permanent fix:
    1. use `lsusb` to identify your device USB VendorID
    2. configure `udev` to set proper permissions when your device is plugged in

https://stackoverflow.com/a/28127944/12075599
> 0 votes

---
Tags: fastboot, linux, bootloader-lock
---


# Question
Title: Has my battery actually been replaced? Samsung A40
I went to a phone repair shop to have my display replaced, which was cracked. I took the opportunity to have the battery replaced too: My Samsung A40 is four years old and I noticed that the battery wasn't lasting as long as it used to. I have picked up my phone from the shop and while it is obvious that the display has been replaced, I am suspicious that they simply left the old battery in there:

1. The battery is draining quickly, as it was before: It's gone from 97% to 90% in about two hours. (I have not charged it since getting it back.)
2. When I turned on my phone after getting it back from the shop, the battery was at 97%, which is, I think, more or less the level it was at before I switched it off in the shop.
3. Under Settings \> Device care \> Battery \> Battery usage, there is usage data for the last seven days. Shouldn't this be blank? Or does a change of batter *not* reset this?

Am I just being overly suspicious or is there a way to confirm whether the battery has been replaced? (Even if I did open it up and look, I didn't think to write down the serial number of the old battery.) If I were to go back to the shop to complain, then I would need firm proof.

EDIT: My original question was not clear. Put succinctly: **Is there a way to tell whether a battery has been replaced using only the software?**

# Answer
Dropping 7% in 2 hours is not excessive. You can see under battery usage, what is using it up. The biggest user is normally the touch screen. On some phones the GPS consumes a fair bit of power. Switch it off, if you dont need it on all the time.

> **Battery life** Battery life is definitely not one of the strongest suits of the Galaxy A40 but it's not necessarily a weak point either. The 3,100mAh unit didn't deliver the runtimes we expected, especially in the web browsing and video playback tests. Still, an overall 73h endurance rating is fairly dependable so you will **probably squeeze out a full day of moderate usage**.

From gsmarena. Note I have no affiliation with the site, its just the first one in the search.
> 1 votes

---
Tags: battery, battery-history
---


title: Where is Android boot animation saved?

text:
# Question
Title: Where is Android boot animation saved?
When you start an Android device, there is an animation showed, usually "Android", but sometimes the manufacturer's logo.

Where is this animation stored? I have looked in the `boot.img`, but can't see it there.

# Answer
> 8 votes
The boot animation is normally located in `/system/media` under the name `bootanimation.zip`. This is a zip file containing one or more directories named `part0`, `part1`, `part2`, and so on, and a text file named desc.txt. The directories each contain a number of still images, JPEG or PNG, sequentially numbered, for example, `0001.png`, `0002.png`, `0003.png`, and so on. The text file is a simple description of the properties, such as how many times to loop each directory, the pixel size of the images, and the framerate. Like this:

```
width height framerate
p loop pause directory

```

For example:

```
1080 1920 20
p 1 0 part0
p 0 0 part1

```

0 for loop means that it loops until the boot process is complete, and the pause is specified in number of frames, so with a framerate of 20, a pause of 1 would mean 0.05 seconds pause before moving on to the next loop or the next part.

Some manufacturers may use a proprietary file format, which may or may not have a different name than `bootanimation.zip`, so make sure that your current file uses the above format before replacing it with a custom one. If the boot animation is corrupted, the phone may boot loop or simply ignore the animation.

The file should be owned by `root:root` and have permissions set to `644 (rw-r--r--)`. It must **not** be compressed.

# Answer
> 1 votes
The boot animation is located at

```
/(Home directory) > System > Media > ... (for me it's bootanimation.zip)

```

And of course you need a file explorer and a rooted phone I guess.

# Answer
> 1 votes
* A root is required to perform this task.
* Use any file explorer application such as `ES File Explorer`, with root access.
* Go to the root directory of `internal / system / media`. You can see a file named `bootanimation.zip`, which is the one that loaded during boot.

Extracting the zip may display multiple folders named as `part0`, `part1`, `part2`,.. and `desc.txt`.

# Answer
> 1 votes
If you have a computer with Android Debug Bridge (ADB) available, you can run this command to find its location:

`$ adb shell`

`# find . -iname "bootanimation.zip" 2>/dev/null`

On one of my devices it was stored in `/oem/media/bootanimation.zip` and on the other device it was stored in `/product/media/bootanimation.zip`

# Answer
> 0 votes
For me, on Pixel 6 with Android 13, it's actually on:

```
/system/product/media/bootanimation-dark.zip

/system/product/media/bootanimation.zip

```

# Answer
> 0 votes
It appears you can override the boot animation on a device. Create a boot animation file, as described in the other answers, and copy it to `/data/local`, which is writable by adb without rooting:

```
adb push bootanimation.zip /data/local

```

Source: Emteria article on boot animations. I have not tried this yet.

---
Tags: boot-animation
---


# Question
Title: Flip right shift and cursor "up" keys for external USB keyboard on Android
On my USB-C keyboard which I use with my Android phone (Samsung Galaxy S23), the placement of the right shift-key is very weird and I keep hitting the "up" cursor key, which I curse the keyboard designers for.

There is a thread with (kind of) a solution for exactly the same problem for Windows here:
Solutions for keyboard with awkward up arrow key
but I haven't seen anything the likes for Android.

So the question is: can I flip the keys, so that the physical "up" key has the menaing of "Shift" and vice versa, in Android? If it doesn't work natively, can you recomment an app that allows this?

# Answer
> 0 votes
This may be old, but I haven't found evidence that this has changed in all the years of Android. Full details are from an old AOSP github repo. This *will require root access* as it requires you to edit system-level files.

> Android uses the standard Linux input event device (/dev/event0) and driver as described in the linux/input.h kernel header file. For more information regarding standard Linux input drivers, please see Linux Input drivers at http://kernel.org.
>
> Key Layout Map Selection of a Key Layout Map Key layout maps are installed in `/system/usr/keylayout` and `/data/usr/keylayout`.
>
> For each keyboard device xxx, set the `android.keylayout.xxx` system property (see Building New Device for help setting system properties). If you don't specify a keylayout file, Android will default to `/system/usr/keylayout/qwerty.kl`.
>
> File Format Key layout maps are stored on the device as UTF-8 text files and have the following characteristics:
>
> Comments: The pound symbol (#) denotes a comment and everything after the pound symbol on a line is ignored.

> Whitespace: All empty lines are ignored. Key definitions: Key definitions follow the syntax key SCANCODE KEYCODE \[FLAGS...\], where SCANCODE is a number, KEYCODE is defined in your specific keylayout file (android.keylayout.xxx), and potential FLAGS are defined as follows:

> SHIFT: While pressed, the shift key modifier is set

> ALT: While pressed, the alt key modifier is set

> CAPS: While pressed, the caps lock key modifier is set

> WAKE: When this key is pressed while the device is asleep, the device will wake up and the key event gets sent to the app.

> WAKE\_DROPPED: When this key is pressed while the device is asleep, the device will wake up and the key event does not get sent to the app.

Using the above commands to help, you could change the file from something like:

```
key 13    DPAD_UP
key 15    SHIFT

```

to:

```
key 13    SHIFT
key 15    DPAD_UP

```

This was a big nostalgia moment for me - I used to be really into keyboard remapping back in the "new-ROM-every-other-afternoon" days.

---
Tags: keyboard, external-keyboard, usb-c
---


# Question
Title: How to I ensure few specific apps is always running? If not launch each applications
I am looking for app or a way to ensure specific apps are always running in the background/foreground all the time.

Edit: apps in question does run as a foreground service.

If they are stopped for any reason, they will be started again by the app or process.

Does app called "Tasker" has capability like this?

# Answer
> 1 votes
* Edit application permissions to include background & foreground activity
* Unrestrict data usage
* Exclude from battery optimization
* Exclude from game-mode optimization
* If applicable and/or desired, exclude from Do Not Disturb, etc
* Lock the process (through Recent Apps screen)
* Set up automation to relaunch program in the event of unintended closure (e.g., via Tasker, Macrodroid, etc.)

---
Tags: auto-start
---


# Question
Title: Can't edit boot commands in VMware for Android x86
I'm attempting to install Android x86 from https://www.fosshub.com/Android-x86.html following the steps on https://hackmd.io/@StanS/Android-x86, and after getting to the point where I can reboot and boot into the OS, I go to edit the boot command for step 4. I hit e twice, but then I can't change the boot command. It just gives me a line with out the string that I need to edit. on the previous page, it has the string listed, but everything I search for just says it should be there.

# Answer
You need to type reboot

Or you can watch this tutorial on Youtube https://youtu.be/nFtNKY1g6Lc?si=HzynNrGjrZaSI414
> 0 votes

---
Tags: 9.0-pie, android-x86
---


# Question
Title: `adb shell mv` moves files but app doesn't work anymore, while it works if I move the same files via file manager
I try to move account-related files/directories of an app (for account changing purposes) via `adb shell mv`. Moving the files works great, but the app hangs while loading/login.

If I move the files manually via files manager, there is no problem at all (I move the files from `/data/data/com.example.app` to `sdcard` and move the same files from another account back to the app folder) -\> everything works fine, the app is loading, the account is logged in and changing accounts works without any problem.

If I move the files via `adb shell mv`, the app is stuck while loading. If I move the files to `sdcard` via `adb shell mv` and move it back with the file manager, it also works fine. But if I move the files from `sdcard` to app folder, it doesn't work.

I also tried copying the file via `adb shell cp -r` but got the same problem.

Does anybody have an idea what's the problem or how to fix this problem? Does `mv` corrupt the files? But if it would corrupt the files, it wouldn't work if I moved it to `sdcard` via shell `mv` and moved it back via files manager.

---

It seems like Robert is right, the file group changes:

Folder original:

```
drwxrws--x 8 u0_a295 u0_a295_cache 3452 2024-01-31 10:30
drwxrwx--x 3 u0_a295 u0_a295       3452 2024-01-31 10:31

```

Folder after moving:

```
drwxrws--- 10 u0_a218 media_rw 3452 2024-01-31 10:33
drwxrws---  4 u0_a218 media_rw 3452 2024-01-31 10:33

```

Files original:

```
-rw-rw---- 1 u0_a295 u0_a295    1229 2024-01-31 10:32

```

Files after moving:

```
-rw-rw---- 1 u0_a218 media_rw    1229 2024-01-31

```

# Answer
> 3 votes
Your main problem is that you move files and folder between special sections of the file-system: from app-private folder where only the app has access to `/sdcard` a special folder where you can not execute something and all files/folders are assigned a special group `media_rw`.

For understanding why the app-private folder works you need to know that Android created for every app an own user account, in your example all app-private files and folders are owned by user `u0_a295` and group `u0_a295` / `u0_a295_cache`.

If you move the files to `/sdcard` the group is changed to `media_rw` as the sd-card section enforces this. If you later move back the files to the app-private folder the group `media_rw` remains and the files and folders have a changed owner-user and owner-group.

To correct that you can execute

```
chown -R u0_a295:u0_a295 /data/data/<app-package name>/files/

```

Note that if you uninstall and reinstall the app or try the same with a different app the user and group name will be different (not `u0_a295`).

---
Tags: adb, file-system, shell, file-management
---


# Question
Title: How to stream audio from PC to Android Device over Bluetooth
I have a rooted Android Device running Android 2.3 Gingerbread and a PC(with Bluetooth dongle) running windows 7.

My mobile has Bluetooth with A2DP support. I want to output the audio(not just music) of my PC to my Android Device over Bluetooth. i.e. I want my android device to work as an Audio Output Device(like headset) for my PC.

How to do it?

# Answer
Dev0 and hello are correct - no you cannot connect using your Android device as a A2DP sink given the standard Android bluetooth stack. Stack Overflow user Dennis Mathews explains why:

> You may not be able to \[create an A2DP connection\] manually between 2 phones also because to stream one device needs to be A2DP sink and other A2DP source; phones are typically only source devices (source of the stream that can stream to sink devices), sinks are headsets or Bluetooth speakers.

He and the OP briefly discuss options for replacing the stack but their conversation dies without a concrete answer...as it seems several other similar questions around the web do. XDA user zelendel, in general, isn't very hopeful about the matter - when asked if it was possible to replace the bluetooth stack he responded:

> Simple answer is no. You can try a CM based rom that gives you those options but the stacks can't be swapped due to driver problems. It is a give and take. The Default has better strength and range but is missing a few unneeded option (PO), while CM uses Bluz stack which gives you the option but you lose some BT signal strength and range.

Sorry, it seems to me you're out of luck.
> 17 votes

# Answer
It is not possible via Bluetooth on Android, only from phone to PC, not from PC to phone.

But here are some solutions you may be able to use:

* The easiest way to do it is using SoundWire.
* Another way to do it is to use Splashtop remote, which uses your WiFi or 3G to remote control your PC and sends high-quality audio and video to your phone, but if you are on 3G it can use a lot of data, so it can get expensive.
* The next thing is to use the AirBubble app and Airfoil to stream audio from PC to Android device.
> 7 votes

# Answer
I found this developer's technique https://stackoverflow.com/questions/15557933/receive-audio-via-bluetooth-in-android to accomplish this, although he says it can't be done with an app. I am not a developer, but if this works maybe someone can find a workaround that could allow an app to accomplish the required changes at least on a rooted phone.

I think it is pretty clear why this feature is not available, it is just another way of stopping us copying copyrighted material, although there are still plenty of ways to do it which are actually more convenient than streaming would be.
> 0 votes

# Answer
SoundIt does just that, but over wifi.

It lets you stream the sound output of your PC to any web browser so you can stream to any phone or even another PC. You can stream to multiple devices at the same time and control each device's volume output remotely.
> 0 votes

# Answer
There is also effort to create Android audio receptor for VBAN protocol from VB-Audio company. Once it is out it should be best thing you can get hands on latency-wise.

---

*2017-03: The VBAN receptor for Android has been released. However it is utilizing UDP, not Bluetooth.*
> 0 votes

# Answer
You can attach a Bluetooth receiver device to your phone, available on Amazon thus your phone will receive Bluetooth audio.

Now, if you want to attach both headphones and this device, attach a splitter to the audio jack. This is my suggestion.
> 0 votes

# Answer
On win10/11, enable bluetooth. In Network & internet settings:

1. Airplane mode - Wireless devices - enable bluetooth
2. Mobile hotspot - enable Share my Internet connection with other devices.
3. pair your phone with PC
4. In phones bluetooth settings you should see on your PC device option to enable internet access, so enable it.
5. Use any app(AudioRelay, SoundWire, Wireless speaker for android, ... ) which can stream audio using wifi...the point is, you will be using wifi/wifi direct IP adress over your bluetooth internet connection you enabled on step 4. On both PC and phone you can have wifi turned OFF and it will work :).
> 0 votes

---
Tags: bluetooth, audio, streaming, bluetooth-hsp
---


# Question
Title: Is 1Gbps ethernet supports for Android or Android x86?
I have a Mini-ITX motherboard which has Gigabit Ethernet adaptor built in. I tried android 9 and Android TV 7 but it maxed out at 100Mbps. Does it have a limitation on Android OS or is it a built-in driver compatibility issue.

# Answer
> 1 votes
That will be a driver issue. There's no sensible reason for Android to be limiting the rate at which it can communicate.

The drivers are built into the kernel, so it's possible that a newer kernel will fix this. That depends on the kernel producer deciding to support 1Gbps communication. There isn't anything that would make that happen automatically.

---
Tags: networking, android-x86, ethernet
---


title: Disable Factory reset via ADB

text:
# Question
Title: Disable Factory reset via ADB
I want to disable factory reset/data wipe on my phone via ADB. I tried running

`pm disable 'com.android.settings/com.android.settings.SubSettings'`

but it threw

```
Exception occurred while executing 'disable':
java.lang.SecurityException: Shell cannot change component state for ComponentInfo{com.android.settings/com.android.settings.SubSettings} to 2
        at com.android.server.pm.PackageManagerService.setEnabledSettings(PackageManagerService.java:3808)
        at com.android.server.pm.PackageManagerService.-$$Nest$msetEnabledSettings(Unknown Source:0)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.setComponentEnabledSetting(PackageManagerService.java:5652)
        at com.android.server.pm.PackageManagerShellCommand.runSetEnabledSetting(PackageManagerShellCommand.java:2363)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:272)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6045)
        at android.os.Binder.shellCommand(Binder.java:1049)
        at android.os.Binder.onTransact(Binder.java:877)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4313)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6029)
        at android.os.Binder.execTransactInternal(Binder.java:1285)
        at android.os.Binder.execTransact(Binder.java:1244)

```

How can I achieve this? I want to disable the factory reset on my Android phone. If theres no way to achieve it through adb, how else can it be done? I have heard of people doing it, so I know there is a way, I just need help doing it.

I also tried `pm disable com.android.settings` but it threw

Exception occurred while executing 'disable':
java.lang.SecurityException: Shell cannot change component state for null to 2
        at com.android.server.pm.PackageManagerService.setEnabledSettings(PackageManagerService.java:3808)
        at com.android.server.pm.PackageManagerService.-$$Nest$msetEnabledSettings(Unknown Source:0)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.setApplicationEnabledSetting(PackageManagerService.java:5528)
        at com.android.server.pm.PackageManagerShellCommand.runSetEnabledSetting(PackageManagerShellCommand.java:2356)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:272)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6045)
        at android.os.Binder.shellCommand(Binder.java:1049)
        at android.os.Binder.onTransact(Binder.java:877)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4313)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6029)
        at android.os.Binder.execTransactInternal(Binder.java:1285)
        at android.os.Binder.execTransact(Binder.java:1244)```

# Answer
> 1 votes
If you disable or uninstall Settings app, your device will work fine until you restart or power off the device -- then it will get stuck in a bootloop.

---
Tags: adb
---


# Question
Title: Phone powers on itself I am afraid of spyware
I'm afraid that one person installed spyware on my phone. When I wanted to be sure that I wasn't being recorded I powered my phone off and I noticed that my phone is powered on. I noticed it about six times. It's hard to say how long after powering it off the phone powers on by itself. I would say that it didn't happen right away.

I have Mi 10t Lite. Android version 12 SKQ1.211006.001, MUI version MIUI Global 13.0.8 Stable 13.0.8.0(SJSEUXM).

I found in google following possible reasons:

1. Battery issue
2. Scheduled power on
3. System update
4. Broken power button

Power button works properly in my opinion, I have not notices any issues. Scheduled power on is turned off in my phone.

After three first unwanted powering on I bought new phone. I used new phone and observed my old phone. Old phone powered on himself three more times and it hasn't turned on by itself for over a week. This may rule out a battery problem because it is unlikely that the battery repaired itself and stopped turning on the phone. It can suggest that spy recognized that he can not spy on me because I use new phone (I left my old phone e.g. in the car).

Find device feature is turned off.

Unfortunately I uninstalled several apps and it is possible that some uninstalled application caused a problem but I did not uninstall anything suspicious and any application should not have permission to power on phone.

I wrote down all application that have permissions camera, call logs, contacts, location, microphone, sms, phone. I compared it with new phone and I googled application that I did not know I have not found anything suspicious.

I used adb logcat to copy logs. I powered phone off and when I noticed that phone is on I copied logs. Is it possible to find cause of powering on in logs? File has 102159 lines so I can not place it here. Additionally logs contain some fscrypt keys.

I do not have any antivirus software. As I know good antivirus are paid and I can not install it from google paly now because I am afraid to add credit card because I am afraid of spyware. I executed "Play protect" and result is ok.

I do not want to do factory reset because I am very curious if there is some spyware on my phone. If I do factory reset then probably I will never know that.

# Answer
Check whether you have any alarm clock applications which could be causing this behaviour (even if it doesn't ring). Alarm clocks keep running in the background, so you can turn off our device for the night without turning off the alarm clock.
> 0 votes

---
Tags: power-on
---


# Question
Title: How can I see how much internet bandwidth each process is using at the moment?
On Android, I have a nice Xposed module which shows me the current internet usage, but for the whole system, not per app:

On my desktop computer I have this expandable panel item which shows me exactly which apps are using the internet connection at any given moment. It also shows me exactly how much they're uploading and downloading per second right now, on a *per app* basis. The UI looks like this:

So I wonder if this is possible on Android as well. I'm asking for a *per app* metric of up/down usage right now, as in the above screenshot from my desktop computer.

Is there any way to get that?

To clarify even more, I'm asking for **current** speed, not past, accumulated usage.

Solutions that require root access and Xposed Framework are welcome.

# Answer
Simple System Monitor does that

Relevant feature from app description

> View list of active apps and processes and their CPU usage, RAM usage, **network activity**, PID and UID.

If you monitor the *Active Processes* tab you can see the change in data usage. You can order the view based on parameters as shown in the second screen shot. The default update interval in settings is 3 seconds which can be varied as per need. If you worried about battery consumption , you can *pause* the app from the menu option on top left
> 7 votes

# Answer
It's Feb 2024, I've tried the Simple System Monitor app from the accepted answer and the app didn't have bandwidth information that is shown on the screenshot. The 'active processes' tab is there, but with no bandwidth info.

So the app that helped me answer the question "What app is using a lot of Wi-Fi bandwidth behind my back?": GlassWire Data Usage Monitor
> 0 votes

---
Tags: applications, 5.0-lollipop, bandwidth
---


# Question
Title: My samsung s21 locked and showing too many incorrect attempts...also phone in a flight mode how to resolve this issue pls help?
My samsung s21 locked and showing too many incorrect attempts...also phone in a flight mode how to resolve this issue pls help? Is factory reset is only last option ?

# Answer
Yes a factory reset is the only option if you don't know your PIN. Data on your phone is encrypted using this PIN. If it was easy to bypass it, there would be no point in this security measure.

As far as I know, you can factory reset your locked phone, only if you have linked a Google account to it. Either via `Find my Mobile` or by `pressing the volume up/down and power buttons`.
> 0 votes

---
Tags: locked-out
---


# Question
Title: Where can I run a .sh script on Android without root?
Lately I've been playing around with .sh scripting in Android. At first I used BusyBox and it's integrated scripting utility, though I quickly realised that coding on the phone isn't the best, so I switched over to my desktop and started using ADB to push my scripts to my device. It all worked well for about two weeks, until recently the exact same scripts that used to work perfectly, tell me some `: not found[0]: syntax error: '{` Error. I've copied the exact same code from my script and used BusyBox to create it for me, and that way it works just fine. So the code is fine.

After some digging, I think it's either because of permissions, because of encoding possibly, or also because of the location of the scripts. I've tried many different locations (because I want to be able to run the scripts without root), and ended up choosing `/storage/emulated/0`. If I understood correctly, this is a symlink to the internal storage, which is read/write-able without root. But maybe sometimes executable and sometimes not? I don't know.

So my question is as following: **What is the best location on an Android Device to run scripts without root from?** Preferably a path that works on any android device.

Info:

* Rooted Samsung S7 SM-G930F
* Android 8.0.0
* I'm using `#!/system/bin/sh` inside the .sh files
* I'm running the scripts with `sh script.sh`
* When trying to run it as an executable `./script.sh`, I get a `Permission denied` error. With or without root.

PS: And if anyone has a clue to why the exact same scripts stopped working out of nowhere, I'd be happy to know!

**UPDATE:** Thanks to @IrfanLatif, I've managed to fix the `: not found[0]: syntax error: '{` Error! I was using Visual Studio Code as my editor for the scripts, which was saving them with the End of Line Sequence `CRLF`, which Android doesn't like. For an easy fix, just change your Line Endings to `LF`, problem solved. Check the comments out for more info.

# Answer
`/storage/emulated/0` is usually mounted in a way that prevents execution of programs from this location.

Therefore even with a set executable bit for your script you won't be able to execute it directly. Of course you can still execute it via sh:

```
/system/bin/sh /storage/emulated/0/test.sh

```

Alternatively there is the directory `/data/local/tmp` which is writable without root (e.g. via adb). There you can place a script and execute it directly.

Note: Listing the content of `/data` and `/data/local` is denied for non-root users, but in `/data/local/tmp` you have permissions again.
> 8 votes

# Answer
I am using the Pydroid3 app over the same device configuration.

`sh script.sh` seems to work in it.
> 1 votes

# Answer
I am using a Samsung A52 (SM-A525F/DS) with Termux installed from Google Play. The home directory, where you can write scripts and set the execute bit, is:

> /data/data /com.termux/files/home

You cannot browse this directory from a file manager on the phone, so a workaround is required to put your scripts there. I have created sub-directories from the home Termux directory, so it looks like this:

> /data/data /com.termux/files/home/myname/scripts

This is the only place where you can execute scripts directly using:

```
./myscript.sh

```

although you can call bash in a new shell and feed its commands from a text file, which does not need to be executable, as in:

```
bash myscript.sh

```

The first line of the scripts must be

```
#!/data/data/com.termux/files/usr/bin/bash

```

Termux provides links to the standard directories DCIM, Download, Movies, Music, Pictures and one to the parent directory of all of the above, which is:

> $HOME/storage/shared

However, from here, you can access **all** the standard directories with read and write permissions (as well as create your own, of course). Here is the output from the tree command run from the home directory on my phone, which explains it better than words:

```
$HOME
├── myname
│   └── scripts
└── storage
    ├── dcim -> /storage/emulated/0/DCIM
    ├── downloads -> /storage/emulated/0/Download
    ├── movies -> /storage/emulated/0/Movies
    ├── music -> /storage/emulated/0/Music
    ├── pictures -> /storage/emulated/0/Pictures
    └── shared -> /storage/emulated/0
        ├── Alarms
        ├── Android
        ├── Audiobooks
        ├── DCIM
        │   ├── Camera
        │   ├── Screenshots
        │   └── mei
        ├── Dashcam
        ├── Documents
        │   ├── Termux
        │   └── 2024-02-02_scripts
        ├── Download
        │   └── .scripts (Latest versions go here using get.sh/put.sh)
        ├── GIFs
        ├── Movies
        │   ├── Whatsapp
        │   └── Downloaded_Videos
        ├── Music
        │   └── Downloaded_MP3s
        ├── Notes
        ├── Notifications
        ├── Podcasts
        ├── Recordings
        └── Ringtones
27 directories

```

From my scripts directory I have written scripts called get.sh and put.sh to help move files between my PC and the phone, as it's easier to script on a PC's big screen. I use a hidden directory in the Download directory called ".scripts" as the point to access files on both my cable-connected PC and from Termux. All I have to do is make them executable once they are in the scripts directory.

In Documents, I transfer copies of the current scripts, the Termux setup files and my $HOME/.profile in directories called Termux and scripts. This is how I maintain back up files.

I hope this helps someone.
> 1 votes

---
Tags: adb, shell, 8.0-oreo, scripts
---


# Question
Title: Remove/hide contacts of one account when multiple Google accounts are added to Phone
I have added two Google accounts to my phone running Android 12. Contacts of both accounts are now being shown on the device.

Is there a way I can remove/hide the contacts of one account? Note that I do not wish to remove the account just want to remove/hide the contacts for this device.

Thanks

# Answer
> 3 votes
Once they are synced, you need to remove them yourself.

**To Stop them syncing**

* Go to Settings
* Account sand Backup (or Accounts and Sync)
* Select Manage Accounts (or accounts are displayed anyway)
* Select Account (From the ones with the Google Icon) (**Image-1**)
* Select Sync Account (**Image-2**)
* Turn off Contacts switch (**Image-3**)

**To remove the accounts**

* You can do it manually
* Or you can use a third party app such as `Contacts Optimizer` to help you
* I also find `MyPhoneExplorer` very handy. You can copy the contacts to your OPC and manage them there.

**Image-1**

**Image-2**

**Image-3**

# Answer
> -1 votes
You can filter the contacts you see in the Google Contacts app to only display the contacts that are stored in a particular Google account's cloud storage. This is the best you can do, there isn't an easy way to permanently hide contacts from a Google account, you can only enable a filter. This has been tested on stock Android 14.

1. Open the Contacts app (the one made by Google)
2. In the top right hand corner of the screen, click on the profile picture of your Google account. A list of Google accounts should be displayed now, alongside the menu options "Add another account", "Manage account on this device", and so forth.
3. Tap on the Google account that you want to focus on. The dialog should close and you should return to the main screen of the app.
4. Now tap on the hamburger menu icon in the top left corner of the screen. A sidebar should appear, with "All accounts", the name of the selected Google account, and then a list of labels.
5. Tap on the name of the Google account to filter contacts to just those stored on that Google account's cloud storage.

You can enable or disable Contacts sync for particular Google account, but that isn't enough to hide those contacts from the Contacts app.

---
Tags: contacts, google-contacts
---


title: Trigger the starting of an app remotely

text:
# Question
Title: Trigger the starting of an app remotely
I want to initiate the start of an app on (my own) phone. It is not rooted, because practically no android can be rooted today, but I can install anything to it or change any setting on it. I also cban install anything to any remote machine, from which I trigger things (particularly to linuxes).

Can I somehow start an app on my own phone, using some remote source?

# Answer
Any automation app can easily perform such tasks, try Automate (free) with a flowchart to start an app upon receiving a "cloud" message:

1. Flow beginning
2. Cloud message receive
3. App start
4. (loop back to #2)

And a flowchart to send the "cloud" message:

1. Flow beginning
2. Cloud message send

Or use the online endpoint to send it from a browser.
> 0 votes

---
Tags: applications, remote-control, remote-access
---


# Question
Title: Resetting a synced Android Chrome profile
I would like to clear whatever settings I have enabled in Android Chrome *and have the resulting clean profile synchronised*. I have synchronisation of Google Chrome enabled on Android, but there are some settings that I need to clear to factory/default settings. Obviously, if I clear *all app data and settings* using the normal Android approach, my login state be cleared as well, so the resulting *clean* profile will not be synchronised to the cloud. There seems to be a bit of a Catch-22 here ...

I basically just want to overwrite whatever data was previously pushed into the cloud with a clean Chrome factory settings profile.

# Answer
You can reset your Chrome profile settings to defaults at `chrome://settings/reset` (site won't let me link because it doesn't begin with https://, sorry). This is the simplest version of a Chrome profile reset, but is only accessible via a desktop browser, *not directly via Chrome on Android*.

This will reset the settings related to your Chrome profile as detailed when you click the button on that page:

> This action will:
>
> • Reset some Chrome settings and Chrome shortcuts • Disable extensions • Delete cookies and other temporary site data

It's possible to clear *all* data associated with your Chrome profile from your Android device at the Google Chrome Sync page. This will erase all of the following:

* Address bar
* History
* Bookmarks
* Reading list
* Open tabs
* Addresses
* Payment methods
* Passwords
* Settings
* Apps
* Extensions
* Themes

Also keep in mind:

> This will clear your Chrome and ChromeOS data that has been saved in your Google Account. This might clear some data from your devices. This will also remove your sync passphrase. You can create a new passphrase.
> 1 votes

---
Tags: sync, chrome-for-android
---


# Question
Title: How can I disable the "Include surrounding text" setting, once enabled?
Chrome has for the last year and a half had a bug where the "Mark text to search" feature breaks if you enable "Include surrounding text". You can read more about the bug here, but the thing I would like to know is how to work around it by simple disabling the "Include surrounding text" option/flag. I have not been able to find it.

# Answer
> 1 votes
1. In the Chrome app, from the overflow (3 vertical dots) menu, select **Settings**.
2. Select **Google services**.
3. Tap **Touch to Search**.
4. Tap **Include surrounding text in Google searches**.

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


# Question
Title: Text in Video caption not seen on laptop
I use google pixel where I take daily videos, where then I click the three dots and on the video caption I write some text about the video, describing it or adding some information that is important to me. I do this as a part of a project.

I thought that once I download these videos to my laptop, I would just go to properties and then on the metadata I would see the caption I have written. However, this seems to not be the case as I do not see any of the text I have written.

# Answer
> 1 votes
According to an old Google Sites post discussing the nature of the relationship of Google Photos to Picasa, it appears that Descriptions are not preserved when downloading a photo or video:

> Captions added after uploading to Google Photos are NOT written to the metadata of the photo. The captions will be lost when you download from Google Photos. A way to preserve the captions was to download using File \> Import from Google Photos in Picasa3 on the computer, but Google disabled that option in 2018. The only way left is by using Google Takeout but you need special software and skills.

The referenced Google Takeout method is described here:

> In Google Photos, "Captions" added before uploading are now shown as "Other" in the info of a photo. They always remain part of the photo.
>
> "Descriptions" added in Google Photos are lost when downloading from Google Photos, but transferred by other methods (Partner sharing, sharing albums).

This seems to refer to uploading to Google Photos from the device, as the "Description" pen doesn't appear in the Pixel photo viewer until *after* the photo has been uploaded. I've tried myself to add a caption prior to uploading by disabling all data, recording a video and adding a caption, then reenabling data. The Description/caption still appears in Google Photos, but is not available as part of the file once downloaded. It does appear there are more intensive methods of accomplishing this task, although it may require Google Takeout and an EXIF editor.

> When using Google Takeout, a .json file in the downloaded ZIP file includes info about the added description, location, and changed date. There are tools able to merge .json and image:
>
> **EXIFTool** https://stackoverflow.com/questions/42024255/bulk-join-json-with-jpg-from-google-takeout To add a description of the file, the appropriate placement for this would be IPTC:Caption-Abstract, XMP:Description, and EXIF:ImageDescription. You could copy these with: '-Caption-Abstract\<Description', -Description, or '-ImageDescription\<Description' https://github.com/mattwilson1024/google-photos-exif (2020) How to merge image with his .json file (Google Photos takeout) \- Exiftool forum
>
> **MetadataFixer** can fix EXIF Metadata in pictures and videos when exporting from Google Takeout. There is a demo version and a paid version: https://metadatafixer.com/.
>
> How to batch merge Google Takeout photos with json files on Mac

---
Tags: video
---


title: SSH to localhost on android

text:
# Question
Title: SSH to localhost on android
I am trying to get ssh working on my android phone. I am currently able to ssh out, from my phone to another device. But I am struggling to be able to ssh in. To test things, I am just working on my the phone and trying to establish an ssh connection with localhost.

Working in termux, I ran the command

`ssh localhost -p 8022`

Then I am given the prompt

`u0_a316@localhost's password:`

I'm struggling a bit to understand this. I know that u0\_a316 should be a user on my phone, but I don't quite know how users on the android oprating system work. I tried entering the lock screen password I have for myself, as well as no password. But neither of these work. Could someone help explain whats going on here, or point me to some (hopefully not too dense) documentation on this?

*this question is cross posted from stackoverflow, following a recommendation in the comments*

# Answer
> 2 votes
You simply need to set a password for your Termux session. You will not be asked for it at any time when you start Termux, so it is safe to do. Just type:

```
passwd <enter>

```

and type in a password. You will be asked to repeat it to confirm.

So when you ssh to your phone from another device/machine, this will be the password required. The command to type on the other machine will be:

```
ssh u0_a316@<your_phone's_IP> -p 8022

```

---
Tags: ssh, termux
---


# Question
Title: Is it possible to communicate with a laptop (or other device) connected with the wifi hotspot?
Could I connect a device to my phone's hotspot and have the phone and device communicate over wifi? I'm intending to have a raspberry pi connect to my phone so I can SSH into it on the go.

# Answer
The answer is yes, and it's easy. I know this is an old post, but it's had 80 views in 6 years, so maybe people are looking for help.

I live in the middle of nowhere, where the Internet is only available on my phone. So I connect all my devices - TV, Amazon Fire stick, laptop, media server and data server - to the hotspot. I do scripting on the phone, but I am actually on my PC connected using SSH. On the phone, I just have Termux and openssh installed. Follow this procedure. After it's set up and you have completed the key exchange, you need to set a password. On the phone, type:

`passwd`

and choose a password (you'll be asked to enter it twice). Still on the phone, type:

`whoami`

This will give you your UID which you will need to enter in the ssh command on the other device. It's something akin to u0\_a123 on a Samsung phone.

Then, all you need to do on the phone when you want to connect, is type:

`sshd`

On the PC, you need to determine the current IP of the phone. On Linux, you can just copy and paste this in a terminal window:

`route -n | grep wlp | grep 'UG[ \t]' | awk '{print $2}'`

I'm not a fan of Windows, but you can always run traceroute to any site to see the IP appear towards the top of the list.

Connect to the phone using:

`ssh UID@<IP of phone> -p 8022`

When you want to disconnect, stop the ssh server on the phone with:

`pkill sshd`

in the Termux screen.
> 1 votes

---
Tags: wifi-hotspot
---


# Question
Title: How do I disable zooming on text input focus?
I know there are certain tricks to disable zooming when making a web page, but how do I disable zoom on focus on my device?

I have Paranoid Android and the Xposed Framework, so, I know anything is possible.

# Answer
> 6 votes
Unfortunately, the answer is that you can't.

That's confirmed pretty conclusively by this bug report/feature request thread in the Chrome development forum. The thread goes all the way back to March 2014, and recent posts indicate that a means of disabling this behavior has not been implemented.

Sadly, recent indications are that the dev team is disinclined to implement such a setting in the future. Despite input from several people providing examples of how this feature can be an impediment, and requesting a setting to disable it, this response from a developer says that they avoid adding new settings, and they'd rather work on making it "less annoying":

> #12: I haven't really noticed it zooming in on mobile sites. When it does, we can consider that a bug, but I don't think a modal ban is the right approach. I'd rather continuing tuning the policy so that it doesn't trigger when inappropriate. Note also that the same code deals with animating the scroll position around when the on-screen-keyboard would cover the form field. That behavior definitely desirable to preserve even on mobile sites.
>
> #13: We generally try to avoid adding settings in Chrome; we'd rather tune this so it's less annoying for all users, not just the ones who discover the setting. We already made a few improvements to make this trigger less frequently since the bug was originally filed; we might benefit from loosening it further to tolerate further zoom levels.

The bottom line is that it sounds like it's not possible and it's not going to be.

You can disable this behavior by using a browser other than Chrome, at least for any sites where you don't want automatic zooming on focus.

# Answer
> 4 votes
I figured it out for FireFox users:

1. In the Firefox browser for Android, navigate to `about:config`.
2. Find the line named `formhelper.autozoom`
3. Set to `false`

This is especially beneficial to navigating websites in desktop mode, without that nasty input zoom.

# Answer
> 1 votes
That's a "solution" for the question asked, but it's a quite efficient workaround.

What helped me was:

1. Open mobile browser "settings"
2. Go to "accessibility"
3. Turn on the "show distance from display on main menu" option on (or whatever it's called on your browser)
4. When on site, set the distance from display to minimum. In my case it was 50%.

That setting altered the display to contain more content on my smartphone screen so zoom auto zoom didn't happen.

# Answer
> 0 votes
My solution that may help was to install an app called Windows Manipulator on my Android phone and then set the DPI significantly lower. This gives me enough screen real estate (albeit with a significantly smaller font).

This seems to keep Chrome from zooming on focus as often. I also switched to FlashFox Pro browser which does not zoom on focus frequently.

These 2 fixes combined have eliminated my complaints. Hope this helps someone.

---
Tags: 4.4-kitkat, browser, chrome-for-android
---


# Question
Title: Rooted Samsung will Not Connect to Wireless Internet
I have a rooted Android Samsung S23 that I use for penetration testing with mobile apps. Frequently, I have encountered issues with connecting it to WiFi networks. When I attempt to login to a WiFi network from this phone, it will return the message "connected without internet". This issue is not exclusive to a single network such as at the office or at home.

I can connect this phone to the internet using my laptop as a proxy. To do this, I enable USB debugging in developer settings. Then within the WiFi settings, I setup a proxy with hostname "localhost" and port number 8080. I then connect the phone to my laptop via USB cable, and entering the command `adb reverse 8080 8080` in my laptop terminal. When doing this, I have BurpSuite open and listening for connections to localhost:8080. I am able to intercept requests to applications on the phone this way.

This is the workaround I have been using so far, but it is very frustrating that I cannot find a fix for the WiFi. I have tried researching this problem but have not found anything helpful online. Changing the DNS settings does not work. I have also tried setting a static IP address for the phone. This does not work. The phone does not seem to be blocked in my router settings. Although for some reason it is listed under 'cable connected devices'. This is the only substantial clue I have.

Any help in resolving this issue would be greatly appreciated, as I am sure I am not the only person that has encountered this bug.

# Answer
You set-up looks quite good, however your way of set-up TCP port forwarding from Android to the PC seems to be wrong:

```
> adb reverse 8080 8080
adb.exe: error: cannot bind listener: unknown socket specification:8080

```

The correct command is:

```
adb reverse tcp:8080 tcp:8080

```

Afterwards you should in Burp see at least the HTTP call that allows Android to detect if Internet is available and if a captive portal exists: `http://connectivitycheck.gstatic.com/generate_204` or `http://connectivitycheck.android.com/generate_204`.

Note that this way your phone may recognize that "Internet" is available, however nearly all apps won't work unless you have installed the Burp root CA certificate as system certificate.

So you will need a Magisk module like MagiskTrustUserCerts that allows you to install the Burp root CA certificate as user certificate and the module will make it a system certificate on every boot.

If you already have installed Android 14 you may need a modified version of the module like ConscryptTrustUserCerts.

**Edit:** It seems like device with Android 14 (and may be 13 too) make a request to `https://www.google.com` for detecting if internet is available. Not sure if this connection uses certificate pinning (and thus ignores the installed Burp root CA certificate). If I bypass that domain in the proxy my device always detects that Internet is fully available.
> 3 votes

---
Tags: wi-fi, rooting, proxy
---


title: GeckoView-based Kiosk app?

text:
# Question
Title: GeckoView-based Kiosk app?
I've had trouble with video playback using Android Kiosk. I gather it's because of the apps reliance on WebView. Firefox is playing the videos well.

Is there a current Kiosk app available based on GeckoView? Or is there an effective way of putting Firefox in kiosk mode?

# Answer
This post briefly mentions SureFox that looks to have recent updates, although other than the name, it's not immediately clear it's based on Firefox, so you might need to test if it works correctly for your application.

AirDroid seems like a good option, although it may require a subscription to use.

Depending on your device and application, you could also explore pinning apps \- it's an Android feature that should be included in almost all recent versions and can be accomplished without any additional software. The downside is that, while simple, it's more geared toward preventing temporary user access, and can be undone rather easily by someone familiar with the feature, although they'd be met with a passcode if you've set one. Here are the steps for this feature:

### Turn on app pinning

* Open your phone's Settings app.
* Tap Security or Security & location and then Advanced and then App pinning.
    + If you can't find it, get help from your device manufacturer.
* Turn on App pinning.
* When app pinning is on, you need to enter your PIN, pattern, or password before you can unpin.

### Pin a screen

#### After turning on app pinning:

* Go to the screen you want to pin.
* Swipe up to the middle of your screen and hold or use 3-button navigation: Tap Overview
* At the top of the image, tap the app's icon.
* Tap Pin.

### Unpin a screen

* Gesture navigation: Swipe up and hold.
* 2-button navigation: Touch and hold Back and Home .
* 3-button navigation: Touch and hold Back and Overview .
* If you're asked for your PIN, pattern, or password, enter it.
> 0 votes

---
Tags: firefox-for-android, kiosk-mode
---


# Question
Title: How to install fedora's phoneshell in old touchscreen tablets and old touchscreen phones
Explain step-by-step procedure on how to install the fedora's phoneshell in old touchscreen tablets and old touchscreen smartphones suitable for both a techie and a non-techie

# Answer
> 2 votes
Do you mean Fedora Phosh, which is part of the Fedora Mobility project?

If so, that only supports very "open" devices, such as Purism librem 5, and the Pine series of phones and tablets.

Phosh isn't a GUI for Android, nor a means of using a mobile device to control a computer running Fedora. It's a GUI for Fedora Linux running on a mobile device, more suitable for small screens than the default Fedora GUIs. This requires that the whole OS on the device be Linux, rather than Android.

---
Tags: hardware
---


title: Download file from Android shell

text:
# Question
Title: Download file from Android shell
I am making a shell script for Android to run on ADB, however, the script should download a file. Commands like `wget` and `curl` aren't available in `/system/bin`. Here are a few possibble solutions that I thought of, each with its cons:

1. Rooting and installing BusyBox (my target systems are rootless)
2. Downloading file in computer using `wget` or `curl` then transferring the file to Android with `adb push` (the script should be ran on Android, not the computer connected to it)
3. Downloading `wget` or `curl` in Android (how can I download a binary without them in first place???)
4. Termux (nope, my script sets some settings in Android which Termux can't)

Is it even possile? If yes, how?

# Answer
> 1 votes
You have two options.

1. Install Termux, which supports curl.
2. Use your option number 2. `adb push` simply copies the file (unlike `adb install`, which looks for an apk file and tries to install it on the device).

Since you say that you are writing a shell script, you will have to install an Android terminal and (presumably) a Linux environment anyway.

You say "my script sets some settings in Android which Termux can't." If you need root access for an app, you may get what you need using Magisk.

---
Tags: adb, shell, downloading, command-line
---


# Question
Title: How can I restore proper functioning of the charge port in a tablet after connecting an OTG adapter that did not work?
I wanted to connect a USB external mic to a Lenovo tablet (P11) with only one USB Type C port (charge port). It did not work because apparently the tablet does not support OTG protocol. It shouldn't be a big issue, except that now the tablet thinks the charger is connected all the time, but loose, or badly connected, and it's continually notifying to adjust the connection. The battery icon shows as charging all the time, even though the charging port is empty.

Any idea how to solve this, and why it may have happened??

Thank you for your help!

# Answer
1. Go to Settings - About phone - Build number.
2. Tap build number 7x, Developer options will turn on.
3. Go back up to Settings.
4. Go into System, and find Developer options.
5. Once in there, scroll down until you find the USB default. There you can change it.
> 0 votes

---
Tags: usb, charging, usb-on-the-go, lenovo
---


# Question
Title: Unfortunately, the process android.process.media has stopped
There are frequent messages like this on a Samsung Galaxy Note 3 with Android 5.0. Factory reset didn't help. Can anybody suggest a solution? I have studied this post by the way.

> Unfortunately, the process android.process.media has stopped.

# Answer
> 0 votes
As @Robert commented:

> Note that there are several security vulnerabilities known that attack the media store scanner (which should be the process that is affected in your case) using modified files. The attacker can get root access by this, so be careful what you do with such an old phone...

Following the above comment, I did a factory reset and installed a few trusted apps only. The error was resolved and didn't happen again.

---
Tags: 5.0-lollipop, system-error, samsung-galaxy-note-3
---


# Question
Title: Choosing input method when on MessagEase
Recently found the MessagEase keyboard and really like it, but don't necessarily want to use it all the time.

With the other keyboards I use, I long press on the spacebar will open the "Choose input method" selection, but not so with MessagEase.

Their FAQ says to "Tap and hold on any text field" to switch input methods, but that doesn't seem to work for me (just get the standard cut, copy, paste, etc pop-up).

Currently have to go into the Android settings under Manage Keyboards and disable MessagEase to switch to a different keyboard, which is sub-optimal.

Any ideas of an easier way?

(Android 10/LineageOS 17.1)

# Answer
> 1 votes
As of 2024, given that MessagEase wants to introduce a subscription model, your best option seems to be to install Thumb-Key instead. It's open source and doesn't nag you. With Thumb-Key you switch to a different input method by swiping down on the Smiley.

---
Tags: keyboard, input-methods, messagease-keyboard
---


# Question
Title: Samsung s23 ultra/google activity/google account
I have alot of weird and unexplainable activities on my google activity. Apps I haven't opened in months showing up. Activity i actually did showing up hours after the fact in middle of night while I sleep. It shows me using Google meet at 4 in the morning in the middle of a work week. Those are just to name a very few.

Also in my google account my phone was showing up twice under devices but just by the model number?

There is so much thats been happening that it's concerning. None of my bank accounts have been touched or hacked. But it's like someone else is doing stuff in the background and I don't know how to explain any of it. Has anyone else had any problems like this at all?

# Answer
> 0 votes
If you are worried about it then just change the password. To me, it sounds more like multiple devices are on the same account. Perhaps your friend, partner on an older phone.

Other measures

* Use face recognition or fingerprint on the phone
* Install a virus scanner such as Kaspersky (the free version does a good job)
* Install an Applock app, so that certain apps (such as banking) require one more step/password

---
Tags: google-account
---


# Question
Title: Rooting Samsung Galaxy A8 tablet (SM-x200)
My device is a Samsung Galaxy A8 tablet (SM-x200) running Android 13. I need to root my device to perform certain actions (delete app data) through MacroDroid. I have a MacBook and no access to a PC.

I have read the XDA Dev threads, etc. but there are so many different files and different downloads and methods.

I am essentially asking if anyone here has the time and willingness to spell it all out for me and tell me exactly which files to download, and what to do with them.

# Answer
This tablet is Galaxy Tab А8 10.5 Wi-Fi SM-X200 and it has a unisoc processor. Try this tool for unisoc devices. It should work with unisoc chips.

Clone the repository using `git clone` then change your directory to the cloned repository using `cd`

If you already enabled OEM unlocking on your developer options, Boot your device to fastboot mode using `adb reboot bootloader` then try `fastboot devices` if it can detect it. Here's the steps you will do in order:

Open cmd/terminal and navigate to the folder execute `fastboot oem get_identifier_token` first to get identifier token

`./unlockbl.sh IDENTIFIER_TOKEN sign.pem signature.bin` to create the unlock file

`fastboot flashing unlock_bootloader signature.bin` to unlock the bootloader

Tell me if it works on MAC system plssss :)
> 0 votes

# Answer
Rooting an android phone with a computer is mostly done by a Windows PC. But if you don't have access to a PC, you can root directly by your phone using some rooting apps.

By installing and running one of these apps such as Kingroot, it will start rooting and restarting until it has been rooted.
> 0 votes

---
Tags: samsung, rooting, tablet
---


# Question
Title: Android 13 car head unit won't route phone calls or AV-IN audio to USB DAC/AMP
I have a full blown Android 13 car head unit - EX-ALS215 (Snapdragon 662). Audio is output from a 3.5mm jack socket on the unit's harness (audio-out socket). I have then connected a Cyrus Soundkey DAC/AMP to one of the USB sockets of the head unit. All audio is now output via the DAC except phone calls and the audio from the AV-IN. (AV-IN is part of the unit's harness and is where I plug my TV tuner as input \[Video/L/R\]) So, voice calls and AV-IN persist in coming out of the 'audio-out' socket on the harness.

**Why is this happening and how can all audio be routed to USB?**

**Clue#1:** I have tested the Cyrus Soundkey with a Samsung Galaxy A53 and when making a phone call the audio from the call was correctly routed to the earphones plugged into the DAC. The microphone used during the call was the one built into the A53. I am at a loss as to what is happening.

**UPDATE#1 (01 Feb 2024):** I used adb to investigate why this is happening. Can you see anything obvious in the text files? or Would you like me to try something else?

**OBSERVATIONS:**

1. I am no expert, but is dumpsys audio showing the "Cyrus Soundkey" (usb\_headset(4000000)) being the default for voice calls? post.com/forums/attachment.php?attachmentid=3377686&d=1706801391
2. dumpsys media\_session: shows the com.wits.ksw.bt application (the KSW BT dialer) making a voice call? Does this mean that kswBt tries to output to the Soundkey and it fails, defaulting back to the builtin speakerphone (as seen in practice)? **UPDATE:** This entry does NOT represent a phone call. Instead it represents BT audio played on my phone via this BT app which is also responsible for voice calls. Indeed BT audio from my phone played using this app, does go through the USB DAC.

**SUGGESTIONS:**

1. Is it possible that the Soundkey is being rejected due to an audio incompatibility with the telephony audio (24bit vs 16bit or something)?
2. Someone suggested that A FiiO Q3 DAC would work with voice calls because it supports USB Audio Class 1.0. Others have said that a FiiO K3 DAC which also supports USB Audio Class 1.0 exhibited the same problem with voice calls. (FYI. The former has a unit from same manufacturer as mine, bought 2 years ago and upgraded to A13 & current firmware. The latter was from same manufacturer in 2020 A10.)

**LINKS TO FILES:** dumpsys audio, media.audio\_policy, dumpsys media\_session, media.audio\_flinger.

# Answer
It looks like after more than a week and 77 views and a bounty of 50, there has been no response.

Today I received the FiiO Q3 which someone claimed would work with voice calls because it supports USB Audio Class 1.0 {16bit} (press 'Gain' button while connecting it to USB). I tried it both in default mode {32bit} and UAC1.0 mode {16bit} and nothing changed. ie. Whatever the behavior of the Cyrus Soundkey was, the Q3 replicated it exactly. No magical improvement in the audio routing.

The voice calls were still routed to the harness, instead of to the DAC. Same thing with DTV audio - still routed to the harness, instead of to the DAC.

My conclusion is that the com.wits.ksw.bt application (the KSW BT dialer) and the DTV application are both hardcoded to specifically use the internal speaker output disregarding any other output. I suppose that person that claimed that the FiiO Q3 was able to overcome this problem was either totally mistaken or his android HU was substantially different (e.g. mine is CCC while his is CCI).

Further detailed info can be found in this thread between these 2 posts: https://f30.bimmerpost.com/forums/showthread.php?p=30805968 https://f30.bimmerpost.com/forums/showthread.php?p=30891352
> 1 votes

---
Tags: adb, audio, music, automotive-head-unit
---


# Question
Title: Type text in non-Latin language using Latin/English transcription in Android
Is there any way to make your Android keyboard type in the Latin alphabet but write in another language, e.g. Persian (Farsi) or other languages? For example, if you write the phonetics of some word in the Latin alphabet (English alphabet), it writes the equivalent Persian word in the input box.

Like the picture below in Google Translate, when the input language is something other than Latin languages, it suggests Persian writing.

>

The Persian keyboard of an Android phone of one of my friends suddenly has been changed and behaves like told. And the language symbol when you swipe is A-\>ا which probably means write in Latin and receive Persian.

I checked all the language settings. Nothing odd was there except only one thing that I checked which was the Farsi Latin input language, and the problem was not due to that. Note: you can forget about the (Farsi Latin) because it was not set in the first place. I only told for the ways I have tried.

So, how to take the keyboard back to normal Farsi?

# Answer
Possibly what you want is called Gboard, where you choose the language you want to type as and the keyboard layout you want to use.

Read more here
> 1 votes

# Answer
I had the same problem and found out that I had to press a button beside the setting in the keyboard that has the following cap/logo.
> 1 votes

---
Tags: keyboard, languages
---


# Question
Title: How to bypass country restriction on some apps like HelloTalk?
Some apps like HelloTalk and Tandem are restricted in Nigeria, and the restrictions of those apps even overpower VPN.

I use Windscribe VPN with paid features I make sure the VPN has no leak because it's always turned on. Yet, the app still detects it and I can't register HelloTalk and Tandem app.

What should I do to bypass it?

# Answer
> 2 votes
Apps can use information from your carrier, location of cell tower and the GPS to figure out where you are. I can get most apps to work this way.

1. Create a Google account
    * Add a payment method with an address in a supported country.
    * You may have to add a different credit card to this account (I havent created one for a while)
2. Add it to your phone
3. Either use this account all the time, or switch accounts when you want to use this app.
4. Turn the VPN on.
5. If it doesn't work, try with GPS turned off.
6. If it still doesnt work, turn of `Wifi scanning` and `Bluetooth scanning` under Location services

---

This still works for me for foreign banking apps and lotto sites.

If the App is using the carrier or your Country has collaborated with the your Carrier to disable these apps, then these apps may still not work.

---
Tags: applications, geolocation
---


# Question
Title: How to get Android Phone storage as a drive path in Windows PC
I am using MI Note 5 Pro android version 9.0 and Windows 10 Basic. On USB plugging('File Transfer' selected), I can only access files from Phone by normal copy paste(ctrl-c/v) but cannot access full file path from Phone because there is no drive letter assigned.

where disk is sd card.

I am getting files path as "This PC\Redmi Note 5 Pro\Internal shared storage" but want something like "P:\Redmi Note 5 Pro\Internal shared storage" How to get it without rooting phone?

Purpose: I want to backup my phone data to PC periodically using "Areca backup" open source utility which creates incremental backup. Note: I will not be writing any data to Phone but will only need to read it for copy operation.

# Answer
> 0 votes
Software like MTPdrive directly mounts a device with a drive letter.

# Answer
> 2 votes
MTP the protocol used for accessing the phone is not implemented as file-system on plain Windows thus you don't get a drive letter without third party software. Additionally MTP is a pretty unstable, ineffective and slow file-system which makes it not a good choice for backup.

But be aware that the files you can access via MTP are just the tip of the ice berg, making a backup of those data will not allow you to restore your phone (except for some apps that explicitly place their files on shared storage section).

If you still want to backup the data you should enable Android Debug Bridge (adb) and use adb-sync go copy the data to your PC. From there you can then make a backup.

# Answer
> 0 votes
AndroidDrive does this. If you're looking to transfer files from the phone, its very buggy in that regard though.

---
Tags: backup, file-system, file-transfer, windows
---


# Question
Title: How to extract default ringtones from Android device?
I just bought a new phone and I do not like the default ringtones/notification sounds, but I like the ones on my old phone.

When I plug my old phone into my computer and go to `This PC\KYOCERA\Internal storage\media\audio\ringtones` like I have been told to go to for the default ringtones, the only ones that show up are a couple of custom ringtones I had put on previously. I want to extract the default ringtones like AT&T Play On and notification sounds like Syrma, so that I can put them on my new phone.

I would prefer not to install drivers/programs onto my computer, but it would be okay with installing an app on my phone *if necessary*. I have the default Windows 10 programs on my computer, as well as and file commander and the rest of the default Android 5 apps on my old phone.

Any help would be much appreciated.

# Answer
You probably need a file browser on the phone to access (need root), or `adb pull`

The built-in ringtones are located in

```
/system/media/audio/ringtones

```

... instead of your *Internal Storage*.

You can also extract them from a ROM `.zip` file downloaded from elsewhere without looking into your phone. Just navigate to the same path above and take all files out there.
> 14 votes

# Answer
You can copy internal files, ex `/system/media/audio/ringtones`, to sd card or anywhere with total commander application.

On Samsung Phone, custom ringtones seem to have to be copied in \<internal storage\>/music/Samsung.
> 1 votes

# Answer
Okay, thanks guys! But, I found New Android version stored audio files in system\_ext/media/audio
> 1 votes

# Answer
On AOSP ROMs, ringtone, notification and other default sounds are located at `/product/media/audio/`

This is valid for at least Android 12+

If you do not have a root file explorer installed, you can run the following command to pull the files:

`adb pull /product/media/audio <target directory>`

This will move the content to the current working directory:

`adb pull /product/media/audio .\`

Running the above `adb` command requires USB/Wireless Debugging enabled from Developer options as well as connecting your phone to your PC.
> 1 votes

---
Tags: ringtone
---


# Question
Title: How to turn off/on Google activity permissions by individual apps
Does anyone know how to turn off/on Google activity tracking by individual apps? There's no option in the Google activity settings.

# Answer
There is no such setting for apps. Google activity tracking is on the Google account.

All I can see on mine is

* Web & App Activity
* Location History
* YouTube History
> 1 votes

---
Tags: applications, google
---


# Question
Title: How to verify if device is reporting fake technical specs like Android version, RAM, or storage memory?
I've been asked if I can check some faulty behavior of a device, a cheap Chinese android smartphone.

I'm not really an android expert, usually I install a few apps to help me figure out few things about the device. These apps I've reported conflicting results compared to what was displayed in the main android settings area:

* With DiskUsage internal memory is reported as 3.9gb vs 16gb in system settings.
* Device Info HW (suggested by @alecxs) explicitly mark as fake the reported version 9.0, pointing Android 6 as correct with API level 23. Unfortunately the app reports the same storage size of 16gb as stated in system settings.
Following another intuition of @alecxs, inspecting the partitions tab and looking at the displayed partitions sizes, it's possible to detect yet another forged spec. The total reported partitions size is around 8gb, the `userdata` partition is around 4gb which is corresponding to DiskUsage report. In my previous attempt I've CPU Info.

This kinda reminds me of fake USB thumb drives scams with less memory than advertised.

So is there a way (preferably without root) to test/analyze common technical details of a device for possible tampering/spoofing?

Like

* Storage
* Android version
* RAM
* CPU
* Something else that can be faked?

FLOSS solutions are highly appreciated! :)

**UPDATES**

* Listed used apps and updated after suggestions in comments.
* Added considerations and further analysis of partitions memory size.

# Answer
> 3 votes
In general the more common an hardware info app is the more likely it is that the hardware faker have integrated a patch to let a system info app display wrong values.

Therefore the best way to identify fake hardware is not to use an app at all. Using a Linux command-line program e.g. executed via `adb` identifying fake values or values that do not match if more likely. To do so I would recommend to copy a (renamed) busybox binary via adb:

1. rename it to something different like `mybinary`
2. push it to the phone `adb push <mybinary> /sdcard`
3. start `adb shell`
4. copy the binary it to a path where you can execute it: `cp /sdcard/<mybinary> /data/local/tmp/`
5. make it executable `chmod u+x /data/local/tmp/<mybinary>`

Now you are ready to use it..eg. to check the physical RAM:

```
/data/local/tmp/<mybinary> free
            total       used       free     shared    buffers     cached
Mem:       5727792    5528296     199496      67020       1712    2170428
-/+ buffers/cache:    3356156    2371636
Swap:      2097148    1737312     359836

```

In this example the total memory of the phone is 6GB minus the size used by the GPU. So we end up here with 5727792 total memory = 5.4GB max RAM

To print disk size you can use

```
/data/local/tmp/<mybinary> df -h /sdcard
Filesystem                Size      Used Available Use% Mounted on
/dev/fuse               109.6G     17.9G     91.5G  16% /storage/emulated

```

It shows the user data partition size and usage. The used phone has 128GB flash memory. The user data partition is smaller as the remaining space is occupied by the system partition(s) and other partitions.

# Answer
> 2 votes
Have you tried using something like AIDA64?

Apparently the newer versions have mitigations against reporting spoofed specs.

Another thing to check against the claimed specs. is pixel/screen resolution, it shouldn't be as easily spoofable, and is often lower than claimed in these cheap unbranded Android devices which have other suspicious specs.

There are also certain device model names which are more liable to report spoofed information.

If you go here, check the device model name/number (and estimated pixel resolution), some device models which frequently have spoofed specs are "FF-5000", "P10", "PX6", "S109", "T906", "TAB910", "TS-M704A", "ZH960" and more.

Other fake devices will have model numbers which appear on the surface to look like a known brand, e.g. "S21+ Ultra", whereas a real Samsung device should report something like "SM-G9960" (most Samsung devices will have model numbers starting with a prefix such as "SM-" or "GT-", although this could also be faked).

# Answer
> 2 votes
If you're comfortable with the command line here's what I think is a better and simpler way that doesn't require adb and connecting to a computer, doesn't require root access or anything else tricky. Easy for a novice or total noob:

1. Install *F-Droid* from *Google Play*
2. Install *Termux* from *F-Droid*
3. Run *Termux*
4. Type `pkg install inxi -y` then Press ENTER
5. Type `inxi` then Press ENTER
6. Read the info displayed.

# **Explanation:**

F-Droid is an alternative to Google Play. It says it is an "installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform".

**Termux** is a terminal emulator with a modified version of linux.

"*Termux combines powerful terminal emulation with an extensive Linux package collection.*"

**inxi** *is a command line system information script, built for console and IRC. It is also used for forum technical support, as a debugging tool, to quickly ascertain user system configuration and hardware.*

***Note:** You might be able to skip installing F-Droid and just install Termux from Google Play... try it.

I had the same issue and wanted to check my hardware because I suspected the hardware and software was spoofing the information shown by the built-in Android tools (Settings) and other apps like AIDA, CPU-Z, Device Info HW and other common apps. I was right (grrr )

*Termux* also has the `df` and `du` commands which show the real disk space available (free) and disk space used.

> `df -h` (disk free, human readable output)

> `du -hs` (disk use, human readable output & summary)

The 2nd command example `du` has a couple of switches:

`-h` is used to show file sizes in human readable format just like `df`, i.e. KB, MB, GB

`-s` is to show a summary only. This is necessary to stop `du` from displaying the name and size of every file. Instead it displays only a summary, which is the size of all files - the summary of disk use. Try just `du` and see what you get.

`du --help` =\> Summarize device usage of the set of FILEs, recursively for directories.

`df --help` =\> The "disk free" command shows total/used/available disk space for each filesystem listed on the command line, or all currently mounted file systems.

Type `inxi -h` (then press ENTER) for extensive help on how to get the information you want. If the results scroll past one screen just use swipe up to scroll up, if you are in a Termux shell (the 'shell' is what you get when you run Termux). You can copy and paste from within Termux in the usual manner, and paste data into other apps on the device, including browsers. This will allow you to post information to forums, tech support, or customer service agents. You can also try addition information gleaning commands suggested by linux savvy tech support ppl. You can also paste into Termux from other apps - useful if you get a suggestion for a command to run in Termux.

There are a whole lot of other options to determine the 'real' hardware and software details of an Android device from within Termux, and other linux style terminals/terminal emulators. You can even install additional packages within *Termux*. For more info just search for *Termux* using your favourite browser and search engine (most ppl use Google as their search engine but there are better & safer options like *DuckDuckGo* or even Yahoo among others).

If you are at all familiar with linux, Termux has a package manager that is pseudo `apt`. The command is `pkg` and it has the usual options one might expect from `apt` like install, search, show, list-installed and uninstall and more, as well as the -y for 'yes to all' argument.

Here's the results from the `inxi` command on my Chinese tablet:

```
.../data/com.termux $ inxi
CPU: single core AArch64 (-UP-) speed/min/max: 871/286/1508 MHz Kernel: 3.18.79 aarch64 Up: 9h 37m Mem: 1.4/2.75 GiB (50.9%) Storage: 39.75 GiB/Total N/A Procs: 2 Shell: Bash inxi: 3.3.31
.../data/com.termux $

```

The actual output from `inxi` displays better than it is shown here, much more readable.

My device reports 1TB of storage, 16GB RAM and Android 13 via the built-in Settings / System / About.

Whereas it actually has 3GB RAM 25-30GB storage (depending on measuring methods/standards) and Android 8.1.0. which is mostly evident from the `inxi` output.

**And I'm 100% certain I've been cheated**.

***Note:** I also used '*Root Checker*' to check the version of Android. Install Root Checker from Google Play, launch it and click VERIFY ROOT. It will display a message telling you if the device is rooted or not, plus some other info including the actual OS and its version.

---
Tags: security, hardware, system-info, tech-specs, fake-phone
---


# Question
Title: Can an app tell if it's been downloaded through an unofficial store?
Let's say I download an app using Aurora Store and I start using it, can this app know what source it has been downloaded from? Can it tell if the download source was different from the Play Store?

# Answer
Android saves for each app by which other app the app had been installed. This information can be queried via Android API and it can be queried using `pm` on adb level:

First list the packages installed:

```
adb shell pm list packages

```

Select an app package name from the list you want to query, e.g. Chrome `com.android.chrome`, and execute:

```
adb shell pm dump com.android.chrome | grep installerPackageName

```

Usually you will get the result that it had been installed from Google Play Store:

```
installerPackageName=com.android.vending

```

Other possible values (observed on Android 13) are `com.google.android.packageinstaller` if the app had been e.g. downloaded by a third party app (e.g. Chrome, Firefox F-Droid) and directly installed.

Apps installed via Aurora Store Session Installer will end up with

```
installerPackageName=com.aurora.store

```

Apps that have been installed via `adb install` don't have the `installerPackageName` property.

Also of interest could be the `packageSource` value on Android 13+ devices.

```
adb shell pm dump com.android.chrome | grep packageSource

```

These are the possible `packageSource` values.
> 2 votes

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


# Question
Title: Cannot use voice command through Google Search Bar microphone icon
I have a Pixel 7. I have typically been able to just go to the search bar on the bottom screen of my phone and say set an alarm and it always set an alarm. Now it's sending me to a website.

Is there any way to take it back to just setting the alarm?

# Answer
> 0 votes
**Unfortunately, it's not possible to access Google Assistant anymore through the microphone icon from the Google Search bar widget.** Users have to use alternative triggers like saying "Hey Google", long-pressing the home button, squeezing the phone (on select Pixel), or long-pressing the power button (on select Pixel).

There were big changes in January 2024 related to Google Assistant, including the shortcut from the microphone icon. As Google stated in Changes we’re making to Google Assistant,

> We’re also bringing you a more consistent experience within the Google app: The microphone icon will now trigger Search results in response to your queries, which is its most popular use case. You can continue to activate Assistant as you always have: Just say “Hey Google” or long press on the home or power button (on select phones) on Android \[...\]. But you’ll no longer be able to use the microphone icon in the Search bar to complete actions like “turn on the lights” or “send a message.” This includes the microphone in the Pixel Search bar, which will now activate Voice Search instead of Assistant. \[...\]

When the user taps the microphone icon for the first time after the update, there will be a pop-up that states

> **Access to Google Assistant has moved**
>
> The microphone button on the search bar now opens Google Voice Search instead of Assistant.
>
> You can still access Assistant with "Hey Google" or if you press & hold the power button to seat alarms, send messages, and more anytime.

---
Tags: app-widgets, google-assistant, voice-command, google-search
---


# Question
Title: How safe is factory reset if I didn't have a pin or password?
Some months ago I had to return a phone to the store and all I did was factory reset to erase everything (I did it two times too). Now I'm getting paranoid about how safe my information is and if it's possible to recover it. I've heard that modern android phones have an automatic encryption system tied to the pin or password. The thing is that I think I didn't have one for the phone and I'm wondering if my information is still safe or it can be recovered easily

# Answer
> 0 votes
While I am not a security expert, the way I understand it is that there is still full disk encryption, even without a pin/password. (The world being the way it is, there may always be some way discovered that allows a break in, but after a factory reset, this process should not be easy.)

**TL;DR:** using the factory reset option is still the best way to keep your data safe.

As noted in the comments on this question and the linked question, the following article has some helpful information on this:

https://source.android.com/docs/security/features/encryption/full-disk

---
Tags: factory-reset, encryption, privacy
---


# Question
Title: How to (brute-)force-kill selected background apps?
I need an **automatic brute-force method** for unrooted Android devices to kill selected apps that keep restarting in the background, i.e. an appropriate "automatic task killer". Ideally, such method entails a kill command running inside an indefinite loop. Two illustrative examples:

1. In Windows, you can run the following batch script from the command prompt:

> ```
> :start
> taskkill /f /im "process_name"
> goto start
>
> ```

2. In Linux, you can run the following bash script from the terminal:

> ```
> while true
> do
>     pkill -f process_name
> done
>
> ```

What I need is an equivalent for Android, but unfortunately, I do not have any experience with programming Android applications yet.

I have tested several "task killer" apps such as SuperFreezZ, but you can only terminate processes manually with those. If Android decides to restart a terminated or frozen process against your will, the new instance is not automatically terminated, rendering all these apps useless.

Are there any apps out there that can get the job done? If not, is there a simple way to implement a background script for Android and have it run permanently?

IMPORTANT NOTE: I do not - I repeat - **I do not** care about CPU/memory/battery usage or any overhead caused by the task-killing app. The sole purpose is to kill selected background apps as soon as they get (re)started, be it by Android or user action. A small app or script that just keeps sending appropriate kill commands every few milliseconds would do the job (hence "brute force"). The assumption here is that one cannot prevent Android from restarting apps in the background without rooting the device, but one can keep force-closing them the moment they are launched.

For better motivation, one (out of several) use cases for me is terminating Samsung's infamous Game Optimizing Service (GOS), which cannot be uninstalled even via `adb` as it gets immediately reinstalled (reminiscent to malware). When terminated by the user, it gets restarted after several minutes. An appropriate task killing app would automate the termination process for the user and ensure that GOS is running only for a miniscule fraction of system run time. There are several more reasons for me to desire such solution, which I do not want to get into here as it is irrelevant to the question.

# Answer
You can do it using an automation app, plus using adb over wireless as stated by @Andrew T. and @Morrison Chang respectively.

**A. Enable Wireless debugging**

1. Make sure that Developer options is enabled.
2. In the Developer options, enable Wireless debugging.

**B. Using Automate**

You can use Automate or other apps such Macrodroid, Tasker, etc.

1. Open Automate, go to Settings.
2. Under "Privileged & Superuser" section, select "Privileged service start method", then select "Android Debug Bridge (ADB)".
3. A notification will appear. Press `Show`. The Developer options will open. Go to Wireless debugging and select `Pair device with pairing code`.
4. Another notification will appear. Enter the code shown. Automate will be wirelessly paired using adb.
5. Go back to Automate and create the flow shown on the picture below.
6. Press `+`, go to Date & Time, select `Delay`.
7. Press the Delay block, press Duration and enter the duration the block must wait. Press `Save`.
8. Press `+`, go to Apps, select `Apps in foreground?`.
9. Set it `Proceed` to `Immediately`. Seclect the package (this is the app you want to stop). Press `Save`.
10. Link the Delay and `Apps in foreground?` blocks.
11. Press `+`, go to Apps, select `App kill`. Select the package you want to stop. Press `Save`
12. Link `Apps in foreground?`'s `No` path to the `In` path of the `App kill` block.
13. Link `Apps in foreground?`'s `OK` path to the `In` path of the `Delay` block.
14. Optional, to select all blocks, press on `Copy` icon, then `Paste` icon. Change the package to stop on the new blocks.
15. Press `Back` button/gesture. Press `Start`
16. Give the necessary permissions if requested.
17. Press `Start`, select the starting points, then `Start`. Or press `Start All`.
> 0 votes

---
Tags: automation, task-management, background-process
---


# Question
Title: Set ISO country code on non-root phone with adb
I want to try the new body-temperature mode of my pixel 8 pro's IR sensor, however that is locked to the US. Apparently the app checks for the SIM ISO country code so I would like to change that to US. Someone wrote a guide that uses the apps Shizuku and Carrier Vanity Name to change the code. I would like to do the same using `adb`. However, executing `setprop gsm.sim.operator.iso-country us` results in `Failed to set property 'gsm.sim.operator.iso-country' to 'us'. See dmesg for error reason.`

I suppose it's a permission problem, but without root access, I can't access `dmesg` to look for the reason of the error. How can I debug this? And how can Shizuku execute the command that I can't, when from my understanding I need to grant Shizuku permissions using adb in the first place?

# Answer
Such features are locked by all the carriers in your country. They are also locked properly by the Phone manufacturers because they cant risk being fined for breaching the local laws.

They don't just use the SIM, but also the Carrier, information from GPS, information from Cell Towers and information from Wifi connections.

Your chance of bypassing it are slim to zero. If someone has managed to do it, then ask that someone.

Your best bet is to do what I did (to get around a different restriction). Look for a Chinese phone on Ebay or Aliexpress that advertises this feature, and buy it. Note, it can't be a normal well known brand. It needs to be unregulated and unknown brand. The instructions will probably in Chinese, I had to get them translated by a friend. Also beware of false claims.
> 1 votes

---
Tags: adb, permissions, shizuku
---


# Question
Title: All new purchases from Play Store are failing from my Google Account
How do you fix the problem when you try to make a paid purchase it says "Couldn't complete your transaction. Your Play balance can only be used in Canada. See the fit card terms of service.". I am in Canada.

I've tried purchasing multiple apps from the Play Store on multiple devices. So this error must be associated with my Google Account. My balance is about $50. I use a VPN and have tried with it off but no difference. I have purchased apps in the past and it worked.

# Answer
Each google account you use is locked to a country. This is in the Payments section. You are able to change this once a year only.

For many situations, a VPN is not enough, you need an account in that country.

The solution is to create another google account and change its country to match your target. Before using it in this country, you need to switch your active account in PlayStore. This works in a few more situations, but still has limitations.

**Changing Account in Playstore**

* Open PlayStore
* Press on your photo
* On the right hand side of your name and account is a drop-down arrow
* Use it to change your account.

**Changing Country on your Account**

* On a browser go to play.google.com/store/games
* Click on your photo/icon
* Click on `Payments and Subscriptions`

If you dont have a method allocated then

* Click on `Add a payment method`
* Enter credit card details (you wont be charged)
* Enter Billing address in the new country.

If you already have a method allocated

* Click on `Edit payment methods`
* Choose a card and click on `Edit`
* Edit your billing address (to the new country).
> 1 votes

# Answer
**Setting your DNS servers to default may do the trick.**

Had the same problem driving me up the wall. Solution for my Android device was: Settings -\> Connections -\> More Connection settings -\> Private DNS Mine was set to "Automatic (recommended)" I changed it to "Off" and was able to make payments in Google again...

Not sure why the DNS server would have an effect on the detected device location, but I recommend also checking DNS settings in the Router and other network settings (e.g. VPN etc.) to see if that fixes your problem.
> 0 votes

---
Tags: google-play-store, google-pay
---


# Question
Title: "Couldn't complete your purchase. Check that you have the correct country selected in your Play account." error on Play Store
How can I fix the following error when purchasing from Play Store?

> Couldn't complete your purchase. Check that you have the correct country selected in your Play account.

It keeps saying that even though the country is correct.

# Answer
Detecting a country is done by various means, for different purposes

* Your ISP's country
* Your internet country (ie VPN)
* Country in your current account.
* Country of your phone manufacture

I have not tried purchasing anything outside my country, but I have installed and activated apps from other countries.

* Use a VPN to switch to the country required
* Ensure the country is correct on your currently selected account (this can be changed once a year only) and is found
    1. Log into Google account on browser
    2. Click on settings (gear wheel)
    3. Click on See All Settings
    4. Click on Accounts and Import tab
    5. Click on Other Google Account settings
    6. Click on Payments and Subscriptions
    7. Click on Manage Payment Methods
    8. Edit the Payment Method (if one exists, or add a new one, if none are visible)
    9. The address shown here is your account's country
> 2 votes

# Answer
Perhaps it’s because of the Cloudflare DNS 1.1.1.1 that you have set up on your WiFi router, which makes it unusable in relation to the country you are using it in. Because when I tried to turn off WiFi and use the internet via Cellular 5G, I was able to buy things on Play Store immediately.
> 1 votes

# Answer
In my case it was the DNS setting on my Android device, not the router. I recommend checking that too:

Settings -\> Connections -\> More Connection settings -\> Private DNS Mine was set to "Automatic (recommended)" I changed it to "Off" and was able to make payments in Google again...
> 0 votes

---
Tags: google-play-store
---