title: How to deactivate headphone's buttons

text:
# Question
Title: How to deactivate headphone's buttons
I think my headphone or phone jack broke, and if I move the jack a bit, somehow the headphones activate the google assistant or pause the music, so this is from the button.

Can I deactivate it on a non rooted Huawei P8Lite (Android 6.0)

# Answer
Software wise: HeadsetBlocker & Wizdroid both attempt to block headphone buttons. However both are very outdated. Can install and try.

https://play.google.com/store/apps/details?id=com.idunnolol.headsetblocker&hl=en https://play.google.com/store/apps/details?id=com.yifandroid.wizdroids&hl=en

Hardware wise: You can try a 4 pole to 3 pole adapter to remove the microphone (I am not positive this will work)

https://www.amazon.com/LEMENG-Female-Headset-Extension-Cable-2Pack/dp/B01LRWO9GU/ref=sr\_1\_6?ie=UTF8&qid=1510759624&sr=8-6&keywords=3+pole+adapter
> 3 votes

# Answer
This solution certainly won't work for everyone, but if your headphones happen to have a removable cable: trying turning it upside down (plugging the phone end into the headphones and vice versa). With my particular cable this disables the controls.
> 0 votes

---
Tags: headphones, headphone-jack
---


# Question
Title: Is there any way to mass background restrict app battery usage?
My Pixel 2 has been experiencing severe standby battery drain (last night it went from 95-30 while I slept), and I'm pretty sure it's one of my apps' faults since it doesn't happen when I reboot the phone in Safe Mode. So now I'm trying to restrict most of my apps from using battery in the background, but it's a huge pain going through 50+ app battery usage pages to toggle their "Background Restriction" property. There's a page to disable app battery restrictions in Settings \> Battery \> Adaptive Battery \> Restricted Apps, but there's no way to add apps to that list. Is there a mass app battery management settings page/developer option I'm missing, or maybe an app that provides this functionality?

# Answer
I don't think there's anything else because all you have to do if you want to restrict background battery usage is to toggle the slider on all 50 apps which barely takes a minute. But if you want help for a longer lasting battery you should search for "Battery" on the google play store and you will find a lot of apps to help you.
> 0 votes

---
Tags: battery, battery-life, background-process
---


title: use a smartphone mic with a mixer

text:
# Question
Title: use a smartphone mic with a mixer
I need an app that makes the output jack audio of the smartphone coincides with what is picking up the microphone. In other words, I would like to use the microphone of the smartphone, like a normal microphone to be connected to a mixer. from an electrical point of view it is feasible, I was wondering if it was possible even on the software side.

has a similar app already been created?

# Answer
> 0 votes
> here's a built one that I'm talking about....

## Direct Download APK from my Google Drive

## New Mic2Aux.apk

* This version has control over the 3 pin - 4 Pin microphone, using audio source changing in settings.

Hope this helps clarify how it works.

* The microphone is recorded into a stream
* The stream is played via the headset or main speaker
* When using No headset, the Audio is looping from speaker to microphone continually getting louder.
* If using Aux cord, there's a delay between processing into a stream and then playing via the output.
* It does work as an example app on my device, however not efficient enough for realtime recording.

---
Tags: microphone
---


# Question
Title: Accessibility services get disabled automatically
This Christmas I gave a **Wiko Lenny 3** to my son, it comes with Marshmallow. When trying to install a parental control I sadly discovered that there's a bug (I suppose) that is well documented for Lollipop/Samsung, that prevents **accessibility services** to be activated.

In other words, as soon as I activate the parental control in the settings/accessibility/services option, it always appears off, although it's on, and resets to off randomly and at every reboot. This makes totally unusable the parental control.

The questions are:

* is there a fix for this? (Any solution with battery savings was tested with no success)
* is there a way to **understand**, via logs or monitorings, what is preventing the services to be activated?
* would rooting some how change something?
* is it safe or even possible to install a different and clean Android version?

# Answer
> 2 votes
Changing the launch setting to start manually and not automatically seems to work.

In Huawei devices, it can be found in **Apps - *app name* \- Battery - Launch**.

Battery saving options, on the other hand, didn't help in my case.

---
Tags: 6.0-marshmallow, accessibility
---


title: Error adding another Google account

text:
# Question
Title: Error adding another Google account
Device: T-Mobile G2 (UK) / HTC Hero OS: 2.1

I have a primary gmail account, a second Gmail account, and a Google Apps account. I'd now like to add another Google Apps account.

However, whenever I try, I get a "you don't have a network connection / This could be a temporary problem or your phone may not be provisioned for data services. lease try again when connected to a mobile network, or connect to a Wi-Fi network. If the problem continues, call Customer Care" message. However I've tried this from 3 cities, across a few weeks, from where I'm always able to access internet and Google accounts.

I presume there's no limit of 3, so what else can I try?

Edit - 3rd Jan - I just tried removing an existing (working) gmail account. I can't add the new account, or put back the removed account - new error is "Can't establish a reliable data connection to the server./This could be a temporary problem or your phone may not be provisioned for data services. If it continues, call Customer Care.". This is on WiFi and 3G - whilst the process was trying I received (pull) email! There's something really wrong.

# Answer
I tried again earlier today, and found it working. Cause of the fix might be: a) enabling multiple login on this account; b) migrating the Google Apps domain to the latest version; c) time, and it fixing itself.
> 1 votes

# Answer
I have 4 Google accounts, so no there's not a limit of 3. I'm guessing trying two Apps accounts is the problem. Try adding another standard (gmail) Google account and see if that works.

**Edit:** I'd try a factory reset at this point.
> 1 votes

# Answer
I did a Network reset on my phone, and it fixed this issue!
> 0 votes

---
Tags: google-account, accounts, htc-hero
---


title: VR Compatibility: Moto G6 vs E5 Play

text:
# Question
Title: VR Compatibility: Moto G6 vs E5 Play
I hope this is the correct place to ask this (they directed me here from Meta Exchange).

I'm starting to program in VR with Unity (for Android) and I'm looking to get a low-cost smartphone with VR support. My phone company offered me free either a Moto G6 Play or a Moto E5 Play.

According to their specifications, both are VR capable (gyroscope and motion sensor included). However, I've read mixed reviews online, so I would like to confirm if both are really VR compatible and which would be best for testing gaming related media.

# Answer
> 0 votes
Neither device is supported by Samsung Gear VR or Google Daydream

One of the requirements for Daydream certification is to have motion to photon latency of 22ms-25ms.

Curiously the Motorola Moto G6 is supported by Google ARCore which is expected to have sensors be calibrated in a similar fashion to Daydream

For everything else there is Google Cardboard which takes advantage of accelerometer/gyroscope on phone. As the sensor measurements/screen latency aren't strictly calibrated the experiences are more static and for brief sessions to avoid motion sickness.

---
Tags: motorola-moto-g, samsung-gear-vr
---


# Question
Title: What does it mean when appears a no Sim/SD Card when I turn on internet
I got a Lollipop 5017 A, and sometimes when I use the phone internet it appears a little ícon close to the internet one that shows a card with a diagonal risk as if the phone can't find the SD/SIM card (one of the two, I'm not sure which).

When I go to Settings \> Storage the option to activate SD card is grey and I can't click it. My question is: is this SD card (the one mentioned in the Settings) a external one (the black one that we can plug in PC) or is it a reference for the SIM card, like in the folder /storage/sdcard0 ?

# Answer
> 0 votes
It would help if you shared a screenshot of the same. But I'll try to answer your question,

1. The SD card mentioned in the Settings is mostly external
2. The icon that appears close to the internet icon is usually a sim card icon
3. The option to activate your SD card might appear grey if the SD card is not detected(if you have one) or not available.

---
Tags: 5.0-lollipop, internal-storage, sd-card, internal-sd
---


# Question
Title: Is there anything malicious with "play support libraries"?
I was doing my daily stuff on my Android Nougat.

And then something started downloading, "play support libraries". I think OK right. But the moment downloading stopped, and installation started my mobile's screen started showing a black screen for 2 secs with of an interval of about 5 secs. It continued for about 2 mins. And then the black screen was no longer appearing. But, now my phone started lagging.

So, I was thinking if that was indeed Play support libraries or something else.

I'd also noticed that the first character of any word was not capital, i.e. "play support libraries". Which is a small mistake *lazy* developers often make while making vulnerable apps with the name of any system app, e.g. "phone" / "settings", so the user doesn't notice, after the app gets installed silently, and can do its work without interference.

So, is there anything I can do to check if my mobile's safe or not?

# Answer
> 3 votes
**What are the Android Support Libraries?**

> The Android Support Library is a set of code libraries — resources that can be used to build features and/or functions into an app — that provide things like features or widgets that would normally require an actual Android framework API to include in an app.

The article goes on to state that:

> There are generally two types of support library packages. One set enables features of new versions of Android on devices running an older version and the other provides standalone features for all versions of Android. Because these aren't part of Android proper, they can be improved and updated without waiting for a major Android platform release.

**Why are the Android Support Libraries important?**

> we don't have to wait for the next version of Android to get an update if a feature is provided by the Support Libraries. This allows developers to add and improve how their apps work, especially on phones that don't run the current version of Android, whenever the libraries are updated.

Your device is not infected by a virus or something else. It is just Google deciding to update your device (even when did not want the update to add more features).

That said, on this thread from Google, there are other users who have noticed lagging the first few minutes after the update.

Source: What are the Android Support Libraries and why are they important?

---
Tags: security, google-play-services
---


