# Question
Title: Creating restricted accounts on phone running Lollipop
Can we create restricted user on phone running Android Lollipop? Seems that restricted users are not supported on mobile but only on tablet (mobile has only simple user no restricted user option).

Reference: http://www.howtogeek.com/205301/how-to-use-android-5-lollipops-restricted-user-profiles-for-basic-parental-controls/

# Answer
> 6 votes
Although it is not possible to create restricted accounts, you can achieve almost the same effect using a "normal" account.

This is the recipe:

* Create account, go into its properties and select whether you want it to be able to take/make phone-calls
* do NOT log in to your Google account during creation of that account
* after creating the account, deactivate any system-apps you do not want for that user and uncheck notifications for that app. Note that you need to uninstall updates to do so (you can update on your original owner account afterwards)
* log in to Google play using your owner account
* go to all apps
* "install" all wanted apps that are already on your mobile. This will NOT download that app again, but seems to simply create a link to that app, activating it within the mobile for the current user (similar to restricted accounts, but more complicated in the handling)
    + do not forget to install any keys-apps for bought apps after the app
* Now enter the properties, accounts select your google account and delete it (just for that user)

The result will be a user without your google login but with some of your apps.

# Answer
> 1 votes
Using stock Android unfortunately the answer is No. It may be possible using a custom ROM but as the site you've linked to suggests, Restricted profiles are only supported on tablet devices.

On a phone you can configure whether the user can receive phone calls and SMS but this is the only option available.

Unfortunately I've not found any information on how to enable restriced profiles in a custom ROM either. As Android can be built from source I'm sure it will be possible but it does not appear to be something that many people have investigated yet. You don't mention what phone you are wanting to set this up on but it might be worth asking over at XDA in the relevant forum as they may be able to shed more light on it.

# Answer
> 0 votes
Updated answer for 2019 - it appears that Google Family Link let's you lock down an Android phone (including restricting apps).

It works by creating a "child" Google account which is locked down, and you simply have to log in with that child Google account.

Here's a guide I found with step by steps on how to set it up https://www.howtogeek.com/205301/how-to-use-android-5-lollipops-restricted-user-profiles-for-basic-parental-controls/

---
Tags: 5.0-lollipop, restricted-profiles
---


# Question
Title: Is there any way to make calls ring/vibrate only for specific contacts?
My friend has an Android phone but she hates actually talking on the phone and hates being distracted by ringing or vibrating. Her mantra is that she'll check it when she checks it. This is quite annoying when I really need to get a hold of her as she often won't notice I was trying to call/text until later. She has the phone set on silent and turned off vibration.

I am wondering if there's any way I can configure it so that either it rings, vibrates, or both -- but only if it's me calling? In other words, I'm asking if it's possible for only specific contacts to trigger a ring and/or vibration, while otherwise being silenced? I'm not sure if this is something that can be configured out-of-the-box as I have an iPhone and am unfamiliar with Android. But even if it involves installing a third-party app, that would be fine as long as it can achieve the same result. Is this possible on Android?

# Answer
> 5 votes
I don't know any direct method, but we can apply some tricks to it. (I am assuming that we want to make all other calls silenced and only your call can ring or better we can say make a sound.)

1. Open a voice recorder and record silence. Name that recording at your convenience.
2. Now go to the settings and change the call ringtone to the one you just now recorded and save the change's made.
3. Now go to the dialer and select your contact and now edit your contact info.
4. (at this you need to be careful as every Android device has this feature in different ways). From there in the settings, select a special ringtone for your contact

Thus when others call, it will sound silenced, and when you actually call, then it will ring the tone you specifically selected for you.

---
Tags: calls, vibration, ringtone, silent-mode
---


# Question
Title: Can my Andoid access an external SD card connected by USB C?
I am speaking about an ***external*** SD card, attached by USB C cable; not any internal SD card.

I realize that access speed would not be great, but I am just looking for a cheap way to carry around 256gB or so in my pocket, for quite infrequent access to large files.

Can my Android 7 device recognize that external storage, either alone, or with help of an app?

---

\[Update\] The device is a ULEfone Armor 2. I would want to use a USB C cable to connect to an external SD card reader (unless anyone knows of a cheaper way to connect lots of external storage (physically, not requiring network access))

# Answer
I tried this on a Pixel 3 with a VAVA Usb C hub and it did not work for me, even though other USB devices were recognized correctly through the hub.
> 1 votes

---
Tags: external-sd, 7.0-nougat
---


# Question
Title: Are these two different phones listed in Google Drive's Backups?
The following screenshot is from Google Drive's Backups.

> **SAMSUNG-SM-J327A backup**
>
> * Apps: 30 apps
> * Call history: 94 KB - Last backup: Oct 13, 2019
> * Device settings: 4 KB - Last backup: Oct 14, 2019
>
> **Samsung SAMSUNG-SM-J327A backup**
>
> * Apps: 32 apps
> * Call history: 101 KB - Last backup: Oct 13, 2019
> * Device settings: 4 KB - Last backup: Oct 13, 2019

They are listed as the same phone but one seems different with the number of apps.

How can I tell if these are two different phones?

# Answer
> 3 votes
You need to check whether there is another phone (in this case with the same model) that used the same account by going to Google Dashboard. From there select Android. The number of devices using the account will be shown and listed.

If there are 2 Samsung SM-J327A models, to differentiate between them, you can go here to use Find my device and compare the IMEIs of both devices by clicking on the info button.

---
Tags: samsung, google-backup
---


# Question
Title: How to transfer my photos from my Android to my MacBook Pro?
Where to find the MTP mode in my Galaxy 5 phone and then how to transfer my photos from my phone to my MacBook Pro? Or at least have them automatically transfer from my phone to my drive in Google.

# Answer
macOS by default does not support the MTP protocol. You'll need to download a utility provided by Google called Android File Transfer on your MacBook to transfer files from your phone to your laptop.

As for the second part, you can set up your photos to automatically be backed up to your Google Drive by going to Google Photos and selecting all the folders which you'd like to be backed up.
> 0 votes

---
Tags: applications
---


# Question
Title: Is it possible to boot into a different recovery from TWRP?
Normally I boot into TWRP with

```
fastboot boot twrp.img

```

Is it possible, after I boot into TWRP with the above command, to boot into a different version of TWRP (from a different image) without booting into a rom, enabling ADB debugging, booting into the bootloader, and then running the command above?

# Answer
> 0 votes
You can reboot to Bootloader from TWRP.

* Using either the `Reboot` menu and clicking on `Bootloader`
* Or from `adb shell` when TWRP is running using `twrp reboot bootloader`

From the bootloader, `fastboot` will work and you can run

```
fastboot boot twrp.img

```

---
Tags: recovery-mode, twrp, fastboot
---


# Question
Title: Can a virus/spyware install itself on a system partition remotely?
If I install malicious app accidentally can it copy itself onto the system partition? Or if a hacker gains access to my phone remotely can he install spyware onto the system partition?

I have read that malicious apps installed on system partition cannot be removed by factory reset or wiping the cache and the only way to remove them is by flashing the original firmware. Is this correct?

If possible then how can I prevent an unwanted software installing or being installed permanently?

# Answer
> 1 votes
Yes, under certain circumstances it is possible to install software remotely on your system partition. And yes, once a software is installed on the system partition it is immune to a factory reset, as the factory reset never changes the system partition.

However for doing so your device must be vulnerable to an exploit that allows to modify the system partition, as this is normally not possible from within a normal app.

Consider the two scenarios which are common ways to infect your device:

1. You install an app that contains malicious code that uses an exploit to temporary root your device and then installs itself onto the system partition.
2. You are surfing the web using a browser that has a vulnerability. You end up on a web site that exploits the vulnerability of your browser to download malicious code into browser. Afterwards the code additionally exploits your system similar to the first infection variant.

If you don't want to be affected by malicious code that installs itself permanently onto your device there are some basic guidelines:

1. Don't download apps from the internet or other untrusted app stores.
2. Or even better, don't install apps you don't know.
3. Always install the updates for your favorite webbrowser app(s).
4. Use a device that regularity gets security updates from the vendor (the more often the better, for some devices there are security updates monthly). Hopefully this allows you to fix the security problems before an malicious app can use it.
5. Don't use a device that no longer receives security updates. If your device is no longer supported I would recommend to to root/unlock the device and install a recent version of LineageOS. Of course this usually means that you should consider this when buying a device (possibility of unlocking plus supported by LineageOS).

---
Tags: security, system-apps, virus
---


title: what is Market, on an Android device?

text:
# Question
Title: what is Market, on an Android device?
In looking up an issue I'm having, I came across 2 questions and associated answers that talked about "Market" (for example, Application Always Downloading).

I've never heard of this app, and couldn't find anything on my phone that even resembled it. I also couldn't find it in Google Play or Google's search engine, and couldn't really find anything about it.

# Answer
> 0 votes
Something about how it was talked about on the aforementioned questions/answers made it seem a lot like Google Play. Turns out, it basically is.

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


# Question
Title: Google Camera says "Can't take photo: Not enough storage left on this device."
On a recently flashed LineageOS 16 Device, I'm getting with Google Photo

> Can't take photo: Not enough storage left on this device.

The File Browser shows 234 GB Free.

# Answer
> -1 votes
Not sure if I did anything before hand, but force-quitting the application and restarting it made it work.

---
Tags: lineageos, 9.0-pie, google-photos
---


# Question
Title: busybox list command show different time format for file last modified time
e.g. android busybox command:

```
busybox ls -ls foldername/

```

outputs are:

```
Jan  1  2015

```

or

```
Oct 16 14:18

```

The first one doesn't show time while second one does not show year. How to make the output show complete date time e.g.`Oct 16 2019 14:18`?

# Answer
> 1 votes
You need to add `--full-time` to the command to view the complete date.

```
busybox ls -ls --full-time foldername/

```

As stated on `ls` command's usage:

> --full-time List full date and time

---
Tags: busybox
---


# Question
Title: "Device Admin" apps are asking for permission to erase my data after failed login attempts! How can I confirm?
I was about to install the Outlook app on my phone, when it asked me to activate it as a device admin. (See image below):

I'm sure few people read the whole warning. One part greatly concerned me:

> **Monitor screen unlock attempts**
> Monitor the number of incorrect passwords typed. when unlocking the screen, and lock the phone or ease all the phone's data if too many incorrect passwords are typed.

---

