# Question
Title: Is it possible to retrieve android data after multiple factory resets?
Lets say I want to retrieve a file that is about one year old. I have been doing one or two factory resets to this day and kept using my phone. Now I want to get that file back, is it possible to get it?

# Answer
> 1 votes
**Practically impossible**

When you your device storage is not wiped but inaccessible (over written with 0's if encrypted).**¹** On top of it you have been using your device which means memory is overwritten again by the apps you installed (and their data).

Effectively, your chances of recovering anything is zero unless you want to try extremely sophisticated data recovery means and *maybe* recover a figment of file, if at all

---

**¹** See for more details here. Also, as Izzy pointed out in a now deleted comment, *it's really "overwritten" only if it was encrypted or if the space was reclaimed by the controller (see Wear-Leveling). So there is a chance such a file could be recovered even after multiple factory-resets. Feasibility is a different thing, especially as one cannot mount internal storage to a PC to use forensics software on it, nor (without root access) generate a disk image for doing so. And agreed, chances are not that good anyway ;)*

---
Tags: recovery-mode, files
---


# Question
Title: Ran :(){ :|: & };: on my android device!
So I was seeing dangerous command in linux and I found a command which seemed funny:

```
:(){ :|: & };:

```

So I ran it on my Samsung Galaxy A7 term non-rooted phone and guess what it hung immediately. So I tried powering off my phone by holding the power button. But it did not respond and the screen turned off after a minute then I tried clicking the home button and all the buttons to wake it up but no response finally it powered off and rebooted and now it works perfectly fine. Should I worry about heat damage or hardware damage. If so how can I confirm that I have a damaged hardware. Developer mode in on too!

PS. I have my phone powered off fro safety because I don't want it to catch fire. XD

# Answer
Modern Android Kernels are smart enough to shut down the entire system before any hardware damage occurs. Even when you're testing the limits of your CPU when overclocking, it will shut down as soon as incompatible frequency/voltage combination is set. So you're far from any real hardware damage cause by the infinite loop command.
> 1 votes

# Answer
It's just called fork bomb, a classic old technique to exhaust the resources of the computer, and render it unable to take care of other processes in the system by eating up (consuming) the memory.

Today's kernels are well-sophisticated and can even detect infinite recursive forks. To answer your question, no, it's not at all any harmful to your Android device (it just completely exhausts your RAM). All it takes is a reboot to fix it.
> 0 votes

---
Tags: 7.0-nougat, terminal
---


# Question
Title: android keeps on restarting with optimizing apps
**Problem:**

It constantly restarts with optimizing apps.

**Some Background:**

* This phone was running on low disk space some days back, which I resolved by removing unwanted files.
* Some apps are third party apps installed by downloading from websites.
* I have searched other threads and none seems to be solving my issue.
* I have done a "cache wipe" as well, which didn't solve the issue.
* This has android version 6.
* I am able to run Fastboot and have access to Fill-Z touch recovery.
* I obviously don't want to format (easy solution) this phone as that would delete all the data in there.

**Extra resource:**

vimeo link describing problem

If anyone can let me know how can I disable this "Optimizing app" before the start, I'd be glad. Any help would be appreciated. Thanks in advance!

# Answer
I had a similar issue not that long ago: the culprit seems to be some app ART cannot compile for some reason. As you successfully applied my solution and confirmed, let me sum up the facts from the comments in an answer:

### 1. figure which app is the culprit.

On each of those crashes, the Android system sets a "tombstone" on the "grave" of the dying process – something known on Unix/Linux systems as Core Dump. Those core dumps are placed into `/data/tombstones`, with at maximum 10 files kept (after that, the oldest one will be overwritten on the next occasion). So we need to look to those tombstones to see whats written on them. As you have a custom recovery which offers access, the easiest way is:

1. `adb pull /data/tombstones tombstones` (will copy the entire directory to your computer)
2. use a viewer/editor of your choice (best one you are familiar with) to open and investigate each of the tombstones, starting with the newest and walking back.
3. look into the "stack trace" to see if an app (or it's path in `/data/data`) is mentioned there. If so, note it. If it's the same app in the next tombstone and the one after, you can be pretty sure this is the case we're describing here.

### 2. put the "obstacle" out of ART's way

Having identified the app, we need to remove it so doesn't get stuck with it. For this, again we need `adb shell` with its prompt – and the directory name from our tombstones:

```
rm -rf /data/data/<whateveritwas>

```

Note this removes all the data of the app as well – so having a backup in advance might be a good idea (in the current state: either `adb pull` the directory, or do a backup you can analyze later).

That done, reboot. Now "optimizing apps" should finish successfully.

### Alternatives to the command-line approach

Some custom recoveries ship with an integrated file manager, usually called "Aroma". Above steps could also be perfomed with that:

* navigate to `/data/tombstones`
* view the tombstones
* navigate to `/data/data` and remove the offender
> 1 votes

---
Tags: cyanogenmod, xiaomi-redmi-note-4g
---


# Question
Title: How to upgrade Android API level on my device?
I have an Android device and its OS is 4.2.2 and API level is 17.

1. How to change the API level without flashing firmware?
2. Is API level upgraded by flashing a custom firmware?

# Answer
The API level is the technical corresponding number to your Android version – so e.g. saying your device is running on "API level 23" would at the same time mean it has Android 6 (Marshmallow) installed. Lifting it to API level 24 would mean upgrading to Android 7 (Nougat). With your device being on API level 17, it's running JellyBean (Android 4.2.\*). That said:

1. No, impossible.
2. Yes if it's "newer" (but not limited to *custom* firmware; a newer "stock" one would do the same) – but an OTA upgrade could achive the same.
> 1 votes

---
Tags: updates, android-versions
---


# Question
Title: Is there a better way to hide TV shows from the gallery?
Yesterday I copied a few TV episodes to my phone's SD card, and now when I go to send a picture in Facebook Messenger, I'm swamped by those episodes. To fix this (i.e. to stop the videos showing in the Photos app and file pickers) I renamed the Videos folder on my SD card to .Videos (making it a hidden folder). Is there a better way to do this though? I don't need to lock them or hide hide them, I just don't want them to show in the gallery.

I'm on stock Android Oreo.

# Answer
The solution to that is pretty easy: Instead of renaming the folder to `.Video` (and thus "hiding" it completely), simply place a file named `.nomedia` inside it. That way you hide it from the media scanner – while the directory stays visible in your file managers.

I cannot check with FB (refusing those data collectors), but apps usually depend on the "media provider" for such activities as you described. The "media provider" uses a database, so available media can be found quickly (if each app would scan your entire storage on a "share" action, that would take far too long). By placing a `.nomedia` file inside a directory, you tell its scanner to skip that directory (and all its content including subdirectories) from being included with this database.
> 3 votes

---
Tags: video, gallery, file-management
---


# Question
Title: How can I copy GPS coordinates from a marker in Google Maps app?
Is there a way to get/copy GPS coordinates from a marker on the Google Maps app? When I drop a marker by holding down on a spot, I get the coordinates in the field. But, when I tap in the field to copy them, the numbers change to the city location.

I should have added this at the start: I am using Version 9.69.1.

# Answer
> 4 votes
It's quite easy

When you drop a pin you get coordinates in the search bar that can't be copied as you observed

To do that, on the left bottom you will find *More Info*. Tapping on that will take you to next screen where you can see the coordinates and long press to copy to clipboard ! You will get a toast confirmation as shown and paste it wherever

Maps version `9.67.1`

(Your GPS needs to switched on with the faint blue circle showing up before you drop the pin)

---
Tags: google-maps
---


# Question
Title: LTE: Lost/Stolen Phone in another country, didn't receive text/data/voicemails after new SIM?
I had an unfortunate situation occur to me where my phone was pick pocketed out of my pocket while on Vacation out of the country. We decided to not cancel the phone line because doing so would disable the find my phone features on the phone. I would have to rely on wifi connection if cellular data was shut off. Anyway, I monitored the phone and my stolen phone number for a week and a half before I was like this phone will never be turned on (essentially radio silence since stolen). I had enough and then I just informed my carrier to blacklist the phone and give me a new SIM card. I was expecting that once I popped in the new SIM card into my old Smart phone I would start receiving all the missed calls and texts on my phone, but none came through. In fact I only received ones that appeared to happen today.

I was wondering what happened. I talked to my family and friends and they all said they were calling/messaging/etc my phone number since it was stolen in order to see if they would get a response. The phone was stolen in Mexico and I was using At&t's international roaming because it was free there. If anyone wanted to get in touch with me in Mexico, I know they were able to because I was communicating with them free of charge out of Mexico no problem with everything as if it was that I was in the states. In any case, is there an explanation what happened here?

Stolen phone: Galaxy S7 At&T Mexican Free Roaming Stolen in Mexico

~ 1.5 weeks elasped

New Phone: Galaxy S5 Started up in USA with my same number At&T USA service

Anyone have any ideas?

# Answer
Chances are that no messages were sent to you in the last 72 hours, and they were deleted. At&t will only try delivering the texts for 72 hours and then they delete them from the servers

> All the messages sent are retried for up to 72 hours and any undelivered messages get deleted after that Source

As for missed calls, you will never receive missed call notification for calls that were made while your phone is off, unless a voicemail was left.

I'm not sure why no voicemails came in. It's possible that it's similar to what I wrote about sms's above, that they get deleted after 72 hours.

Also possible that your phones data was turned off, and therefore you did not see it in Google's device manager. But all texts and calls came to that phone.
> 0 votes

---
Tags: sim-card, 4g, gsm
---


# Question
Title: How do I add to the favorites in Samsung S3 contacts?
I have some favorites in my contacts list, but I don't know how they got there. How do I add more, and how do I remove ones I no longer want?

# Answer
To favorite a contact:

1. Open `Contacts` app
2. Search for contact to favorite
3. Long-press on contact
4. Select `Add to Favorites`

To remove from favorites, select `Remove from Favorites` for a favorite contact (has a star).
> 1 votes

# Answer
Visit each contact you wish to designate a favorite, and click the Star Icon till lit up. Then visit the Favorites list, and it's there.

From the Favorites list, click again to clear as a favorite. Bing; it's gone.
> 0 votes

# Answer
This is something that stumped me for a long time and I finally figured it out. If the star doesn't show when you open your contact it's because your contacts are merged (sim contacts, phone contacts, WhatsApp contacts etc).

Here is what you do:

* click on the contact and when it opens click on the three vertical dots at the top right hand corner.
* Then click on 'Manage Linked Contacts'. This will show you the merges.
* Remove sim, WhatsApp and anything else leaving only the phone contact. Now when you go back into the contact the star appears and you can mark it as a favorite.
> 0 votes

# Answer
You can also call them and then delete the call before it begins to dial.
> -1 votes

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


# Question
Title: Google Maps >9.60: Can't access the layers. How to turn off/on layers?
I recently opened Google Maps and found the traffic layer to be enabled. And so I tried to turn it off by swiping from the left to open the App Drawer (aka Hamburger Menu).

Unfortunately the usual button for layers was grayed out and said that the "Layers have moved":

When I click the button it just closes the App Drawer.

I can't figure out how to access the "Satellite & traffic" or any layers. **In the new version of Google Maps, how do you turn on/off the layers (i.e. Satellite, Traffic, Topology, etc)?**

version is: 9.62.1

I tried to search for how to access the feature. But all I found was some webpages that said the layers feature in Google-Maps was moving... but nothing about how to access the layers feature after it moved.

# Answer
I have this change on my Samsung tablet.

I have a new button at the top right of the map, where the compass symbol used to be, which accesses layers.
> 1 votes

# Answer
I found the answer! About the button on the menu, choose where says Settings, then choose turn on.
> 0 votes

---
Tags: google-maps, maps
---


# Question
Title: Is it possible to simulate a button press on an Android application from another application (Android or Desktop)?
I need to automatically click on a specific button on an app. Is there a way to do this on a completely controlled environment?

By controlled environment, I mean the phone could be rooted, it could be connected to a desktop machine, any external app could be installed, and any other requirement.

Note: the button is NOT on an exposed activity.

# Answer
You can use adb command to simulate touch

`adb shell input tap x y`

where x y are the co-ordinates of the pixels on the screen to be tapped.
> 1 votes

---
Tags: automation, buttons
---


title: How do i screen record on my device?

text:
# Question
Title: How do i screen record on my device?
I have an Amazon Fire HD8, and I need to know how to screen record the best way possible! Please help, because I'm a fairly newer youtuber, and I don't know what I'm doing, honestly!

# Answer
You would need a third party app to record your screen. Install any screen recording app from the play store and enjoy.

I personally like one that's called AZ screen recorder it records your screen, and gives some nice options with it.
> 2 votes

# Answer
There are many screen recording applications on Google Play Store. Try various apps and find out which one best suits you. Use this Android Authority link, where you can find some apps.
> 0 votes

---
Tags: recovery-mode
---


# Question
Title: NANDROID backup without warranty voiding?
Is there any way to do a 100% NANDROID backup without any warranty voiding?

If there is a way to **temporarily root** or install TWRP, that would be fine too

http://forum.xda-developers.com/showthread.php?t=1964607

I do rooting experiments (eg. processor clock battery runtime) on cheaper phones, but I better do not sacrifice the more expensive ones.

# Answer
> 1 votes
> Is there any way to do a 100% NANDROID backup without any warranty voiding?

Nandroid means using custom recovery (TWRP or CWM ) and in turn unlocking boot loader (on most devices). Whether this voids warranty or not depends on a) OEM b) Country / region specific laws. It depends on case by case so a general answer is not possible but in most branded devices it would void warranty