# Question
Title: How do I record a video with a file size larger than 4GB on Galaxy S4 exfat SD card?
I've searched quite a bit and called Samsung tech support who didn't have any documentation on this issue. They all say that there isn't a limit on how much video you can record. I want to record class lectures, they run about 2 hours long. I set up the camera and tap record. Camera runs properly for about 30 minutes then says "Maximum File Size Reached" and stops recording. This happens to occur at a file size of 4GB about where you'd expect fat32 issues to occur. This is a Samsung SGH I337 from ATT Android Version 4.2.2

Here's what I've tried. The camera is set to record to the SD card. The SD card is exfat formatted. I can drop a 16GB .iso onto the card from my windows 7 computer through the phone via the usb cord with no issues. This leads me to believe there isn't a file size limitation from the format of the card. The SD card is NOT full it is a 65GB card with 40GB free.

Does anyone know of an app or a tweak that will let me record unlimited video within the real constraints of my hardware, 50GB's of 1080P video at a time or until battery failure?

Thanks for your time.

# Answer
> 1 votes
I would change the video quality settings to a lower rez and try again Leave it 16:9 At 1280x720 instead of 1920x1080. I would imagine your content will be watched on computers and iPads etc and not in imax theatres. You might get 2 hours out of that.

It is a stupid limitation . I'm in the same boat so I'll keep looking. Maybe there are some developer options to fiddle with.

Cheers

# Answer
> 0 votes
The issue is not about the file size but about the video length. Devices that can record videos longer than 30 minutes are classified as video-recorders in the European Union and are subject of higher import taxes. That is why manufactures of smartphones and compact cameras limit the maximum video length to 28-29 minutes - to avoid those higher taxes (and som eof them do so not only for EU market but for other contries for simplicity in production). So reducing resolution or bitrate will not solve the issue.

*PS. It is rumored that this regulation will be cancelled soon so the future smartphones will be "allowed" to record videos longer than 30 minutes. But as of now (Feb 2019) I couldn't find any reliable information about how soon it's going to happen*

---
Tags: sd-card, camera, video-recording
---


# Question
Title: Zenfone 2 Deluxe custom rom - question about model variants
My phone went dead and a friend gave me his old Zenfone 2 Deluxe, which comes with the terrible ZenUI and a million asus apps that are a pain in the ass. I wanna throw it away and install a custom rom, something as clean as possible.

When googling, however, I find a lot of custom roms for Zenfone 2 laser, and for Zenfone 2 Z00A. According to Google, Zenfone 2 Deluxe is ZE551ML, however in the settings it says the model number is Z00AD. I'm very confused about this.

Of everything posted on xda's zenfone 2 forum, it's very hard for me to understand which roms I can install and which I can't\shouldn't. Please advise, how do I proceed?

# Answer
> 2 votes
ZE551ML, Z00A, Z00AD and Z00AD\* (A/B/C) refers to the same device, as evident on ASUS' support page:

The custom ROM community would refer to this device as Z00A. Look for ROMs targeting this codename.

On a side note, the "Laser" variants have Qualcomm SoCs (SD410/SD615), vastly different from the regular/Deluxe variants.

---
Tags: asus-zenfone-2
---


# Question
Title: Is it possible to Unlock bootloader at phone with MIUI without registration?
Is it possible to Unlock bootloader at phone with MIUI without registration at: https://en.miui.com/unlock/

# Answer
> -1 votes
No, it is not possible. You must register.

---
Tags: bootloader-lock, miui
---


# Question
Title: Rear camera and flash tourch is not working!!on Nokia 3.1
I am not able to use Rear Camera and Flash Light in My Nokia 3.1. Front Camera Works Well. When I open Camera App, by default it Opens with Front Camera. Rear Camera Option is Not Found. (Front Camera works Perfectly Fine)

Even when i opened WhatsApp and Take a pic, only front camera is shown. No Button to switch To Rear Camera. (Front Camera works Perfectly Fine)

# Answer
> 0 votes
Seems like an hardware defect with the camera. If a restart doesn't fix it, then you can should bring it to a Nokia Care point.

---
Tags: camera
---


# Question
Title: How do I hide the SSID of an Android phone?
I sometimes use my phone as an ad-hoc WiFi network, however there is no option in the settings to hide its SSID. How can I achieve this?

# Answer
> 1 votes
You cannot hide AP SSID (stop SSID broadcasting or beaconing) through Android API.

SSID hiding depends on the kernel/WiFi-driver that you have on your phone. Only a few drivers (devices) support this feature. Also, a few drivers support monitor mode. Vendor-drivers have closed source which makes it difficult to add these features to them. See bcmon project for example.

Android API allows you to connect to the network with specific SSID (it may be hidden) programmatically. You should know network SSID and password (see this link about `WifiConfiguration` class and `hiddenSSID`, this link about `WifiManager` class, and these Stack Overflow answers: programmatically create WiFi Configurations, connect to a specific WiFi network).

---
Tags: wifi-hotspot
---


# Question
Title: Android Pie on Pixel 2 keeps wanting to restart
I bought a Pixel 2 a few weeks ago and upgraded it to Android Pie, but about every three days it comes up with a notification asking me to restart (I forget the exact wording of the message). Have done this about five times now. Any idea why this is happening and if there is a fix?

# Answer
It could be just your regular OTA updates. Pixel phones receive updates every month. And sometimes there can be more than 1 update in a month. These are monthly security patches which are delivered and installed to your phone automatically. The device then needs a reboot to finish installing the update. Depending on what software the device shipped from the factory, you'll receive several updates to come to the current build.

For example, if your phone shipped with the September 2018 security patch, the device will install October, November, December, January and February before resting on the latest release. After that it will be one security patch update every month.

The updates are incremental. So, you'll have to install all updates one after another. You cannot skip directly from September to Feburary unless Google pushed the full packages each month. The Pie update was pushed in August 2018. So it will be with August security patch. Now your device needs to update from August to Feb. I believe it should be almost done, if not, a bunch of more updates will finish the backlog.

You can probably finish all updates one after another by checking in Settings \> System \> Advanced \> System update after each reboot to ensure that you have finished installing all available updates.
> 0 votes

---
Tags: 9.0-pie, google-pixel-2
---


title: Does adb backup store all applications?

text:
# Question
Title: Does adb backup store all applications?
On my non-rooted phone first I did `adb backup -all -apk -obb -f lenovo.ab` and bit later `adb restore lenovo.ab` (both commands had no errors). Surprisingly I did not find quite a lot of apps after the restore. There are two options: these apps were not stored in the backup file in the first command or they were not restored in the second. To check the first option, I made a tar file from backup with `dd if=lenovo.ab bs=24 skip=1 | openssl zlib -d > lenovo.tar` (advice taken from Is there a way to look inside and modify an adb backup created file?) and did not find the missing apps there. So `adb` did not store them.

The question is why? Probably many of the missing apps (or even all of them) were not updated for a long time. Can this be the reason to discard the app from backup?

# Answer
```
# adb shell bu -h
 backup [-f FILE] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]
        [-system|-nosystem] [-keyvalue|-nokeyvalue] [PACKAGE...]
     write an archive of the device's data to FILE [default=backup.adb]
     package list optional if -all/-shared are supplied
     -apk/-noapk: do/don't back up .apk files (default -noapk)
     -obb/-noobb: do/don't back up .obb files (default -noobb)
     -shared|-noshared: do/don't back up shared storage (default -noshared)
     -all: back up all installed applications
     -system|-nosystem: include system apps in -all (default -system)
     -keyvalue|-nokeyvalue: include apps that perform key/value backups.
         (default -nokeyvalue)
 restore FILE             restore device contents from FILE

```

There are two important things to consider when backing up apps through adb. First, all those apps whose developers do not want it to be backed up are never backed by adb. This is done by declaring a flag (`allowbackup`) in app's manifest. Second, even if a developer wants their app to be backed up, they can decide on either full backup (`fullbackuponly`) or only the key/value pairs backup. This is again done through app's manifest.

In your case, only the apps with `allowbackup=true` and `fullbackuponly=true` were backed up. Installation age or last revision's age of an app has no bearing on adb backup.

If you are curious to know which apps couldn't be backed up, I suggest you try an app from user Izzy's extensive app inspection list. As of now, I'm not aware of any app which can sort and show the apps based on those backup attributes.
> 2 votes

---
Tags: adb, backup, restore
---


# Question
Title: Constant "<Untitled> Download unsuccessful." notifications
I'm constantly harassed by these *"\<Untitled\> Download unsuccessful."* notifications.

After taking the above screenshot, I cleared the entire notifications list. Within the next three minutes (usually even less), the list was already overflowing again.

I've learned to manage the symptom by navigating to the ***Download Manager*** application settings; hitting *FORCE STOP*, followed by *CLEAR DATA*, and *CLEAR CACHE*. Although the notifications slowly start showing up again. Just one at first, but gradually increasing in number with each occurance. Within a day or two, the numbers are usually back out of control.

I have no idea what it's supposedly attempting to download, or why. But whatever it is, it's not instigated by myself. I could just disable download notifications, but I'd rather identify the underlying problem and kill it directly. Needless to say, I'm not too keen on my devices automatically trying to download random mystery files from the internet. Any ideas? Thanks.

FYI: The device in question is a **ZTE Blade L5** smartphone.

# Answer
I think I solved my issue with constant "download unsuccessful" notifications. In the Puffin browser I went to settings and the download icon then erased all. Haven't seen an instance for quite awhile.
> 0 votes

# Answer
I found out what it was with es file explorer. On home, where it says recent downloaded files it will say what files around how long ago. Subtract those with the time current time and you've got your culprit. I hope this lasts. It was text now from panda helper
> -1 votes