Well shoot, if there's risk of ***all data being erased***, I'm not really not that interested anymore! I often accidentally swipe patterns while I'm holding my phone in my hand. Plus a friend or young family member may be fooling around with my phone, unknowingly creating me a very long restoration process and lost data I can never get back.

What I'm wondering:

1. Is this just a generic warning given for any app requesting admin privileges? Perhaps it's possible that Outlook doesn't use the erase feature?
2. Is there a way to verify *how many* incorrect login attempts will trip the erasure?
3. Can I override the ability for it to erase my phone? (I'm guessing not.)

# Answer
> Is this just a generic warning given for any app requesting admin privileges? Perhaps it's possible that Outlook doesn't use the erase feature?

Only the operations which the app can perform are shown to the user. If the device admin screen shows an operation like "Monitor Screen Lock Attempts", then rest assured, the corresponding app does have that feature.

I am sharing an image from an app named Tasker which employs only one device admin operation and is asking only for it. This should be sufficient that the device admin screen doesn't show generic operations but only app-specific ones. This can further be tested against the list of maximum operations that can be shown from here.

> Is there a way to verify how many incorrect login attempts will trip the erasure?

Developers might be able to see it by analyzing the code from the APK using special tools. You could test this using trial and error on your own by using and running your app on it. Try incorrect passwords and count for yourself. I'm not aware of an easy way.

> Can I override the ability for it to erase my phone?

I do not know as of now. An Xposed module like Bypass Exchange Policies might be able to do this.
> 1 votes

# Answer
https://www.microsoft.com/en-us/microsoft-365/blog/2015/02/17/pin-lock-updates-outlook-ios-android/

"this is an app-level wipe, not a device wipe. The Outlook app will reset and Outlook email, calendar, contacts and files data will be removed from the device, as well as from Outlook’s cloud components. The wipe will not affect any of the user’s personal apps and information."

Phew! wish they said that in the install process TBH.
> 0 votes

---
Tags: security, outlook, device-administrator, remote-wipe
---


# Question
Title: Not receiving notifications on dual WhatsApp on Samsung Note8
I have two instances of WhatsApp on my Note8. When I receive a message on my primary WhatsApp, I get notifications instantly as normal. However, on my dual WhatsApp, I don't get notifications unless I open the app.

Sometimes, I get notifications come in all of a sudden as if the app has come alive and checked, but this is not consistent with the primary app.

I've gone to *Settings-\>Notifications* and there is only one 'WhatsApp' app listed and notifications are enabled. However, this cannot be where the issue is as the notifications are fine for the primary app, just not the dual app.

If I go to *Settings-\>Apps*, then here I do see both instances listed. And notifications are enabled for both. I've also checked the *Mobile data* settings for both, and they both have *Allow background data usage* enabled. I am not using *Data saver*.

The only thing I've not tried is disabling *Optimise battery usage* for WhatsApp as this seems to be for both instances of the app, not either. But other than that possibility, I'm stumped. Any ideas welcomed.

# Answer
> 1 votes
I think your phone power saving app is putting a dual messenger app to sleep. so please check that it's not in sleep app list.

# Answer
> 0 votes
I had problems with getting notifications for my dual Viber app and it seems that by default they are turned off.

So, you need to go to *Notifications \> Advanced* and there you could find and manage your dual messenger's notifications.

I'm not sure that the path will be the same for your device but for the record I'm using Samsung Galaxy S7 with Android 8.0.0 on it.

Maybe that could help you with the issue.

---
Tags: notifications, settings, whatsapp-messenger, samsung-galaxy-note-8, samsung-dual-messenger
---


# Question
Title: Can a lost rooted/unlocked phone be decrypted by a thief?
Someone stole my One plus 7 Pro.

It was rooted and had TWRP and Magisk 19.x ( latest subversion before 20.x dropped). I had a passcode and fingerprint set up on my phone. It was stolen at a technical convention for students. Assuming the thief has knowledge about Android can my phone's encryption be broken to give access to my files?

TWRP requires the passcode to be able to decrypt the storage, so does the phone on boot.

Any input is appreciated.

TLDR;

> Phone got stolen at a technical convention Thief might have knowledge of Android Running Stable Android 9 latest firmware before Stable 10.0.1 Running Magisk 19.x (Latest before 20.x dropped) Running TWRP 3.3.1.x TWRP requires the pin to decrypt

My concern, Can it be hacked/cracked to give access to the storage inside?

Thanks in advance

EDIT: My passcode was 5 digits long.

# Answer
If your phone is encrypted, then it cannot be decrypted without having access to the decrypt option in Settings. And since you have a fingerprint lock set up, as far as my knowledge goes, you are safe - no one will be able to access your data, even if you are rooted. Decrypting the phone externally should require extensive hacking algorithms and knowledge about the phone architecture, and I doubt anyone will spend that much time.

If, however, the thief wipes your phone (factory resets it) from TWRP, then all the data will be lost, which again means that your data will not be available to the thief, and you are still safe.
> 0 votes

---
Tags: encryption
---


title: Why is Magisk failing ctsProfile?

text:
# Question
Title: Why is Magisk failing ctsProfile?
Under "SafetyNet Check Success", my Magisk shows ctsProfile is not passing? Is there anyway to check on this and figure out why?

# Answer
Try using the MagiskHide Props Config. Install the module from the downloads section in magisk manager. The details can be found here:

https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-t3789228
> 0 votes

---
Tags: magisk, safety-net
---


# Question
Title: How to limit an app's access only to specific networks?
I'm currently using DroidWall to limit apps' access to the Internet - and it's working great.

Recently I've started to have the need of allowing certain apps network connectivity, but **limited only to the current LAN** (e.g. only to communicate with IP addresses 192.168.1.x)

DroidWall doesn't seem to offer this in any trivial way (except, perhaps via its custom scripts, for which there aren't any clear instructions for how to apply them only to an individual app).

How can I limit an individual app to LAN access only?

# Answer
> 5 votes
You can use rules like this in your custom scripts:

```
$IPTABLES -A "droidwall-wifi" -m owner --uid-owner 12345 --destination "192.168.1.0/24" -j RETURN

```

Instead of `12345`, you need to specify the UID assigned to the app; you can find that UID in the list of apps in DroidWall.

Remember that UIDs are assigned dynamically, and if the app is removed, the UID previously assigned to it may be assigned to a completely different app installed later.