> If there is a way to **temporarily root** or install TWRP, that would be fine too

Again depends on OEM and the Android version it is running. But by and large this is becoming increasingly difficult to do with OEMs and Android security features preventing this

Without rooting , if you wish to back up (not Nandroid) see this Full Backup of non-rooted devices

---
Tags: rooting, backup, nandroid
---


# Question
Title: Quick way to enter three dots (ellipsis)?
The Samsung keyboard has a Quick Symbol key, where ".,?" are on the same key and accessed similar to the T9 method (don't know if this is standard for Android keyboards).

A good idea, but how can I quickly enter an ellipsis (three dots)? The best I could come up with is:

```
dot space del dot space del dot

```

Quite clumsy, but much faster than tapping dot and then twice wait until a next tap wont change the dot anymore. There surely must be a better way?

### Update

On the Galaxy Tab there is no option to choose another keyboard layout; apparently on other Samsung devices there is (see GAThrawn's answer). Here you can see what options I can choose from:

# Answer
> 3 votes
I recommand you to install AnySoftKeyboard (available in Android Market), it a bloody good keybaord, by pressing 1 sec. on \[.\] key there is an additional key wit the three dots ! What I also find great in this keyboard is that you can install your country keyboard what the standard Androïd keyboard does not provide... Test it ... you will adopt it !

# Answer
> 1 votes
You know you may get an additional set of related characters on holding a key pressed for a while on Android's native keyboard. I have a Nokia 6 with clean Android Nougat. You can enter the dots of ellipsis character (not three dots/periods/full stops/decimal points) by first switching to the numeric mode (using the ?123 key at the bottom left) and then holding the dot key (between the space bar and the Enter key at the bottom right). Since the dots of ellipsis is the only additional character envoked this way, it is simply entered on releasing the key…

# Answer
> 0 votes
It sounds like you're using the Samsung Keypad with "Portrait keypad type" set to 3x4 Keypad, and "XT9" switched off?

For starters, your device has a lot of different keyboard types pre-installed, if you switch to a different keyboard or mode, you can just press "..." with 3 presses on the "." button.

Before I go into your other keyboard options, you can teach the phone the "..." sequence as a new learned "word". Go into **Settings** -\> **Locale and text** -\> **Samsung keypad**, you should now see an option **XT9** make sure that this is ticked, and then you can go into **XT9 advanced settings** and scroll down until you see **XT9 my words** press **Add word** and type in the three dots as if they were a word and save.

Now when you're typing you should be able to do it as `dot (wait) dot dot` which is slightly faster.

Alternatively change your keyboard mode, go into **Settings** -\> **Locale and text** -\> **Samsung keypad**, **Portrait keypad types** one of your options here is **Qwerty keypad** this keypad looks a lot like a normal computer keyboard, and you can just press `dot dot dot` without any need for pauses.

Finally you should also have the Swype keyboard pre-installed on a Galaxy Tab, to turn this on go into **Settings** -\> **Locale and text** -\> **Select Input Method** and pick **Swype**. This looks a lot like the Samsung Qwerty keyboard, and you can use it the same way to do `dot dot dot`, it also a totally different and fast (once you've had some practice) way to enter words by swiping your finger across the keyboard. Swype should pop up a tutorial to show you how to do this when you first switch it on.

---
Tags: keyboard, samsung-galaxy-tab
---


# Question
Title: How to bypass 20 item limitation in clipboard?
The Android clipboard by default has a limitation of twenty items.

How can this limitation be bypassed?

For dessktop PCs, there is Ditto clipboard. But for mobile phones, there is nothing like that, as far as I know.

Mobile phones are heavily restricted compared to desktop PCs.

# Answer
> 4 votes
There are plenty of apps that can store far more than 20. Search for*Clipboard* on Play Store . One such app ~~which doesn't require extra / suspicious permissions~~ is Clipper which I found to be very effective in organising clipboard

You will find plenty more apps in Clipboard Tools, from the curated repository maintained by Izzy , as he noted in comments . Also note that Izzy has pointed out better alternatives in his now deleted comments, needing fewer permissions:

> Clipper requires permissions to "test access to protected storage, modify or delete the contents of your USB storage, view network connections, full network access, receive data from Internet, receive cloud messages, run at startup". From a privacy point-of-view, all those network permissions should *not* be there as they are certainly not required for the functionality of a clipboard: Keep in mind you might copy sensitive information like passwords. Not saying the app intentionally does something bad here – but who knows what some integrated ad/tracking library might do (Clipper contains at least 3 of them)?
>
> So better choices would probably include:
>
> * My Clipboard: only requests "run at startup, reorder running apps, draw over other apps". Not sure why it needs to "reorder running apps" – but at least it doesn't ask for network access, so the danger of transmitting sensitive data is much lower (if existing at all).
> * CopyClip: only requests "draw over other apps, ACTION\_MANAGE\_OVERLAY\_PERMISSION" – perfectly understandable, as it needs to draw its action buttons (for copy/paste) on top of the app you're copy/pasting from/to.

---
Tags: keyboard
---


# Question
Title: Options after opening a phishing website on my android
Someone sent me a link in WhatsApp claiming I can get a chance to get two free Emirates plane tickets, at first I just thought of it as a hoax but I was curious at the same time so I opened the link and followed its instructions to share the page with 20 people and answered a few questions. Yes I was stupid. My question is what can one do after visiting a phishing website on Android? Like scan the phone for virus? I didnt find anything strange installed on my phone...

# Answer
Clear your browser cache, as first step and if you want to be doubly sure run a malware detection app from Play store. Malware bytes is a good idea since it gives you pro features free for one month

It may or may not be a phishing site but since you are rightly concerned, this should be enough.
> 0 votes

---
Tags: antivirus
---


title: Share Facebook Post via Whatsapp

text:
# Question
Title: Share Facebook Post via Whatsapp
Today I saw an interesting post on Facebook (App). So I decided to share it through **Whatsapp** with my friends. But I can't find any Whatsapp share button on **FB App**. There is only **Messenger** share button. So how I can share it through Whatsapp.

# Answer
> 1 votes
Click the post you want to share, in the top left hand corner there is a down arrow click it for options. You can copy the link and send from WhatsApp or if your keyboard has the option share it from the clipboard.

# Answer
> 0 votes
1. Suppose you want to share a video, click on the video.
2. Once it starts playing, now 'right-click' on the playing video, you will see a drop-down like this:
3. Select the 'Show Video URL option, you will get the link. Copy and paste it into a new window to test if it opens up the desired FB post or not.. Thanks.!

---
Tags: whatsapp-messenger, facebook, facebook-messenger
---


# Question
Title: why non rooted android does not support sdcard formatted with ext4?
Prone to data loss, fat32 or exFat are the only options right?
I just lost many files on a sdcard.
Formatted on linux desktop, to ext4, android will not reconize the sdcard, despite it could.

my question is: why this non-sense?

lollipop here :(

is our only option for quality, to root the smartphone?

# Answer
> 0 votes
yes , not make any sense , the better I could get until now is mount ext4 , with adb root

Mounting a ext4 formatted sdcard on Android Marshmallow

more info here: https://android.stackexchange.com/a/204616/119381

---
Tags: ext4
---


title: Access /data/data per Symlink

text:
# Question
Title: Access /data/data per Symlink
I have the following question:

I have an App on my mobile phone and on my tablet, and I would like to synchronize the data. Unfortunately the App can not do it. I know, the App stores all the important data in the /data/data sqlite Database. So here is my idea:

Is it possible to symlink (or hardlink) (with adb terminal?) the sqlite Database into a directory, which I can access, and then I could use folderSync to sync that file, so I would have synced the appData. Is Something like this possible? This is the only possibility to sync it, without root.

# Answer
> 3 votes
No, that wouldn't remove the requirement for root. Symlinks don't get around the permission system in that way. If you try to access a file via a symlink, you still need to have permission to access the target of the link. Hardlinks don't check permissions when you access the file, but they do when you create the link, so you would still need root.

This would be a bit of a security vulnerability if it worked that way, not just on Android, but on Linux desktops and servers too.

Apart from that, it's a bit of a flaky way to sync data. If you make a change on your phone while it's offline, and then make a change on the tablet before the sync happens, whichever one doesn't sync first will lose its change. You need to manage that very carefully, and it's very easy to get caught out by accident. If the app developer adds the feature, they can consider changes separately and work out a useful way to merge them.

---
Tags: adb, sync
---


# Question
Title: How to lock the screen to remain vertical/portrait?
When screen rotate lock is off, the screen on my tablet has four possible orientations: A, B, C, and D, as illustrated below:

I know that it is possible to lock the screen to one orientation -- A *or* B *or* C *or* D -- by deselecting the screen rotation icon in the Notifications pulldown:

But **I want to lock the screen** so that it is *always* in *either* the **A** *or* the **C** orientation (**vertical/portrait**), and *never* in the **B** or **D** orientation (horizontal/landscape). In other words, I want the screen to always be oriented vertically, but still respecting the particular vertical orientation (gravity).

Is this possible?

You might wonder why I want to do this -- I am physically disabled, and it would (really help me out if this were somehow possible. I'm running Android 7.1.1 on a Samsung Galaxy Tab A (2017).)

# Answer
It looks like the app called "Ultimate Rotation Control" will do what you are asking. Here's the link: Ultimate Rotation Control
> 4 votes

# Answer
To lock your screen to have always (**vertical/portrait**) install and use **Screen Rotation Control** available on the Play store here
> 2 votes

---
Tags: auto-rotation, orientation
---


# Question
Title: Google Play Store is unable to search for updates
I have a THL T9 Plus with Android 6.0. Google Play Store version is 8.5.39.W-all \[PR\]. Google Play Services is version 11.9.51. I try to install updates on phone, but I get the error message, "There was an error during update process." I can't see even new version of installed applications in the list.

I tried to force stop those processes, wipe caches, restart phone and I already updated Google Play Store client version, but none of these helped, I got same error message.

# Answer
Here are list of things can be done like uninstall updates and install fresh again, you can get a list of check here
> 1 votes

---
Tags: google-play-store, 6.0-marshmallow, google-play-services
---


# Question
Title: Why can't my Galaxy S4 load my email inbox after I changed the password?
I changed the password for my Gmail account a couple of days ago. Since changing it, my Galaxy S4 cannot load the webpage. Whenever I try to load Gmail in the web browser, it gets stuck loading and reloading the webpage, though no content ever resolves.

I've been trying to load the page daily for about a week now with no success. I thought it may have the old password saved on my phone, but I enter the new password on the step before loading the page.

Tips?

# Answer
> 0 votes
This may be slightly different on a GS4 but give this a try and let me know if you run into any issues:

* Go to Setting -\> Apps -\> Web Browser (Chrome, Firefox whatever browser you are using)
* Clear Cache
* Clear Data

And if that doesn't work: Uninstall and reinstall.

# Answer
> 0 votes
Go to Settings -\> Accounts and sign out and sign in with the new password.

---
Tags: email, samsung-galaxy-s-4, google-account
---


# Question
Title: How to save large chat history of WhatsApp in Android phone
I'm not able to store my WhatsApp chat of single contact in email chat because of large amount of messages so how is it possible?

# Answer
> 1 votes
Your WhatsApp chats are automatically backed up and saved daily to your phone's memory. You can also periodically backup your WhatsApp chats to Google Drive. To backup your chats, go toWhatsApp \> Menu Button \> Settings \> Chats\> Chat backup \> Back Up. Now, to export a copy of the history of an **individual** chat or group, use the Email chatfeature instead:

*Open the chat for the individual or group.Tap the Menu Button.Tap More.Tap Email chat.Choose whether to Attach Media or not*

Note: **When sending with media, you can send up to 10,000 latest messages. Without media, you can send 40,000 messages. These constraints are due to maximum email sizes.**

---
Tags: whatsapp-messenger
---


# Question
Title: How can I run a custom .sh script at each startup (without native init.d support)?
This looks like a general concern of rookie Android system players who have just rooted their phones. The most prevalent method may be throwing your script into `/system/etc/init.d`. If the ROM supports `init.d` then Voila but that's not always the case. So

How can I run my custom script at each startup? What's the user/group my script will be running as if I use your solution?

---

We welcome all kinds of solutions.

# Answer
Simple way (working):

1. Prepare your post boot commands in a script, say /system/xbin/post-boot (set exec perm)
2. Add the above custom script path at the end of /system/etc/init.qcom.post\_boot.sh

Eg:

```
# echo /system/xbin/post-boot >> /system/etc/init.qcom.post_boot.sh

```

Done!

(If you can't find the qcom post\_boot (Qualcomm devices), look for any post\_boot scripts)
> 1 votes

# Answer
I think that most easy way would be by using app Kernel Adiutor. It has ability to emulate init.d Open app and swipe from left edge, it will reveal menu, scroll to tools section and than tap on init.d There you have a switch to enable or disable init.d emulator, for devices that doesn't support init.d, in bottom right you have a "plus" icon to add scripts to run.
> 2 votes

# Answer
From my answer on another question, I have two methods here.

### 1. Add `init.d` support manually by editing `init.rc`

I haven't done this ever personally but I can tell that

* You need to unpack and repack your boot image. This may not be very hard if you can learn from the SuperSU zip package.

### 2. Replace a system service (in this case, the script will always be run as root)

Replace a system service (`debuggerd` is the best choice) binary with your custom shell script. Then run `start debuggerd` to activate it (effective from next boot).

If there's a `debuggerd64`, be sure to replace it with a null script.
> 1 votes

---
Tags: boot, scripts, init.d
---


title: How to run a script on boot in CM12.1?

text:
# Question
Title: How to run a script on boot in CM12.1?
Most questions I can find related to this are dated 2011 and thereabouts, so perhaps it's not too surprising that things have changed since. I've tried a whole bunch of things, with no results whatsoever.

There are some scripts in `/system/etc/init.d` (which also appears under `/etc/init.d` on my device). In particular, there is a `00banner` script which is supposed to log a welcome message. The welcome message never appears in logcat.

I've placed my own script here, which was eventually reduced to nothing but this:

```
#!/system/bin/sh
log -t mytest Testing

```

Nothing. Never appears in logcat unless run manually via terminal. Then it works.

There is also a `90userinit` file here, which invokes `/data/local/userinit.sh` if it exists. I've created it with the same contents as above. Again, nothing ever appears in logcat. Which is not surprising, really, since if `00banner` won't run then this wouldn't either.

I searched for anything named "init.rc" but nothing like that exists anywhere on my device.

All of my scripts have 755 permissions.

What else can I try? (other than apps that run scripts for me)

# Answer
> 6 votes
there is a simple method to add init.d support to any rooted android for versions 4.0 and above ,google made a script that runs at boot as superuser the script is `install-recovery.sh`it is used to reflash stock recovery at every boot they thought it was a good security to prevent custom recoveries but it opened a new hole that can be exploited by users to fake init.d feature. **Dependencies** : in order to this method to work you need the following

1. Busy box installed with the `run-parts`symlinked to your path like `/system/xbin`
2. Obviously you gonna need a rooted phone with the `/system` able to mount as `rw`
3. kernel version doesn't matter.

**Method I : (The easiest way !)**

1. Download this APK (free to use,don't mirror, thanks @Ryuinferno from XDA).
2. Install the apk like any normal app.
3. Launch the app.
4. click on Activate ! that's it you're all setinit.d is now supported you can click the test button or reboot your phone to see if your init.d scripts are exited
5. you can uninstall the application it wil not affect the init.d support

**Method II : (difficulty: medium)**

1. Download this zip unzip it and put init.sh on your sdcard (in this exmple it's gonna be `/sdcard` it can change from device to other.
2. now open a terminal ,or use `adb shell` from computer and run the script.
`su`
`cp /sdcard/init.sh /data/tmp/init.sh`
`chmod 777 /data/tmp/init.sh`
`/data/tmp/init.sh`

the script will run and ask you to reboot twice ,that's it you have officially init.d support :D

**Reference:** \[MOD\]\[APK+SCRIPT+ZIP\] Enable Init.d for Any Phones w/o Need of Custom Kernels!!!

# Answer
> 2 votes
Edit: I saw end off post, This one way, I will try to add without apps ASAP (not home, publishing using mobile), but you can use this, if anything other does not work.

You can try using app called Tasker.

It costs 3.29$ and require root access but it can run Shell scripts. Also, it have Trial version so you can try before buying.

First create Task. Go to Task tab, tap + sign, enter task name. Now go again + sign, and type `shell` in filter. You will find option `Run Shell`, select it, and configure it per your needs.

After that go back to first tab - Profiles, tap + sign to create new. Select Event as type, go System and select Device Boot. Go back and you will be asked to select task. Now select previusly created task and you are ready to go!

# Answer
> 1 votes
This requires you to flash a zip but then you can put your scripts in /system/etc/startup and then they should automatically start up with the phone.

http://forum.xda-developers.com/showthread.php?t=2664645

Also from my comment under the question. I tried looking in my history but I couldn't find the link where people were claiming that CM had their own way of running scripts on boot.

Edit. After some more digging it isnt CM, per say, that does its own thing for scripts. Its the kernel. Not all kernels support init.d for android. If you post what device you are using. I can look around for a kernel that supports custom scripts on boot for ya.

# Answer
> 0 votes
I also have the same problem executing script file in terminal in CM12.1. The solution is by copying the script to `/data` folder and execute it. So I think, CM 12 only allow script executable from certain location.

# Answer
> 0 votes
Simple way (working):

1. Prepare your post boot commands in a script, say /system/xbin/post-boot (set exec perm)
2. Add the above custom script path at the end of /system/etc/init.qcom.post\_boot.sh

Eg:

# echo /system/xbin/post-boot \>\> /system/etc/init.qcom.post\_boot.sh

Done!

(If you can't find the qcom post\_boot (Qualcomm devices), look for any post\_boot scripts)

# Answer
> -1 votes
Following Steps to run scripts at boot time. (Required adb)

1. adb root
2. adb remount
3. adb pull /init.rc
4. edit init.rc add line for execute script like sh test.sh
5. adb push init.rc /
6. adb shell
7. chmod 755 init.rc
8. adb reboot

it work for me. i hope this help you.

---
Tags: root-access, boot, auto-start
---


title: Turn off screen on boot

text:
# Question
Title: Turn off screen on boot
**How can I have my device automatically turn off its screen after booting?**

* booting as in having turned off the device, finished charging and turning it back on
* turn off screen as in the function after single-pressing power button

At night, I turn off my device to charge it overnight. In the morning, I turn it on. Since the boot process takes a long time, I usually leave it on the counter for it to ***s l o w l y*** boot up. During this time, I get ready for my morning (which takes longer than for the device to boot). Taking the device with me to manually turn off the screen once it is finished booting is not good enough for me.

Short of building my own app that runs itself once on boot or having it turn off the screen after *n* seconds of inactivity, how can I have my device automatically turn off its screen after booting?

The device in question is not rooted, but answers requiring root privileges are acceptable
(I plan on rooting the device... eventually...)

# Answer
> 0 votes
For this, I suggest you use an app called Tasker with this app, - among other things - you can set it that when you are not using any app, the screen should timeout after x amount of time, but while you are using an app, it will time out at a different amount if time.

1. download Tasker. (it is a paid app, but it has so much to it that it's worth the money)
2. Open the app and press on the '+' symbol on the bottom right of the screen. And press 'application'
3. Now select the apps in which you want the display to stay on for a long time. For example your ebooks app, or any other app. Select as many apps as you want for this action.
4. Press on the back button on your phone. Now it will ask you what you want to happen when you open those apps.
5. Press on 'new tasks'
6. Type a name for this task something like 'screen timeout 5 min'
7. In this new window, press on the plus symbol, and in the search bar type 'display timeout'
8. Press 'display timeout', and now under where it says 'mins' choose the amount of time you want the screen to stay on for, while using the apps.
9. Press on the back button twice, and you should be brought back to the main page.
10. Long press on 'screen timeout 5 min' (or whatever you named this task) and press on 'add exit task' -\> 'new task'
11. Give the new task a name something like 'screen timeout x seconds.'
12. Here, do the same as steps 7 and 8 just when setting the time, set it to the amount of time you want the screen to stay on while you're not using the selected apps.
13. Now, go back all the way to the main screen of Tasker and press on the check mark symbol on the top right. (If you don't see a check mark symbol, then don't worry about it, just doing this step)
14. Test to see that all is working by going to your home screen and see how long it takes for the screen to go to 'sleep' it should be the amount of time selected in step 12, then go into the selected apps and see how long the screen stays on.

---
Tags: applications, screen
---


title: Connect phone to tv usb

text:
# Question
Title: Connect phone to tv usb
I have plugged my phone up to my through the usb and on my phone it says connected as media device. But when I go to the usb in the settings on my tv it says there no device connected. Any ideas?

# Answer
> 1 votes
There are two common ways:

* Some smartphones support MHL (Mobile HDMI Link) cables.
* Most smartphones are equipped with Miracast. Screen Mirroring can be enabled/disabled in the quick toggle menu, which also contains WiFi,Bluetooth,Torch,etc.

# Answer
> 0 votes
The phone is just charging and not connected because maybe your TV doesn't support that feature. Try using Screen Mirroring in Settings\>Display\>Wireless Display.

---
Tags: usb, connection-issues, lg-g2, smart-tv
---


# Question
Title: Insufficient space on Android 6 with SD-Card mouted as internal storage
I've got a Motorola Moto G 3 with Android 6.0 I installed a 32 GB SD-Card and I mounted it as Internal Storage (the new feature in Android 6). After installing some apps I get the error 'Insufficient memory' in the play store. Looking in the memory tab in the settings menu I saw that the internal storage is nearly full but with a filemanager I see that I have 25 GiB of storage left. I have enabled the device encryption and I have enabled remote debugging in the developers setting. (UI-tweaker is enabled too)

Has anyone an idea? Thanks for your help!

Regards Microgamer

# Answer
> 1 votes
The correct way to do this is navigate to

**Settings** -\> **Apps** -\> *select a large app* -\> **Storage**

Here it appears some apps have the option to **Change** the storage, while others do not - developers have to implement this.

If you have a **Change** button, then a menu appears where you can select the **SD card** and transfer the app.

I fear you'll have to go through all your large apps manually and try to free up space.

Another option would be to **delete the cache** of the apps on your internal storage.

---

Here you can read about how Android deals with adoptable storage.

---
Tags: google-play-store, internal-storage, 6.0-marshmallow, adoptable-storage
---


# Question
Title: How to send notifications based on location?
I have multiple places I visit Home , Office , Church and 2nd office.

Every time I reach any of those, I need to call my parents. I am trying to have a notification sent as soon as I reach any of those locations

# Answer
> 0 votes
There are many many apps on the Google Play Store that do this.

If you want to stick to a basic and free app, you can use Google Keep.

Simply create notes for each event and add the location to the note, Google will then remind you.

Here is a tutorial, on an external site.

---
Tags: notifications
---


title: Is 'SELinux enforcing' responsible?

text:
# Question
Title: Is 'SELinux enforcing' responsible?
My HTC android mobile is rooted after unlocking the bootloader, but it is with S-ON. When I write some files(I mean copy and paste) inside my '/system' partition for the purpose of applying a 'Mod', it works , but whenever I make a reboot, those files vanish. Is it due to 'S-ON' or is it due to 'SELinux enforced' ? What for is 'SELinux permissive' required?

# Answer
> 0 votes
It is due to S-ON, so changes made to /system while the phone is running is not permanent, and will be reset upon a reboot of the device. For information on SELinux in Android, review this link https://source.android.com/security/selinux/.

A brief explanation, taken from the above link:

> "With SELinux, Android can better protect and confine system services, control access to application data and system logs, reduce the effects of malicious software, and protect users from potential flaws in code on mobile devices."
>
> "Permissive mode - in which permission denials are logged but not enforced."
>
> "Enforcing mode - in which permissions denials are both logged and enforced."

---
Tags: root-access, selinux
---


title: VCF files to Galaxy S7

text:
# Question
Title: VCF files to Galaxy S7
I have a *Samsung Galaxy S7* running Android version 7 (Kernel Version is 3.18.14.12365438). I want to import my PC contacts from Outlook 2007 or my iPhone 6S. I also generated the `.vcf` files, which include photos of the contacts.

All the files have been in the download folder on the phone. How to continue and update the contacts?

# Answer
> 0 votes
As you have the contacts in form of `.vcf` file(s), you can use the *Contacts* app's native import functionality:

1. Start the contacts app
2. Tap the "3-dot-menu" (top-right of the screen)
3. From the drop-down menu that opens, chose "import/export"¹
4. On the next page, chose "Import from SD card"²
5. A file browser should open and let you chose the file to import. Pick your `.vcf` file
6. Now your contacts should be imported. If you have multiple files, repeat above steps.

Visualisation of the process (click image for larger variant)

---

¹ if there is no "import/export" directly in that menu, check the sub-menus – e.g. *Manage contacts* or *Settings*
² might be phrased slightly different, like "import from internal storage"

---
Tags: contacts, import
---


# Question
Title: Why are there two different Firefox icons?
Why are there two different Firefox icons? The version is 57 I guess.

# Answer
> 1 votes
Single app can use **different** `small-icons` or `status-bar-icons` for different notifications.
In your case there are two notifications from Firefox for which the icons are different.
They are set programmatically like `setSmallIcon(R.drawable.icon_name)` for every notification.

---
Tags: notification-icons, firefox-for-android
---


# Question
Title: How to fire text message to particular mobile numbers when my device enters into geofence specified?
I want to track a vehicle fleet. Whenever the device enters into the specified geofence, it should fire a text message to the specified mobile numbers, so that they will get notified.

# Answer
You don't need a specific application to do this: it can be done with Tasker. Use the AutoLocation plugin to set up a geofence event. In Tasker, create a profile "enter depot" (or whatever the area is), where the *event* is entering the geofence you defined, and the *task* is to send an SMS. (You can find "Send SMS" under the "Phone" action category.)

With the Tasker App Factory feature, you can also export an app of this configuration, to easily install on multiple devices.

I'm sure you can set up something similar using Automate or another automation app. I just know how to do it with Tasker because that's what I use.
> 0 votes

---
Tags: gps, automation
---


# Question
Title: contents of playlists being deleted but playlist files still exist
Sometimes (probably on reset/power-cycle, which I do every now and then) I lost most of the content of my playlists. I have about 15 playlists that I have created. I have put songs in them several times (several hours of work) and then have come back later and found them all empty -- except for 1 or 2 which remain intact. There are .pla files for the playlists in sdcard/Playlists.

The music files are all on the external sd card.

I have done tests like setting up several playlists, then restarting or power cycling, then checking to see if the content is still there. It usually is. But if I don't use the play for a while then come back, the playlists' contents have been whacked.

Anybody know the 'right' way to store playlists for Android 4.1.x? In some db? Playlist files? Either one? Does one supercede the other?

I have tried both the default player and MixZing player. Phone is Galaxy Note 2 Android 4.1.3.

Sure would be nice to be able to depend on the playlists not being emptied out all the time.... Any clues greatly appreciated! Thanks!

# Answer
> 1 votes
I had a long journey and did some trial and error. I think I've figured this out - with a big disclaimer that the details may vary between devices, Android versions, music apps and maybe even types of SD card.

## The apparent cause

It seems to happen when this happens - this fits my experiments plus the details in the various angry "Arrrrgh why are my playlists empty" forum threads I've read:

1. **Something causes the phone to need to reconnect to the SD card**, such as restarting the phone or connecting it to a computer by USB.
2. **Reading the SD card doesn't happen instantly** \- kinda like plugging a pen drive into a computer, it needs a little time, seconds or maybe a few minutes. The more stuff on the SD card, and the older/slower/cheaper the SD card, the longer this will take.
3. The important part - **something causes the music app to look at the playlist *while the SD card isn't fully connected***. It sees a bunch of references to files it can't find.
4. The music app, instead of sensibly realising that the files are on a card that is being connected, freaks out and **deletes each item in the playlist it can't find**. If all your music is on the SD card, that means emptying the playlist.

---

## Possible fixes

So far, the first two of these seem to have been enough to fix it for me (Sony music app, Xperia Z3 Compact, 4+ year old nearly full 16GB SD card).

1. **Don't touch the music app until the SD card has definitely finished connecting**. For example, wait 5 minutes after restarting the phone or unplugging from a computer. Some versions of Android show a notification like "checking SD card for errors" but in my testing relying on this wasn't quite enough.
2. **If you use a music widget, move it off home screen 1 and maybe delete it**. This was a crucial one for me. If I had the music widget on my first centre home screen, or, if I swiped over to the home screen with the music widget immediately after restarting the phone, the playlists got wiped (even though I hadn't touched the widget or app). If I had the music widget on the home screen one swipe to the right, and I didn't look at that screen until a few minutes after restarting the phone, the playlists didn't get wiped. Clearly the widget being visible on the screen caused the music app to do some startup process which then triggered this problem if the SD card wasn't fully connected yet.
3. **Maybe play a second of a song you know is on the SD card before touching a playlist**. I thought this would fix it for me, forcing the music app to have successfully read from the SD card before giving it a reason to look at my playlists, but my music app doesn't seem to work that way. Others might, though.
4. **Test anything else that might start the music app before the SD card has loaded**. For example, some phones have music players on the lock screen, or things that auto-start the music player if headphones are plugged in.
5. **Consider getting a faster SD card**. This is a last resort option, I've seen people post that this solved it for them. I guess maybe some modern SD cards connect fast enough or leave some sort of trace that stops this happening.

# Answer
> 0 votes
You can try deleting the empty playlists cached in the phone, forcing it to rebuild them from the Micro SD. Here's how:

1. Power off.
2. Remove the Micro SD containing your music and .m3u playlist files.
3. Power on.
4. Open your music app and delete all your empty playlists.
5. Power off.
6. Reinsert the Micro SD.
7. Power on and open your music app.

All your playlists should reappear.

Unfortunately, in my experience with a new Samsung S8, the problem quickly reappears. The Micro SD is mounted as a file system during boot but it's possible the playlist software often starts sooner (especially on a very fast phone) and that the playlist software simply does not anticipate this.

So it's quite possible that for playlists to work reliably on any given phone, both the playlists and the associated music files have to be in the phone's internal storage.

# Answer
> 0 votes
I've seen this on my Samsung S7 on Nougat. My music audio files are stored on the external SD card. It's sad it's still happening in 2018.

The most recent time I lost my playlist items happened when my battery died but when I charged it and booted it up, the Samsung Music app was still in the 'Recent apps' list (as it was a app I had just used). This must have prompted it to verify the playlist links before SD was mounted, and it removed any links to audio files in based on the SD card that it couldn't find.

I am now using a playlist backup app from the Play store (it's called PlaylistSync but there are several others) to regularly backup the playlist to Google Drive and when this calamity happens I have just restored the most recent back-up. This saves a lot of frustration from having to re-build your playlists again.

---
Tags: external-sd, music, music-player
---


# Question
Title: How do I display two different calendars exclusively on 2 different widget?
How do I display two different calendars exclusively from my Google calendar on 2 different mobile app widget?

# Answer
I don't think it is possible as mentioned in Google forum\- though that's about two years old

You would need a third party widget for that- see Izzy's Calendar widgets collection. I tried Widget What and When Free and it works fine with two different calendars in two widgets
> 1 votes

---
Tags: calendar, app-widgets, google-calendar
---


# Question
Title: Recovery mode device drivers not working in HTC Desire 616
I have an HTC desire 616, bootloader locked, S-ON. I am able to enter on recovery-mode but the device is not listed in ADB, though I have all latest drivers from Google, Windows and HTC. I am able to enter in sideload mode, drivers are working and I have 3 choices and 3 installed but the signature check prevents me to install any sort of updates.

1. I think is still on the software and relies on drivers but I don't know what I can do further
2. Is it possible to flash a unlock\_code.bin of zeros?

Kindly waiting your help

# Answer
> 0 votes
Finally I might have a solution but I need your help guys. I need the images of all partitions (userdata, cache, system,expdb,rootm,blinkfeed, ebr2,logo, misc, sec\_ro,seccfg,protect\_s, protect\_f, nvram, pro\_info, ebr1, mbr, preloader) which is not a custom ROM but essentialy it is like a copy of your phone. I need to download them from someone who has the same firmware d616w and with his bootloader unlocked(I might be wrong about this last sentence). Then I will flash all of them on my device, I will turn my device into S-OFF if it is not already and manually change IMEI, MID, S/N and other phone infos. Hopefully it will work, otherwise I m gonna use it as a brick for constructions ahah.

---
Tags: adb, fastboot, bootloader, htc, usb-drivers
---


# Question
Title: Which camera gives more accurate image, the front or the back camera?
My phone is Kyocera Hydro Icon with Android 4.4.2.

I use its back and front cameras to take pictures of my head and face at distances around an arm's length. I found the front camera gives more pleasing pictures than the back one, for example,
the pictures taken by the back one often shows my eyes are proportionally smaller.

Also the front camera seems to produce completely dark pictures when the lighting isn't good, while the back camera can still produce clearer pictures.

Which camera gives more accurate or realistic pictures of my face and head at distances around an arm's length?

# Answer
Resolution governs quality of pictures

1. The back camera invariably is of higher resolution and is meant for better quality. Typical resolution is upwards of 10 Megapixels
2. Front camera is not meant for high resolution and was intended for visiting the image during video chats. With demand for better quality (including "selfies", it is now typically upwards of 2 megapixels and in recent phones 5 or more. Dark images as reported is less for to quality of camera but more to do with subject focus and lighting conditions

**Edit**

OPs concern is more about "distortion". To reduce distortion

* Take the snap at arms length, picture would be smaller but less distortion
* Reduce aspect ratio (if default is higher) to 4:3
* Keeping the subject and camera at same level and experiment with aligning your face to the top/bottom edge of photo to see if it reduces distortion
* Try an app like Cameringo, which augments photo taking capabilities considerably and adding effects (I use the pro version of this but more for rear camera shots and both trial and pro versions are good). This may also help tackle the rear camera issues faced
> 1 votes

# Answer
Interesting question. I found that the back camera does kind of "distort" the face when used for selfies, probably because it was constructed for capturing objects/persons at a longer distance (probably because of the "barreling" effect etc.). The selfie has less MP but it does show the aspects of the nearby face more correctly IMO. Even concidering the lower photo quality of the selfie camera I would still use it for selfies, back for full body in mirror etc.

As a blogger I first wanted to mount a tiny mirror on the back of the phone so I could use the back camera for selfies because of the higher MP. But I found out that this camera was in fact designed for another purpose. The moment the camera is 1+ metres away from the person, everything looks fine. It's the handheld selfies where the back camera "problem" starts to appear.

My phone is a Huawei Honor 6.
> 1 votes

---
Tags: camera, front-camera
---


title: Have a confirmation on launching an app

text:
# Question
Title: Have a confirmation on launching an app
I'm looking for a way to control other apps opening: Before opening an app, I would receive a dialog box before asking me if I would really open the application then I can say no and I'm less addict. I'm not looking for something that will block other application usage, only show a pop up with a dialog.

# Answer
I'm not sure if there is an app that does exactly that, but you can use any app lock for this.

Take for example this app lock download it, and set the code to be the number 5 (example) now, go to the app lock settings \> password settings \> password hint. Change the hint to say something like "are you sure you want to use this app? Press 5 for "yes", or exit for "no".

Then, select which apps you want this dialogue to appear on by going to "app lock" and press on the + symbol. After you add the desired apps, you'll see an option called "fake" this will be an even better reminded not to use it. Basically if you choose this option, what will happen is, when you open the blocked apps, it will say that the app crashed, and only after long pressing on "ok" will it open the keypad.
> 1 votes

---
Tags: applications
---


# Question
Title: TWRP OnePlus 5T not asking for encryption password
I want to flash the new Update for the OnePlus 5T but TWRP is not asking for a decryption password as usual and hence cannot mount the data partition.

It's possible that this is not working since the last update (OnePlus 5T OxygenOS 4.7.6).

Is there a way to force the decryption, for instance by some command in the TWRP terminal? Or is there a way to reset this?

In the Android settings, the Encryption Option is not changeable, it just says "Encrypted".

UPDATE: Obviously OTA Updates are possible now, I don't know how. Till now, with custom recovery and/or root this was an issue and not possible so you had to download the Update manually and install it through TWRP or other recovery.

During OTA Update, the recovery was overwritten with the original from Oneplus.

The option for Smartphone encryption in the settings remains unchangeable, so I believe I could not change the code if I wanted to.

# Answer
> 4 votes
From the TWRP terminal enter the command `twrp decrypt <your password>`

Source

---
Tags: twrp, encryption, 8.0-oreo
---


# Question
Title: Remove Google Apps mini and install another version - LineageOS
I have installed LineageOS 14.1 (+TWRP) on Samsung S5 g900f (klte) with Google Apps mini. I followed this guide: https://wiki.lineageos.org/devices/klte/install

I also added Google Apps Mini zip during the installation phase.

**Question:** Is there a way to remove Google Apps mini and install Google Apps nano (or pico) package? (Without reinstalling from scratch)

Regards

# Answer
Flashing the LOS package again (to restore `/system` to a clean state) then flashing the GAPPS you need should be sufficient - no need to do a factory reset. Of course, do a nandroid backup as always just to be safe.
> 1 votes

---
Tags: installation, twrp, google-play-services, uninstallation, lineageos
---


title: Stop auto-selecting cellular network

text:
# Question
Title: Stop auto-selecting cellular network
I'm roaming in Mexico with an international plan via a US-based GSM carrier. This gets me 4G on TelCel in Mexico, and it works great.

However, occasionally, for reasons unknown to me, sometimes my phone will switch off of TelCel, and switch to a cell network named "334 01", which does not provide cellular data. This happens while browsing the Internet on my phone, while tethered to my laptop, or while I'm asleep. From a quick search I gather that "334 01" is AT&T's IMSI code, but my US carrier is *not* AT&T, though this phone was never carrier-locked.

Is there an Android setting that I can modify to either:

* Stop my phone from changing cell networks automatically
* Prohibit my phone from connection to a specific cell network (in this case "334 01")

Tethering is explicitly included in my plan, so I don't think it's TelCel "kicking me off". When I notice that my data connection is gone I can switch back to TelCel by selecting it via the "Cellular Operators" menu in settings. My phone is a Motorola Moto X Pure running Android 7.0.

EDIT: Whoops, the offending network is "334 03" which is Movistar.

# Answer
> 7 votes
# Problem was that the settings made in the device by manual selection wouldn't stick

**Solution**

Dial `*#*#4636#*#*` and in Phone Info section → preferred network type choose the network type you would like to be always connected to.

As OP noted in their comment, the network selection made in settings was not sticking and the selection made in above menu did stick and prevent roaming (they chose LTE as preferred network)

# Answer
> 4 votes
There is a setting to "fix" your device to a given network:

*Settings › More … › Mobile networks › Network operators:*

By default, this is set to "automatic". But there's an option to "manually select". This will then scan for available networks, and let you chose one (obviously only possible with the desired network in reach). Having done that, whenever the chosen network is not available, you'd simply have "no network" – it wouldn't switch to any other operator, however strong his signal might be.

I've often used that in the past before going abroad if I wished a device to not "accidentally roaming" *even for calls.* That way my then provider couldn't fool me with costs for "twice redirected calls" (from home to roaming to mailbox-at-home-network): Manually selecting my home network before departing, the device found no suitable network in the target country :)

---
Tags: 7.0-nougat, mobile-network
---


# Question
Title: Outlook Android no longer synchronizes Office 365 contacts
As of version *2.2.74* my Android Outlook *does not sync any contacts*.

The previous version has synced all of my coworkers from Office 365, but after a factory reset my coworker contacts are missing.

There is a setting in the application that shows if I enable contact synchronization and it is set on.

In Accounts and synchronization settings, I have an Outlook type account, and it has the Sync contacts set on and the last sync took place seconds ago.

In the new version of Outlook Android, there is a new tab called Persons, and it says I have 0 contacts. I guess this new feature is not working as expected.

Do you have any idea why these settings can't help?

# Answer
Well, it seems, they restructured how the contacts are synchronized.

I checked my Outlook on my computer, and it has 2 *separate contact store options:*

> Address book - mycompanyemail@mycompany.com
>
> Contacts - mycompanyemail@mycompany.com

All my company coworkers were in the *Address book* and my *Contacts* were empty.

I copied them to *Contacts* and now they are all synchronized - even appear in the new Contacts tab of Outlook Android.

So to draw a lesson: always check your online *Contacts* and see what it contains.
> 0 votes

---
Tags: contacts, sync, outlook
---


# Question
Title: How to decrypt an undecryptable micro SD card?
I encrypted my micro SD card and used it (and encrypted/decrypted it) without issue during some months. But one day, without explanation, my micro SD card is no more decryptable: the encrypt screen at Android startup (or SD card inserting) is loading unending or showing "0Mb/0Mb - 100%" and micro SD card still unavailable and invisible.

When I connect the SD card directly to PC or Mac, files tree is browsable, files are visible but unreadable.

I tried some softwares like Android File Transfer or Android Data Recovery (Wondershare Dr.Fone for Android), without success.

I don't want to reset my phone because I will lose all my micro SD card data. Is there a way to recover data from corrupted and undecryptable micro SD card?

* Phone : Samsung Galaxy 7 (SM-G930F)
* Android : Marshmallow 6.0.1

# Answer
I finally find a solution in an *recovery-android.com* comment by *vid971* :

> 1. Go to Lock Screen and Security and select None and Keep Fingerprints. You will then be asked for setting up a password.
> 2. Remove the SD Card from the phone and Reboot.
> 3. When phone has rebooted put your SD Card back in. You will have windows prompts, for you Sim card Pin and Mobile Data usage, and after that you'll be on the Encrypt SD Card page. Click Encrypt. As your card is already encrypted it will be fast.
>
> From then your SD Card should be recognised again and usable.
> 1 votes

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


# Question
Title: How to root Moto G 3rd generation running Marshmallow?
For the past few months I have tried various methods of rooting my Motorola Moto G 3rd gen (Android 6.0.1) and they have all failed. How on Earth do I root my phone?

# Answer
> 1 votes
Excerpt from my XDA Tutorial on rooting the Moto G 2015 -

---

This guide covers ALL Moto G 2015 models (including the G Turbo) that can be bootloader unlocked and have TWRP available, it doesn't matter if it is the XT1540, XT1541, XT1543, etc., the method is identical. In fact, this method will work on all 2015 and 2016 series Moto phones running Marshmallow, including the Moto E, X, G3, G4, and Z.

Please read completely and make sure you understand each step and how to do it, if you don't get something search the thread or ask an open question.

tl;dr version for advanced users: Skip to "**How to do it**" section

I am writing this tutorial because there are still lots of failed root attempts using older "standard" methods that do not work on this device. I also do not like the "one click" root methods, because they can and do fail (KingoRoot will brick a Moto G3, regardless of what it's web page says), and when they do people have no idea how to fix it. The manual way is not difficult, and it teaches you how to work on, fix, and use your device on a level above that of the average smartphone user.

I will only cover the details of rooting, the prerequisites are covered elsewhere in detail and I will link to reliable sources for the information. Specifics of the prerequisites are outside of the scope of this tutorial, but are open for discussion in this thread.

**Prerequisites:**

1. Device must have an unlocked bootloader. See Moto - Unlocking the Bootloader for more info. **NOTE:** *Performing this prerequisite will give you all the tools (fastboot) and drivers needed to continue, and wipe your device, meaning erase all your information and programs. Make sure to backup any important data first. This step will also permanently void your warranty once an unlock code has been issued by Moto, it doesn't matter if you even use it, your warranty is done.*
2. You need to have TWRP installed or one-time booted via fastboot. CWM and other recoveries will NOT work at this time. See TWRP for the Moto G 2015 or TWRP for Moto G Turbo.
3. You need a copy of the latest **STABLE** SuperSU ZIP from Chainfire's site on the internal storage or SD card of your device.
4. Reboot and start TWRP recovery, the method you use to do this doesn't matter (boot or flash).

**How to do it:**

Now, the procedure is the same whether you are trying to root the first time, or you did it the old way just flashing SuperSU and are now not able to boot...

In TWRP, go to Advanced and open the Terminal, in the terminal type this EXACTLY as shown:

`echo SYSTEMLESS=true>>/data/.supersu`

Now press enter (there is no confirmation returned), then exit and press the Home key. Go to Install and select the SuperSU zip file you downloaded from Prerequisite #3 and swipe to flash it and reboot. No need to clear caches or anything else but you are welcome to if you wish. You can install SuperSU updates normally through the app going forward (as of this posting).

**Why do I have to do this???**

For whatever reason, the install script for SuperSU does not recognize that this device (like many others) requires a systemless root installation. By creating /data/.supersu in the TWRP recovery environment, the SuperSU install script parses the file and sees "SYSTEMLESS=true" and ignores what it auto-detects and forces a systemless root installation.

Hope this is helpful to someone!

As always, if this is the first time you have booted TWRP or attempted root... **BACKUP IN TWRP FIRST**!!! Once the system is modified, it cannot be undone (easily) and you will always have a known good starting place if the worst happens.

**DISCLAIMER:** I am not responsible for anything that happens... Your device, your responsibility, no matter what happens... Although all the information here has been tested and is known to work with no issues except where noted, things occasionally can and do go wrong and we cannot foresee every possible scenario or circumstance.

**If you need assistance**, we need detailed information about what what's going on and what you have tried to do... Please provide details including:

1. Device model number and Android version
2. TWRP version
3. SuperSU version
4. Output of 'cat /data/.supersu' from TWRP terminal

And a copy of recovery.log if possible, and any other pertinent information you can think of. Without specific information there is nothing that I can do to assist you and request for help may be ignored.

Photos added showing what a proper command and flash should look like. Note that in picture 1 the exit command is not needed, you can just back out. In pictures 2 and 3 a proper flash of SuperSU is shown, note that system-less mode is specified and the boot image is patched, this is what should occur. It is normal for it to loop once or twice, but that is it, first boot could take 10 minutes plus.

---
Tags: rooting
---


# Question
Title: What are the command line options of Genymotion's player
Can someone give me a list of the cli options of Genymotion's player command. I see that I can get a list of the devices via VituralBox's command:

```
$ VBoxManage list vms

```

Then I can start the desired device with:

```
$ ./player --vm-name "Samsung Galaxy S2 - 2.3.7 - API 10 - 480x800"

```

Now I'm looking for player command option to start the Genymotion from the last run state. In other words have it resume where it was when the device was closed.

There's a chance the option might be in one of the possible cli arguments. I've searched for a list, but so far my results are to how to start a VMS but not the full list of options that are available.

I also used `-help` and `--help` as a parameter, but it just gives and error. Not the full usage options of the player command.

This is the list that I have compiled so far (found by running player without argument):

```
--vm-name
--quiet

```

It may be that those are the only options of the player command. If it is I'd appreciate knowing so that I can stop searching.

# Answer
> 1 votes
When you use player inproperely it writes help info into the log file. Eg.

```
siciarek@siciarek ~ $ ~/bin/genymotion/player --help
Logging activities to file: /home/siciarek/.Genymobile/genymotion.log
siciarek@siciarek ~ $ tail -n 6 /home/siciarek/.Genymobile/genymotion.log
2018-01-18T18:28:13+01:00 [:8281] [debug] Usage: player
2018-01-18T18:28:13+01:00 [:8281] [debug]        --vm-name|-n <device name>
2018-01-18T18:28:13+01:00 [:8281] [debug]        [ --no-popup|-s ]
2018-01-18T18:28:13+01:00 [:8281] [debug]        [ --poweroff|-x  ||
2018-01-18T18:28:13+01:00 [:8281] [debug]          --startadb|-a  ||
2018-01-18T18:28:13+01:00 [:8281] [debug]          --stopadb|-z ]
siciarek@siciarek ~ $

```

---
Tags: android-emulator, command-line, genymotion
---


# Question
Title: How can I change password for my Exchange settings
Due to corporate policy, I was forced to change my domain password, which impacts also the access to Exchange server. Now I need to update that password also in my Android phone (Galaxy S, Android 2.1.1), but I can't find the settings in the phone. Any idea?

# Answer
> 7 votes
`Settings - Account and Sync - <your exchange account>' - Account settings - (scroll down) Incoming settings' - password field`.

On my Samsung Galaxy S - running Froyo 2.2.1

# Answer
> 2 votes
The phone *should* prompt you for the new password once it gets an error back from Exchange. If it doesn't - you can try removing the account and re-adding it on `Menu -> Settings -> Accounts and sync` page.

# Answer
> 1 votes
Samsung Galaxy S2...same solution touch click "Incoming Settings" which looks like a label rather than a field

# Answer
> 1 votes
Samsung version 7.0 answer: Apps - email - settings - click account - exchange server settings

This was way more difficult to figure out than it should have been.

# Answer
> 0 votes
In Samsung Galaxy S2:

> Settings \> Accounts and Sync \> (Select your Exchange email) \> Account Settings \> (Select your added account) \> Scroll down to Sub heading "Sever Settings" \> Exchange server settings

Under that heading is:

* Domain\User name
* Password
* Exchange Server Settings

The phone does NOT prompt you for a new password. That would be nice if it did, instead of continually updating you with notifications that it could not connect to the Exchange server.

# Answer
> 0 votes
Changing your account setting will allow you to access your e-mail, *but* will not reset the Google account synchronization.

After you update your passwords in the accounts of the security section then open the Playstore application.

The Playstore application will then notice your change of password and will prompt you for the new one.

Give the new password and that's it.

---
Tags: settings, exchange, password
---


# Question
Title: Is there some documentation how exactly does the Factory Reset Protection (FRP) works?
Is there some detailed documentation how exactly does the Factory Reset Protection (FRP) on Android devices works?

# Answer
I think much of this is intentionally kept "quiet"... in researching some of this myself a while back, this is the most I could find "in detail".

https://github.com/intel/kernelflinger/blob/master/doc/FRP.md

Bootloader Policy and Factory Reset Protection Google's verified boot (GVB) specification and Google Factory Reset Protection (FRP) for AndroidTM define a set of security protocols for ensuring system integrity and dis-incentivising device theft, respectively.

There are legitimate reasons to unlock the bootloader without knowing the screen unlock PIN; specifically RMAs. An RMA processing center should be able to unlock device flashing restrictions in Fastboot and return the device to a factory pristine state without requiring the user to disclose their screen unlock PIN or potentially opening their user data to compromise.

This documentation describes the solution for defining a class A device and a mechanism that allow for unlocking a device for RMA regardless of FRP or class A status. It meets Google FRP security requirements by ensuring that there is no single skeleton key to unlock devices if all security considerations are implemented. It also allows devices to be provisioned so that the entity with unlock authority could be Vendor, the OEM, ODM, a carrier, or an enterprise organization.

Device User Experience User boots the device to Fastboot User obtains an action challenge fastboot oem get-action-nonce force-unlock User gives the challenge to the action authorization agent and receives an action authorization token file (details later) User flashes the action authorization token fastboot flash action-authorization token\_file Fastboot performs the authorized action Implementation The OEM action authorization protocol is a simple challenge response where the device's Fastboot generates a one-time-nonce, the OEM action authorization agent signs the nonce and approved action using its private override authorization key (OAK) to generate an authorization token, and then the device's Fastboot validates the action authorization token and executes the action.

Override Authorization Key The override authorization key (OAK) is a public key that is set in the device during manufacturing and that is used to validate action authorization tokens. If an OAK is not set, then all action authorization features are disabled and default bootloader and Fastboot behavior specified in GVB and FRP is in effect. Since the OAK is capable of overriding the class A and FRP policies, it is important to ensure that it cannot be changed by unauthorized code, which would change the identity of who can override policy.

The OAK may act as a validation root certificate if the certificate authority attribute of the certificate is "true" -- standard X.509v3 certificate handling. This means that the OAK can be used to issue certificates that are also able to sign action authorization tokens. This is the preferred method of setting the OAK in cases where multiple entities need the ability to issue action authorization tokens without having access to a single key.

OAK is stored as the OAK time-based authenticated EFI variable under the Fastboot GUID of 1ac80a82-4f0c-456b-9a99-debeb431fcc1. The content of this variable is the SHA256 sum of the OAK certificate.

Bootloader Policy Mask Bootloader policy mask (BPM) is a set of 64 boolean policy flags. If a BPM is not set, then Fastboot defaults to a policy matching a BPM value of zero. If a BPM value is set, a one bit indicates the corresponding policy is active.

The BPM is set in the device during manufacturing.

Policy Name Bit(s) Description CLASS\_A\_DEVICE 0 If set, the bootloader enforces the behavior defined by GVB for class A devices. MIN\_BOOT\_STATE 1-2 Minimal boot state required to boot the device (0 for red, 1 for orange, 2 for yellow and 3 for green) BPM is stored as the BPM time-based authenticated EFI variable under the Fastboot GUID of 1ac80a82-4f0c-456b-9a99-debeb431fcc1.

Generating One-Time-Nonce The one-time action authorization nonce has the form "::\<8 bit action id\>:\<16 client random bytes\>" with all fields hex encoded. It is generated when the fastboot oem get-action-nonce command is used. Fastboot saves the value for a limited amount of time before it expires. Each time the command is run a new value is generated and previous value is overwritten. The value is not stored persistently. If Fastboot is restarted, the old nonce is no longer valid.

The following actions are defined.

Name Action ID Description Force unlock 0x00 Makes Kernelfliner execute the Fastboot flashing unlock command as if the "enable oem unlock" developer option is enabled. All standard GVB properties apply, including secure erase of the user data partition. The version field is a one byte value. It must be zero for the current version.

Creating an Action Authorization Token An action authorization token is generated by signing the action authorization nonce with the OAK. The token is a PKCS #7 signed document, where the body takes the form "::\<8 bit action id\>:\<16 client random bytes\>:\<16 auth agent random bytes\>" with all fields hex encoded. The auth agent random bytes added when creating the authorization is to prevent an attacker from mounting an attack by supplying known plain-text values.

The token must contain all certificates required to validate the signature chain of the token.

The action authorization agent must verify that the nonce is exactly in the prescribed format.

The action authorization agent must verify that the action ID in nonce is a recognized value.

If possible, the action authorization agent should verify that the serial number is valid.

Flashing the Action Authorization Token The authorization token is sent to Fastboot using the special "action-authorization" flash target. Fastboot verifies that the token is valid, invalidates the current one-time-nonce, and executes the authorized action.

Fastboot must validate that there is no extra data after parsing the token.

Fastboot must verify that the signature's certificate chains to the OAK set at manufacturing.

Fastboot must verify that all values in the token body have the prescribed values.

Fastboot must verify that the value returned by the "oem get-action-nonce " command matches the value in the token body and the nonce has not expired.
> 4 votes

---
Tags: factory-reset, documentation
---


# Question
Title: Downloader app failing to download apps over a specific wifi hotspot (Error 495)
This may look like it's beating a dead horse, but it's not.

All of my Android devices of different brands and different chipsets, from Exynos, Snapdragon 820, Snapdragon 435, with stock or custom ROMs, AOSP-based and manufacturer-based ROMs, all fail to download apps on a fully functional WiFi connection that has no problems with accessing every possible resource that I ever needed.

Updating/Downloading apps fails with Error 495. I had done everything I could to mediate this, but since this is happening on all of the devices that I tried, with more than 1 Google account, it's safe to say that it's **not the device's fault**.

The fault is in the Downloader app (the one that downloads the apps for Google Play), in communicating with my Asus RT-AC66U router with Asuswrt-Merlin on it. Everything else works fine, including when I connect to another WiFi hotspot on the exact same internet connection. But it also doesn't work if I connect to a WiFi repeater that's hooked up to the same problematic WiFi hotspot on the Asus router. (Both the 2.4 and 5GHz hotspots fail)

Rebooting both routers, and making them go a power-off/on cycle, had no effect. Unhooking the repeater off didn't help either. As I've said, everything works fine. Other WiFi devices on the same hotspot have access to HTTP, HTTPS, with no reported broken keys that would suggest a security risk or anything. I didn't change any settings, and updates used to work just 4 days ago.

So the question is: What is so special about the Downloader app, or about Play store, that makes it the only thing that's failing?

Or how can I diagnose this? Maybe an easy to use packet sniffer that's able to show the failing request and allow me to reproduce it outside of my phone, and figure out what exactly about my router's settings it doesn't like. I promise to share my findings, and will describe in detail every step that I took, if it helps me fix this issue. Because right now I don't even know where to start looking.

# Answer
Lucky for me, my router has a connection log, that I could look through. From my phone that was trying to download an app, there were many connections, but these brought up my interest:

```
tcp   192.168.1.174:51959                      52.15.96.207:443                         SYN_SENT
tcp   192.168.1.174:51974                      52.15.96.207:443                         SYN_SENT

```

Indeed, the remote IP did not respond. But the feature worked on other access points. I decided to change the DNS settings in the DHCP server, from the ones provided by the ISP, to OpenDNS.

https://en.wikipedia.org/wiki/OpenDNS

This can also be done from the phone, from the advanced WiFi connection settings, when you choose something other than DHCP.

That did the trick.

As mentioned by What is error code 495 on Google Play and the YouTube app? too. Please, if this solves your problem, go upvote, so that it doesn't sit on the bottom of the answer list.
> 2 votes

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


title: Key icon in notification bar lg aristo

text:
# Question
Title: Key icon in notification bar lg aristo
Sreen shot of home screen with notification bar

# Answer
That indicates you are using VPN to connect to Internet

Either you installed a VPN or a firewall / ad-blocker app that uses VPN (I see you are using Orbot, that could be it)
> 2 votes

---
Tags: notification-bar, notification-icons
---


# Question
Title: Select from screen - text recognition is gone
Before I was able to long-press middle button and get mini-menu with things that was android captured from the screen, including ability to select text directly from images for translation etc.

Now when I long press middle button I get big menu at the bottom with Google assistant, I still can get things captured from the screen if I press "what's on my screen" option, but text recognition from images is gone. I need it back.

I don't know exactly when this option disappeared, sometime in the previous 2 months.

Android 6.0.1

# Answer
> 0 votes
It's the new Google Assistant that replaced the old Google Now on Tap. There are few hacks around to remap your middle button back to Now on tap, but all of them will fail eventually as Google starts depreciating the old feature.

One temporary way is to go in Google settings and change your language to something other than US English (Maybe UK, Aus or Ind?)

---
Tags: screen
---


title: Force app to fit on screen

text:
# Question
Title: Force app to fit on screen
I am trying to use an Android app which is not designed very well. Part of the UI is not visible which prevents it from functioning. Is there a way to force it to fit on screen? Possibly by overriding the display DPI with a developer option?

This is a screenshot of the app:

Screenshot from Google Play Store. Yes, it says iPod. Lol.

On my phone the "pairing" button is not visible as it is off the bottom of the display, and there is no scroll bar:

Screenshot from my phone.

As you can see, the UI is simply too big to fit on the display, so some parts get pushed off. Since the UI does not scroll, they are inaccessible.

# Answer
> 2 votes
After googling for a while I found a solution. Enable `adb` debugging on the phone and run this command:

```
adb shell dumpsys display | grep mBaseDisplayInfo

```

Find the part that says "density". This is the screen DPI. Reducing it will make Android think your screen is bigger, and it will shrink all of the UI respectively. I changed it from 240 to 200 by running this command:

```
adb shell wm density 200

```

Now the problem app looks like this, and I can use it:

screenshot showing fixed app

Note that this will affect everything on the phone including the homescreen.

I found this solution here. Contrary to what that page says, I did not need to reboot for the change to take effect.

---
Tags: screen, screen-resolution
---


# Question
Title: z3c 5803 Lollipop 5.1.1 rooted -> TWRP Factor Reset -> Now Philz Touch 6 instead of TWRP
I used TWRP to make a backup ( with the default options ) to make a backup to my external SDCard.

Then I used TWRP to perform a default factory reset

I did not manually touch anything else. I booted my android to check if I got a factory reset but I did not wipe anything else or install anything.

If I now boot into recovery I see "Philz Touch 6

Now I am confused, normally at this point I saw the TWRP GUI ?

Is TWRP still on my phone Why is Philz Touch there now ?

PS: This was the first time I used the key combination to boot into recovery. Before the factory reset I used the app "quick boot" to boot into recovery.

But I assume both methods ( app and physical buttons ) have the same results.

So my Question is where is TWRP after I performed a TWRP Factory Reset ?

# Answer
> 0 votes
After the comment above `I see on XDA that your device has custom recoveries that can host both TWRP and Phil's` I searched my windows PC for the installation file that I flashed to install TWRP. The filename is *XZDualRecovery*

Google then gave me this link having the manual

This means I have both PhilZ Touch AND TWRP installed.

I solved my problem by the correct key combination during startup:

* press `VOL-UP` for PhilZ Touch;
* press `VOL-DOWN` for TWRP.

---
Tags: backup, recovery-mode, twrp, clockworkmod-recovery, sony-xperia-z3
---


# Question
Title: Is there a way to look inside and modify an adb backup created file?
I created a backup of my Galaxy Nexus with `adb backup`. The resulting file is named backup.db and it's somehow encrypted.

I wanted to restore the backup, but it stops when it comes to restoring `com.android.providers.contacts`. I used `adb logcat` to find out what's going on and found out that `com.android.acore` crashes during the restore process.

I'd like to gain access to the data in the backup and remove the contacts database to restore everything back to my phone. Are there any other ways restoring the data from the backup?

# Answer
> 19 votes
The file is not encrypted, unless your specify so when creating the backup. It is however compressed (using deflate). You can find out the exact format by looking at Android source (com/android/server/BackupManagerService.java) code, and, technically, should be able to extract specific data from it. However, IIRC, there are some file integrity checks in place, so it most probably won't work if you just delete a bunch of data from it. Unfortunately the `restore` command doesn't seem to have an option to restore a particular app/package only or exclude a package.

# Answer
> 59 votes
I started working on this. I'm posting my results so far here as a "community wiki" answer for two reasons: first, if someone else wants to join in, there's a place to talk; second, if I get pulled away from this project, there'll be hints for someone else to start working.

The backup logic on the host is entirely contained within https://github.com/android/platform\_system\_core/blob/master/adb/commandline.cpp, in the function named `backup`. The function is *very* simple: it validates the command line options, sends the command mostly as-is to the adb daemon on the phone, and writes the phone's output to the file. There isn't even error-checking: if, for example, you refuse the backup on the phone, `adb` just writes out an empty file.

On the phone, the backup logic starts in `service_to_fd()` in https://github.com/android/platform\_system\_core/blob/master/adb/services.cpp. The function identifies that the command from the host is `"backup"`, and passes the unparsed command to `/system/bin/bu`, which is a trivial shell script to launch `com.android.commands.bu.Backup` as the main-class of a new Android app process. That calls `ServiceManager.getService("backup")` to get the backup service as an `IBackupManager`, and calls `IBackupManager.fullBackup()`, passing it the still-unused file descriptor (very indirectly) connected to the `backup.ab` file on the host.

Control passes to `fullBackup()` in com.android.server.backup.BackupManagerService, which pops up the GUI asking the user to confirm/reject the backup. When the user do so, `acknowledgeFullBackupOrRestore()` (same file) is called. If the user approved the request, `acknowledgeFullBackupOrRestore()` figures out if the backup is encrypted, and passes a message to `BackupHandler` (same file.) `BackupHandler` then instantiates and kicks off a `PerformAdbBackupTask` (same file, line 4004 as of time of writing)

**We finally start generating output there, in `PerformAdbBackupTask.run()`**, between line 4151 and line 4330.

First, `run()` writes a header, which consists of either 4 or 9 ASCII lines:

1. `"ANDROID BACKUP"`
2. the backup format version: currently `"4"`
3. either `"0"` if the backup is uncompressed or `"1"` if it is
4. the encryption method: currently either `"none"` or `"AES-256"`
5. (if encrypted), the "user password salt" encoded in hex, all caps
6. (if encrypted), the "master key checksum salt" encoded in hex, all caps
7. (if encrypted), the "number of PBKDF2 rounds used" as a decimal number: currently `"10000"`
8. (if encrypted), the "IV of the user key" encoded in hex, all caps
9. (if encrypted), the "master IV + key blob, encrypted by the user key" encoded in hex, all caps

The actual backup data follows, either as (depending on compression and encryption) `tar`, `deflate(tar)`, `encrypt(tar)`, or `encrypt(deflate(tar))`.

**TODO**: write up the code path that generates the tar output -- you can simply use tar as long as entries are in the proper order (see below).

**Tar archive format**

App data is stored under the app/ directory, starting with a \_manifest file, the APK (if requested) in a/, app files in f/, databases in db/ and shared preferences in sp/. If you requested external storage backup (using the -shared option), there will also be a shared/ directory in the archive containing external storage files.

```
$ tar tvf mybackup.tar
-rw------- 1000/1000      1019 2012-06-04 16:44 apps/org.myapp/_manifest
-rw-r--r-- 1000/1000   1412208 2012-06-02 23:53 apps/org.myapp/a/org.myapp-1.apk
-rw-rw---- 10091/10091     231 2012-06-02 23:41 apps/org.myapp/f/share_history.xml
-rw-rw---- 10091/10091       0 2012-06-02 23:41 apps/org.myapp/db/myapp.db-journal
-rw-rw---- 10091/10091    5120 2012-06-02 23:41 apps/org.myapp/db/myapp.db
-rw-rw---- 10091/10091    1110 2012-06-03 01:29 apps/org.myapp/sp/org.myapp_preferences.xml

```

**Encryption details**

1. An AES 256 key is derived from the backup encryption password using 10000 rounds of PBKDF2 with a randomly generated 512 bit salt.
2. An AES 256 master key is randomly generated
3. A master key 'checksum' is generated by running the master key through 10000 rounds of PBKDF2 with a new randomly generated 512 bit salt.
4. A random backup encryption IV is generated.
5. The IV, master key, and checksum are concatenated and encrypted with the key derived in 1. The resulting blob is saved in the header as a hex string.
6. The actual backup data is encrypted with the master key and appended to end of the file.

**Sample pack/unpack code implementation** (produces/uses) tar archives: https://github.com/nelenkov/android-backup-extractor

Some more details here: http://nelenkov.blogspot.com/2012/06/unpacking-android-backups.html

Perl scripts for packing/unpacking and fixing broken archives:

http://forum.xda-developers.com/showthread.php?p=27840175#post27840175

# Answer
> 8 votes
Great and detailed answer from Nikolay Elenkov. However I should added that somebody already develop a software that do just that and package it here: http://sourceforge.net/projects/adbextractor/

The package contains both Java and Perl tool. I myself prefer Perl over Java any day, so I extracted the Perl codes, make sure they are executable, installed the required Perl library, and run the `backupdecrypt.pl` against an adb backup file, and it convert it into a tar or gzipped tar file without any issue.

I even formed a one liner in Bash 3 that allow me to do adb backup directly to gzipped tar file:

```
adb backup -f >(backupdecrypt.pl -D -z - backup.tgz) -all

```

Hope it helps.

# Answer
> -3 votes
For explore existing backup file, try http://www.adb-backup.com page, it is simple without "dd", "tar", ...

Data is not stored on this server. I've developed this online service to make it easier to view backups without manipulating with dd / tar or installing additional software. I'm author www.adb-backup.com

---
Tags: backup, adb
---


title: Cannot connect: Obtaining IP address

text:
# Question
Title: Cannot connect: Obtaining IP address
*This is not a duplicate of 'Android stuck on obtaining IP address' and similar questions*

When I try to connect to my home network with my android phone, it displays this message and never connects:

```
"Obtaining ip address...".

```

This only happens when it tries to connect directly to the modem, rather than another access point (which is much much slower in my case).

I have followed tips online, the standard reconnect, reboot everything etc.; aswell as changing from DHCP to static IP. After assigning a static IP I successfully connect to the modem, but I have no internet connection. Rebooting and using different IPs does not help.

This problem is infuriating. Sometimes when I leave it for (DHCP) ages (10-20 mins) it manages to connect successful, but then the connection typically breaks down again maybe half an hour later.

The modem in question is a virgin media fibre modem, model EVW3226 manufactured by Ubee.

The internet works perfectly on all other devices we have, although sometimes it crops up on the Samsung tablet aswell.

The problem device in question is my Oneplus X running the latest version of oxygen (android 6.0.1 in this case) for this device.

# Answer
Does your modem have free addresses in dhcp pool? I didn't configure this model but I had some device with restricted internet access for static configured IP. anyway it's look like your dhcp server has some issues.
> 1 votes

---
Tags: wi-fi, internet, dhcp, ip-address
---


title: To report Youtube security bug

text:
# Question
Title: To report Youtube security bug
I found security vulnerability/bug on YouTube. I want to report. How can I report it? Is there a quick way?

# Answer
Being that YouTube is a product of Google, You can report the bug on Google's report security bug, page

From the page:

> If you have found a security bug in a Google product and want to report it to us, you've come to the right place. Please fill out the following form and we'll be in touch shortly. If this is a valid vulnerability report, it might also be eligible for a reward as part of our Vulnerability Reward Program. Thanks!
> 2 votes

---
Tags: security, youtube, bugs
---