# Answer
I have had this problem with the ZTE BLADE and found that if you go into *Settings › Notifications › Downloads,* then block the Downloads, it should stop the notifications after you clear them a couple of times. It worked for me.
> -2 votes

---
Tags: notifications, troubleshooting, download-manager, zte-blade
---


# Question
Title: Is it possible to flash a custom ROM without a custom recovery image?
For a non-rooted device, almost all articles/forum posts I've read say that in order to flash a custom ROM you first **need** to flash (or boot) a custom recovery image like TWRP.

I'm not sure I understand why. If the bootloader is unlocked, shouldn't it be possible to manually flash images that make up the custom ROM to the required partitions with `fastboot flash <partition> [ <xxxx.img> ]`, and leave the stock recovery untouched.

I realize that this may be difficult and that there is no benefit in doing it this way, but I'm curious to know whether or not it is possible, and if not, why?

# Answer
> 2 votes
This question isn't as straightforward as it seems. The answer really depends on the contents of the custom ROM zip (assuming it comes in zip format) that you're trying to flash.

Most custom ROMs are not provided as image files. While almost all custom ROM zips include a boot.img which includes the kernel and is fastboot flashable, the system portion is where you run into an issue without a custom recovery. Stock-based custom ROMs typically include system files in a folder, which a custom recovery (like TWRP) will then extract to the system partition of the device. There is no way to complete that operation via fastboot. In order to flash such a system using fastboot, you would have to create an empty image based on the size of your system partition, format it using the expected filesystem for your device, loop mount it to a folder (if using a Linux system - in Windows you may have trouble finding a tool to do this, though OSFMount *may* work), and then copy the contents to that folder, so that they are included in the image. Once you unmount the image, you'll have a raw system image of the custom ROM that is flashable via fastboot. See an example of this process described here.

For AOSP-based custom ROMs, system files are typically included as a block-based full OTA dat (or dat.br) file. These can also be converted into an image file, using a tool like sdat2img for a dat file, and the same tool for a dat.br file, after using the Brotli tool to decompress it.

As you can see, while it is *possible* to flash a custom ROM without a custom recovery, it's certainly simpler to use one, especially since most custom ROM zips are built with the expectation that a custom recovery is how it will be installed.

# Answer
> 3 votes
Yes it is possible to flash images via Fastboot ?

With an unlocked bootloader you should be able to flash some partitions without overwriting the stock recovery, however each system usually requires a unique recovery to handle factory resets etc..

I have had issue's in the past with Maximum flash size, it wouldn't let me use Fastboot because my system.IMG file was too large to send via Fastboot.. That then required splitting the image into smaller files and flashing the smaller files.

You don't specifically need a custom recovery, however it makes everything a lot easier... For example, most custom firmware requires you to do a full backup of your device prior to installing, you need a custom recovery or rooted device to be able to make a full backup...

Why do they say " Use a custom recovery " ... Well this is probably determined by the firmware creator, they've most likely built everything into a single Flashable Zip file, using Fastboot won't work because the zip file contains more than just .IMG files, usually a ZIP firmware will have a folder called system, the system folder is copied to your device by the recovery, not flashed .. each firmware usually contains 3 parts ( boot.IMG, System folder, additional files)... However some firmware's contain a complete system.IMG file instead of a folder.. These files can be pulled from the firmware and flashed via Fastboot, however Fastboot can not flash folders ( only a custom recovery can do that )

... I'm starting to get lost here...

---
Tags: recovery-mode, custom-roms, fastboot
---


title: Question about recovery log

text:
# Question
Title: Question about recovery log
i got a brand new nokia phone a few days ago. The phone and box was in new condition except a tiny bit of dirt/gunk on one of the metal rim/side of the phone.

This got me thinking as to whether the phone might be refurbished, so i took a look at the recovery menu and noticed that the View recovery logs already had a log inside it. The first line says, 'Started recovery on Tue 27 Jan....' I am guessing the date is the default 27 Jan 1970 a lot of folders on the phone have currently.

My question is: Are brand new phones supposed to have this recovery log file, or is this an indication that the phone is refurbished?

Thanks a lot for the help

# Answer
The recovery should essentially have logs. The factory also tests the device sensors and hardware for normal functionality. So, I'm guessing one of those tests would also be about checking that recovery mode is accessible or not.

You should check for warranty in the Nokia Support app and I wouldn't worry if it shows the device in warranty.
> 0 votes

---
Tags: recovery-mode, data-recovery
---


title: Stuck in system recovery

text:
# Question
Title: Stuck in system recovery
I have a hTC *D626w*, after an interrupted update, it does not boot any more. When I enter recovery mode, I see the following message at the bottom of the page:

```
No file end with factory_update.zip found in SD card.

```

The message persists after removing the SD card.

I chose **wipe cache partition** and **wipe data/factory reset**. But after selecting **reboot system now**, a white page appears on which I see hTC.

Does anyone know what's wrong with my device?

# Answer
> 1 votes
Interrupting an Android update is not a good idea as your device is now in an "in between" state that is not usable.

Most likely you have to flash a complete factory image (also called RUU image) of your device to recover it.

Usually HTC devices support fastboot, which should allow to flash such an image to your device. Check the HTC ROM Download page for an image matching your specific device.

# Answer
> 0 votes
## A system update could have been making important system configuration changes when it got interrupted.

You should have an incomplete ( Corrupted ) system, this is why you should never interrupt a System firmware update.

## What to do now ?

* First you need to unlock your bootloader at the HTC Dev website
htcdev.com/bootloader
* After that, you can try to repair your device via Fastboot by flashing the stock images back.

Considering the information I found suggest that you still have the update.zip and you might have a MTK CPU.

* You can alternatively try to flash the Firmware using SP Flash Tool v5.17 or above.

You will need to extract your Update.zip file and find any .IMG files... E.g, boot.img, recovery.img and especially system.img

If you can find boot.img, try to flash that with Fastboot first... Then try the rest...

If you have an update that contains folders, you will have difficulty installing it without a custom recovery.

With SP Flash Tool, you DO NOT need to unlock your bootloader, as you can flash the bootloader also.

I can find only a few ROM - Firmware online, however the firmware I found doesn't have Gapps included ( Google Apps ) ...

Do you have an MTK CPU ?

---
Tags: boot
---


title: Oem unlocking not allowed

text:
# Question
Title: Oem unlocking not allowed
I am getting an error while trying to unlock the oem. The error reads as Oem unlocking is not allowed. I have yu yuphoria 5010a. And in oem device-info fetting as device tampered - false. Please help asap.

Thanks, Dev

# Answer
You need to enable the option "OEM Unlocking" in the developer options. Provided YU allows you to unlock the bootloader, the switch will be enough for you to go back to fastboot mode and issue the OEM unlock command.
> 2 votes

# Answer
Just to clarify.
You need to enable OEM Unlocking in Development Options

Steps,

1. Open Settings
2. Open About ( or more, then About )
3. Locate Build Number
4. Tap Build Number 7 times
You should see, You are now a developer.

After that, you will have a new option in settings, called Developer Options.

Open Developer Options and look for OEM Unlocking.
> 1 votes

---
Tags: micromax-yu-yuphoria
---


# Question
Title: What position do cellular communcation (1G, 2G, 3G, 4G or other function only implemented in phone) play in Android operating system archtecture?
I am entirely new to Android, but have a little knowledge on Linux.

I have view the architecture graph of android on official site:

# The Problem:

Not all android device support cellar network. As a result, it isn't shown in graph. **But which layer is actually cellular networking (and other function related to SIM card) drivers in**?

# Analysis:

If it is in kernel layer, it means that there should be an independent kernel repository or patch specific for cell phone other that tab computer, smart television and music player. It would not be a good design of architecture and will be difficult to maintain.

If it is in HAL, it means that wrong driver won't affect the booting process, instead, it will only make cell phone unable to connect to cellar network. While the other application and GUI should be run properly, because the init system will skip the error units. However, it is actually not true.

# What I have done:

I have a Samsung Galaxy Note II GT N7108 (China Mobile) (Use **TD-SCDMA**) which I bought from China. I download and flash two firmware package (Official Samsung ROM for AT&T device and Lineage OS 14.1 for NOTE II LTE). But the result is the same, the device is unable to boot and keeping no change on startup screen.

# Update 1:

According to the wikipedia link provide by '@Morrison Chang', it is said that NOTE II for China Mobile use Snapdragon SoC. However, it should be noticed that, the model use Snapdragon SoC is GT-N7108D instead of GT-N7108. GT-N7108 use Samsung Exynos 4412 as its SoC.

# Answer
> If it is in kernel layer, it means that there should be an independent kernel repository or patch specific for cell phone other that tab computer, smart television and music player. It would not be a good design of architecture and will be difficult to maintain.

Bingo. Lots of device specific stuff are in binary blob drivers which only work for specific devices. Android has no common platform like a PC. Those drivers are held by the device manufacturers or system-on-a-chip vendors.

See: Why is it that Android still can't be installed as regular OS?, and Why are there not generic phone OS installers?

Based on this article from LWN.net: An update on the Android problem is seems like the Android kernel problem is improving, but architectural changes like Project Treble would only benefit devices already integrated with those changes.

And so posts like Is there a technical reason Android update story is so bad? will remain valid for some time.

If you wish to go down deeper, at least be aware of the content in the AOSP Architecture documentation

**Yes, but what about cellular radio**