There are some enhancement requests for DroidWall (#275, #253) requesting to add such feature, but developers did not respond to them yet.

# Answer
> 0 votes
I came across a solution that can work for you today.

I have been using this firewall for years but never realized that it has a hidden feature until today.

For most apps on the Android device will still work on LAN even if the APP is completely blocked from the internet.

I tested it and it did not access the internet at all but was able to access LAN.

This can easily be tested from a browser.

For other APPs that use UPNP services. It will not work on LAN if you block it. So then you will need to go to the access log and see the request on to the LAN and open it while making sure the others are blocked from the APP in the firewall.

The APP is called No-Root Firewall by Grey Shirts.

The APP works very well but just does not work on LTE connections and no updates since 2014.

---
Tags: networking, firewall
---


# Question
Title: How to start root shell with Android Studio?
I just installed Android Studio. How do I get into root shell on my phone? Or do I have to download ADB separately?

# Answer
Android Studio does not contain ADB, you need Android SDK / Android SDK platform tools for it (it is installed on first run of Android Studio).

If you don't want to use Android studio, just download standalone Platform tools and extract to some folder.

ADB is by default located in `sdk\platform-tools`:

`%USERPROFILE%\AppData\Local\Android\sdk\platform-tools\adb.exe`

`C:\Users\<user>\AppData\Local\Android\sdk\platform-tools\adb.exe`.

It's possible to add to PATH in Windows and use Terminal inside Android Studio only by command: `adb shell` and after use `su` get root shell.

1. Locate the SDK platform tools folder (e.g. `%USERPROFILE%\AppData\Local\Android\sdk\platform-tools\`)
2. Open *Enviroment Variables* in Windows (See http://www.computerhope.com/issues/ch000549.htm)
3. Add the platform tools path (e.g. `%USERPROFILE%\AppData\Local\Android\sdk\platform-tools\`) to the PATH variable
4. (optional) Reopen Android Studio
5. Use Terminal with `adb shell` command

When you don't want to use it inside Android studio, you can use it just in command line / terminal by: `C:\Users\<user>\AppData\Local\Android\sdk\platform-tools\adb.exe`
> 67 votes

# Answer
**WINDOWS:** In the current version of Android Studio, ADB.exe is located in `%USERPROFILE%\AppData\Local\Android\sdk\platform-tools\`. Earlier versions of Android Studio have it in `%LOCALDATA%\Android\sdk\platform-tools` instead.

**MAC:** Find the ADB executable in `~/Library/Android/sdk/platform-tools`.

**To open the ADB shell:** Ensure Android Studio is installed. In the command line interface (CLI) for your platform -- Command Prompt for Windows or Terminal for Mac -- navigate to the location of the ADB executable as described above (you can copy/paste the strings as shown and don't need to type in your actual username) and do the following:

1. Type `adb devices` and press Enter.
2. Locate the name of your device in the list.
3. Type `adb -s XXXX shell` and press Enter, replacing XXXX with the name of your device from the previous step.
> 92 votes

# Answer
On a Mac Android Studio installs adb there:

```
/Users/<your username>/Library/Android/sdk/platform-tools

```

To use it in your shell, you can add it to your .profile file:

```
export PATH=/Users/<your username>/Library/Android/sdk/platform-tools:$PATH

```

Please open a fresh terminal window after you did that, or load the changes by typing this in your terminal:

```
source ~/.profile

```
> 8 votes

# Answer
Once you have Android Studio set up make sure you can connect to an emulator or a device where it will be listed in the AVD (Android Virtual Devices). If a physical device is connected confirm that debugging mode is enabled and access is allowed to Android Studio. A separate ADB is not needed as all the build tools are part of the IDE.

Now you are ready to access your device's shell!

1. Access the terminal at the bottom of the IDE by selecting the *Terminal* button.
2. In the terminal issue `adb devices`. This will list the all devices currently connected to Android Studio. Find and use your device's name for step 3.
3. Now issue `adb -s <device-name> shell`. Now you are in your device's shell.

On a side note, if you want to access the shell of an *emulator* with root access installed from Android Studio, issue a `adb -s <device-name> root` before accessing the shell.
> 2 votes

---
Tags: adb, root-access, shell
---


title: Why doesn't my wallpaper scroll?

text:
# Question
Title: Why doesn't my wallpaper scroll?
At first, my question was why I had to crop my wallpaper wider than it seemed to be, but I saw that that question was already asked and answered here: Setting wallpaper - wrong orientation

So now my question is, if wallpaper is cropped wide so that it can scroll when you switch between screens, how come mine doesn't move? I am using a picture I downloaded from the internet on my phone, and as far as I can tell it doesn't move at all no matter what I do.

If it matters, my phone is a Motorola Atrix HD.

# Answer
The launcher application on some phones does not provide the ability for a scrolling wallpaper, the only way to fix this would be to download a separate launcher.

Here is a list of most of them -

https://play.google.com/store/search?q=launcher&c=apps
> 1 votes

# Answer
http://androidforums.com/samsung-galaxy-s3/586033-galaxy-s3-cheated-some-us-leaving-out-scrolling-wallpapers-2.html#post4756930

Citation: "Scrolling wallpapers glitch when they have infinite scrolling. If you scroll past the end of the wall paper, it'll sharply shift to the other side of the image. I would imagine some find this to be unsightly. The developers at Samsung probably see this as a problem and probably thought infinite scrolling was a more important feature than wallpaper scrolling."
> 0 votes

# Answer
On some LG devices, go to **Settings - Display - Home screen - Swipe effect**, then choose **Panorama**.
> 0 votes

---
Tags: wallpaper
---


# Question
Title: Error 28 when sending SMS to short numbers
I am using Android 6.0 and when I try to send SMS (via Hangouts or Messenger) to a 4-digit number, I get a confirmation pop-up and then an error saying

> Can't send message with `SIM_NAME`, error 28

I've tried to clear cache. Messages to regular numbers can be sent without any problems.

Why, and how to fix it?

# Answer
There's a possibility that **the short number/code hasn't been registered by the operator**.

There are 2 similar cases happen with different operator:

* Sky Mobile

> Why won't my phone allow me to send an SMS to a 5 digit number? It keeps telling me error 28 try again. I only activated my SIM card on Saturday.
>
> ---
>
> Not all, if any, short codes are supported on Sky Mobile I’m afraid
* ID mobile

> I enter a few text competitions a month that use short codes, usually ITV competitions or the Gadget Show. However the new Gadget Show competition that uses short code 65555 will not send and I simply get a popup error of: Cannot send message with id - error 28
>
> Everything else works, phone, internet, texting. I even entered another competition that uses a short code beginning 6 and that works fine. I still have loads of unused credit before I reach my cap.
>
> Gadget show comp has changed the SMS number this series and I read somewhere that short codes have to be manually registered with the network providers to work, so maybe ID have not enabled 65555 yet??
>
> ---
>
> Hi all, we've got the problem sorted that was preventing you sending a message to 65555.

If that's the case, then there's really nothing that can be done from the user's side except by letting their operator know and request to allow/register the short numbers. Otherwise, switching to a different operator is the last alternative.
> 1 votes

# Answer
U need to allow sending premium messages. Go to settings,apps,messages,permissions,premium messages,always allow
> 0 votes

---
Tags: sms
---


# Question
Title: How can I get edits done in aCalendar to sync?
Any changes I make within aCalendar (e.g. adding an event, changing the calendar for an event, adding or deleting a calendar) aren't reflected within the local Google Calendar app or from the Google Calendar website. The changes may be reflected in other calendar apps on the same device (e.g. Business Calendar). Moreover, opening one of these other calendar apps may cause the changes to propagate to the local Google Calendar app and the Google Calendar website. Within aCalendar's "Manage calendars" screen, the Google Calendar account has "io-error" next to it.

The phone is connected to WiFi and the cell network. Account sync is turned on for the Google account, and synchronization is enabled for Google Calendar. Data saver and battery saver are enabled.

How can I get aCalendar to synchronize its changes?

System info: LG V20 Android Oreo 8.0.0 Google Calendar 6.0.56 aCalendar 2.2.7

# Answer
aCalendar's help docs ("General Sync Issues / Sync of two devices" and "Problems with Google Calendar Synchronization") list a number of settings to check, including:

* background data
* energy/battery/power saver

In particular, if the phone's energy saver mode is turned on, background apps are restricted. aCalendar relies on Google Calendar running in the background for synchronization, so energysaver mode thus interferes with calendar synchronization.

To get calendar sync to work, go into the energy saver settings and exclude/exempt Google Calendar. It should not be necessary to exclude aCalendar or other calendar-related apps (e.g. Calendar Storage).
> 1 votes

---
Tags: sync, calendar
---


title: Can't install apps after factory reset

text:
# Question
Title: Can't install apps after factory reset
I have a Lenovo Tab 4 10-inch tablet (Lenovo TB-X304F). Recently I had an error on it and had to perform a factory reset, and I'm experiencing problems reinstalling some apps I had installed before.

I have never rooted this tablet. Before the factory reset I did install some non-Google Play apps, but since the factory reset I have only installed apps from the Google Play Store. The tablet and apps are up to date, and the tablet is running Android 8.1.0.

Here is the most recent app problem. I purchased "Planescape: Torment" on November 11, and I installed it on my tablet around that time. However, now that I'm trying to install it again after performing the factory reset, I've had two errors, depending on the method I use to try to install it.

If I try to install it using the Google Play app on my tablet, it says "Your order is processing, your item will be available in a few minutes." (And I did not purchase this recently; I purchased it well over a month ago.) It lists the app as being $9.99 when I view it, as though I hadn't bought it, but when I tap on the button as though I'm going to purchase it, Google Play asks for the standard app permissions and then shows that error. It does exactly the same thing when I try to install it from the library list of all of my apps in the Google Play app.

If I try to install it from the Google Play website, the website tells me it's already installed on my tablet, which is no longer true. It used to be installed; it is not now.

I've cleared the cache and the data from the "Google Play Store" app and the "Google Play services" app. I chatted with Google Customer Support and they had me uninstall updates to the Google Play Store and then update it again, but that made no difference. I have of course turned the tablet off and back on. The Google Play Store doesn't seem to have registered that the app was uninstalled, and I don't know how to trigger that, and I have no idea what to do about the message I'm getting in the Google Play app itself on my tablet.

Does anyone know how I can resolve this and get my old apps reinstalled? Thanks!

# Answer
Google Support had me try a number of things that didn't help, but when they had me remove my payment methods, that seemed to do it. I had already removed and added my Google accounts from my device, which I didn't think would help because it clearly wasn't a problem specific to my device. (I had realized I also couldn't install that game or other games I'd bought to my phone, a separate device, so it wasn't device-specific.) The last thing I did was remove my payment methods and cancel a subscription in Google Play, and then I could install my apps to my tablet and phone. I'm not sure how that fixed it, but it did. It seemed to "reset" my devices with Google Play, so to speak. If anyone knows how that resolved the issue, I'd love to hear. I'm glad it worked, but I don't know why it worked.
> 4 votes

# Answer
I saw the "Your order is processing, your item will be available in a few minutes." message while trying to fix an order gone bad.....

I was trying to purchase a "second phone line" in the Hushed app. The subscription/purchase had gone through Play store (where I was charged) but something went wrong on the handover to the app vendor or at the app vendor and the line did not appear.

Each subsequent time I tried to purchase that item, I got the "Your order is processing, your item will be available in a few minutes." message.

I ended up cancelling the subscription that existed on Google Play, then purchasing another subscription. So yes, I payed for the first month of the subscription twice, hardly an ideal fix.
> 0 votes

---
Tags: google-play-store, installation, google-apps
---


# Question
Title: How to get past stalled initial station search in NextRadio?
I have a phone with an FM chip. To make use of it, I installed NextRadio. During onboarding, NextRadio is supposed to look up local radio stations. However, it hangs on this step, displaying a throbber but going no further and not responding to any input. How can I get past this step so I can use the app?

# Answer
> 0 votes
With data networks (cellular data, Wi-Fi) disabled, NextRadio's station search will fail immediately instead of hanging.

Try enabling airplane mode, then re-opening NextRadio. Instead of stalling and showing the activity indicator, it should give you a message that it couldn't find a station listing. Tap "OK" to proceed.

Now disable airplane mode, as it also disables the radio. Using the basic tuner, you can add stations as favorites to assign a name to them.

---
Tags: applications, fm-radio
---


title: Apps opening automatically when updated

text:
# Question
Title: Apps opening automatically when updated
I have a Nexus 5 that I just updated to Android 5.0 Lollipop. Since then, whenever an app is updated from the Play Store, it opens automatically. If 15 apps are updating, all apps will open one by one.

I can't find any setting for this. How can I stop this?

# Answer
You could disable the automatic updates from the Play Store.

Then you could control which app should be updated, so one at a time would be opened.

I'm pretty sure that is a bug that will be fixed in a near future, but you could turn off that until that fix come.
> 0 votes

# Answer
According to the (now deleted) OP's comment,

> This issue is fixed when Google Play Services is updated.
> 0 votes

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


# Question
Title: Dual phone SIM card - how to disable both SIM's
I've a dual phone SIM card (Pocophone). How can I to disable both SIM's without power down everything?

# Answer
> 0 votes
Simply switching on Airplane/Flight mode will do the job.

# Answer
> 0 votes
Usually in dual phones in android settings there is a setting as which sim to use for call,data ,text I had such a setting in my sony xperia.I am not sure about it in other phones because my Mi A3 does not have such a setting. Look in your phone settings sim setting and there should be setting for each sim in tray. If you have such a setting then only you can disable both sim the way you want to.

---
Tags: dual-sim
---


# Question
Title: Merging WhatsApp chat histories from different devices but same account
Is it possible to merge WhatsApp chat histories on 2 Android devices (but 1 account)?

If so, how?

# Answer
Admission: This doesn't fully answer your question, but it may help others struggling like I was with chat-history transfer. I couldn't better place my tip elsewhere (like here) because I don't have the reputation yet to allow me to do so.

Today I finally (read, much hair pulled over last few days) moved from my old Samsung S4 to a Note Edge (Note 4) with the same phone number. The directions WhatsApp gives for transferring history is incomplete or out-of-date it seems. In my case the last crucial step was to RENAME the **msgstore.db.crypt8** file to **msgstore.db.crypt**. Bingo! This time when installing and activating WhatsApp the missing "Restore" question came up, and all went fine. HTH

Credit: crucial tip discovered in another response here at Stack Exchange.
> 3 votes

# Answer
The most realistic approach I've found is this:

1. decrypt the WhatsApp backup file with the WhatCrypt app
2. merge two sql databases.
3. encrypt it

---

Although the approach looks promising, WhatCrypt 2.4 failed for me. (This is the most recent version for October 2019 - no updates since October 2016. It's still available via the Wayback machine.). I get "Different key file for this database". But maybe I'm simply doing something wrong.
> 1 votes

---
Tags: whatsapp-messenger, chat-history
---


# Question
Title: How to set Wi-Fi HTTPS proxy, not HTTP, via adb shell?
For HTTP I found a link: How to set WIFI proxy via adb shell? But I want to setup HTTPS proxy via `adb shell`.

# Answer
This question is a near duplicate of questions like this and this, and closely related to this and this. In fact it can be better explained by a developer, but since it keeps on appearing again and again with slightly different situations, I'll try to explain what I know with some unnecessary details to make the picture clear from a broader perspective.

In short:

* Unlike VPN, a proxy - by design - is not meant to be set system-wide. Individual apps have to create connections through proxy instead of connecting directly to remote hosts (visited websites).
* If an app doesn't have built-in support for proxy, it's possible to enforce the proxy on per-app basis or system-wide. Most of the solutions require root access, but Android's VpnService APIs work without root.
    + Transparently proxying `https` traffic requires SSL Bumping (decryption) on proxy server which breaks the security model of `https`. This needs to be worked around from both sides; client and proxy.

Android lets proxy be configured for Wi-Fi, Mobile Data (APN) or both. As of Android 9 proxy settings are saved in

```
/data/misc/wifi/WifiConfigStore.xml
/data/user_de/<User_ID>/com.android.providers.telephony/databases/telephony.db

```

Both files aren't directly accessible for editing without root. But there is another ***Global HTTP Proxy*** setting meant for managed devices which saves proxy information to `/data/system/users/<User_ID>/settings_global.xml`. It's possible to change global device settings through CLI:

```
~$ settings put global http_proxy <host>:<port>

```

And to unset:

```
~$ settings put global http_proxy :0

```

Or you can manually set keys:

```
global_http_proxy_host
global_http_proxy_port
global_http_proxy_exclusion_list
global_proxy_pac_url

```

Android sets this host/port information as the following Java system properties on all DVMs of running apps:

```
http.proxyHost
http.proxyPort
https.proxyHost
https.proxyPort

```

But only default browser or other system apps necessarily honor these proxy related networking properties. That's why when setting Wi-Fi proxy it warns:

> The HTTP proxy is used by the browser but may not be used by the other apps.

For non-system custom apps, it is up to the app creator to respect the proxy settings and use them for `http` and `https` proxy, as usually a server listening on single port can handle both type of requests (GET and CONNECT) as explained below.

---

## HOW PROXY WORKS (EXPLICITLY)

Actually `http`/`https` proxy is used only by *proxy-aware* apps and Android cannot enforce this system-wide. No one can, except the (`http` client) app which is making `http`/`https` connections. It's because proxy is set on per connection basis i.e. client itself decides which kind of connection it's going to make when creating a network socket. For `http` proxy full URL is to be given after `GET` verb instead of simple path. For `https` proxy the `CONNECT` method is used instead, so that proxy is requested to create a `http` tunnel towards remote host, through which TLS handshake takes place (without proxy's involvement) and encrypted traffic flows back and forth. It's essentially like doing a single local port forwarding.

See this answer for SOCKS proxy. For further details: Why proxy set on Android does not work when used as hotspot?

## CLIENTS' SUPPORT FOR PROXY

Since establishing a proxy connection is the responsibility of client app, many client libraries have in-built support to configure proxy settings. Mostly web browsers let user configure proxy in settings UI or use system provided information e.g. on Windows there are IE Proxy Settings and also `netsh` command for programs which are linked against WinHTTP library. On Linux environment variables `http(s)_proxy` are honored by many networking libraries, CLI utilities and GUI programs including web browsers ().

However native methods aren't directly applicable to Android's Java based framework. Android's `HttpURLConnection` (, ) and Apache's `HttpClient` (deprecated) handlers honor (, ) above mentioned system properties (, ). So the apps making use of these APIs are able to use same proxy (, ) for all connections. An example is WebView (10, 11) which is based on Chromium:

> by default the system-wide Android network proxy settings are used to redirect requests to appropriate proxy servers

But not all Java libraries consider the VM system properties as was the case with Apache HttpClient before version 4.2. Such apps may listen to `PROXY_CHANGE_ACTION` broadcast (12, 13) to get notified of changes in proxy settings and then getDefaultProxy settings - either set through CLI (global) or GUI (per network basis) or programmatically (14, 15).

Or app may also ask user to configure proxy in app itself and use multiple available proxies (16, 17) including system properties (18) on per-connection basis.

Proxy-aware apps, particularly web browsers support:

* Configuring `https` (SSL) proxy explicitly in settings through GUI (e.g. Firefox's `network.proxy.ssl` preference) or CLI (Chrome's --proxy-server option) or plugins like FoxyProxy.
* Using `.pac` (19, 20, 21) file to import proxy settings from remote host.

For Wi-Fi APs Android also supports importing `.pac` files (but not WPAD). In this case *ProxyHandler* and *PacProcessor* helper apps make a local proxy available to apps but authentication doesn't work.
* `CONNECT` over TLS connection towards SSL proxy (e.g. Squid or Apache) in contrast to plain TCP `CONNECT` method which sends unencrypted traffic from client to proxy before TLS handshake. See FoxyProxy and `network.proxy.proxy_over_tls` option on Firefox.
* Authentication if proxy requires, other apps usually fall back to no proxy mode when connection to proxy isn't established. Apps need to handle authentication even if loading some content in WebView.

So if you want your app to work with `https` proxy, consider all above factors and choose appropriate SDK/libraries when coding the app.

## ENFORCING PROXY (TRANSPARENTLY)

For those libraries and programs which provide no means to configure proxy, there are different methods `proxifiers`/`socksifiers` use to force traffic towards a proxy server.

* tun2socks is a socksifier which accepts all TCP (and optionally UDP) traffic directed towards a `tun` interface in routing table. That's how VPN works on Android. While `tun2socks` is a perfect choice to be used with SOCKS tunnels, it doesn't support `http(s)`. But there are `tun2http(s)` solutions (like TunProxy) which are based on Android's VpnService API and transparently redirect all `http(s)` traffic towards remote proxy.
* redsocks is another similar tool but it NATs all traffic to a specific port listening as SOCKS or HTTPS (HTTP/CONNECT) proxy. `transparent_https` is another similar custom made minimal solution.

Both above methods can be used on Android to forward traffic to an upstream proxy e.g. on internet or local network (22). Also see related details in this answer.

* Setup interactive proxy like ZAP or mitmproxy on your local network (e.g. on router / gateway) using only routing / TPROXY (no DNAT/SNAT) and configure it to use your upstream proxy running in explicit mode (`CONNECT`).
* Use Shared library interceptor method. See details in this answer.

## SSL/TLS INTERCEPTION (MITM)

If the purpose of `https` proxy is the Access Control like logging, anti-virus scanning, content blocking, filtering or adaptation, SSL bumping (23, 24) is required on proxy server. In the absence of `CONNECT`, the very first HTTP request sent is already encrypted. So the proxy doesn't know who the original intended host is, (SNI may help but even with `CONNECT` method, you can't do DPI) without decrypting SSL.

It means that every outgoing SSL/TLS connection is to be terminated and re-established by proxy, so the proxy must be forced intercepting (like squid). But not every `https` proxy supports SSL decryption and working transparently (25); the ***s*** part needs special handling of Certificate Authorities. Proxy's root SSL certificate - which signs dynamically forged web server's certificate - needs to be added to credential store of client app and/or device (keeping this in consideration) to avoid invalid certificate errors. Or client may opt to ignore the errors, thus defeating the purpose of secure `http`.

If the purpose is not the filtering but only to hide visited websites from ISP / local network or to hide public IP from visited websites, an alternative is to do simple NAT on both sides i.e. on device or router and the remote proxy server. SSL Pass through is a similar approach.

---

**RELATED:**
> 3 votes

---
Tags: adb, shell, command-line, proxy, https
---


# Question
Title: External keyboard and ESC key on Android
https://www.logitech.com/en-hk/product/k580-multi-device-wireless-keyboard

This bluetooth keyboard (probably many others) has the back tick ``` and `Esc` keys on it. Will these ``` and `Esc` work on Android Apps such as Termux with Vim? Linux on Dex?

I think External Keyboard Helper Pro is an app that can help with this as well browsing the Play Store.

# Answer
> 1 votes
Yes it will work.if virtual keyboard with `/`` and` esc\` worked then why not hardware keyboard worked it will work.

---
Tags: keyboard, external-keyboard, termux, text-input, text-editor
---


# Question
Title: Can connect to hotel WiFi, but Google Chrome says I am offline
I (Oneplus 3) and my girlfriend (iPhone) arrived in a hotel yesterday with open networks for us to use. So no splash screen or log in. The problem that I am facing is that I am able to connect to the network but I can't seem to use Google to search for things. It gives me "You're offline" without any additional information. However, I am able to receive WhatsApp messages and use some other apps like Facebook.

I have tried everything that I can think of and have been using mobile data to Google that problem for a few hours but no result. The weird thing is that when I connect to like a restaurant WiFi, everything works like it's supposed to. In the hotel, everyone can use WiFi except me.

# Answer
Try this:

1. Make sure if it is a DNS resolution issue, Just use the IP of Google to check if we can connect. `74.125.24.94`
2. We can see the IP configuration of the network in our mobile. In Android, (I don't know what is yours, only in mine),`Open settings-> wireless network-> click the ! of the wireless you connect-> network information`, we will see DNS, Gateway, IP address, mask, and so on. Check if they are all correct.
3. Then you can check if you have static settings in the `static IP` in the `!` as well `as network information`.
4. We can also try to set up a static IP to see if it works.
5. Finally, we can also try to clear the network and re-connect again.
> 0 votes

# Answer
I'm not sure your problem is related to DNS, some networks will not let you forward DNS to an outside network. You may have to point it to the gateway device on the network.

In Android:

Open the Settings on the device.

Select “Wi-Fi”.

Long press your current network, then select “Modify network”.

Mark “Show advanced options” check box. Change “IP settings” to “Static” Add the DNS servers IPs to the “DNS 1”, and “DNS 2” fields.
> 0 votes

# Answer
I had the same problem many times, after hours I finally tried the browser called "browser ". After selecting the wifi that you want to hook to, open "browser", then try a random search. Click ok (except) past all the warnings. Hope this helps someone.
> 0 votes

# Answer
Use a different browser besides Chrome and that should help. That's what works for me. Something about Chrome on Android, I guess.
> 0 votes

---
Tags: wi-fi, internet
---


# Question
Title: Decrypting an SD Card after the phone is wiped?
I have a Samsung Galaxy with an encrypted SD card, but the phone got factory reset.

Is there a way to decrypt it?

# Answer
The purpose of an encryption is to make it impossible to get access to the data without the correct key.

The encryption key of the SD-card is stored on the device and was deleted by the factory reset.

Therefore the chance to decrypt the sd-card is nearly equal to 0.
> 0 votes

---
Tags: samsung, sd-card, encryption
---


# Question
Title: How to use your Android phone as a proxy server?
I wanted to use my Android phone as a proxy server, meaning that I wanted to be able to use the IP on the phone as a proxy, so all requests and responses are received on the phone and forwarded back to the original requestor.

How do I do this?

# Answer
If you're just interested in setting a proxy up over your Wifi, you can do that with Servers Ultimate quite easily, but I don't know why anyone would really want to do that. A much more useful option is to use mobile data, but as Kevin's answer said you're going to hit a lot of headaches, namely at the ISP level (Verizon, AT&T, etc). Chances are you won't get them to change their NAT policy for you.

It's hard to use your mobile data as a proxy because all incoming connections are blocked. But, if you have a laptop, and your phone connected to your laptop via adb, one option is to run a command like this:

```
adb forward tcp:6400 tcp:8080

```

This command forwards all TCP connections sent to your host (laptop)'s 6400 port to your phone's 8080 port. Next, set up a proxy server on your Servers Ultimate App running on port 8080. No root required! Finally, on your laptop, set up your browser to use a proxy server connected to port 6400 on your laptop. For example, open Firefox, go to Settings, Networks, and use 127.0.0.1 and port 6400 as a proxy. Here's what's going to happen:

Any requests from the laptop's browser will be proxied internally to port 6400, which `adb` will forward to port 8080 on your phone, which is a proxy server that accesses the outside internet using your mobile data!

If needed, you can also open the firewall in your router up to access your laptop's port 6400 over WiFi from other devices, although I recommend setting up some kind of security policy.

There are tons of tutorials for enabling developer options and adb on your laptop, it's easy.
> 12 votes

# Answer
Servers Ultimate is an advanced app for turning your phone into a server. By the same developer, Proxy Server offers a more basic and solely "Proxy Server based" approach. As stated on its description:

> Run your own Proxy Server on your device! The app can handle HTTP and HTTPS protocols and GET/POST requests. You can even set the app to forward all connections to a default host and port so you can use other protocols as well through the socket!

They later on add

> For more servers and features have a look at our app Servers Ultimate

For some extra information about Servers Ultimate, check this article on LifeHacker, this article on XDA, and the apps own XDA thread.
> 7 votes

# Answer
If your phone is rooted (or at least bootloader is unlocked), you can run tinyproxy (HTTP/HTTPS proxy) as `init` service. It works with both Wi-Fi and Mobile Data, in latter case you have to make sure your phone is accessible from internet. See How to connect to Android through SSH over 3G/4G public IP?

* Create a directory on `/data` or `/system`:
```
~# mkdir -p /data/local/tinyproxy/tmp

```
* Create configuration file:

```
# /data/local/tinyproxy/tinyproxy.conf

Port 8080
Timeout 600
LogFile "/tinyproxy.log"
LogLevel Connect
MaxClients 100
MinSpareServers 5
MaxSpareServers 20
StartServers 5
MaxRequestsPerChild 0
ViaProxyName "tinyproxy"
#BasicAuth <username> <password>

```

For further configuration options see documentation.
* Build `tinyproxy` from source or may try this one. Move binary to `/data/local/tinyproxy/` and set permissions. Use `AID_NOBODY` or any other unused UID for service:
```
~# cd /data/local/tinyproxy/
~# chown -R 9999.9999 .
~# chmod 0755 . tmp tinyproxy
~# chmod 0644 tinyproxy.conf

```
* Add following lines to `/init.rc` or any other `.rc` file:

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

service tinyproxy /system/bin/chroot /data/local/tinyproxy /tinyproxy -d -c /tinyproxy.conf
    seclabel u:r:magisk:s0
    user 9999
    group 9999
    disabled
    capabilities NET_RAW NET_BIND_SERVICE SYS_CHROOT

on property:sys.boot_completed=1
    start tinyproxy

```

If using any firewall app, make sure to unblock incoming port `8080`. Reboot device. `tinyproxy` server should be running with least privileges. Connect locally or remotely.

---

## PS:

If phone isn't rooted or you want to further sandbox the proxy server, you can patch SELinux policy with following rules. Use Magisk `supolicy` tool or `sepolicy-inject`:

```
create tinyproxy
allow init tinyproxy process transition
allow init tinyproxy process { rlimitinh siginh noatsecure }
allow tinyproxy tinyproxy process { getsched fork }
allow tinyproxy toolbox_exec file { entrypoint read getattr execute }
allow tinyproxy tinyproxy dir { search write add_name remove_name }
allow tinyproxy tinyproxy lnk_file read
allow tinyproxy labeledfs filesystem associate
allow tinyproxy tinyproxy file { read open getattr create write append unlink execute execute_no_trans }
allow tinyproxy tinyproxy capability { sys_chroot net_raw }
allow tinyproxy tinyproxy unix_dgram_socket { create connect write }
allow tinyproxy tinyproxy tcp_socket { create connect accept read bind getattr write shutdown setopt listen }
allow tinyproxy port tcp_socket { name_connect name_bind }
allow tinyproxy node tcp_socket node_bind
allow tinyproxy tinyproxy udp_socket { create connect read getattr write bind }
allow tinyproxy node udp_socket node_bind
allow tinyproxy system_data_file file lock
allow tinyproxy tinyproxy file lock

```
* Check `dmesg` for `avc` denials to define any more required rules.
* Replace `seclabel u:r:magisk:s0` in service with `seclabel u:r:tinyproxy:s0`.
* Set SELinux context:
```
~# chcon -R u:object_r:tinyproxy:s0 /data/local/tinyproxy

```

Now the service will run without Magisk too.

---

**RELATED:**

SOCKS proxy can be run with SSH, see:
> 2 votes

# Answer
I had some trouble getting Servers Ultimate's proxy server to work, and my first thought is that it is because my phone is not rooted. However, the problem here is actually not necessarily at the OS level, depending on your use case.

If you're trying to use your mobile data connection as a proxy, you might have some trouble, because most mobile data providers will block any ports that you'd normally be able to use to set up a proxy. Your best bet is to contact the mobile data provider and see if they have any ports that are open beyond the value of 1024 (Android blocks ports below this number for security reasons).

Alternatively, you can:

* Use a proxy server on Wifi, but make sure the proxy port is open in your router
* Root your phone so that you can set-up port forwarding to use your mobile data connection
* Root your phone so that you can use port values beneath 1024 which are usually open.

To realize this is the case, try running a Servers Ultimate proxy server on Wifi with its port open. You'll have something that functions, but if your goal is to use mobile data, you're out of luck for now.
> 1 votes

---
Tags: networking, proxy
---


# Question
Title: Moto G in to USB Debugging mode issues on Windows 7
I've installed Motorola USB Driver and enabled USB Debugging mode as well with MTP enabled.

The Issue is - The device hardly shows as available in Eclipse for \<\< 1min time and after that it gets back to offline mode. I tried to do ADB command like Kill-server and start-server but there is NO effect.

And it comes back to online after so many ON/OFFs and disable/enable the USB debugging again and after all these efforts, the device again stays in debug mode for the same \<\<1 min.

I also tried it with PTP mode as well but no use.

Is this a known issue with Moto G or Am I doing something wrong?

My settings are like this under USB Debugging:
stay awake - On
USB debugging - On
Allow mock locations - On

Appreciate if somebody can guide me which will enable me to work with my Moto G and Android Programming.

# Answer
I tried with a different USB Cable and it is working stable now.

Unfortunately Moto G doesn't come with USB cable as part of the accessories and hence we have to rely on the USB cables available in the outside market.

Currently I'm using Sony Xperia's USB cable which is working like a charm on my Moto G for USB Debugging. It's been couple of hours and the USB debugging is still on and going great :)

Let me observe the same for another day before I conclude the issue.

And another suggestion I received is - Do not work on Windows for Android Development but stick with Linux as windows drivers are buggy in most of the times.

I appreciate the suggestion as of now and may look at this option as well in the near future to switch to Linux for Android Development.
> 1 votes

# Answer
Try cleaning out your USB type C port on your phone. That's what fixed it for me on my Moto X4, a little lint in there can cause the data connection to drop, even after cleaning it, my connection is still pretty weak, if the table wiggles it often disconnects.
> 0 votes

---
Tags: 4.4-kitkat, windows, usb-debugging, motorola-moto-g
---


# Question
Title: How can I automatically connect my phone to the stronger Wifi signal around it?
I have a Google Nexus 4 and have two wi-fi networks that I use in my home. Since they are in some range of one another my phone stays connected to the router that's farther away from the one I'm closer to. Is there a way or app that can connect me to the stronger wifi signal around me when I move around my house?

# Answer
Unfortunately, there's no native method for this (at least to my knowledge). But WiFi Switcher does exactly that. According to its description:

> The tool checks the registered WIFI networks every 20 seconds. If one of these networks has better signal strength than the currently one, the tool changes the WIFI network to this better one.

But it's not that well rated (3.2 with 75 ratings). The alternative WiFi Jumper has a better rating (4.1@194), but is not free:

> * Automatically connect to the strongest available WIFI (scaninterval configurable)
> * Even unknown, but unsecured networks can be used automatically (configurable)
> * Optional: create Wifi Zones based on one or more Radio Cells to automatically start and stop Wifi Hardware.
> 1 votes

# Answer
You can do it manualy by using Wifi Analyzer and then connecting to the strongest wifi around you. I don't know an app that could automate this for you. Link to app
> 0 votes

# Answer
There is another third-party method using "WiFi Connect" as a plugin for Tasker. There is a tutorial on YouTube, described as follows:

**Switch to Strongest WiFi Signal on Android**

> Based on a request from a viewer, in this lesson we create a profile and task to test the strength of the current WiFi signal and switch to another one if it's weak. Best utilized in a house or business where there are multiple hotspots/connections, we cover several new topics including Splitting Variables, Testing Text to see if it contains a word or character string, Flashing variable info, and Reading/Writing files. (This lesson also makes use of a Tasker plug-in called WiFi Connect.)
> 0 votes

---
Tags: wi-fi, network-signal
---


# Question
Title: Why proxy set on Android does not work when used as hotspot?
I am setting the proxy in APN settings of my mobile network in below shown screenshot:

It works well. I verified via whatismyip. However, when I enable the hotspot on the device and use this hotspot on another device and check IP from it, it shows my original mobile service provider IP and not the proxy IP.

Why such behavior if the hotspot is supposed to use the mobile network and the proxy is set in APN for it? How can I make proxy work on device using hotspot as well?

Note: I do not want to set proxy under advanced setting on other device wifi option while choosing this hotspot. The app that I am trying to use detects proxy set under wifi so this is my only option.

# Answer
> 4 votes
Your question is related to understanding of OSI model. Proxies use `http`/`https` or `socks` protocol, I assume you are talking about `http` which is an Application Layer (L7) protocol in OSI model. When an application generates `http` message, it's handed over to lower layer. In case of `https`, message is encrypted by SSL/TLS which are L6 protocols. At L4 the message gets a TCP header and then at L3 it's converted to an IP packet. This packet goes through NAT and firewalls filtering at L3, and finally through RRM/PDCP/RLC (if using Mobile Data), MAC and kernel routing at L2. At L1 it's transmitted over Wi-Fi as `802.11` frames or CDMA/TDMA/FDMA signals over Mobile Data.

Hotspot on the other hand is mainly based on 2 userspace tools; `hostapd` \- which creates Wi-Fi Access Point at OSI L2 - and `dnsmasq` (up to Android 9) - which works as DHCP/DNS server at OSI L7. If the connected host is using phone as DNS server (as configured by DHCP), phone receives DNS queries and recursively forward them as UDP/IP packets to upstream DNS server on internet (whatever `dnsmasq` is configured to use). Rest of the traffic coming from hotspot network is NATed and routed at L3/L2.

So you see none of the (IP packets) traffic coming from connected hosts goes through `http` stack on Android phone, hence not being forwarded to proxy server. It's the responsibility of applications like Web Browsers to make `http(s)` connections to proxy server, not directly to remote host like web server. It's not possible to create a hotspot which can be configured to use `http` proxy at OSI L7. Proxy settings (host/port) we set for Wi-Fi or APN or globally are just forwarded to applications, each application has to create proxied connection on its own, or just ignore the proxy information. You need to provide these proxy details to apps on every host connected over hotspot. See question linked below for more details.

However it's possible to forcefully redirect the whole traffic towards a proxy server by using Linux/Android kernel's NAT/REDIRECT/TPROXY (at L3) and routing table (at L2). That's how proxifiers work, but there are **limitations**. Email clients use IMAP/POP3/SMTP (L6/7) protocols which won't work with `http GET` method, instead require `http CONNECT` proxies. Latter can only forward TCP traffic, for UDP at least SOCKS5 proxy is needed which operates at L5. DNS and mostly games and voice calling apps generate UDP traffic, so they won't work with `http` proxies at all. `ping` utility - for instance - uses ICMP (at L3) which can't be encapsulated in TCP or UDP, so it won't work with SOCKS5 too.

So it's not possible in true sense to redirect ***all traffic*** towards a remote (proxy) server without using a L2/3 solution like VPN. For more details see How to set Wi-Fi HTTPS proxy, not HTTP, via adb shell?

---

> Why such behavior if the hotspot is supposed to use the mobile network and the proxy is set in APN for it?

Hotspot is supposed to use the mobile network, apps are supposed to use the proxy. The proxy you configured in APN isn't enforced system-wide.

> I do not want to set proxy under advanced setting on other device WiFi option while choosing this hotspot.

Unfortunately this is the most straightforward way, other methods require either rooting and/or using third party apps (to create VPN). See above linked question on how to enforce proxy transparently.

# Answer
> 1 votes
The reason being you are seeing the symptoms are because when you turn your hotspot on think of it like turning your phone into a router. So any network settings on the hot spot will not change the devices individual IP address. When you connect to your hotspot it connects by that devices IP and not when is changed in network settings because the changed network settings are last in the hierarchy of things. I do believe if you google search it the are apps that will spoof your devices ip address essentially the same concept as a proxy just undetectable.

---
Tags: wifi-hotspot, mobile-network, proxy, apn
---


# Question
Title: Connecting an android phone through the wifi with proxy
I am currently abroad. I have internet on my PC via a RJ45 cable on Win7 PC. It works fine through a proxy (address + specific port).

Now I want to use my smartphone but there is no wireless connection in my room ...

So how to create a hotspot from my PC (which has a wireless card) so I can go online with my smartphone (which also has the wifi function)?

I tried the virtual router solution manager and Connectify and the classical solution proposed sites (control-\> Network and Internet-\> Network and Sharing-\> new connection-\> ad hoc wireless network -\> name + password + WPA2) then share the map. But without success ... I mean the Android phone says I am connected but I can't reach anywebsite with chrome or the preinstalled Android Internet browser. **Usually I succeed with this virtual router goal time is not working probably the raison de proxy application!**

PS: If it's easier I'm also starting to connect my pc to the internet via usb cable. But rooter my smartphone as my smartphone procedure is complex ...

# Answer
Based on my experience, when using a virtual router on a PC with an internet connection only through proxy, in order for your Android device to connect to the same proxy your pc is using, you have to configure your WiFi connection proxy settings on your Android device to use the same proxy settings on your PC. Afterwards, you can succesfully connect using your android phone. I've already tried it on my Note3.
> 2 votes

# Answer
did you specify the proxy configuration when you were setting up the network, you need to enter the proxy details in the network configuration try Google nexus 4 android network configuration website its for nexus 4, but hope its similar to any other android device.

http://support.google.com/android/bin/answer.py?answer=1649770. get an english one or translate this page if its in french.

Hope it helps
> 2 votes

# Answer
An answered by @p057 you need to set proxy in Wi-Fi settings on your phone. The reason is that hotspot network (AP or ad-hoc) cannot be configured to use proxy. Proxy is used on per-connection basis by apps themselves. It's not enforced system-wide. For details see Why proxy set on Android does not work when used as hotspot?
> 0 votes

---
Tags: internet, wifi-hotspot, proxy
---


# Question
Title: How to redirect complete outgoing phone's traffic to a proxy server?
How to redirect entire phone traffic (including all apps) to a proxy **(with out rooting the phone)**

We are developing a parental control app for Android, in that we have requirement to capture all out going traffic from Android phone for categorization. Is there a way to achieve this in Android **with out rooting the phone**.

Thanks, Gopi.

# Answer
It sounds like you are describing a VPN (virtual private network). A VPN directs all traffic (whether http or other tcp/ip protocols) through a specific server, usually with the intent to encrypt traffic between the device and the VPN server.

However, encryption isn't necessary, and a VPN would have full control over routing, which means you could customize a VPN server to block specific requests. Or you could redirect requests to unsafe/undesirable websites to a 'block' page of your choosing.

Almost all android devices have VPN capabilities built-in. You should look into that technology. In order to force the user to go through the VPN, you will need an app that can be set as a device admin (a built-in, almost-root privilege that prevents the app from being removed) that would also set the VPN to be always on.

See this Android.SE question and answer for more details.
> 1 votes

# Answer
By design proxy isn't to be set system-wide, it's to be used on per-connection basis by every app individually. However it's possible to enforce the proxy on whole traffic e.g. by modifying routing table or NAT rules at OSI Layer 2 or 3; either by rooting the phone (which you don't want to) or making use of VPN (as answered by Stephen Schrauger). However you can't redirect all TCP/UDP traffic to a proxy server, there are limitations. For details see Why proxy set on Android does not work when used as hotspot?
> 1 votes

---
Tags: proxy
---


title: Grant notification access via ADB

text:
# Question
Title: Grant notification access via ADB
This might seem weird, but I installed a regular Android app using ADB to my Huawei Watch 2 and the app requires notification access which when attempting in app causes it to crash as it trys to open the settings to allow it's access which doesn't exist in the settings.

I just need to grant this one permission in order to get the app to work

# Answer
For Android 9 or above use this:

```
adb shell cmd notification allow_listener com.mypackage.app/com.mypackage.app.mylistener

```

For any other Android version below 9 use this:

```
adb shell settings put secure enabled_notification_listeners %nlisteners: com.example.myapplication/com.example.myapplication.service.ServiceNotificationIntercept

```
> 5 votes

# Answer
adb shell into your device and do

> cmd appops set *package.name PERMISSION\_NAME {allow/ignore}*

Edit: I don' think this will work with notification access. Anyway, the command for changing system settings is

> adb shell settings put *setting\_name value*

But I cannot find any setting name corresponding to notification access. You can take a look all the available settings here

Other alternative if you are rooted is to extract the settings.db where all the preferences are store, modify it there using sqlite and reboot.
> 1 votes

---
Tags: permissions, 7.1-nougat, android-wear
---


# Question
Title: How to redirect all web requests from hosts connected to hotspot to a local web server?
I literally have the same question as found in this post: How to redirect complete outgoing phone's traffic to a proxy server?

I have an Android phone acting as a hotspot server (using KWS). I am able to connect another device and access my little webpage by typing `192.168.43.1:8080` into the URL search of my browser, so no problem there.

However, I would like for all requests by connected devices to be redirected to my webpage.

The answer in the linked question suggests running two DNS servers using the Server's Ultimate app. My only hesitation is that it is not free, and the 'free' version is a 7 day trial. I have tried another app called "Set DNS," which seems promising, but it will not recognize my hotspot as a network; it keeps waiting for me to connect to something.

**QUESTIONS:**

* Can I simply change the `/system/etc/hosts` file as mentioned in the linked post?
* Would I add a line such as: `192.168.43.1:8080 *`?
* If not, must I purchase Server's Ultimate, or is there another alternative?

**PS:** This is for an advertisement. The webpage is to be static and informative (no malicious activity).

# Answer
> 1 votes
***NOTE:*** Solution suggested here requires root access.

> I would like for all requests by connected devices to be redirected to my webpage

When you create hotspot, Android runs `dnsmasq` as DHCP/DNS server (up to Android 9). We can use this DNS server to resolve every domain to your desired IP address. Create file `/system/etc/dnsmasq.conf` and add the following option:

```
address=/#/192.168.43.1

```

See details in manpage. Start hotspot and test. Similarly you can use other DNS servers on your Android device e.g. dnscrypt-proxy.

You need to make sure that the connected hosts don't use some public DNS like `1.1.1.1`, instead must use DNS provided by DHCP i.e. IP address of Android device. Or redirect all DNS traffic to local DNS server:

```
~# iptables -t nat -I PREROUTING -p UDP --dport 53 -j REDIRECT --to 53

```

**NOTE:**

For `http://example.com` request goes to `192.168.43.1:80` and for `https://example.com` it goes to `192.168.43.1:443`. However if you type `http://example.com/test.html` it requests page `192.168.43.1:80/test.html` which should exist, otherwise an error will be returned. An easy way is to configure your advertisement webpage as index page and default error page. For instance `index-file.names` and `server.error-handler` options on `lighttpd`.

---

> * Can I simply change the `/system/etc/hosts` file as mentioned in the linked post?
> * Would I add a line such as: `192.168.43.1:8080 *`?

`hosts` file is used by DNS resolvers which are usually part of main C library of OS. As far as I know the built-in resolvers on Android/Linux/Windows don't support wildcards, so the `*` trick won't work. Secondly, domain names are resolved to IP address (`192.168.43.1`) not ports (`:8080`). See below links for details on DNS.

Web browsers by default use port `80` for `http` requests. If you are running server on some other port, you have to mention the port on web browser. Or redirect all newly generated TCP traffic from port `80` to `8080`:

```
~# iptables -t nat -I PREROUTING -m conntrack ! --ctstate RELATED,ESTABLISHED -p tcp --dport 80 -j REDIRECT --to 8080

```

---

**RELATED:**

---
Tags: wi-fi, browser, wifi-hotspot, proxy, web-server
---


# Question
Title: Share Android internet from proxy Server app via hotspot or usb tethering
I have a proxy Server android app that lets you modify outgoing http requests that app Called "Simple Server Android"

With it I Managed to get a free internet from my Carrier (Hacked connection) By adding proxy and port to it

every thing is Work just fine on my android , But I Want to share this connection to my computer with this settings

# Answer
> 0 votes
A stock android feature is that you can use your device as a portable hotspot. On that device, go settings → more (in the wireless an. Networks chunk) → tethering and portable hotspot, in which you'll see two options: Portable WiFi hotspot(is a checkbox) and setup WiFi hotspot.

Choose set-up, and give it the name and password of your choice. Then save, turn it on (Mobile data must be on, just as WiFi connection need to be off) and connect your computer to it as you would to any wireless network(assuming you are on Windows, internet icon in bottom right) click it then your hot-spot, put in the password and you are done!

# Answer
> 0 votes
You need to set proxy in Wi-Fi settings on your PC too. The reason is that hotspot network cannot be configured to use proxy without modifying NAT rules and/or kernel routing table at OSI layer 2/3. Proxy is used on per-connection basis by apps themselves, it's not enforced system-wide. For details see Why proxy set on Android does not work when used as hotspot?

---
Tags: wifi-hotspot
---


# Question
Title: "Priority only" notifications not turning off
My OnePlus One with Cyanogen OS 13.1.2 has for some reason refused to shut off its "priority only" notification status, pressing on the notification icon in the dashboard doesn't do anything, nor does restarting the phone.

However, the phone doesn't seem to act like it's only priority only mode, but it's preventing me from switching to do not disturb mode or the actual priority only mode.

Does anyone have any idea how to deal with this?

# Answer
> 0 votes
Create an automatic rule (`Settings` \> `Notifications` \> `Do not disturb` \> `Automatic rules`), regardless of the name or type. "Priority only" mode should stop and you should be able to regain control over the "Do not disturb" tile in the notification bar.

---
Tags: cyanogenmod, notifications, bugs, oneplus-one
---


# Question
Title: Do permissions have to be declared in the manifest for an app to have the access they provide?
I was using Universal Copy for a while to be able to copy text from fields that are not normally able to be selected, but due to it being able to see all contents on the screen when running, I would disable the it in accessibility settings until needed, which was a pain. I found Copycat, which does the same thing but with only one permission (run at startup) declared, and it states the following:

> This app does not use any internet connection at all, So it never syncs any of your saved data anywhere. You can confirm it yourself by checking the app permissions. Your data is safe in your device.

On the surface, this seems great, since it appears there's no concern about giving it the access involved with the accessibility service. However, I know that Android permissions aren't so well-defined, unfortunately, and that if an app has *any* permission in a category, it has *all* permissions in that category. Since the "run at startup" permission is in the "Other" category, which is also where the internet permissions are located, it would seem that it would have that access, even though it doesn't specifically request it.

So my question is, is that true, or does an app *have* to declare a permission in its manifest in order to be able to use it, and does that declaration *always* mean that permission will show when viewing an app's permissions in the Play Store? IOW, is Copycat truly safe, or could it potentially still be sending information, and the developer is either misguided, which wouldn't exactly be promising, or outright lying, which would clearly be bad? I emailed them a few weeks ago but have not received a response.

**P.S.** I wasn't sure if this should go on Stack Overflow, since it relates to programming, or not, since it's not related to any specific code.

# Answer
> 1 votes
A basic Android application has no permissions associated with it by default, meaning it cannot do anything that would adversely impact the user experience or any data on the device. To make use of protected features of the device, you must include in your AndroidManifest.xml one or more tags declaring the permissions that your application needs. At application install time, permissions requested by the application are granted to it by the package installer, based on checks against the signatures of the applications declaring those permissions and/or interaction with the user. No checks with the user are done while an application is running; the app is either granted a particular permission when installed, and can use that feature as desired, or the permission is not granted and any attempt to use the feature fails without prompting the user.

Read more here https://developer.android.com/guide/topics/permissions/overview

---
Tags: permissions
---


# Question
Title: Android-x86 8.1 in VMWare Workstation doesn't show GUI
I installed android-x86-8.1-r2.iso 64 bit version in VMWare Workstation 15.5.0 under Win10x64 1903.

It starts into the linux command line prompt, and I tried Alt+Fx, there is no GUI. I tried all four boot menu(normal/debug/debug nomodeset/debug VIDEO=LVDS...), all the same.

# Answer
To switch to GUI, please ensure that you have **3D acceleration turned on in VMWare Machine Settings.**

If you still cannot see the GUI, try **Alt+F7**
> 3 votes

---
Tags: android-x86
---


# Question
Title: Working with Security Metadata in APK file
According to this Blog post, Google has added a Security Metadata on top of an APK to verify that it was originally distributed by Google Play. More specifically it adds APK Signing Block to the APK file.

I have some questions regarding this:

(1) How did Google insert this the metadata into APK signing block of the APK and how it verifies that metadata on the phone (technically)?

I guess it is possible to create custom content in this signing block? Let's say I want to distribute some APK privately in my company, when the user installs that APK then I can figure out if the APK belongs to our company or not, just like Google did with their apps in Play Store.

(2) If all developers use App Signing by Google Play, then does the mentioned security metadata above become unnecessary? Because Google can just simply verify the certificate inside each APK instead.

My apologies for the shallow understanding. Any comments are highly appreciated!

# Answer
> How did Google insert this the metadata into APK signing block of the APK and how it verifies that metadata on the phone (technically)?

Technically the Google "Frosting" signature is inserted the same way as described in the APK Signature Scheme v2. Note that it is just added to the same section inside the ZIP file - it does not replace any existing signatures in this section.

> I guess it is possible to create custom content in this signing block? Let's say I want to distribute some APK privately in my company, when the user installs that APK then I can figure out if the APK belongs to our company or not, just like Google did with their apps in Play Store.

As far as I know the only "meta data" is the signature itself. If it is present it is an APK from Play Store.

> If all developers use App Signing by Google Play, then does the mentioned security metadata above become unnecessary? Because Google can just simply verify the certificate inside each APK instead.

No. The Google Frosting signature is just an additionally signature. The Android permission model still relies on the common APK signature by the developer. Only the Google Play Store app is able to verify the Google frosting signature. The other parts of the Android system (those from AOSP) don't even recognize this signature.

For more technical details see this question + answers on Stackoverflow: Security Metadata in Android APK
> 1 votes

---
Tags: applications, security, google, zip
---


# Question
Title: Why can't Android device use Google service without permission?
Now Google doesn't allow HuaWei to ship their services with the phone and the install-after-shipment route is blocked too.

I think Google apps like Map/Gmail/Search/Youtube/Drive/Docs/Play/Assistant are all standard Android applications that can be installed on any Android compatible (no need to be certificated) devices.

Does the above fact means that Google's Android apps will use some DRM like mechanism to first verify whether the device is certificated or it won't run? If so, does this apply to all Google Android apps, or only some apps?

# Answer
First the problem is mainly a legal problem, not a technical problem: Huawei is not allowed to install the Google apps.

Second the Google apps you mention are only the user visible part - similar to an iceberg there is a large hidden part you don't directly see:

The Google Play Services and it's, libraries.

This is not a normal "app" as it is running as a system app and therefore can't be installed by a user. And it is required by each app you mentioned and even more. Most of the regular apps you find in Google Play Store also make use of this service, e.g. for receiving push notifications. Therefore the impact of not having Google apps pre-installed on a device is larger than you expect.

And even if you manage to install the Google apps on a device Google will recognize that this device is not allowed to use Google apps: Every device and every firmware version is certified by Google. In that process Google creates some sort of fingerprint that allows to identify each device. As an end user you can ask Google for an exception for your device by registering it's Google Services Framework ID at Google. This will then allow you to use Google apps until you do a factory reset.
> 3 votes

---
Tags: google-play-services
---


# Question
Title: How to modify environment variables like PATH at startup?
I'm trying to add `/data/bin` to variable `PATH` at startup in order to have it available for any other app.
In Ubuntu I use the file `/etc/environment`, I cannot find anything similar in Android.
I discovered that `adb shell` detects `/data/bin` existence and adds it to `PATH`, the system doesn't seem to do the same at boot though.

# Answer
> 3 votes
> I discovered that `adb shell` detects `/data/bin` existence and adds it to `PATH`, the system doesn't seem to do the same at boot though.

It's because `adb shell` starts a shell process (Android's default is MirBSD Korn Shell) which reads its configuration file `/etc/mkshrc` and can easily change environment variables. But apps inherit their environment from `zygote`, so we need to set variables before `zygote` starts.

Edit `/init.rc` file or any other `.rc` file or create your own. Append or prepend directories to Android's default `PATH`:

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

on init
    export PATH /data/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin

```

---

## DETAILS:

On Linux distros `/etc/environment` is evaluated by PAM (a set of libraries called modules) which is a centralized authentication mechanism used by privilege granting and administering programs like `login`, `su`, `sshd`, `passwd`, `useradd` etc. First process `init` \- after starting system services - drops us to a login shell or display manager (which starts a display server like X.Org to show GUI), running on a virtual terminal. When logging in a user, shells and display managers are configured to read and set environment from different files like `passwd`, `login.defs`, `profile`, `bashrc` `xsessionrc` etc. usually found in `/etc` or user's `HOME` directory. This environment is inherited by CLI utilities as well as GUI programs which run in desktop environment, including terminal emulators. Applications which attach to terminals also set `TERM`.

However on Android there is no concept of `getty`, `login`, text terminal logins and traditional X window system. There are no user sessions and hence no login files. `init` starts `zygote` which loads Android's Java framework, and after starting services in `system_server`, it forks virtual machines in which apps run. So the first thing we see (after animation ends) is an app; System UI (lock screen) or Home/Launcher app hosted by SurfaceFlinger - Android's display server. Mainly environment of all these programs is set in `init`'s `.rc` files through `export` command. `/init.environ.rc` () exports variables like `ANDROID_ROOT`, `ANDROID_DATA`, `ANDROID_STORAGE` and others. Or programs set some variables themselves e.g. `logd` sets `TZ` () to ensure correct timestamps in `logcat`, and `adbd` sets `EXTERNAL_STORAGE` ().

Commonly used variables for Java framework are defined here. `PATH` is set by `init` on boot () and is part of Bionic libc definitions (). CLI shell utilities like `su` () and `run-as` () also define `PATH`, `HOME`, `LOGNAME`, `USER`, `SHELL` etc. `DOWNLOAD_CACHE` is set in `/init.rc` () and `ANDROID_ROOT` is set by `zygote` () itself.

Shell specific configuration files like `bashrc` or `mkshrc` are read only if you use `adb shell` or a terminal emulator app.

---

**FURTHER READING:**

# Answer
> 0 votes
Edit the file: `/system/etc/bash/bashrc` and **export** your environment variable there..

Actually, the default environment variables are predefined in the ramdisk's file: `init.environ.rc`. (You may unpack the boot.img to edit it and repack & flash it)..

You may also modify those system variables in the *bashrc* file itself..

Also check the `/system/etc/mkshrc` file..

---
Tags: applications, boot, shell, processes
---


# Question
Title: How to create a wifi hotspot from the terminal?
**How would you suggest to create a hotspot from a root terminal?**

I would need to create

* hidden hotspot
* hotspot without password

I am looking for an equivalent of `create_ap` for android. Here is the full help section to get an insight of what I would need:

```
Usage: create_ap [options] <wifi-interface> [<interface-with-internet>] [<access-point-name> [<passphrase>]]