Mobile telephony radio is managed via a baseband processor which will have its own CPU/RAM/Firmware. Control communication appears to be done by serial AT commands. Realize that baseband processors may differ based on device model.

For more detail see: How mobile OS talks to baseband OS and How does Modem code talk to Android code

**But why doesn't it boot?**

Flashing software that isn't specifically designed for the hardware could/would result in bricking. A quick check of the specs for a Samsung Galaxy Note II shows two different CPUs - Exynos and Qualcomm. While both may run ARM code, the internal architecture is different: i.e. number of cores, GPU driver, camera driver, memory layout etc. Putting a US AT&T firmware, designed for Exynos, on hardware for China Mobile, containing Qualcomm, is guaranteed won't work.

**Response to Update 1**

While the CPU chipset may be the same, GT-N7108 radio band support for the USA is poor with no 3G bands, which means that the physical baseband processor would be different for Galaxy Note II models marketed and sold in the USA. As part of the boot process, the baseband processor is checked (further details in prior links), that could easily result in a non-operational state.
> 1 votes

---
Tags: boot, system, kernel, operating-system
---


title: Removing images created by Linux Deploy

text:
# Question
Title: Removing images created by Linux Deploy
I have SM-G900F on Lineage Oreo. I installed Linux Deploy and left the path to `${EXTERNAL_STORAGE}/linux.img`, and I removed the app for a second time. Now, I still have the `linux.img` in my memory, but I can't delete it because I don't know the path to where was it created, while in the installer app can't find it.

Going to Settings -\> Storage and tapping on Linux Deploy doesn't work, I can't see more than 50 MB used for it.

What can I do?

# Answer
I made it to delete the file using ES File explorer.
> 1 votes

---
Tags: applications, files, delete
---


title: How to have microG works on Havoc OS?

text:
# Question
Title: How to have microG works on Havoc OS?
Long story short, **microG** is supposed to take advantage of **signature spoofing** in order to do his magic. But I couldn't make this happen.

---

Context :

I just did a clean install of **Havoc OS** (**Android Pie**) on my **Oneplus 3** using this thread.

This distro is supposed to natively support Signature Spoofing, as it claims in its features list (twice). And migroG is officially supported. But there's no support provided on SourceForge (official website for Havoc OS) and the way to contact the dev is Telegram (which I don't use).

---

What I've tried ?

There is a switch available in the **Settings** app, and according to the terminal, it's working : `settings get global allow_signature_fake` returns 1 or 0, depending on that switch.

However, when trying to check with microG or with this checker I get a negative answer.
You can see it on these screenshots :

Over the 600 pages of the official thread, I saw other people having issue with this but noone really have a working solution.

Some said they used a Magisk module called NanoDroid, but in its today's version, this one detects that the distro already allow it and do nothing. Plus, I read this override on distro natively supporting it is not recommended anyway.

According to this thread :

> LineageOS for microG since December updates refuses sigspoof to work when the permission is not defined in privapp-permissions, this is now the case (on all ROMs with native sigspoof support)

As Havoc OS is based on LineageOS, I've tried that too.
I've then installed a magisk module called \[Terminal\] App Systemizer and use it to swap both apps (Checker and microG) to `/system/priv-app`.

Then after reboot I've got some progress : Signature Spoofing Checker still says "Disabled", but microG show one more checkbox filled (*System grants signature spoofing permission*). See the screenshot :

Now I'm stuck and have no clue were to go next. Any idea ?

# Answer
> 2 votes
Havoc Os v2.2 is out, (see on xda thread for Oneplus 3/3T)

This version correct the problem and everything works as expected now.

---
Tags: custom-roms, 9.0-pie
---


# Question
Title: Huawei Phone Ram replacement, flash rom?
My friend's phone died with no signs of life, the repairs shop diagnosed it to have it's ram chip failed and they say that all the data will be lost after repair.

Does it need to have its ROM reflashed after the ram chip replacement?

# Answer
> 1 votes
All the data will likely be lost, in fact, the phone will likely even have a new IMEI after the repair. The exception would be any data on an SD card as long as it is not adopted as internal storage.

These individual components, such as RAM, storage, radios, etc, are generally not replaceable even in an authorized factory repair facility. The standard practice for this "repair" would be to replace the mainboard of the phone. This action is similar to replacing a motherboard in a laptop, when it is done it is essentially a new device in the same original shell. Any data or information currently on the existing device will be lost as the "guts" will be replaced with new.

---
Tags: rom-flashing, hardware, huawei, ram
---


# Question
Title: MAM and Android: fingerprint option never shown
We're trying to configure Intune so that people with Android devices can access their corporate email through Outlook for Android. In the Access Requirements blade (dashboard \> client apps- app protection policies \> intune app protection - properties), we've activated PIN (including simple PINs) and fingerprint for accessing the apps.

Whenever a user tries to access the corporate email through Outlook, it's prompted to install the Intune app (company portal app) from the store. After doing that, the user is asked for a PIN after setting up the corporate email account in Outlook. After the specified timeout, the user will be asked for a PIN again. However, the app never allows the users to use fingerprints to unlock the app. It will only allow the user to enter the PIN.

The Intune portal seems to imply that I should be able to use a fingerprint (instead of a PIN) to access the mail, but we've tried it on a couple of Android Devices (OnePlus 3T and 5T) and the fingerprint option is never shown.

Any ideas on what's happening?

Thanks.

# Answer
> 1 votes
In order for it to work, you need to create a work profile and associate the fingerprint to that profile.

---
Tags: fingerprint, android-enterprise, microsoft-intune
---


title: Hotspot issue, connected, no internet

text:
# Question
Title: Hotspot issue, connected, no internet
I have an issue in my phone, and I lost hope I will find solution.

```
Phone:
* Xiaomi Redmi Note 4
Android Version:
* 7.0 NRD90M
MIUI Version:
* MIUI Global 10.1
Kernel Version:
* 3.18.31-perf-g4339b70

```

The problem: I share internet via hotspot and everyone can connect to it with any devices but when I connect my tablet (Galaxy tab) or my other phone (OP 5T) I got an exclamation mark next to my wifi and "connected, no internet".

I don't understand why. Can somebody help me what is the problem?

# Answer
> 0 votes
What is the thing that provides you internet ?

Wi-Fi or cellular data ?

if its wifi Android devices auto-disconnect from the wifi so they can host you Hotspot

if its cellular data then i dunno !

---
Tags: connection-issues, wifi-hotspot, xiaomi, redmi-note-4
---


# Question
Title: Can I use my android phone as finger print, webcam, and mic for my windows 10PC?
I suppose I can buy a mic, a webcam, and a finger print censor for my windows 10.

But I have all those in android phone already.

Is there an easy way to do so?

# Answer
**As for the camera and mic part**,

If you simply search the web for phrases like *"use Android camera/mic on PC"*, you will come across many apps; some of them actually do the job.

I have used an app called DroidCam in the past which had worked for me in Windows 7 after a litte bit of struggling. (I have never tried it in Windows 10, though; but I guess it should work)

**As for the fingerprint reader part**,

There is not a solution which can be assured to work flawlessly. But there are some things which might be helpful :-

* **Dynamic Lock** by Microsoft — If you are simply looking for a solution to unlock your PC using your phone, then this might be the solution for you. Although it doesn't specifically use a fingerprint unlock, it allows you to keep your PC unlocked when your phone is close enough and reachable via Bluetooth.
* **Third-party solution** — There is an app called Remote Fingerprint Unlock which is slightly complicated to set up but will do the job for you.
* **Samsung Flow** — If you happen to have a Samsung Android phone, then this solution from Samsung should work for you.
This app has also been ported to non-Samsung devices by some developer(s) but the Fingerprint unlock functionality **does not** work on non-Samsung devices yet.

(Mentioning the below content just for the sake of completeness; doesn't answer this question)

* **Google Smart Lock for Chromebooks** — This is a solution provided by Google to unlock your PC with a fingerprint scanner on your phone. However this only works on Chrome OS (v71+) and not on any other OS.
> 6 votes

---
Tags: fingerprint
---


title: actual limitations of locked bootloader

text:
# Question
Title: actual limitations of locked bootloader
I have read in many posts that a locked bootloader prevents from flashing custom ROMs, because it checks the digital signature of the ROM itself.

I thought a "bootloader" was only responsible for *loading* an image at startup, thus a locked one would refuse to load an unsigned image.

Therefore, wouldn't it be more accurate to say that a locked bootloader refuses to *load/boot* an unsigned image, but it cannot do anything to prevent one from *flashing* that image ?

Of course flashing something one cannot boot does not make any sense, but that is not the point of my question. I just want to learn exactly what the locked bootloader on a phone does.

# Answer
> 1 votes
Your statement is correct. :) The bootloader **can't** prevent images from being flashed, it just prevents unsigned images from loading. My answer to this question has some detail on the way locked/unlocked bootloaders work.

For example, if we consider "SP Flash Tool", an application that communicate with the bootloader of MediaTek devices to flash images, the lock status of the bootloader **does not** affect ability to flash. (It is still possible to block flashing by only allowing signed binaries to communicate with the bootloader) But still, if an unsigned image is flashed, the bootloader will refuse to load the image.

Still, usually images are flashed using Fastboot (even when there are more options to flash like "SP Flash Tool") and quite a lot of devices only have Fastboot as a known flashing method. Some common exceptions include Samsung, and MediaTek devices. And Fastboot checks most of the time if the bootloader is unlocked, and only lets flashing images if it is. (Same goes for Odin, the flashing application for Samsung devices. It only lets flashing when bootloader is unlocked) So, unless there is a secondary way to flash, it usually is not possible to flash with a bootloader unlocked.