Options:
  -h, --help              Show this help
  --version               Print version number
  -c <channel>            Channel number (default: 1)
  -w <WPA version>        Use 1 for WPA, use 2 for WPA2, use 1+2 for both (default: 1+2)
  -n                      Disable Internet sharing (if you use this, don't pass
                          the <interface-with-internet> argument)
  -m <method>             Method for Internet sharing.
                          Use: 'nat' for NAT (default)
                               'bridge' for bridging
                               'none' for no Internet sharing (equivalent to -n)
  --psk                   Use 64 hex digits pre-shared-key instead of passphrase
  --hidden                Make the Access Point hidden (do not broadcast the SSID)
  --mac-filter            Enable MAC address filtering
  --mac-filter-accept     Location of MAC address filter list (defaults to /etc/hostapd/hostapd.accept)
  --redirect-to-localhost If -n is set, redirect every web request to localhost (useful for public information networks)
  --hostapd-debug <level> With level between 1 and 2, passes arguments -d or -dd to hostapd for debugging.
  --isolate-clients       Disable communication between clients
  --ieee80211n            Enable IEEE 802.11n (HT)
  --ieee80211ac           Enable IEEE 802.11ac (VHT)
  --ht_capab <HT>         HT capabilities (default: [HT40+])
  --vht_capab <VHT>       VHT capabilities
  --country <code>        Set two-letter country code for regularity (example: US)
  --freq-band <GHz>       Set frequency band. Valid inputs: 2.4, 5 (default: 2.4)
  --driver                Choose your WiFi adapter driver (default: nl80211)
  --no-virt               Do not create virtual interface
  --no-haveged            Do not run 'haveged' automatically when needed
  --fix-unmanaged         If NetworkManager shows your interface as unmanaged after you
                          close create_ap, then use this option to switch your interface
                          back to managed
  --mac <MAC>             Set MAC address
  --dhcp-dns <IP1[,IP2]>  Set DNS returned by DHCP
  --daemon                Run create_ap in the background
  --stop <id>             Send stop command to an already running create_ap. For an <id>
                          you can put the PID of create_ap or the WiFi interface. You can
                          get them with --list-running
  --list-running          Show the create_ap processes that are already running
  --list-clients <id>     List the clients connected to create_ap instance associated with <id>.
                          For an <id> you can put the PID of create_ap or the WiFi interface.
                          If virtual WiFi interface was created, then use that one.
                          You can get them with --list-running
  --mkconfig <conf_file>  Store configs in conf_file
  --config <conf_file>    Load configs from conf_file

Non-Bridging Options:
  --no-dns                Disable dnsmasq DNS server
  -g <gateway>            IPv4 Gateway for the Access Point (default: 192.168.12.1)
  -d                      DNS server will take into account /etc/hosts

Useful informations:
  * If you're not using the --no-virt option, then you can create an AP with the same
    interface you are getting your Internet connection.
  * You can pass your SSID and password through pipe or through arguments (see examples).
  * On bridge method if the <interface-with-internet> is not a bridge interface, then
    a bridge interface is created automatically.

Examples:
  create_ap wlan0 eth0 MyAccessPoint MyPassPhrase
  echo -e 'MyAccessPoint\nMyPassPhrase' | create_ap wlan0 eth0
  create_ap wlan0 eth0 MyAccessPoint
  echo 'MyAccessPoint' | create_ap wlan0 eth0
  create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase
  create_ap -n wlan0 MyAccessPoint MyPassPhrase
  create_ap -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase
  create_ap -m bridge wlan0 br0 MyAccessPoint MyPassPhrase
  create_ap --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase
  create_ap --daemon wlan0 eth0 MyAccessPoint MyPassPhrase
  create_ap --stop wlan0

```

# Answer
This is done with `hostapd` located in `/system/bin/hostapd` in principle.

You may generate a hotspot through the interface and get the command with

```
ps | grep hostapd