---
Tags: boot, bootloader, bootloader-lock
---


# Question
Title: Note 8 dies when battery is drained completely
the samsung galaxy note 8 dies when battery is drained completely and it wont start or charge unless the battery is pulled and charged and pushed back again. Why this happens and is there any solution for it ?

# Answer
> 0 votes
Since it's a Note 8, it MAY still be covered by a warranty. If so, take the phone to the store you bought it, they should look it up for you, and if it needs any repair they will take care of it, since as far as I can tell it's not your fault.

---
Tags: samsung, battery, unbricking, samsung-galaxy-note-8
---


title: Second Google Account for Phone

text:
# Question
Title: Second Google Account for Phone
I have a **second** Google email address for business. I would also like to be able to upload business photos / media to the HOA account with photos: can this be done and how?

I have added the 2nd Google account to the phone successfully, but attempts to share photos (via Google-Photo app) presented only the one (the original) Google account.

# Answer
You have to add the second Gmail account to the Google Photos app separately. You can upload photos to this account by switching to it from within the app.

To add the account just open the hamburger menu from the left of the Google Photos app, click on the downward facing arrow next to your user name and then select the Add account option.
> 1 votes

---
Tags: google-account, google-photos
---


# Question
Title: "Failed to send message. Review message and try again" when sending SMS to short code from Samsung Galaxy Note8
When trying to send SMS to short code recipients like 567676, 56161, etc. from Samsung Galaxy Note8, I got the following error message:

> Failed to send message. Review message and try again.

I've tried entering the correct SMSC number, allowing premium access, nothing has worked. I tried the SIM in another phone., I couldn't send it from there too.

I'm able to send SMS to normal phone numbers.

How to fix this?

# Answer
> 3 votes
I had the same issue, turns out the problem was due to my mobile balance. I had unlimited recharge package which always showed 0 balance hence the messages were not going out for these kind of numbers that are chargeable. I recharged my mobile and voila, the message got sent.

---
Tags: samsung, sms
---


# Question
Title: What is the difference between Factory Images and Full OTA Images on the Android download site?
On the Android Developer site you can download Factory Images or Full OTA Images.

What are the exact differences between them?

# Answer
> 11 votes
Factory images are meant to be flashed using fastboot or alternative low-level tools or environment. They come with batch and shell scripts to automate flashing. Flashing them requires a device's bootloader be unlocked (is considered a data security risk by OEMs). Flashing factory images in entirety **would always** delete user data, unless the user has taken precaution before flashing, such as excluding userdata partition from the script or running other available and relevant scripts.

On the other hand, full OTA images are over-the-air updates that are to be flashed via recovery environment or seamlessly in A/B supported devices. OTA updates are usually either incremental or full. Incremental updates require the user to be running a specific Android build (not just Android version) as they increment in the existing build only. On the other hand, full OTA updates don't require a specific existing build to continue. They are handy when a user hasn't updated their system for a long time and wants to skip successive incremental updates. In addition, per an answer here from beeshyams, any full OTA *in theory* should carry all the previous security patches made available up to the release of that OTA.

I myself had jumped from an Android 9 build to an Android 10 build using a full OTA on a OnePlus 6 even though there were a couple of incremental builds between those two builds.

---
Tags: rom-flashing, stock-rom
---


# Question
Title: Phone stuck in Safe Mode (Volume Keys not functioning)
Recently my Samsung Galaxy E7 entered into Safe Mode. My volume keys are non functional. Can someone please suggest a way to get out of Safe Mode using ADB.

# Answer
The problem was resolved. The volume keys were internally shorted leading to infinite boot into safe mode. Repairing the keys worked out.
> 0 votes

---
Tags: adb, shell, safe-mode
---


# Question
Title: How do I move gigabytes of data from my computer to my phone's SD card?
I'm trying to put my music collection (~37GB) onto my android phone's SD card via USB cable and MTP. It has to go on the card, because my phone's internal memory is not capacious enough.

I've tried drag and drop, rsync, cp, etc. (OS is Linux, phone is Galaxy S8)

Once I get about ~15 GB of data in the directory I can't even ls it or look at it in the GUI file browser, much less add more. Attempting to do anything at that point seems to crash the filesystem driver.

Googling the problem seems to be useless, I just get a bunch of basic tutorials on transferring data with no mention of problems or scope.

Is there some known way to accomplish this short of yanking out the SD card and loading things onto it directly? Am I just weird for trying to copy such a large amount of data via USB/MTP?

# Answer
> 2 votes
I put the SD card in the computer and drag & drop there. I have a SD slot and use a uSD to SD card adapter. Try dragging smaller chunks vs all at once. I have a 64GB card and drag 20-30 folders at a time, each folder being a complete album. Getting ready to install a 128GB card and do it all again to hold about half my music collection.

# Answer
> 0 votes
Was able to do it no problems on a borrowed Windows 10 box. Not that such an answer is very pleasing to a linux enthusiast.

---
Tags: data-transfer, mtp
---