```
> 1 votes

# Answer
My answer to How to use Android device as router without cellular connection? includes a shell script that does exactly what you want using `hostapd`/`wpa_supplicant` and `dnsmasq`, the only extra thing to be done is internet sharing:

```
# allow IP forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward

# allow forwrding through firewall
iptables -I FORWARD -i $AP_INTERFACE -s ${IP}/24 -j ACCEPT
iptables -I FORWARD -i $WIFI_INTERFACE -d ${SUBNET}.0/24 -j ACCEPT

# source NAT
iptables -t nat -I POSTROUTING -s ${SUBNET}.0/24 ! -o $AP_INTERFACE -j MASQUERADE

```

When turning off do the inverse.

---

**RELATED:**
> 3 votes

---
Tags: root-access, wifi-hotspot, terminal, command-line
---


# Question
Title: Do Firebase analytics work without Gapps?
Out of curiosity, if a user installs Android without Google Apps or APIs and then installs an app that includes Firebase analytics, will the analytics function? Will the app still send something to Firebase, or will it open an empty connection, or will communication be cut off?

To word this another way, is it the Google apps (Play Services, service frameworks, etc.) that open a connection to Firebase, or is it the app itself that does so? Or, does this vary from app to app?

# Answer
As evident from these FAQs:

> * I don't want to use other Firebase products (such as Analytics).
>
> Google Analytics for Firebase is enabled by default to provide the full range of FCM features. However, it can be disabled. **The FCM SDK's only hard dependency is Google Play Services** (which was also a dependency in GCM).

The code which creates connection to Firebase servers is part of Play Services. Apps make use of Google APIs to use that code. Without GApps none of Google Mobile Services will work and the apps heavily depending on those will refuse to start or may keep crashing. Developers can explain better.

**RELATED:**
> 1 votes

---
Tags: google-analytics
---


# Question
Title: change root location to /system/xbin android
i have a root android device, but su is located on / So, i wanna change my su to /system/xbin or /system/bin. but i can't change su while i'm using it.

I also need to change 2 files that are located in / and /sbin However, every time I change them android returns the previous files after reboot.

# Answer
> 0 votes
I am also facing the same problem.

I got a workaround that changes the installation scripts not to save the su image to / data, but to / system, and by modifying the su startup script to mount su into / system as well. However this method only works by installing su via recovery (using TWRP\_3.0.2).

I am still looking for an alternative to do within the system

I changed the scripts from SuperSU-v2.82 tool

https://forum.xda-developers.com/apps/supersu

---
Tags: root-access, adb
---


# Question
Title: What are the pros and cons of running LineageOS?
Specifically, do Google apps (Maps, Play store) and third-party apps (Skype, Viber, etc.) work as reliably with it as they would with, say, Android One?

Or is it more of a hit-and-miss situation?

# Answer
> 1 votes
**Pros:**

* you can run latest android OS on your device even after your manufacturer stops security patch/ os upgrades.
* Experience pure stock android.
* Nowadays builds are mostly stable with less bugs. You don't have any bloatware on your device.

(Download from sites like xda, and official builds are best, for which developers release nightly, after bug removal.)

* By rooting, you can take over control on everything on your device.

**Cons:**

* If the developer stop support, you need to switch to another build (pixel experience, havoc etc)
* You need to unlock bootloader which is a security issue.
* Rooting also a security issue, some banking apps doesn't work on rooted device (This can be solved using MagiskHide method from Magisk Manager).

---
Tags: custom-roms, lineageos
---