# Question
Title: How can I configure a separate MMS APN on LineageOS
Some mobile phone providers (e.g. Optus, including MVNOs that deliver service through Optus' networks) have a separate mobile APN (access point name) for sending MMS to what is used for mobile data.

However, the user interface in LineageOS (and probably other Android variants) does not seem to let you configure two APNs.

Through the UI, under Settings -\> Network & Internet -\> Mobile network -\> Advanced -\> Access point names it is only possible to select a single APN as 'preferred'.

How can I configure my MMS APN at the same time as my data APN?

# Answer
Firstly configure the mobile data APN through the UI and verify that is working.

Next, we will need to configure to MMS APN without using the API. To do this, you will need access to the phone through `adb`, and you will need a rooted phone (see other posts on how to do this if you don't already have that). All of the commands could alternatively be performed on the device itself through a shell.

In Android, the different networks that can be configured are identified by a 'subscriber ID' or subId. The first step is to find the correct `subId` to use.

If you haven't already, restart adb as root using `adb root`.

Now find the `subId` already in use for data with:

```
adb shell content query --uri content://telephony/carriers/preferapn

```

Look for the part of the line that looks like `sub_id=3,` \- you may have a different number in place of 3. That is the subId for mobile data - not the one we want to use, but useful for elimination. Also make a note of the `_id` number and the `numeric` from the response - you will need those in another step.

Run `adb logcat -d -e "matching subId"` and look at the subIds that come back. If you only have one SIM enabled, but you need to enable a separate network for MMS, you should see two different numbers in the results. Eliminate the one that matches the mobile data subId. This is the subId you will need to configure (in my case, it is 2).

Now list the options with

```
adb shell content query --uri content://telephony/carriers/ --where "numeric='50502'"

```

(replacing `50502` with the numeric you recorded from the earlier query). In the results, find the row that matches the APN you want to configure. In the Optus case, the row will like something like

```
Row: 5 _id=2912, name=Optus MMS, numeric=50502, mcc=505, mnc=02, apn=mms, user=*,
server=*, password=*, proxy=202.139.83.152, port=8070, mmsproxy=61.88.190.10, mmsport=8070,
mmsc=http://mmsc.optus.com.au:8002/, authtype=-1, type=mms, current=1, protocol=IP,
roaming_protocol=IP, carrier_enabled=1, bearer=0, bearer_bitmask=0, mvno_type=,
mvno_match_data=, sub_id=3, profile_id=0, modem_cognitive=0, max_conns=0, wait_time=0,
max_conns_time=0, mtu=0, edited=0, user_visible=1, user_editable=1

```

If there are several options and you are not sure which one, you could try each one in turn using the following steps. Note the number after `_id=` \- that is your APN ID you need to configure.

To configure the MMS APN, use the command

```
adb shell content insert --uri content://telephony/carriers/preferapn/subId/2 --bind apn_id:l:2912

```

Replace the `2` with the subId you worked out you needed to configure (i.e. the one that is not the mobile data subId). Replace the `2912` in the above with the apn\_id from the above command.

If you configured the APN successfully, you should now be able to send MMS and use mobile data at the same time.
> 0 votes

---
Tags: mms, apn
---


# Question
Title: Phone turned off for empty battery. Now it gives "No command"
My **non-rooted** phone (**Morotola MOTO G5s Plus**, bought just 2 months ago) just reached the 1% battery and automatically Powered Off.

I charged it for some hours. Tried to turn it on but just the flash icon of charging kept staying. Disconnecting the charger didn't make the icon disappear.

So I pressed the Power button for 10 seconds till it turned off.

It automatically restarted, but now it doesn't load anymore. I wait for a while and the I get just the *"No Command"* recovery mode.

I tried to *"Wipe cache partition"* already. No luck. I tried to *"Run the Graphics Test"*, but it gave quickly \*"Installing system update" -\> Error -\> "Erasing" -\> "Installing system update" (and a really graphical animated logo; so graphic looks fine) and then comes back to the menu. After that it still doesn't load, and running the test again does the exact same thing.

What just happened? Did my phone broke just because of empty battery?

How do I resolve? How do I prevent data loss?

# Answer
I didn't really solve the problem, but I just tried to be sure that the phone was rebooting **really** from scratch (the purpose of *resetting*).

I went in recovery mode and I tried choosing "Power off" this time. After that it didn't try to reboot automatically as all the previous times.

I waited a little and then powered it on. Magically it booted correctly and without any issue
> 1 votes

---
Tags: recovery-mode, battery, data-recovery, bootloader, motorola-moto-g
---


title: Firefox wants to record video/audio

text:
# Question
Title: Firefox wants to record video/audio
I have an Xperia Z5, running 7.1.1.

When I browse the web using Firefox, I keep getting requests from Firefox to record audio and take photos/videos. Both requests always happen together, in that order. I can't think of any reason why it would need to, but it does seem to happen only when I'm on pages with a lot of ads. I deny it every time, of course, but I don't tell it not to ask again, because I want to know when a request comes through.

So, my question is, is this normal? Could ads get Firefox to record video and audio, and if so, why would they? Or, could this instead be evidence of malware/a compromised device?

# Answer
When the pop-up appears, there would be an option of "Dont ask me again", check that and it will never appear again.
And if for some reasons you need that allowed later, you can give it permission by going to **Settings**\>**Apps**\>**Firefox**\>**Permissions**, switch on the permission for particular service you need.
> 0 votes

---
Tags: security, firefox-for-android
---


# Question
Title: Reduce space between icons on home screen without changing icon size
I would like to **reduce the space between the app-icons on my home screen without changing their size**, so that I could fit more icons on one screen. The size of text or buttons in menus should not be affected.

I‘m using Android 7.1 (with LineageOS 14.1) and a solution with adb would be ok.

The „Home Screen Settings“ give me the opportunity to turn off icon labels and I can modify the “Grid size” to from “Comfortable” to “Cozy” or “Condensed”, but that does reduce the icon’s size.

I tried changing the screen resolution:

```
adb shell wm size 1080x1920

```

as well as changing the density:

```
adb shell wm density 250

```

but both changes the size of the icons.

I attached a screenshot to illustrate how much space there would actually be left on the screen for more icons.  Thank you for any suggestions!

# Answer
> 2 votes
Reducing the gap also reduces the sizes. If you are using the default launcher Trebuchet, you should also see `Custom` in the Grid Size settings. Clicking it allow to set the number of icons per columns and rows. Select a high number for colums and rows.

Confirm your choice, then go back to the Home screen and rearrange the icons. You will be able to fit as many icons as you selected in the settings. The gap between them will be reduced.

If 7x7 is not enough, you can use other launchers. Nova launcher for example allow a 12x12 grid.

**Note:** I am not related to Trebuchet nor Nova launchers developers.

---
Tags: adb, screen, 7.1-nougat, home-screen, app-icons
---


title: Nox player sound not working?

text:
# Question
Title: Nox player sound not working?
I just installed Nox Player with Android 4.4.2 and at first, its sound was working. I played some games, but after some hours as I closed it and restarted it, since then at starting the sound first played, and then in 2 to 3 mins it goes off. To listen to the sound again, I have to restart the player, and then again in 2 to 3 mins, it does the same.

Any solutions?

# Answer
> 0 votes
Just go to properties of nox.exe and then compatibility mode and Uncheck "Run this program in compatibility mode for windows 8" and Check "Run this program as an Administrator"

this work for me hope work for you also

---
Tags: audio, noxplayer
---


# Question
Title: How to run DNSCrypt as a background service on Android?
I've installed an unofficial lineage OS 14.1 ROM on my phone and i want to have dnscrypt used on boot by default.

There is what i have done:

1. Download arm binaries from: https://github.com/jedisct1/dnscrypt-proxy/releases
2. Push dnscrypt-proxy in /system/xbin
3. Push dnscrypt-proxy.toml in /etc/dnscrypt-proxy/
4. Created the following script: /etc/init.d/99dnscrypt

```
#!/system/bin/sh
log -p i -t dnscrypt "Starting dnscrypt-proxy..."
dnscrypt-proxy -config /system/etc/dnscrypt-proxy/dnscrypt-proxy.toml &
log -p i -t dnscrypt "Changing dns with iptables..."
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:53

```
5. Reboot

Now if i launch 99dnscrypt as root from adb it works like a charm

But on boot it does not.

On logcat i see this errors:

```
02-07 01:00:22.369   267   267 I sysinit : Running /system/etc/init.d/99dnscrypt
02-07 01:00:22.540   275   275 I dnscrypt: Starting dnscrypt-proxy...
02-07 01:00:22.878   278   278 I dnscrypt: Changing dns with iptables...
02-07 01:00:23.236   277   277 W dnscrypt-proxy: type=1400 audit(0.0:28): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:23.236   277   277 W dnscrypt-proxy: type=1300 audit(0.0:28): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=274 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:24.238   277   277 W dnscrypt-proxy: type=1400 audit(0.0:45): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:24.238   277   277 W dnscrypt-proxy: type=1300 audit(0.0:45): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:28.242   277   277 W dnscrypt-proxy: type=1400 audit(0.0:82): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:28.242   277   277 W dnscrypt-proxy: type=1300 audit(0.0:82): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:29.233   277   277 W dnscrypt-proxy: type=1400 audit(0.0:94): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:29.233   277   277 W dnscrypt-proxy: type=1300 audit(0.0:94): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:30.234   277   277 W dnscrypt-proxy: type=1400 audit(0.0:105): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:30.234   277   277 W dnscrypt-proxy: type=1300 audit(0.0:105): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:31.235   277   277 W dnscrypt-proxy: type=1400 audit(0.0:121): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:31.235   277   277 W dnscrypt-proxy: type=1300 audit(0.0:121): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:32.236   277   277 W dnscrypt-proxy: type=1400 audit(0.0:145): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:32.236   277   277 W dnscrypt-proxy: type=1300 audit(0.0:145): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:33.247   458   458 W dnscrypt-proxy: type=1400 audit(0.0:146): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:33.247   458   458 W dnscrypt-proxy: type=1300 audit(0.0:146): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:34.248   458   458 W dnscrypt-proxy: type=1400 audit(0.0:147): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:34.248   458   458 W dnscrypt-proxy: type=1300 audit(0.0:147): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:35.249   458   458 W dnscrypt-proxy: type=1400 audit(0.0:148): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:35.249   458   458 W dnscrypt-proxy: type=1300 audit(0.0:148): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:36.250   458   458 W dnscrypt-proxy: type=1400 audit(0.0:149): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:36.250   458   458 W dnscrypt-proxy: type=1300 audit(0.0:149): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:37.251   458   458 W dnscrypt-proxy: type=1400 audit(0.0:150): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:37.251   458   458 W dnscrypt-proxy: type=1300 audit(0.0:150): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:38.242   458   458 W dnscrypt-proxy: type=1400 audit(0.0:151): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:38.242   458   458 W dnscrypt-proxy: type=1300 audit(0.0:151): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:39.244   458   458 W dnscrypt-proxy: type=1400 audit(0.0:152): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:39.244   458   458 W dnscrypt-proxy: type=1300 audit(0.0:152): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:40.245   458   458 W dnscrypt-proxy: type=1400 audit(0.0:153): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:40.245   458   458 W dnscrypt-proxy: type=1300 audit(0.0:153): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:41.246   458   458 W dnscrypt-proxy: type=1400 audit(0.0:154): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:41.246   458   458 W dnscrypt-proxy: type=1300 audit(0.0:154): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:42.247   458   458 W dnscrypt-proxy: type=1400 audit(0.0:155): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:42.247   458   458 W dnscrypt-proxy: type=1300 audit(0.0:155): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:43.248   458   458 W dnscrypt-proxy: type=1400 audit(0.0:156): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:43.248   458   458 W dnscrypt-proxy: type=1300 audit(0.0:156): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:44.249   458   458 W dnscrypt-proxy: type=1400 audit(0.0:157): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:44.249   458   458 W dnscrypt-proxy: type=1300 audit(0.0:157): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:46.251   458   458 W dnscrypt-proxy: type=1400 audit(0.0:185): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:46.251   458   458 W dnscrypt-proxy: type=1300 audit(0.0:185): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:47.252   458   458 W dnscrypt-proxy: type=1400 audit(0.0:186): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:47.252   458   458 W dnscrypt-proxy: type=1300 audit(0.0:186): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:48.243   458   458 W dnscrypt-proxy: type=1400 audit(0.0:187): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:48.243   458   458 W dnscrypt-proxy: type=1300 audit(0.0:187): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:49.254   458   458 W dnscrypt-proxy: type=1400 audit(0.0:188): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:49.254   458   458 W dnscrypt-proxy: type=1300 audit(0.0:188): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:50.255   458   458 W dnscrypt-proxy: type=1400 audit(0.0:189): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:50.255   458   458 W dnscrypt-proxy: type=1300 audit(0.0:189): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:51.256   458   458 W dnscrypt-proxy: type=1400 audit(0.0:190): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:51.256   458   458 W dnscrypt-proxy: type=1300 audit(0.0:190): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:52.257   458   458 W dnscrypt-proxy: type=1400 audit(0.0:191): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:52.257   458   458 W dnscrypt-proxy: type=1300 audit(0.0:191): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:53.259   458   458 W dnscrypt-proxy: type=1400 audit(0.0:192): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:53.259   458   458 W dnscrypt-proxy: type=1300 audit(0.0:192): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:54.260   458   458 W dnscrypt-proxy: type=1400 audit(0.0:193): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:54.260   458   458 W dnscrypt-proxy: type=1300 audit(0.0:193): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:55.261   458   458 W dnscrypt-proxy: type=1400 audit(0.0:194): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:55.261   458   458 W dnscrypt-proxy: type=1300 audit(0.0:194): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:56.262   458   458 W dnscrypt-proxy: type=1400 audit(0.0:195): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:56.262   458   458 W dnscrypt-proxy: type=1300 audit(0.0:195): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:57.253   458   458 W dnscrypt-proxy: type=1400 audit(0.0:196): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:57.253   458   458 W dnscrypt-proxy: type=1300 audit(0.0:196): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:58.254   458   458 W dnscrypt-proxy: type=1400 audit(0.0:197): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:58.254   458   458 W dnscrypt-proxy: type=1300 audit(0.0:197): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:00:59.255   458   458 W dnscrypt-proxy: type=1400 audit(0.0:198): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:00:59.255   458   458 W dnscrypt-proxy: type=1300 audit(0.0:198): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:01:00.256   458   458 W dnscrypt-proxy: type=1400 audit(0.0:203): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:01:00.256   458   458 W dnscrypt-proxy: type=1300 audit(0.0:203): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:01:01.257   458   458 W dnscrypt-proxy: type=1400 audit(0.0:204): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:01:01.257   458   458 W dnscrypt-proxy: type=1300 audit(0.0:204): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)
02-07 01:01:02.258   458   458 W dnscrypt-proxy: type=1400 audit(0.0:207): avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0
02-07 01:01:02.258   458   458 W dnscrypt-proxy: type=1300 audit(0.0:207): arch=40000028 syscall=281 per=800008 success=no exit=-13 a0=2 a1=80802 a2=0 a3=b674a934 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/dnscrypt-proxy" subj=u:r:sysinit:s0 key=(null)

```

What is the difference between executing this as root after boot and launch it from init.d? Any idea how i can solve this?

# Answer
Pardon me if I fail to sum up the vast subject in a brief answer :)

## SELINUX AND AVC DENIALS

Android is based on Linux kernel that makes use of Discretionary and Mandatory Access Controls (DAC, MAC) to restrict access to system resources such as files on a certain filesystem. DAC includes classic UNIX `RWX` file modes, owner/group or UID/GID, Extended Attributes and Access Control Lists. XATTR and ACL are rarely used filesystem related attributes, though MAC also makes use of XATTRs. Root user (UID: 0) is the `super user` (administrator) within DAC mechanism which can bypass all permission checks imposed by kernel. To make controls more fine-grained, authorities of root user are further divided in subgroups called capabilities.

Coming to MAC, SELinux and AppArmor are commonly used Mandatory Access Control mechanisms. In SELinux model, every file/process is labeled with a context and rules are defined to allow a context access the other.
Say, we want to run command `ls` with context `my_process` on a file with context `my_file`, rule must be defined to allow this access:

```
allow my_process my_file file { getattr read open }

```

Otherwise access will be denied with error something like:

```
avc: denied { open } for pid=... comm="ls" path=... scontext=u:object_r:my_process:s0 tcontext=u:object_r:my_file:s0 tclass=file permissive=0

```

<sup>* File SELinux labels can be changed with `chcon` while processes can be started with a given context using `runcon` command.</sup>

## SELINUX IN ANDROID

Android uses SELinux as part of its security implementations. When a ROM is compiled for a specific device, thousands of SE Policy rules are defined to allow all possible desired accesses. These rules are compiled into a binary file `/sepolicy` which is placed at root of initramfs in `boot.img`. This file is loaded during early boot process by `init`; the very first process that starts all other processes.
Init also starts different processes/services with different contexts as defined in their init \*.rc files.
All filesystem labels are stored in multiple files saved in rootfs or at `/system/etc/selinux/*_contexts`, `/vendor/etc/selinux/*_contexts` etc. These labels can be restored by `restorecon` command.

## ROOTING AND SELINUX

Now if you want to start a process with different context that hasn't been explicitly allowed in SE Policy, you need to define new rules. However that's not possible under normal circumstances as DAC, MAC and capabilities together won't let you do that. Here comes rooting the phone; let's take example of Magisk.
Magisk starts a daemon as an init service that lets any non-privileged process ask for super user rights. So the problem of UID 0 and lack of capabilities is resolved. In order to address SELinux denials, Magisk defines two new contexts: `magisk` for proccesses and `magisk_file` for filesystem. Then rules are defined to allow all access attempts from/to these contexts and `/sepolicy` is replaced with modified policy file. From now onward any processes running with Magisk rights won't be disallowed from doing anything. This could be really dangerous.

**Now coming to your question,**
You are starting a process with context `u:r:sysinit:s0` which isn't allowed in policy to access all resources it needs. So what you can do is:

**OPTION 1:**
Run init.d scripts with root's privileges and forget about denials; DAC or MAC. Magisk, for instance, executes scripts placed in `/data/adb/*.d` directories on boot.
But as a common practice, processes shouldn't be given unnecessary privileges.

**OPTION 2:**
Set SELinux permissive:

```
/system/bin/setenforce 0
# OR
echo 0 >/sys/fs/selinux/enforce

```

But it disables SELinux for whole device which isn't recommended. So instead:

**OPTION 3:**
Set only `sysinit` to `permissive`:

```
/sbin/supolicy --live 'permissive sysinit'
# or let sysinit do anything without logging denials
/sbin/supolicy --live 'allow sysinit * *'

```

<sup>* supolicy tool is part of Magisk to manipulate SELinux policy. You can also use sepolicy-inject or similar tool.</sup>

All of the above solutions are a quick workaround but if you don't want to leave anything loose, go ahead.

**OPTION 4:**
We can define SEPolicy rules for `sysinit` context and save that as our default policy to be loaded on boot. For instance, avc denial in your log:

```
avc: denied { create } for scontext=u:r:sysinit:s0 tcontext=u:r:sysinit:s0 tclass=udp_socket permissive=0

```

can be converted to an SEPolicy rule:

```
allow sysinit sysinit udp_socket { create }

```

`sysinit` is an init service added to some custom ROMs that executes scripts under `/system/etc/init.d/`, but it's not a standard AOSP service and the UID, GID, supplementary groups, capabilities and SELinux contexts that this service runs with may differ on different devices.
So in a more general perspective, let's create a new `dnscrypt-proxy` init service with desired context and additionally with desired UID/GID/groups/capabilities to grant least required privileges.

## HOW TO ADD CUSTOM INIT SERVICE TO ANDROID?

1. Place executable binary at `/system/xbin/dnscrypt-proxy`
2. Create directory `/etc/dnscrypt-proxy`, configuration file `/etc/dnscrypt-proxy/dnscrypt-proxy.toml` and optionally `/etc/dnscrypt-proxy/blacklist.txt` if needed.

```
 listen_addresses = ['127.0.0.1:55']

 [blacklist]
   blacklist_file = '/system/etc/dnscrypt-proxy/blacklist.txt'

 [static]
   [static.'cloudflare']
   stamp = 'sdns://AgcAAAAAAAAABzEuMC4wLjGgENk8mGSlIfMGXMOlIlCcKvq7AVgcrZxtjon911-ep0cg63Ul-I8NlFj4GplQGb_TTLiczclX57DvMV8Q-JdjgRgSZG5zLmNsb3VkZmxhcmUuY29tCi9kbnMtcXVlcnk'

```

* I'm using here port 55 because otherwise `dnsmasq` server will fail to listen on pre-occupied port 53 when tethering is turned on, causing hotspot to fail.
* Private DNS (DoT) feature introduced in Android Pie doesn't use port 53. To enforce `dnscrypt-proxy`, Private DNS should be disabled.

3. Create `/etc/init/dnscrypt-proxy.rc`.

```
 # define service
 service dnscrypt-proxy /system/bin/logwrapper /system/xbin/dnscrypt-proxy -config /system/etc/dnscrypt-proxy/dnscrypt-proxy.toml
     seclabel u:r:dns_crypt:s0
     user 999
     group 999 3003
     disabled
     capabilities NET_BIND_SERVICE

 # start dnscrypt-proxy after netd daemon
 on property:init.svc.netd=running
     start dnscrypt-proxy

 # redirect all DNS queries to dnscrypt-proxy
 on property:init.svc.dnscrypt-proxy=running
     exec u:r:dns_crypt:s0 root root -- /system/bin/iptables -w 60 -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to 127.0.0.1:55
 on property:init.svc.dnscrypt-proxy=stopped
     exec u:r:dns_crypt:s0 root root -- /system/bin/iptables -w 60 -t nat -D OUTPUT -p udp --dport 53 -j DNAT --to 127.0.0.1:55

```

* Process doesn't need to be run as root. Use non-privileged UID 999 or any other UID not used by Android OS.
* In order to access internet, process needs to be in group aid\_inet (3003) or have the capability NET\_RAW (create `socket`), and should have capability NET\_BIND\_SERVICE (`bind` to socket).
* If you are using a firewall (like AFWall+) to block outbound traffic, you need to explicitly allow UID 999 on every boot:

```
     ~# iptables -I OUTPUT -m owner --uid-owner 999 -j ACCEPT

```
* To forward hostpot traffic through `dnscrypt-proxy`:

```
     ~# iptables -t nat -I PREROUTING -p udp --dport 53 -j DNAT --to 127.0.0.1:55
     ~# echo -n 1 >/proc/sys/net/ipv4/conf/all/route_localnet

```

4. Define SEPolicy rules:

```
 ~# supolicy --live 'create dns_crypt'                  # create new context
 ~# supolicy --live 'allow init dns_crypt process *'    # let init handle the service
 ~# supolicy --live 'allow dns_crypt dns_crypt * *'     # allow mutual love

```

In the same way:

```
    # allow access to files under /system
        allow dns_crypt system_file dir { read open }
        allow dns_crypt system_file file { lock entrypoint execute_no_trans }
    # allow creatig/connecting to net sockets
        allow dns_crypt node tcp_socket { node_bind }
        allow dns_crypt node udp_socket { node_bind }
        allow dns_crypt port tcp_socket { name_bind name_connect }
        allow dns_crypt port udp_socket { name_bind }
    # allow reading /proc and /dev filesystem
        allow dns_crypt proc_net file { open read }
        allow dns_crypt proc_stat file { read }
        allow dns_crypt properties_device dir { read }
    # allow writing to logcat, logging to file requires different AVC rules
        allow dns_crypt devpts chr_file { open read write }

```
* That's what works for me on AEX Pie ROM. However the labels and contexts may slightly differ on different Android versions and on different phones.
* For testing, you can set SELinux permissive on boot by adding a line temporarily to `dnscrypt-proxy.rc` file:

```
     ...
     ...
     on property:init.svc.netd=running
         exec u:r:magisk:s0 root root -- /system/bin/setenforce 0
         start dnscrypt-proxy
     ...
     ...

```

Then use `dmesg` to see avc denials and define any further rules.

5. Save and load policy file.

```
 ~# supolicy --save /etc/selinux/sepolicy

```

Live injecting a large number of rules to policy takes longer. Since these rules need to be loaded on every boot, save them as default sepolicy file.

* Unpack `boot.img` and replace the `/sepolicy` file with yours. In this way the ***service will work even if the phone is not rooted***.
* However if you don't want to modify `boot.img`, you can take support from Magisk to load custom policy on boot before the `dnscrypt-proxy` service is started. It's because even `init` on its own can't load any custom policy once SELinux is set enforcing after loading default policy.

```
     ...
     ...
     on property:init.svc.netd=running
         exec u:r:magisk:s0 root root -- /system/bin/load_policy /system/etc/selinux/sepolicy
         start dnscrypt-proxy
     ...
     ...

```

6. Set permissions and fix contexts:

```
 ~# chmod 0755 /etc/dnscrypt-proxy /system/xbin/dnscrypt-proxy
 ~# chmod 0644 /etc/init/dnscrypt-proxy.rc /etc/dnscrypt-proxy/* /etc/selinux/sepolicy
 ~# restorecon -Rv /system/xbin/dnscrypt-proxy /etc/*

```
7. Reboot.

You have a harmless, innocent-looking `dnscrypt-proxy` service running on your device.
> 17 votes

---
Tags: root-access, dns, selinux, background-process, init.d
---


# Question
Title: Can an Android phone be used as a Bluetooth headset/speakers?
Is there a way to make an Android phone (HTC Desire HD) act as Bluetooth speakers or headset?

I'd like to use the phone as wireless headphones whilst watching a movie on a computer (running Ubuntu).

# Answer
As of Feb 2011, the Bluetooth API only supports pairing with the Android device as the master.

Reference: Stack Overflow - Use Android device as a headset for another device
> 10 votes

# Answer
Here's a XDA article by Mishaal Rahman that basically says:

Even without A2DP profile on Android (which is not implemented even in Android 8 yet), you can do a low-quality Bluetooth streaming via Hands-free Profile (HFP) to Android from another Android phone (sorry iPhone owners!)

Install Tasker and a AutoVoice plugin on the source phone, and create the following Tasker profile:

```
Profile: Reroute Audio (192)
State: BT Connected [ Name:BMW 15384 Address:* ]
Enter: Anon (199)
A1: AutoVoice Ctrl BT [ Configuration:Enabling Headset Sound Timeout (Seconds):0 ]

Exit: Anon (204)
A1: AutoVoice Ctrl BT [ Configuration:Disabling Headset Sound Timeout (Seconds):0 ]

```

Warning: I have not tested this myself.

Warning: quotation about HFP audio quality:

> Note: because the Hands-Free Profile is not meant to send high-fidelity audio streams, the audio quality of your music will suffer. This is just the nature of the Hands-Free Profile and there’s nothing you can do about it without either upgrading your stereo’s Bluetooth to bring A2DP support or to stream through another peripheral.
> 4 votes

# Answer
I must be missing something, why do you want the phone to do it?

You'd be better off using a USB Bluetooth chip (they cost less than £5) on your PC and a Bluetooth Headset (I've got a superb one that lets me plug in any headphones I want, 3.5 stereo jack so would take any little speakers as well).
> -1 votes

---
Tags: bluetooth, headphones, bluetooth-hsp
---


# Question
Title: Hard Reset to Factory Settings without USB access
I've got an Asus ZenPad 300C that is crashing constantly. Things I have tried:

* Clearing cache. I am unable to access Settings to clear the cache but was able to run a clean-up app, which I think did some of that. No effect.
* Factory Reset. If I use `Power`+`Volume Up` to access recovery mode I can see the options - `FASTBOOT MODE` and `POWER OFF`, but the power button doesn't work so there's no way to actually select `FASTBOOT MODE`. I tried connecting via USB to run ADB and do it that way but USB Debug mode is not enabled and I cannot get into Settings on the phone to allow it because Settings crashes.
* Battery. I have removed the back and temporarily disconnected the battery but that made no difference.

Is there any other way to perform a hard reset or troubleshoot and fix this issue or is it done for?

# Answer
> 0 votes
I completely forgot you don't need debugging and all things. On Windows/Mac/Linux:

1. Just open an internet browser and go to https://www.google.com/android/find
2. Enter your email ID and password (which one used in Asus Zenpad Z300C)
3. If you have multiple devices with the same ID, then selected Asus Zenpad Z300C carefully
4. If only one device is registered, then skip step 3. And on the left-hand side, select the option ERASE DEVICE.
5. Might be Google will confirm the password again. So enter it again.
6. Done.
7. Your device is now factory reset.

Note: Your device Asus Zenpad Z300C needs to be connected to the internet to perform this operation, prefer a WiFi connection.

---
Tags: factory-reset, usb-debugging
---


# Question
Title: LG V20 stucks on "firmware update, now looking for any connection" message
I powered off my LG V20 and 3 hours later went to turn it on and it says, "firmware update, now looking for any connection". It appears stuck on this screen. I can't do anything.

Any suggestions?

# Answer
I fixed it myself. I held the button down for a while to try to turn it on. Finally, the screen changed where I could toggle and select power off to stop the cycle. It worked and the phone powered down. I turned it back on and good to go.
> 2 votes

---
Tags: updates, lg, device-firmware
---


title: rooting gigaset phone

text:
# Question
Title: rooting gigaset phone
I am trying to root my Gigaset phone (GS 160), but I couldn't make it with

http://kingoapp.com (probably the model is not supported)
and
https://towelroot.com (model is not supported)

Does anyone have another tool in mind that could work?

Thanks for your help

# Answer
> 0 votes
Try OneRootClick they have quite a good range of phones they can root.

---
Tags: rooting, 6.0-marshmallow, root-access
---


# Question
Title: How to remove apps which doesn't allow uninstall option without rooting smartphone?
I'm using Samsung J7Max recently I updated MY AIRTEL app and try to uninstall it app uninstalled but leaves an duplicate MY AIRTEL app which tell me download MY AIRTEL app from playstore. I can't remove it or disable it. Don't know what to do. Here is snapshot of duplicate Airtel app.

# Answer
> 0 votes
From what I understand :

* MY AIRTEL is a *system application* that's installed in the `/system` partition
* Updates to this app are stored in the `/data` partition

*Without* rooting your phone, you only have *read* access to `/system`, and read/write access to `/data`. That's why you can uninstall MY AIRTEL updates (which are in `/data`), but not the app itself (which is in `/system`). And since Google Play has a newer version, you'll be prompted to update it again, etc.

Rooting your phone will allow you to gain write access to `/system` and hence uninstall any system application.

# Answer
> 0 votes
Your question specifically asks for a no-root solution, which is difficult but not impossible if you are willing to use a temporary root through ADB. Connect to your device via adb and enter adb root, mount the system partition, and delete the APK thats in your system partition. This may not work for all devices, as it can be difficult to get true root in production build on many devices. good luck.

---
Tags: samsung, stock-android, bloatware
---


# Question
Title: Proc-folder: App generated almost a thousand sub-folders
When I was searching with the "File Manager" app (com.alphainventor.filemanager) for some files in the root-folder, it generated hundreds (almost a thousand) folders in the proc-folder. \[I don't have root-access btw., but still can see some files there.\]

They're named just 1, 2, 3, 4, etc. Each folder has about ~40 files in it.

I already found out, that those are virtual files, that eat like no space. However I would still like to clean those up.

Is there any smart way to do this? I was hoping, they would be removed by restarting the system or deinstalling the app, but so far nothing worked. :/

I am on an LG G7 with Android 8. Any help would be greatly appreciated.

# Answer
> /proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). source

Therefore the directories and folders you observe just represent the processes started by the app. If you see them that the app has still running processes. Some apps contain ant-reverse-engineering technologies by using multiple processes for monitoring each other. Also the Android system may start multiple smaller processes for one app e.g. for background service(s).

Conclusion: The proc file system is nothing you should worry about. Just ignore it.
> 0 votes

---
Tags: file-system, lg
---


title: Recover Whatsapp Keyfile

text:
# Question
Title: Recover Whatsapp Keyfile
I have a backup of my whatsapp database, however i accidently wiped the keyfile from the system partition when i tried to recover my phone that did not boot any more.

Does anyone know if there is any backup of this file somewhere on the internal storage of even in the cloud at whatsapp, or if it is somehow possible to decrypt the database without the file?

Thank you!

# Answer
> 0 votes
It is not possible to decrypt the database without the keyfile, and WhatsApp make a point of not having your messages in the clear (they are encrypted end to end)

So unfortunately you have no chance of getting your data back without that keyfile.

---
Tags: whatsapp-messenger
---