text:
Samsung Note8 wifi issue (connectivity.samsung.com.cn)
I captured this screen when using WiFi with web authentication
First it goes to the connectivity.Samsung.com.cn
Then to the  wifi login screen
This is weird, does my wifi info exposing?
*I bought this phone in Hong Kong.

The domain samsung.com.cn is just an alias of samsung.com/cn. It is the Samsung domain for China. The fact that you bought the phone when you were in Hong Kong validates it.
connectivity.samsung.com.cn is a subdomain that your phone checks when you're connected to WiFi or mobile data to know if it is able to "talk" to the mothership (in this case Samsung servers). Type the URL in your browser and you will get Ok if the link is established.
So when you are connected, your phone establishes a link with Samsung servers (just as it does with Google if you have Play services installed). Your phone has not been exposed to hackers but is calling home possibly to check if there are updates from Samsung for your phone.


text:
Stop using an app during work hours
I need to avoid using a personal messaging application in my android phone during work time.
One way is to uninstall the app before work starts, and install again after the work time.
Or use some app blockers ?
Or... what else ?

Disable app, configuration and personal data won't be gone either.

@IrfanLatif Great idea. But I'm lazy :-) to disable and enable on daily basis. Is there any apps available to auto disable and auto enable ?

Automation apps can possibly do but I prefer commandline solutions. I'd run a cron job if I need to. Btw disabling takes hardly 10 seconds. From some launchers e.g. Nova, app's settings can be directly accessed by long pressing app icon.

@IrfanLatif I'm a programmer, but I'm not that much in to android programming. What I need is, I need to feel I like I don't have WhatsApp messenger during work hours. Right now, I'm using App Block to allow me to use WhatsApp only for 15 minutes and I select "strict" mode, which do the job well.

Do you have root access?

@ReddyLutonadio No

You can use "Automate" app to disable the notifications for your messaging app (see question https://android.stackexchange.com/questions/213886/how-to-prevent-an-apps-notification-from-updating-while-the-screen-is-off). I'm not sure if you can set it to disable/enable the notifications on specific times, but if you can't then you can achieve the same by using Tasker and secure settings plugin. But I just saw that you don't have root, so probably both solutions won't work for you. if you have android pie, the Digital wellbeing function might be able to hide the notifications.

Or you could just set up the "do not disturb" mode to meet your requirements.

@mnd Actually, I am not only need to stop notification but the complete app.

then I guess getting root would be your only option if you want to automate the stopping/killing of the app.

Depends on your Android version. But go to Settings -->Apps--> Choose App-->Notifications-->And then chose option like Calls, Messages and so on.
I think that this is better than app blocker, becaose most app blockers will completly block apps and messages and this methond will only give you no notification and it takes 15 seconds.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How to find local IP when connected to VPN?
I have connected an android device to a VPN using the native Android VPN client feature. I need to know the IP the device has been assigned on the VPN subnet, but I can't find it on any Android menu nor with any tool.

Android's VPN uses TUN interface on OSI Layer 3. So you can find what IP is assigned to that interface using Android's built-in command ip. From any terminal app or adb shell:
~$ ip addr | awk '/inet.*tun/ {print $2}'

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Is there a way to always fire up my express VPN app whenever I open an incognito tab in chrome?
Is there a way to always fire up my express VPN app whenever I open an incognito tab in chrome?
Basically something like a batch file or shell script maybe that can trigger this?

MacroDroid can run shell scripts, but i believe it can not capture the triggering event

The problem is in detecting the incognito mode by end users. Some apps such as SwiftKey are able to guess/know the incognito mode but I don't think any end user solution exists for detection unless somebody copies the logic and provides it to us.

When you open incognito tabs in chrome, there is a notification that appears with the message "Close all incognito tabs". You can use it to automate the process of launching your app.
Using Automate:

In the Interface section, select the Notification posted block. Click on it, select chrome as the package and set Chrome as the title on the Input arguments section. In the output arguments section, set x (or any name).
In the General section, select the Expression true? block. Click on it and set "Close all incognito tabs" as the formula.
In the Apps section, select App start. Click on it, select your app in the package section.
Link the block as seen on the image below.
Save the macro. Grant Automate the Notification Access permission. Click Start.

When you open an incognito tab in  Chrome, when a Notification with the title Chrome appears, if the notification has "Close all incognito tabs", the app selected in step 3 will start.
Note: I don't have your app installed. So I stopped my demonstration at step 3. You could play with other blocks for instance to click at some part of the screen to click a button, minimize the app, go back to chrome after opening it, etc.


text:
Is it a Kernel or a ROM that provides power_supply battery files?
Long story short I was installing custom ROMs to my Android device and one thing that stays in place regardless of ROM I use is a wrong battery stats monitoring. The device always behaves like it's being charged, although it's not.
I've checked the /sys/class/power_supply/battery and voila - there's no battery, only /sys/class/power_supply/usb. According to some docs I've found that will make the system think it's connected to an external power source.
The question is what is responsible for creating this battery file - is it a kernel, or a ROM (i.e. LineageOS, Resurrection Remix etc).

[UPD:] In the document I've provided they write about  /sys/devices/power_supply, not /sys/class/, although here the /sys/class/power_supply/*/ is mentioned as a Kernel interface. Should I assume that it's a Kernel issue then?
It's interesting though, that the stock ROM does show battery stats correctly, although nothing was added to /sys/class/ and TWRP recovery I'm using shows battery charge as -1%.

Did you check ls -d /sys/devices/*/power_supply/battery or ls -d /sys/devices/*/*/power_supply/battery or ls /sys/class/power_supply/battery? Both ROM and kernel are involved in hardware handling. There must be some binary blob in /vendor acting as HAL which interacts with kernel, which ultimately deals with hardware. Mostly custom ROMs keep on including the same blobs in their ROMs extracted by someone. Do you face same issue with your stock ROM?

@IrfanLatif I've updated the question. Will go and read 'em manuals a bit more, thanks for showing the direction. And no, stock ROM was fine.

So you have checked and there is no /sys/class/power_supply/battery/status? If it exists cat it.

Yeah, there's even no /battery there - just /usb.

And there is no pgrep -a hardware.health either?

Nope =) I've decided to install stock ROM and then check what does it look like from the console. Will be back as soon as there'll be anything interesting to share.


text:
Disable title translation of YouTube videos
Is there any way to prevent the YouTube app from translating (some) video titles from the original title (e.g. English) to the phone's configured language? (e.g. Spanish)
It's really annoying as those translations look auto-generated and are often wrong, and also gives the impression that the video itself is in a different language than the one it is really in.
In YouTube's web interface this does not happen, using the same Google account.

The simplest workaround I found was to logout. However, the video suggestions shown after logout are generic and kind of useless.

There are many other people, here or here who are looking for the same option. Google has not yet offered a solution to disable the option while on mobile.
Among the possible solutions posted on the second links is to:

Go to https://myaccount.google.com/language
Add all the languages you understand in the list
Reload whatever youtube page you were on
Youtube shouldn't translate video titles anymore
  Note that you may still have some video titles translated for some time because they were cached by your browser.

Also, if you watch videos in languages you don't understand, they will be translated (unless of course you select all languages).
Another possible solution is to change the language of your device to be the same as the language of the video. But it not practical because you will to keep changing languages.
Until Google decides to provide a proper solution, all the above solutions are hit and miss. They work for some and not others.

I don't know if this worked at some point, but it has no effect now.

Confirmed, first solution doesn't work. I've got en-us as my primary language, PL as secondary, the problem is still there.

I clicked on my profile picture on youtube and in the menu that breaks I went to languages and set my language to the language of the video in question. That worked for me, hopefully it works for you.

could you share a screenshot?

This is NOT a solution. What if there are video in more than one languages? You'll see all titles in your chosen language

You can change it.
Go to You Tube ---> Settings --->Subtitles --->You will be redirect to Google Subtitles(CC) ---> Under regular options you can find Language.
--->And you can choose new default language.
NOTE: In GS(CC) for language options default option is phone default language not Google Acc. language.

Will the change also apply on the title as well or only subtitles?

Yes. It will. Basicly title and subtitle are the same in this context

Thanks, however I changed the subtitle language but it is still the same


text:
How to connect USB device to a phone doesn't have OTG

What are hardware and software difference between OTG support and non-OTG support devices (android)?
Is there a way to connect non-OTG device with a pendrive (or other) via USB? Is there any hardware limitations if the slave device is powered externally?
Does the OTG feature comes with kernal/OS or any android OS (6.0 or later) is capable of OTG if hardware supported? If yes, is it same for Android ONE and AOSP?

https://en.wikipedia.org/wiki/USB_On-The-Go

@alecxs I went through that article, but here's the problem in practical way. Assume there is a phone that the manufacture says NO OTG support. IF I connected a pen drive with external power (as the device is unable to supply power), will it work? Is it a hardware limitation or with some software tinkering can it be achieved?

it does not really matter if it is a hardware limitation unless you have the ability to compile a custom kernel, if it does not support it you won't change this with a app. it is not related to power supply, it has to be announce the host mode (or accept the demand of the OTG adapter by short-circuit pin 4+5 in other words)


text:
Should I get A1 or A2 spec'd Micro SD card for my phone?
I'm currently running with Samsung EVO Micro SD card in my phone (GT-i9195 or serranoltexx) in Adoptable storage mode.
I'm looking for a faster card to improve performance. I was about to get Sandisk Extreme A2 card for my phone.
However, I found the official pages about A1 and A2 class by SD Association. According to the official documentation,
A1:

The Application Performance Class 1 (A1) was defined by SD Physical
  5.1 specification.

A2:

The Application Performance Class 2 (A2) is defined by SD Physical 6.0
  specification. It makes SD memory card much higher performance than A1
  performance by using functions of Command Queuing and Cache.

Note that A2 uses extra tricks to achieve better performance, especially Command Queuing (A2 spec'd cards have minimum support of 2 for Command Queuing depth).
I'm looking for a card that has as low latency as possible for a single read. Should I get A1 spec'd card instead of A2 because even though A2 has higher random access "minimum" IOPS, it may only get it with QD32 queues? I'm looking for a good random 4K read QD1.
I wish storage manufacturers specified random 4K read QD1 performance. It seems that only storage with manufacturer published numbers is Intel Optane series where those numbers don't look too bad.
Update: more information:
Another document on the official site explains A2 features a bit more:
Command Queue:

The new CQ mechanism allows the SD memory card to accept several
  commands in a series (without their associated data) and execute them
  (with the data) whenever the memory card is ready. It contributes
  mainly to random read performance.

Note that this clearly uses "random read performance" as average IOPS, not the maximum time for any given read operation.
Cache function:

In order to overcome the relatively limited write speed operation of
  flash memory, the Cache function allows the card to accumulate the
  data accepted by the host in a high-speed memory (e.g., RAM[)] [...]
  Data loss is allowed if the data is not moved to non-volatile storage.

So... high write IOPS is allowed to be writing to card internal RAM and data loss is acceptable? The OS can already do exactly the same thing with higher performance!
Self-Maintenance:

Card-initiated operation allows the SD memory card to perform internal
  maintenance operations while the host bus is idle. When a new command
  is received, the card must ensure that new command is serviced without
  violating SD standard timing (Read Command, 100 milliseconds; Write
  Command, 250 milliseconds).

And if card has entered "card initiated self-maintenance" mode (which A2 card is allowed to enter any time no commands are in the queue) the effective read IOPS may go down to 10 and effective write IOPS may go down to 4.
I think A2 spec has way too huge tolerances for bad performance. Calling the above as "minimum 4K read: 4000 IOPS" and "minimum 4K write: 2000 IOPS" is a lie.
(I'm wondering if I should get Sandisk Extreme A1 card when those are still available on the market. Samsung EVO+ cards have nice performance in benchmarks, too, but if I've understood correctly those are meant for non-application usage and have worse wear leveling algorithm than Sandisk Extreme cards. The same thing with Sandisk Ultra cards - they don't last having the same sectors written repeatedly.)

TL;DR: Get an A1 card unless you know for sure that your workload greatly benefits from Command Queuing (CQ) and your host hardware supports CQ.
Long answer:
After looking around a lot it seems that the A2 specification could allow better performance but actual hardware implementations are slow enough that A1 is better choice nowadays (year 2019).
Thomas Kaiser has collected info about A1 and A2 rated SD cards and says

Application Performance Class 1 (A1)
This performance class requires at least 1500/500 read/write IOPS (IO
operations per second) with a 4k blocksize (small data chunks) and at
least 10 MB/s sustained sequential write performance. No special host
requirements are needed, the card simply has to exceed the performance
requirements on its own.

and

Application Performance Class 2 (A2)
A2 promises even better performance with 4000/2000 read/write IOPS
minimum but there's a problem since as outlined by the SD Association
A2 cards show "much higher performance than A1 performance by using
functions of Command Queuing and Cache".
Cache and Command Queuing require host (driver) support since the host
needs to activate those new features first. The cache feature on A2
rated cards makes use of volatile RAM on the card [...] involving the
risk of data losses [...]

Another user wrote about real world performance between Sandisk Extreme A1 and A2 cards:

I did some searching online and found a few other SD card benchmark
results where A2 cards performed worse than A1 cards, so my results
seemed to be what others were finding as well.
[...]
A2 cards not only require special hardware and/or software for maximum
performance, they actually perform WORSE than A1 cards without it
[...]
[Sandisk fine print about A2 cards]: Up to 160MB/s read speeds,
engineered with proprietary technology to reach speeds
beyond UHS-I 104MB/s, requires compatible
devices capable of reaching such speeds
[...]
As far as I can find, the only "compatible device" is the SanDisk
Mobilemate USB 3.0 micro SD card reader

James A. Chambers has tested A1 and A2 cards with Raspberry Pi:

A2 is not supported by Raspberry Pi yet (or almost anything else
really) so A1 is the important mark to hit.

So the current status seems to be that A1 is strictly about card hardware speed and A2 is about card + host hardware/firmware/software solution. The only bit about A2 which in fact could improve performance is Command Queuing (CQ) which allows card to process some requests slower and still allow higher average troughput even for small I/O operations. And if you care about worst case latency (QD1) then any queuing is never worth it so you do not even want this feature.
However, it seems that with current hardware (year 2019) of A2 cards the latency for any single request has been increased from A1 cards. I guess this is caused by too slow embedded processors inside the cards that try to do a bit too much. The firmware is probably optimized for benchmark throughput (the card can handle lots of requests in paraller but execute each request a bit slower) and as a result, the latency for any single request has gone up. As a result, if your host device doesn't support CQ feature of A2 cards, you get the worst of two worlds: the latency will go up and overall throughput will suffer.
In the end, if your host does not support A2 feature, get an A1 card. And if you care about QD1 performance, get an A1 card even if your host hardware/firmware + software does support all the A2 features.
According to latest benchmarks I would recommend either SanDisk Extreme A1 cards or A-Data Premier A1 cards. According to StorageReview benchmark, the A-Data Premier A1 card has highest random 4K performance: 2971 IOPS for 4K read, 1190 IOPS for 4K write. The SanDisk Extreme A1 cards is better known, though, so it may be a safer bet. The SanDisk Extreme A1 is already hard to find because SanDisk prefers to sell A2 variants now especially for bigger flash sizes.
I wouldn't be surprised if current crop of A2 cards were cheaper to manufacture than A1 cards because the manufacturers can use lesser spec'd internal processor to achieve the A2 minimum random access performance thanks to more buffering and queuing. I can only wish more benchmarking sites would focus on request latency over throughput.

Status: I've been using A-Data Premium A1 MicroSD card (64 GB) for a couple of months and it has worked well. The performance has been about twice the performance of Samsung EVO+ 32 GB (for random 4K the A-Data has more than twice the performance). I haven't encountered any media errors this far so this seems like a good card. Considering the performance, I'd assume that this card is a good choice for Raspberry Pi, too, but I haven't tested it myself.

The exact card I have is AUSDX64GUICL10A1-RA1 from https://www.adata.com/en/orderinfo/451

Update 2020: I have purchased two of AUSDX64GUICL10A1-RA1 and one of the cards failed. I don't know if I were just unlucky or if there're quality problems. The another card is working perfectly.

Update year 2023: only one card AUSDX64GUICL10A1-RA1 has failed this far. The another one is still in daily use and has worked perfectly.


text:
Finding lost bluetooth device
I was traveling from NY to Cleveland and I misplaced my Sennheiser Momentum TW's.
I used Google My Activity to help see my phone activity, and I see Spotify was opened at 3:21pm which would suggest I still had them after my stopover at 3:03pm (according to Maps timeline). Is there anyway I can view the last time they were connected to my device?
All help is greatly appreciated!
More than welcome to some out of the box solutions!

try the notifications history widget https://nexus7.gadgethacks.com/how-to/unlock-hidden-notification-history-feature-your-nexus-7-tablet-0150162

Thanks for your response, I couldnt find that widget (using an s10)

this work for android 7.0 nougat: install QuickShortcutMaker, navigate to activity Settings - com.android.settings.Settings$NotificationStationActivity - Create shortcut


text:
How do I change the country/region in Google Play Store?
I live in Israel. My Google Play is set to USA. I want to change it to Israel. The need to change that had arisen when I tried setting up Family Link on my kid's phone, which fails due to" country setting being different on parent and child phones". Sure enough, his country is set correctly in Google Play settings.
How can I change mine when the account->country and profile setting appears unchangeable?
Edited for clarification: I have never lived in the US and don't recall setting the country to US. I have no US based payment methods defined , but I do have Israeli payment method defined and used.

Have you seen our google-play-store tag wiki and checked with its links – like, How do I change the Google Play country? and Problems with changing the default country in Google Play Store? Do the answers to those questions solve your problem?

Yes I have. Same for the recently updated instructions by Google.

You have good instructions here:
https://support.google.com/googleplay/answer/7431675?hl=en .
But since this is Google you need to add payment method.
Change your Google Play country
If you move to a new country you may want to change your Google Play country. Your Google Play country determines what content you see in the store. The apps, games, and other content in the Store can vary by country.
You can only change your Play country once per year. So if you change your country, you won’t be able to change it back for 1 year.
When you change your country, you won’t be able to use your Google Play balance that you have in your old country in your new country.
Change your Google Play country
To change your country, you need to set up a new country in Google Play. To set up a new country, you must be in that country and have a payment method from the new country.
On your Android phone or tablet, open the Google Play Store Google Play.
Tap Menu Menu and then Account and then Country and profiles.
Tap the country where you want to add an account.
Follow the onscreen instructions to add a payment method to that country.
The first payment method must be from the country you’re adding a profile for. Once you create the profile you can add payment methods from other countries.
This creates a new Google Payments profile linked to the new country. The Google Play Store will automatically change to the new country. It can take up to 24 hours to change.
If that is not working:
Fix problems changing your Google Play country
If you can't change your Google Play country or don't see the option to, try the following:
Clear your cache and data
On your phone or tablet, open the Settings app Settings app.
Tap Apps & notifications and then See all apps.
Scroll down and tap Google Play Store Google Play.
Tap Storage and then Clear cache.
Tap Clear storage and then OK.
Check if your app is updated
Open the Google Play Store app Google Play.
Tap Menu Menu and then My apps & games.
Games with an update available are labeled "Update." You can also search for a specific game.
Tap Update.

As mentioned in the question , I have located the menu where the change should be applied but I don't see a way of actually applying it. I have Israeli payment method defined and have been using them, and no US based payment method at all.

Try to update app(Google Play Service 2019), or clear cache.If that is not working try on other device(laptop, PC, tablet). Best idea would be to contact Google Customer Service.

Thanks, I have not had the best results contacting them,I think I am still waiting on  a question from 2017..


text:
Install APK from ADB and bypassing the prompt on Redmi
Device = Redmi 5 Plus.
I have 250 apps as a .bak created by PC app. But the cheater PC app is asking for premium to restore it now. So, I can extract the .bak and find my apps.
I wanted to batch install those apks. I tried adb install apkname.apk to check if it works. But the phone keeps prompting me to accept the install and countdown starts, or else it will auto deny after countdown finishes. I've also tried 3rd-party app like ApkInstaller but it's the same.
I read many articles and they say it works without prompt. So, why am I getting this issue? How to bypass this prompt automatically?

there is a similar question i just found searching about it (but not a duplicate ), i see that as me you want a batch/cmd solution but only got a linux one, so here it is: https://android.stackexchange.com/a/214145
that is a very complete answer that show how to do it. and this is a very compact and simple one, https://android.stackexchange.com/a/229080 , i just tested it and it still works.

UPDATE: So, in the end, it seems the problem was the 'MIUI optimization' feature. After I turned it off the batch install command works fine.

In addition to adb install, you can directly use package manager from adb shell to install apps. Place .apk files in /data/local/tmp and make sure files are readable, SELinux context must be u:object_r:shell_data_file:s0. Now:
~$ cd /data/local/tmp
~$ ls *.apk | xargs -I {} pm install '{}'

Another simple root solution is to use some file explorer e.g. MiXplorer to batch install apps. Select all .apk files and tap on Install from menu.

Thank you Irfan for answering. But can you explain what the SELinux context here means? And what the commands are doing and what they mean. I tried copying an apk to the 'data/local/tmp' and did the 'adb shell' but after that all the commands are coming "permission denied". And the MiXplorer that you suggested is not free. I tried the other installer but they do ask for the permission.


text:
Pass through ODIN MODE
I have a Samsung J3 6 (2016), I'm trying to hard reset (PIN loss).
I found out that I should hold Volume Up+Power+Home for several seconds. Then I am warned that downloading a costum OS might be dangerous, I continue by press Volume Up.
I finally get stuck with a big droid and "Downloading... Do not turn off target !!" and also
ODIN MODE
SECURE DOWNLOAD: ENABLE
MOM DOWNLOAD BLOCK: 0
PRODUCT NAME: SM-J320FN
CURREN BIN: Samsung Official
SYSTEM STATUS: Official
FAP LOCK: ON
USB Init Start!
USB core reset done!

It's the same screen since 6 hours, is there a way to make the download complete?

This happend to me on J3  2017, I left it for more than 48 hours but nothing. Then phone batery ran out, so phone reseted and firmware was deleted. I needed to download new firmware with Odin to phone  from https://www.sammobile.com/firmwares/. It took me 8 hours too download it, becaose that site  has Premium with normal download speed, but you need to pay for it.
ODIN DOWNLOAD
Put file in Odin and start downloading.
That process will fail hidden(it should fail) and you need to make a last step manulay. Link for official Sammobile tutorial :https://www.sammobile.com/forum/threads/35929-SOLVED-firmware-flashing-FAIL-after-hidden-img
I do not know if is this going to help you, but you can reset phone with this method to a state before you start this. And if you do everything good you wont loose your data.
And for PIN reset you can just make hard reset :Volume Up + Home + Power button for a couple of seconds and navigate with Volume button to hard reset. It will wipe all of your data to factory settings(if you have Samsung Acc. backup everything will be safe), including PIN code, but you need to input your gmail pasword (if you have gmail on phone) to unlock it,or phone will be locked.

http://fw.updato.com


text:
Google play and play services for Sony Experia T3
I lost my phone and lost all google apps as a result. Now I want to reinstall Google play and play services. Kindly assist

Welcome to Android Enthusiasts! Can you give more information? You lost your phone and was able to get it back? Or do you have a new phone? If you got it back, where only Google Play and Play Services that were no longer available? Did you check if they were disabled? Please edit your post and add more details.

I managed to get the phone back, long after I had bought 2 other phones. Now I want to start using my old phone which has no google play apps save for google. I have tried downloading google play and services, but to no avail.

Have you checked if they have been disabled in Settings -> Apps, then click the 3-dots followed by show system apps? Is/was your phone rooted?

The app preferences were reset and th phone is rooted


text:
Can I recover files after factory reset if I root after resetting?
Device: ASUS Zenfone 2 ZE551ml
OS: Android 5.0
Notes: Not rooted, USB debugging not enabled, no custom recovery
My phone's storage got too full after recording too many videos and I backed them up to Google Photos. I hadn't backed up or moved the files to any other location and my phone ran out of power in the process of backing up to Google and when I tried to boot it, it got stuck on bootloop (is that what it's called?) where the screen gets stuck on the ASUS logo with the loading circle. I've tried rebooting it, charging it for eight hours, clearing the cache partition, rebooting it again overnight and it still hasn't revived yet. Since my phone is not rooted, developers option and USB debugging is not activated, and I don't have any custom recovery services installed I can't use ADB or SDK and the like.
Since the full memory is most likely the main issue here and I can still access recovery mode, I'm not too worried about my phone getting hard bricked. All I really want to do is recover my data, mainly photos (the ones that might not have been successfully backed up in Google) and .txt files from my Inkpad Notepad app which I stupidly didn't sync/back up for 5 months. As I mentioned my phone is not rooted, USB debugging isn't enabled, and I don't have CWM or anything like that so I can't access my internal memory from recovery mode. I am also almost blind to technology and tinkering with electronic devices is too complicated for me and I doubt I would be able to execute it well, so I was thinking of doing a factory reset and immediately using a file recovery app to recover my data. From what I've gathered, it's possible to recover files from a factory reset as long as the cached (?) file remains don't get overwritten, and so it's best to not use the device after factory resetting it. If I'm mistaken, please correct me.
Now I have a few questions about this; please bear with me:

What application/program would be the best to recover .txt files?

Most file recovery apps can recover images, videos, audios and even documents but so far I haven't seen one that explicitly lists TXT in its list of files it can recover. I really want to recover my notes, so I want to be sure that I can prepare an app that can actually recover my files. I've tried DiskDigger before, but it was to recover an image so I don't know how well it would work for other file types. Also, I would appreciate it if the app were free, although it doesn't have to be so long as it works well.
Also, what android file recovery programs do you recommend in general? Which ones actually work well? Because I've seen a lot of mixed reviews regarding these apps, at least in Playstore.

Would this method work if I root my phone after factory resetting it?

Since my phone was not previously rooted, I have concerns if this method would work. Would rooting my phone after factory resetting affect my data remains?

If this method is possible, could you provide me with step-by-step instructions on how to do it so I don't mess up?
If this method is not possible/unreliable, would you have any suggestions on how I can actually recover my files?

Are my files actually recoverable? Are .txt files recoverable? Will I be able to recover my data and photos in relatively good quality?
I recognise I have been negligent in backing up my data and I plan on never doing it again within my capabilities. I desperately want my data back, so if anyone can help me with this, it will be much appreciated. If anything happens I will be sure to update. Thank you.
Edit: I have not done a factory reset yet, my phone is still just turned off for the time being.
Also, this got me thinking. Does unlocking bootloader and factory resetting delete the data in the same way? If so, could unlocking bootloader make my phone boot properly again, instead of factory resetting first and double-deleting my data. Would that work?

Possible duplicate of How to recover a deleted file from /data partition?

In order to recover data you need either some custom recovery or root access. Both require unlocked bootloader. And unlocking bootloader must erase everything on your /data and /cache partitions, making it irrecoverable, even from, what you call, cached files. See this answer as well: https://android.stackexchange.com/a/214496/218526. If you somehow manage to boot custom recovery without data being erased, you can for sure access it. But that's highly unlikely, though depends on SoC/OEM if they programmed their bootloader to erase data or not.

So that means if I unlock bootloader, there will be absolutely no way to recover my data? Is there no way to root my phone without unlocking bootloader? What can I do about this situation? I'm pretty blind about Android and everything, so although  the posts you've linked are useful I don't understand much of it. Is my data completely unrecoverable at this point? Do I have any hope of resurrecting my phone without factory resetting? Sorry for so many questions, and thanks for your time.

I never used Asus, never used Intel SoC, and I don't recommend going for unofficial modifications to your device. But here is an unofficial method listed to boot your device in custom recovery without unlocking bootloader. You may try it on your own risk.

Sorry, but I have more questions. Can CWM recover files if factory reset was done? How can I recover deleted files with CWM? Since from what I've read, CWM mainly backs up the data before restoring it. Also does unlocking bootloader and factory resetting delete the data in the same way? If so, since my phone's main problem is a full memory, could unlocking bootloader make my phone boot properly again, instead of factory resetting first and double-deleting my data? Would it matter? Or does unlocking bootloader just erase everything?

You should first familiarize yourself with basics e.g. what is CWM, bootloader, factory reset etc. So that questioning and answering make more sense. The questions you asked are all answered in provided links. But still if you don't want to read those, edit your question to include all of your related questions in a list and I'll address all of those in the answer, not possible to answer in comments.


text:
How do I enable DNS over HTTPS on Firefox for Android?
I found the option to enable DNS over HTTPS for Firefox on the desktop but I can't find it on the Android version of the browser. Is it supported? How do I enable it?

I try to complete Dale answer

Open Firefox and type: about:config
filter with: network.trr.* and set the following values:
network.trr.mode value 3
network.trr.bootstrapAddress and set value as one ip from this page
(mine value is currently 104.16.249.249)
now open a new tab to this page used to verify if everything is working. You should have all green except sni. To make all green you should
switch tab and go back to config page
change filter with: network.security.* and set:
network.security.esni.enabled value true
go back to previous tab and refresh. You should have all green.

credits/references:

Dale answer
Mozilla Wiki Page
u/SKITTLE_LA Reddit answer

I needed this because my mobile data DNS is failing for some addresses. After setting network.trr.mode=3 and network.trr.bootstrapAddress=104.16.249.249 it works! Thanks!

This seems either outdated or wrong. Typing about:config in Firefox Android does nothing (the contents of the view does not change)

@RomualdBrunet you have to use firefox nightly version app for android to be able to access the config page

Although I have not been able to prove it's really changing the routing of DNS queries, I have changed the settings on Firefox for Android: network.trr.mode to 2 (fail-over enabled) or 3 (fail-over not enabled) and network.trr.uri to 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google) or 9.9.9.9 (Quad9).  This came from this Mozilla page (not specific to Android Firefox).  So you type about:config in the address bar, then search for and change the network.trr* settings.
But as mentioned by Irfan, you can have all your DNS go to cloudflare by using their 1.1.1.1 app, or if you're on the Android Pie, you can go to Settings > Network & Internet > Private DNS and select Automatic (I'm sure that's GOT to be Google's 9.9.9.9) or Private DNS provider hostname with 1dot1dot1dot1.cloudflare-dns.com, for instance (credit to this page on TechRepublic).

You'd have to set the network.trr.mode to 3 to test if it's really working. Mode 2 uses regular DNS as a backup if DOH fails, so you won't really know if you're using DOH if you don't test it in mode 3 first.

For some reason using network.trr.mode to 3 fails to work when I'm on mobile data, but works fine when I'm on WiFi.

Things have changed since the time most of the answers were written so here's an updated version:

The previous TRR (Trusted recursive resolver ) only encrypted the SNI(server name indication) which proved to be insufficient in masking your DNS queries. It has been shown that DNS queries , especially the SNI can still be leaked. So a new draft has been proposed which suggest to encrypt the entire 'Client Hello' message. This new draft (initially called draft 8) has been now referred to as ECH (encrypted client Hello). And it still under development, no browser have yet released it for production. This upgraded version would require all DNS servers to implement it for it to work properly. And as of date not many (I think none) have it working. Meanwhile firefox had removed Encrypt SNI since version 85. It would replaced by ECH in near future.

Though one can still enable DoH (DNS over HTTPS) or TRR(Trusted Recursive Resolver ) as Mozilla calls it.
From the firefox nightly version, go to about:config
then turn network.trr.mode to 2 or 3 depending on whether you want to fail the request if TRR fails to resolve the address or use a fallback default (your ISP) as your resolver.
firefox has cloudflare's 1.1.1.1 set as the default TRR so you don't have to change anything else.
In the absence of Encrypted SNI, it won't be as secure but still be able to access some DNS blocked sites because most of the ISP's still don't have the means to find out.
Some ISP that have advanced DPI( deep packet inspection) means would  be able to detect it though


text:
Is Mozilla Firefox for Android, Fennec, using same Desktop Firefox "Quantum Engine"?
I have, up to now always thought that Firefox for Android (codenamed Fennec) uses much of the same codebase as the Firefox for Desktop (Linux/Mac/etc...). However this recent post on HackerNews makes me think I might have got this wrong.

This marks the last Android release with extensions/add-on support.
  There will not be a 69 release of this edition of Firefox for Android
  ("Fennec").

I am of course concerned about the add-ons support, but also remain confused, to the best of my understanding Firefox on the Desktop systems has already been using the changed new Web-Extension API, has Fennec not supported this, and more importantly:
is Fennec something different (if so how) to the Desktop Version of Firefox (which I suppose is gradually becoming more Quantum).?

Fennec (<=68) is being phased out in favour of Fenix (>=69).
From that standpoint, Fennec will be "frozen" at version 68 and will not be updated to the engine used by the desktop version of Firefox 69.
Fenix will, at some point in the future, replace the current version of Firefox Android and is slated to begin at version 69, with some overlap with version 68.
Fenix features a largely rewritten architecture and engine and brings a lot of potential benefits, but the existing Fennec is pulling too much developer time away from it and causing problems in both camps. As a result it seems they want to draw a line in the sand, call an effective halt to Fennec and move over the majority or developers time.
Android Police have some more information detailing the change.
One of the things not currently supported in Fenix is extension support, and it is for that reason that the article you list states that Fennec is "the last Android release with extensions/add-on support."
It is currently unclear, as far as I can see, as to what the intention actually is with regards to extension support in the future. It may well be that if we choose to upgrade in the meantime that extensions are lost temporarily but, short of Firefox following Googles lead with regard to crippling the extension system, I would expect them to return at some point.
It does appear that there is still some discussion going on and that feature parity with the current version (Fennec/68) is intended.
The mobilisation of developer time might actually turn this feature from "nice to have but low priority" to being actively worked on.

So can I understand you answer that Fennec may or may not have had features subsumed under "Firefox Quantum" already? It however is different to Firefox Desktop enought that it takes additional developer time. Time that should be now spend for its successor Fenix (which albeit will lack web-extension support, even though web-extensions are already the "painful loss taken" for the Firefox Quantum, which lost the orignal/legacy extensions)?

I've only recently switched back to Firefox Mobile since I found that Greasemonkey and userscripts work perfectly on it. The performance is definitely well above what I experienced previously so I had assumed that the Quantum engine improvements were there and the Wikipedia page also seems to corroborate: https://en.m.wikipedia.org/wiki/Firefox_for_Android in the release history section "Version 57.0: November 14, 2017. First version based on Quantum project."

thanks for that piece of information. I asked that question because of the confusion regarding "Extensions and Quantum engine". It seems that Quantum (with Electrolisis multi-process) when introduced (also in Fennec as you mention) slaughtered many extensions and was unpopular. The link to HN above featured some replies that mentioned Quantum being the reason for the no extension in Fenix, when indeed I was thinking that Quantum is already in Fennec. It seems Fenix is something completely new, yet also based on the Quantum, which fennec is already.

I can see why the loss of extensions was a problem in the past and the loss of them again in another system is a problem, but most of what I can find suggests that like last time it is a short term problem and is being dealt with. The timeline doesn't look to be set in stone either so things are happening.  That HN article seems to be being needlessly fatalistic.

Fennec: Firefox for Android (based in FF version 68.x).
Fenix:  Firefox for Android (based in FF version above 69.x
Fenix is based in Android Components and GeckoView (Firefox Quantum engine)
Curiously the usage of names can be a little bit confusing because the
app "Fennec" (from F-Droid) at the moment is based on the latest Firefox( Fenix).


text:
Can I use the phone's mic when connected to a bluetooth speaker?
When connecting the phone to a BT speaker that includes a mic (pretty much all of them), the speaker acts like a BT headset, and the phone's mic is disabled.
Can I use the speaker for audio output only, using the phone's internal mic?
Update: Think about handling a phone call using the BT speaker, but its mic is lousy and noisy, so I want to use the internal phone mic instead.

If you have the BT, the best thing would be to test

@Beveloper - ... and how should I test that???

you asked: Can I use the speaker for audio output only, using the phone's internal mic? your post sounded like you did connect the speaker but the mic is disabled. So to test if the internal mic works is to use a sound recorder on your phone to check that

@Beveloper - re-reading my post, I do not see why you understood that the mic is disabled. My question is - how to disable the external (remote) mic and use the internal mic instead, while still being connected to the remote speaker for audio output. See update.

Okay. Lets see if this works: Go to your phone Bluetooth setting, from the list of paired devices, select the configuration button on the right of the BT Speaker. There's always options to select "functionality" which can be marked on or off. Check if you'll see a Mic option there and deselect it...

How the person's voice will be head over the speaker

@Beveloper - OK that was a good idea. I checked the phone BT setting for the speaker device. You can configure it to pair as a phone device or as a media device. So I disabled the "phone" setting and tried calling. The problem is that now it won't connect for phone calls at all. So, no luck here.

sorry about that. Wish I could assist futher. I guess you may have to disconnect the speaker when making calls then


text:
USB OTG not showing WiFi network even after drivers are installed in Android kernel
I am trying to connect to WiFi using a USB WiFi stick by making use of OTG on my Android Nexus 6. The USB WiFi stick has a separate AP. However, I am unable to see this AP in the list of available WiFi networks on my android phone.
I have installed a CROM with a custom kernel including the drivers of the WiFi stick. I can see the drivers and firmware being loaded using dmesg:
[ 3480.147186] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[ 3480.161788] usb 3-1: New USB device found, idVendor=2ef5, idProduct=0008
[ 3480.161807] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3480.161819] usb 3-1: Product: Dongle
[ 3480.161829] usb 3-1: Manufacturer: WiFi
[ 3480.161838] usb 3-1: SerialNumber: AB1018S052
[ 3480.174615] wifi 3-1:1.0: Firmware Version: 10441, $Revision: 13790 $
[ 3480.176511] ieee80211 phy9: Selected rate control algorithm 'minstrel_ht'
[ 3480.180991] ueventd: firmware: loading 'wifi/wifi_x/fpga_xc.bit' for '/devices/f9200000.ssusb/f9200000.dwc3/xhci-hcd.0.auto/usb3/3-1/3-1:1.0/firmware/wifi!wifi_x!fpga_xc.bit'
[ 3480.195460] ueventd: loading /devices/f9200000.ssusb/f9200000.dwc3/xhci-hcd.0.auto/usb3/3-1/3-1:1.0/firmware/wifi!wifi_x!fpga_xc.bit took 14ms
[ 3481.666134] wifi 3-1:1.0: probe::FPGA download success.

Also, there is a light on the stick that turns green when the drivers are recognized. So, I can say with surety that the drivers are loaded and the device is recognized. However, the WiFi AP for USB stick is not appearing.
When I do the same thing on my Ubuntu laptop, after loading drivers I can connect to two different WiFi networks at the same time, one with built-in WiFi card and the other with USB stick. But I believe this cannot be done with Android, where you can connect to one WiFi at a time.
I suspect that even after the drivers are loaded, Android is only scanning WiFi networks available to built-in WiFi card. Is there a possibility to disable the built-in WiFi in Android and make the Android OS scan WiFi networks available to USB WiFi stick as well?
Thank you.

Do you get a network interface on Android when USB WiFi stick is connected?

@IrfanLatif No, I can't see any additional active interfaces using ifconfig in adb shell.

Neither in /sys/class/net/?

@IrfanLatif: There are following interfaces, but these interfaces exist even without installing the device drivers:
127|shamu:/ # ls /sys/class/net/
dummy0/         r_rmnet_data3/  r_rmnet_data8/  rmnet_data4/    sit0/
lo/             r_rmnet_data4/  rmnet_data0/    rmnet_data5/    usb0/
r_rmnet_data0/  r_rmnet_data5/  rmnet_data1/    rmnet_data6/    wlan0/
r_rmnet_data1/  r_rmnet_data6/  rmnet_data2/    rmnet_data7/
r_rmnet_data2/  r_rmnet_data7/  rmnet_data3/    rmnet_usb0/

Seems like the problem is with your driver. Also confirm with iw dev | grep Interface and cat /proc/net/wireless.

@IrfanLatif: There is an interface with wlan1 with the name of the device in the Driver name as well. Can you tell how can I scan over wlan1 interface rather than default wlan0 interface and connect to a WiFi over it?
2|shamu:/ # iw dev | grep Interface
Interface wlan1
Interface wlan0
shamu:/ # ifconfig wlan1
wlan1     Link encap:Ethernet  HWaddr 70:b3:d5:95:85:fe  Driver lifi
BROADCAST MULTICAST  MTU:1500  Metric:1

iw dev wlan1 scan. But for that interface should be UP.

Try iw wlan1 interface add wlan1 type managed && ip link set dev wlan1 up.

Or iw phy phy9 interface add wlan1 type managed && ip link set dev wlan1 up.


text:
How can I change the icon, icon name that lays under the icon, notification name, and notification icon for an Android app?
I'm running Android 5.1.
I'd like to change the icon for a few apps on my device.
I'd also like to change the app name both on the desktop and on the notification window that the OS makes pop up when those apps push notifications to my device.
Lastly, I'd like to change the notification icon that appears at the very top of my screen when a notification is pushed.
How can I do this?
I think I need to take the app, somehow "unzip" it and get the APK for it, change the image files and text files that carry those pieces of data, "re-zip" it, and finally reinstall it.
Is this correct?
How do I accomplish my goal?
Thanks.

Try APK Editor. Some Launcher apps (what you call desktop) like Nova let you change app icon and their label apparently. However to change notification related things, you need to modify app, which can be illegal/unethical if developer doesn't allow to customize his/her intellectual property.

You need an apk editor. With it you can edit app,so change icons etc.,but you also need to change JSON file becaose app need to know which file it need to use. After you edit app, you need to sign it,  most app editors do it automaticly. And then install like update over app. But there is a problem. Some apps will after update return to original settings. And some will give you notice that app is edited and forbid you from using it. So all dependent on app. You did not specify your device manufacter, but if you have Samsung you can change icons of most apps in Samsung Theme app(some thems can change app icon design and notification iconand you can also  download only app icon design).
If you only want to "edit" app you need to be vety carefully to not ruin app completly. Good Luck.

Hey, thanks for the info. I downloaded an APK extractor, extracted the APK I wanted, moved it over to my Linux box, and opened it up. Where do I find the icon .png, name, notification .png icon, notification name, and notification ring tone? What are the names of those files? Where are they in the APK structure?

I managed to find all of the things I needed to change in the APK. But, when I attempted to install the altered APK, I got an error. I don't think that the APK is properly signed after altering it. Any ideas?

Did you also change JSON file?

no. why would i need to change it? I didn't change any of the file names.

If you change any part of app(icons set), you also need to change JSON file,which control app.


text:
incorrectly receiving DNS settings from AP when connecting to public wifi
I had to fly recently. The flight had in-flight entertainment through gogoinflight, but I couldn't access it on my phone while everyone around me could.  I thought the problem was with the router but I couldn't access the public wifi in the destination airport, either.  I couldn't even open the wifi login pages to accept the user agreements. Nothing seemed to work!
Cellular internet works fine.  Wifi at home works fine.
On another recent flight, I also took my laptop so I could check network settings against my phone's settings.
# ip addr

yielded the same subnet and same gateway
# ip route

yielded the same routes, too.
(from memory)
# ip route
172.19.131.141/23 dev wlan0 proto kernel dhcp scope link src 172.19.131.0

from my laptop, the login page, or airborne.gogoinflight.com was in the 172.19.134.x subnet, but that should be fine based on the route's mask (/23).
for good measure, I added a 0.0.0.0/0 route through wlan0 but still nothing.
At this point, it looked like my phone knew how to get at IP addresses, but there was a problem with the DNS settings.
I checked DNS settings in /etc/resolv.conf on my laptop:
/etc/resolv.conf
--------------------
nameserver 172.19.(something).(something)  <--essentially, the access point transmitted the DNS to my laptop correctly and I was able to resolve addresses without problems

on my android phone:
/system/etc/resolv.conf
------------------------
nameserver 8.8.8.8 <--because google and android...
nameserver 8.8.4.4 <--because google and android...
nameserver 172.19.(something).(something)  <--essentially, the access point transmitted the same DNS server to my phone when I connected.

Even though I know it doesn't matter, I removed the WAN dns entries to google for good measure and made the resolv.conf file match my laptop's, but to no avail!
I tried multiple browsers (Chrome and Firefox), too,  to make sure it wasn't a browser setting.
any ideas?

Android's bionic libc resolver doesn't use /etc/resolv.conf normally: http://androidxref.com/9.0.0_r3/xref/bionic/libc/dns/resolv/res_init.c#286. And ip route isn't enough to see Android's routing table. It only shows main (254) table, while Android uses table 97 for WiFi.

Hi, Irfan.  Thanks for your response. I am unfamiliar with libc's dns resolver.  Glancing through the code, it looks like it's parsing a file called _PATH_RESCONF, which, as found in resolv_private.h, is defined as "/etc/resolv.conf" or "/etc/ppp/resolv.conf" (I don't know the value of ANDROID_CHANGES).  My phone doesn't have a "/etc/ppp/resolv.conf" file, so that leads me to believe it uses "/etc/resolv.conf".  This is contrary to what you suggested. What would it use if not /etc/resolv.conf?

Related: https://android.stackexchange.com/a/205740/218526. Android's DNS resolver uses nameserver values received from DHCP which the client doesn't save to /etc/resolv.conf or any other file.


text:
How to load kernel module with Magisk root but without custom kernel?
I am having a really hard time finding anything about this on Google which is not from 2011. I have a Samsung Galaxy S10+. I have rooted it with Magisk without TWRP, i.e. no custom recovery or custom kernel. I want OTA updates without having to delete everything on my phone just to update, that is why I use Magisk without TWRP.
What I need is drivers for my WiFi adapter TP-Link TL-WN7220. I know that to be able to install a driver into the kernel, that means a custom kernel and then you would not be able to have OTA updates which defeats the above purpose.
My question is, is there a way to load a driver, even if it is temporary like loading a kernel module on Linux? On Linux this does not require a reboot, can this be done similarly on Android, so I will keep my stock kernel but still be able to run the WiFi adapter?

Is it possible to add a driver to my kernel without flashing a new kernel?

I know that to be able to install a driver into the kernel, that means a custom kernel and then you would not be able to have OTA updates which defeats the above purpose.

You can't have OTA updates with Magisk installed because flashing Magisk modifies boot partition in which kernel binary lives. Before OTA update, you will have to uninstall Magisk which will restore original boot.img, backed up in /data. So at the moment you can do whatever you want with kernel. That will be reversed with Magisk uninstall.

is there a way to load a driver, even if it is temporary like loading a kernel module on Linux?

Yes you can load kernel modules just as you do on Linux. But for that you have to rebuild kernel with the required module, or it should be compatible with installed kernel if built separately.
The installed kernel should be built with CONFIG_MODULES=y in order to load modules. Make sure the version of kernel source code tree or that of header files match with installed kernel version. Otherwise dependencies may break resulting in Unknown symbol in module type of errors. Also, if kernel is signed (CONFIG_MODULE_SIG_FORCE), modules must be signed with the same key to avoid required keys not available error.


text:
Does my Galaxy S6 have an unlocked bootloader?
I want to install the Resurrection Remix custom ROM on my SM-G920I (Australian Version). Before I start doing anything, I need to make sure that the bootloader is unlocked, so I don't brick my phone.
To find out the state of my bootloader, I tried doing a few things that I read online. First, having a look at download mode, by holding home, power and volume down on startup. It instead goes to "Odin Mode" and lists these items.
ODIN MODE
PRODUCT NAME: SM-G920I
CURRENT BINARY: Samsung Official
SYSTEM STATUS: Official
REACTIVATION LOCK: OFF
SECURE DOWNLOAD: Enabled
KNOX WARRANTY VOID: 0 (0x0000)
RP SWREV: B:4 K:2 S:2

Do any of these items tell me about the bootloader?
I then tried using the ADB and fastboot method. Fastboot refused to work for me, saying no devices found. I later found out that Samsung devices do not have a fastboot mode at all.
Lastly, I tried just going to Developer Options and enabling "Allow OEM Unlock", but this feature was nowhere to be found on my device.
How am I able to check if my bootloader is unlocked, so I can root and flash a custom ROM on my device?

Most if not all non-US-carrier Samsung devices come with unlocked/unlockable bootloader; those without the "OEM Unlock" switch are simply unlocked by default. Just proceed with flashing TWRP or whatever ops you need to do next.

How do I make sure it's unlocked? I don't really want to end up bricking my phone.

AFAIK there's no concrete way of checking bootloader status on Samsung devices, since they have no fastboot mode. Most if not all sources on the internet will tell you to determine from the model number, i.e. whether it's from those US carriers.


text:
Can't erase cache using fastboot on OnePlus2
My OnePlus2 (I think using OxygenOS) displays start icons (normal logo and fastboot, depending on how I boot it), however, afterwards the screen always remains black, while the phone responds to key presses.
Booting in recovery mode starts up the phone too, but never displays anything.
I tried to clear the cache using fastboot (following the fastboot-info on here), but get this response:
$ fastboot erase cache
******** Did you mean to fastboot format this ext4 partition?
erasing 'cache'...
FAILED (remote: device is locked. Cannot erase)
finished. total time: 0.020s

When I tried to unlock, following the -help suggestions, e.g.:
  flashing unlock                          Unlocks the device. Allows flashing
                                           any partition except
                                           bootloader-related partitions.

But it doesn't work:
$ fastboot flashing unlock
...
FAILED (remote: unknown command)
finished. total time: 0.006s

And another command I read about seems disabled:
$ fastboot oem unlock
...
FAILED (remote: oem unlock is disabled)
finished. total time: 0.009s

Is there another way I can erase the cache using fastboot or adb? I hope clearing the cache might resolve the black screen issue on my phone.

Black screen in recovery too, doesn't seem to be /cache related. Anyway: On your phone go to Settings > Developer options. Then enable the 'OEM Unlocking' option.: https://forums.oneplus.com/threads/24-06-2016-oneplus-2-how-to-unlock-bootloader-flash-twrp-root-nandroid-efs-backup-and-more.345478/. A little bit search is usually helpful.

Hei, thanks for your comment @IrfanLatif - do you have an idea what else it could be related to if it's not the cache? I've found multiple resources online that mentioned that black screen on startup might get resolved with clearing the user cache, so that's why I've been trying to do that.

Might be the /cache is responsible. But device should boot in recovery mode at least.


text:
Installing a homebrew/linuxbrew formula on an Android device
How would one go about installing a simple homebrew/linuxbrew formula on an Android device via adb? Specifically, I want to install this formula which contains a cli tool called aamath that translates mathematical formulas into ASCII art. I would want to verify that I can run this tool inside an adb shell session. Then a second step (which I may ask in a future question on this site) would be to write my own APK that invokes this tool.


text:
Mobile Legends takes total of 2.2 Gb in my internal storage, but I can't locate where the other 1.4 Gb is
Mobile Legends takes total of 2.2 Gb in my internal storage

I want to know where that 2.2 Gb is located.
I went to /storage/emulated/0/Android/data/com.mobile.legends but only 600+ MB is in there

Went to /storage/emulated/0/Android/obb/com.mobile.legends - nothing there, just a mobile legends folder that is empty.

Where is the other 1.4 GB located?

I don't know the app, so I won't write a comprehensive answer, but I suspect, it's in /data/data/com.mobile.legends/. All user data is usually confined to /data/data/ unless explicitly (by the developer) written to external storage.

@GiantTree There's no /data folder inside the parent /data. All folder starts with "com." , "org." , etc. (https://i.imgur.com/MkW23Yi.png)

@yalpsid The /data/data folder exists on every Android folder I know. However you don't have access to list it's content. And every app has only access to it's app-specific subfolder. If you want to see the content of /data/data folder you must be root.


text:
Using wlan1 instead of wlan0 in Android Nexus 6
I am trying to use a WiFi dongle with Android Nexus 6 with custom ROM and kernel. I have installed drivers of USB WiFi dongle on Android phone that appears at wlan1 network interface in adb shell. Whereas, the default WiFi appears at wlan0. However, I am unable to access or even ping the devices available on wlan1.
I have connected the USB dongle to it's WiFi and assigned an IP address:
iw dev wlan1 connect -w WiFi-XC
ip addr add 172.16.0.120/16 broadcast 172.16.255.255 dev wlan1

The dmesg show that the association to the WiFi AP is successful:
[  242.667204] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[  245.599269] wlan1: authenticate with 70:b3:d5:95:94:6e
[  245.599934] wlan1: send auth to 70:b3:d5:95:94:6e (try 1/3)
[  245.603278] wlan1: authenticated
[  245.604767] wlan1: associate with 70:b3:d5:95:94:6e (try 1/3)
[  245.606292] wlan1: RX AssocResp from 70:b3:d5:95:94:6e (capab=0x421 status=0 aid=2)
[  245.609720] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[  245.616657] wlan1: associated

The routing table looks like:
10.10.0.0/16 dev wlan0  proto kernel  scope link  src 10.10.10.108
172.16.0.0/16 dev wlan1  proto kernel  scope link  src 172.16.0.120

Whereas, the output of ifconfig looks like:
wlan0     Link encap:Ethernet  HWaddr 44:80:eb:30:e5:03
          inet addr:10.10.10.108  Bcast:10.10.255.255  Mask:255.255.0.0
          inet6 addr: fe80::4680:ebff:fe30:e503/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3670 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4500 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:854154 TX bytes:1080264
wlan1     Link encap:Ethernet  HWaddr 70:b3:d5:95:85:f1  Driver wifidongle
          inet addr:172.16.0.120  Bcast:172.16.255.255  Mask:255.255.0.0
          inet6 addr: fe80::72b3:d5ff:fe95:85f1/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:487 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30055 TX bytes:6051

When I try to ping the router at 172.16.0.10, or ping the device from router, the ping doesn't succeed. However, when I try to run nmap -sn 172.16.0.0/24 on the router to see the devices it can see, surprisingly it shows that it can see the device:
Starting Nmap 7.60 ( https://nmap.org ) at 2019-07-11 12:56 UTC
Nmap scan report for 172.16.0.120
Host is up (0.0017s latency).

I have a suspicion that both wlan0 and wlan1 cannot work at the same time. If this is the case, how can I take down wlan0. If this is not the case and both wlan0 and wlan1 can work at the same time, can someone suggest a solution?

You are looking at only main table in routing table. Android uses many other tables as well, particularly 97.

As indicated in the comments, there are multiple routing tables that Android uses. The routing table that is shown by ip route show is the main routing table, which is not added to ip rule list by default in android. Do add the main routing table to ip rule, you need to execute command ip rule add from all lookup main pref 1.


text:
DeX mode not starting after Android security update
After recent two Android security updates, Samsung Galaxy Note 8 plugged into a DeX station is unable to detect it and therefore it is not offering the notification which allows to turn on the external monitor or going to DeX options.
Attached keyboard and mouse via USB ports on Dex Station still work fine with the phone as it is. Only the DeX mode recognition seems to be gone.
What I did try:

An advice to plug the phone into DeX Station unplugged from the power and the re-attached the power cable but it did not help the DeX recognition.
A troubleshooter from Samsung. Update was completed, no change.
Trying the device elsewhere with a Galaxy S9 phone. It worked normally.

It was an HDMI connectivity issue.
If there is a connectivity issue to an external monitor, for example HDMI cable is detached or damaged, the DeX Station behaves exactly as described above. Everything in DeX Station seems to be working except of the external monitor which remains blank and also there is no DeX item among notifications.
My assumption that the external monitor will start working after the DeX notification is clicked was wrong. The monitor should always produce the image from the phone when the phone is on. Only then the DEX notification follows on the phone.


text:
How to remove telegram's secondary account
Telegram has multiple accounts feature and you can follow the guide here on how to enable it.
The problem is I can add a new account, but can't find any button or option to remove it.

Open that account.
Go to Settings.
Tap on three dots in the upper right corner.
Log out.

Wow .. hidden place just to log out. Thanks btw


text:
Is it possible to change notification bar on Android Pie?

Hi. After updating Samsung Galaxy J7 2018 to Android 9.0(Pie), my notification bar changed. So is there any way to change icons order
(justify clock to the other side).
NOTE: My phone is not rooted.

it is the android 9 feature to place clock on the left.

so, it can not be changed?

Android version 6 had such features which is not available in android 9. May be it requires a root permission to change clock position.

I believe you can do that. Download Good Lock 2019 and install Quickstar. You can move the clock back to right, or even hide it. You also can hide/unhide other icon on the status bar.
If you are unable to use Good Lock, there is alternative. Download an app called "Nice Lock". Then you need to manually download and install "Quickstar apk" from apkmirror. After that, open Nice Lock and from there open Quickstar.


text:
How can you open a URI from the command line?
I recently started playing with the app called 'Automate'. The starting block for each Automate flow provides a URI. Can this URI be used to initiate a flow? Can I accomplish this from the command line? Specifically, I would like to call Automate flows from within a Termux environment.
I assume this can be done with am start ... but I haven't had any luck trying different commands (and I have successfully used am from within Termux before, so I don't think that's an issue). I have very limited knowledge of Android intents.
I tried running am start -d content://rest-of-uri and I received a prompt asking which app to open, I chose Automate and the notification appeared for a second but the flow didn't run.

As shown here, you can use these commands:
am start -a com.llamalab.automate.intent.action.START_FLOW -d content://com.llamalab.automate.provider/flows/13/statements/1

or
am start -a com.llamalab.automate.intent.action.START_FLOW -d content://com.llamalab.automate.provider/flows/13/statements/1 -n com.llamalab.automate/.StartServiceReceiver

Replace content://com.llamalab.automate.provider/flows/13/statements/1 with your flow URI.
The first command worked for me while the second was giving an error in Termux and result=0 in Terminal Emulator.

Thanks! The first one is working great. Is there a way to pass data to the flow as a variable?

I am not sure if it's possible as I see no input variable for the Flow beginning block. What I have read is that you can write your variable to a file, then read it from your Flow.

Oh yeah that should work, thanks!


text:
Backup data from android device (Xiaomi mi A2)
I need to backup data from my android phone. OS is broken (unknown reason). see attached sreenshot https://i.stack.imgur.com/znSXR.jpg
I can't enter bootloader - device stucks.
That's the only options I have https://i.stack.imgur.com/6uB0o.jpg
Device is not rooted. I'm PHP developer but have no android skills. I already tried adb, but unsuccessfully:

adb backup says "adb: unable to connect for backup: closed"
adb shell says "error: closed"
adb pull says "adb: error: connect failed: closed"

I can put ROM update via "adb sideload" but it says "update package is older than current build", as I have newest Xiaomi update
I do not want to make hard reset before making a full data backup.
thanks for any help

If your bootloader is previously unlocked, in recovery the entry 'reboot to bootloader' should bring you fastboot mode, there you can try to flash TWRP

Unfortunately there is no known method for flashing TWRP with locked bootloader for your device. However, some hackers have investigated exploits via EDL Mode Qualcomm HSUSB QLoader 9008 (which you can trigger via test point) if your data is worth it, you can find someone who may break in. here is the theory http://forum.xda-developers.com/xiaomi-redmi-5a/how-to/bypass-bootloader-lock-redmi-5ariva-t3772381 and here is a method where the exploit is used http://xiaomitips.com/guide/how-to-root-locked-redmi-note-3-snapdragon.

beware even if managed to flash TWRP, you must find the right TWRP version which is able to decrypt your userdata partition. official latest is not always the best! for example Redmi 5 TWRP v3.3.1-0 has broken decryption, but there is a inofficial TWRP v3.2.3-0 which will successful decrypt (with default_password out of the box)

Thank you, this comment gives me to know  that is too difficult for me :) also there are many risks and the threat to waste a time. I already did a factory reset and that helped. all apps has been restored from google cloud. I just lost all the photos, but it is not a problem. thanks again for your time

authors: Микола Чорний


text:
I can't unlock bootloader on fly fron linux
My OS is majaro linux.
My phone is fly nimbus 8.
I tried to unlock bootloader on it.
I followed the instruction.
First I go to the Dev mod then enable OEM unlock and USB debugging.
Second I typed:

adb devices

output:
List of devices attached
56090913288827  device

Then I typed:

adb reboot-bootloader

It became like this:

Then I checked again:

fastboot devices

output:
56090913288827  fastboot

It seems all works out good!
But then I entered:

sudo fastboot oem unlock

And then nothing. I mean absolutely nothing: it does not throw an error, not answers, not completes.
By the way, the phone does the same - absolutely nothing!
if I plug off the device it writes:
FAILED (Status read failed (No such device))
fastboot: error: Command failed

I tried it already ten more times but it doesn't want to work!
Does anyone know what the problem?
Did somebody have the experience in flash the fly(in particular nimbus 8)?
I'll de be waiting for an answer!
Thanks!

I don't know why but Mediatek devices (which your device is) do not have bootloader support via fastboot. If you are looking to install a custom recovery or a ROM, you need to use SP Flash Tool. Visit its site to know about is usage.

@Firelord This is the case! If I wanna install custom recovery I need to unlock bootloader! I already tried SP flash tool, but again, when I click download it do nothing. However, when I start it from the terminal it sees when i plug in or plug out the device. PS. Sorry for my grammar!

try fastboot flashing unlock from windows with latest platform tools, linux platform tools have issues sometimes. SP Flash Tool can flash boot/recovery with locked bootloader. Do a readback first! Then try to flash stock boot/stock recovery first. if you can flash boot only, you can root with Magisk and write recovery with dd. if your device have MTK secure boot you need to find Secure Boot Download Agent

btw you have not installed Mediatek preloader VCOM drivers, you really need Windows for it. device must switched off for readback/flashing (flash with removed battery if possible)

I found out what the matter!
Fly nimbus 8  delivers in two kinds: with MTK and with spreadtrum!
In my case it was with spreadtrum.


text:
SMS archiving and control
I've searched throughout the web with no joy. My background: I've got 16+ years in software (I'm out of it but not before I built some Android apps for myself).
My problem is that I'd like to reduce the amount of space used on my phone for old messages but I'd like to keep them available.
Something like an automated system that prunes old messages to off-site (cloud) storage but makes them available upon demand.
What I want, is a system that lets me keep my chats growing indefinitely while keeping only a specified amount of space used on the phone.
Thoughts?  Suggestions?

sms database is growing regardless deleted messages. if you export all messages, delete database and import back, the size is reduzed. you can do it manually with MyPhoneExplorer

2 options come to mind.

Export sms to text file and upload the text file to a cloud service.
In your application, you would need to recognize when the user wants to load older messages, maybe an onScroll event or maybe a "Load More" button etc...
Store SMS entirely on cloud services.
Only load the sms from a cloud, and upload whenever you receive a message.
The application purely loads the sms list as a ListView from the content returned by the server.

Using PHP and SQL as the server API would work to build your own server.


text:
Background apps get killed (by something other than battery optimization)
All of my background apps get killed when I turn off the screen.
This is particularly annoying for my most-used messaging app, WhatsApp.
I've looked at the obvious "Battery Optimization" option:

Based on advice found elsewhere, I've checked that the background process limit in developer options is the default (I've never changed this AFAIK):

And yet, it gets killed in the same manner as battery optimization would. If I look at running background processes:

When I then press the power button, and power it back on after < 10s, the list is the same. But if I wait longer than that:

...whatsapp has disappeared.
This happens for all apps I install that have some sort of useful background feature - the Battery Optimization setting doesn't seem to do its job anymore.
What else can I try to diagnose this?
NB0: Android 7.0 on DOOGEE S60
NB1: This just started happening some time ago, i.e., it did work propertly when I got the phone.
NB2: I know how to use adb
NB3: I'm also fond of trying new apps and have ~400 apps installed. Ideally, I don't uninstall/disable all of them 1-by-1 to see which one is the culprit...

Install Addons Detector or any other similar app and filter to see which apps have permission KILL_BACKGROUND_PROCESSES granted.

@IrfanLatif hmm only 2 apps show up. 1 is MX Player (presumably because it can make itself the exclusive media player?), the other is Tasker (which I haven't used in ages). Both don't seem likely candidates...Uninstalling them, trying again.

@IrfanLatif nope, no effect. Whatsapp is still killed. If it makes any difference, most of my widgets (clocks etc.) also stop updating after reboot + screen off...same thing I guess

Use this method to track kill syscall. Requires root.

...hmm. It would appear the DOOGEE S60 is not easily rooted. Not without significant effort and wiping the entire phone, that is. Any other suggestions?

Hit and trial. Check logcat for any hints why apps killed. Disable doze completely: dumpsys deviceidle disable all. Check appops restrictions: appops get com.whatsapp RUN_IN_BACKGROUND. Go through related tags, make searches on forums, and try everything possible.

@IrfanLatif thanks ever so much!

Welcome and do share if something works for you. Also there are other factors like battery saver, adaptive battery, aggressive battery, background data restriction, power saving mode or any other performance boosting settings. But those might not be directly relevant to your case. And obviously, low hardware resources is an obvious reason for background being killed by Android framework or kernel.

Go to "settings", "memory" and turn off "background auto clean memory".

Hi, just for confirmation, is this for the device mentioned in the question, Doogee S60? Otherwise, you might want to note the device model since Android is highly customizable, and not every menu is there on every model/version.

Can confirm; that setting is not there on my model...


text:
Link2sd pkg error
I have problem with Link2sd app. When i'm trying to move any app to sd card following error appears. Any ideas how to fix it?
Samsung galaxy J3, 5.1.1 Android

fixed, solution for the future;
Just open Link2Sd and convert the system app to user app by clicking on the app, then click on the three dots on the top-right corner, then select Converto to user app. After that you have to restart and then you can move to sd, or link if you want to.


text:
Opening an .apk on Android shows a file list instead of installing
For a client I build a private app which their employees can download on their tablet and use. To get the app, the employee opens Chrome on his tablet and navigates to an URL to start the .apk download.
This approach worked fine for the last few years, till a few weeks ago. Instead of installing the app, a folder is shown with the files of the .apk.
The only difference I noticed is the source that's stated in the 'Downloads' screen. On June 16th everything worked fine, the source says 'chrome-native://newtab'. As of July 1th, the source changed to the domain where the .apk was downloaded and this problem occurs:

The tablets are only used for this particular app. The company buys a tablet, navigates to the URL, downloads the .apk and installs it. It would like to keep it as simple as this.
I've searched everywhere, but still have no clue what causes this problem. Any ideas?
This problem occurs on Android 8.1.0, the upgrade form 8.0.0 to 8.1.0 may be the cause of the problem. But I still have no idea how to solve it.

The issue happens with an incorrect HTTP header.
If the request has the right Content-Type header: application/vnd.android.package-archive, the APK will be installed correctly.

Hi, glad to know that you found the solution by yourself! Considering Android Enthusiasts Stack Exchange actually focuses on Android end-users (who are not necessarily developers), I'll try to reword the explanation for more end-users friendly. Feel free to [edit] and correct/improve it, thanks!

I just had the same problem and was looking for an explanation.
If you tap on an .apk in that list a message (Toast) pops up saying it can't open the file, right?
A workaround I found is to open the file explorer app and manually navigate to the Downloads folder and tap on the .apk there. You'll be able to install the app without issues.
Or you can just use another browser, like Firefox.
My guess is that Google restricts Chrome from opening APKs. Funny enough you have to explicitly allow Chrome to download APKs but now you can't install them anymore… Still trying to wrap my head around this.
I'll edit this answer if I find out more.

@Thijs Thank You, you've taken me in the right direction. A colleague set application/apk by mistake. However it only solved another problem (download not working), the problem with Chrome still persists. Do you know where else we need to set the Content-Type? We only added the MIME-Type in our IIS-Server. The APK is generated via the usual Android Studio function. It's the same with debug or signed release versions.
One more thing i just noticed: Downloading it from a site works (virtual IIS directory, clicking on file), but opening a direct link to the apk seems to cause the problem.

Okay, thanks nonetheless. I really think it has something to do with the latest Chrome version or Android security. Because it works with every other browser or file explorer. Just not with the Chrome- or Downloads-App. I'll leep an eye on this.


text:
Phone stuck in bootloop and recovery not working
TLDR: I wanted to root my LG G6 (H780) so I unlocked the bootloader, flashed TWRP, then SuperSU and now it's stuck in a bootloop and the recovery isn't working.
Unlocking the bootloader itself was as easy and gave me zero problems. Flashing TWRP was also easy however I did initially have a problem with it: it asked for a password to decrypt the storage even though (afaik) I had turned the encryption off. After some searching I found out that this might be a bug with the version that I used so I found a more up to date one for my phone. This time it didn't ask me for a password and I was even able to flash SuperSU. After flashing SuperSU I wanted to reboot my phone, and it's now stuck in a bootloop. If I try to go into recovery I get the 2 prompt that ask you if you are sure you want to delete all user data but after that, it just goes back into the bootloop.
I was wondering if anyone has any idea if there is even anything that I can do. I can't get it into recovery so I can't even use ADB (afaik). Thanks for your help.
I have seen other similar questions about this but I believe they are specifically for that phone.

I managed to start Download mode and use LG Bridge as shown in this video.
I wanted to try this before, but I wasn't able to get into Download mode. The time window to hold volume up and plug in the cable it pretty small.


text:
Is there a way to set up a firewall on mobile hotspot to block incoming connections?
I've been using the Android mobile hotspot to get an Internet connection while traveling. The stock hotspot is fine for my laptop which is firewalled, but there are a few devices (smart TV, game system, etc) which are not at all secure to put onto an open network.
I want to have a firewall on my mobile hotspot (for blocking all external traffic except return traffic). Is there any way, including app for that? Preferably open source but even paid is fine. My Android isn't rooted, so I would prefer a solution that doesn't require rooting my phone (if possible).
Just in case you might think NAT provides adequate firewalling for security, read here. TLDR; NAT is not a security layer.
I've already tried searching for this here, but I only found a question from someone trying to filter IP addresses that was never answered. None of the hotspots I found in the Play store offered any port blocking features.
I should mention that I have reason to believe my carrier's NAT does not block incoming connections. That reason being that running a web server on my phone using NodeJS in Termux will be accessible over the Internet.

I want to have a firewall on my mobile hotspot (for blocking all external traffic except return traffic). Is there an app for that?

No, apps can't do it. It's something at lower level, apps aren't that privileged. VPN apps are a workaround for outgoing connections (because of possible filtering based on UIDs and SOcket_MARKs), but not for incoming connections.

My Android isn't rooted, so I would prefer a solution that doesn't require rooting my phone (if possible).

Not possible without root (AFAIK), but with root it's simple; thanks to Linux kernel. Since Android uses default policy ACCEPT, drop any unwanted packets:
~# iptables -I INPUT -i rmnet_data1 -m conntrack ! --ctstate ESTABLISHED,RELATED -j DROP
~# iptables -I FORWARD -i rmnet_data1 -m conntrack ! --ctstate ESTABLISHED,RELATED -j DROP

First rule will allow only return traffic for Android device, second for tethered hosts. Replace rmnet_data1 with whatever interface your Mobile Data is using. I hope you won't want to block incoming connections from WiFi interface (wlan0) to let hotspot work.
Note that iptables rules on Android are dynamic, netd keeps on updating them with network changes. So better use these rules with some app like AFWall+.

I'm not an expert but as per my understanding, open ports make sense only when you have a public IP, preferably static, as is the case with fixed line broadband connections and special SIM cards with fixed public IP service. Mobile Network Operators (I assume you are connected to Mobile Data) always do Carrier Grade NAT (sometimes double NAT), basically to address the problem of IPv4 Address Shortage, but it also serves additional interests. They run e.g. transparent caching proxy servers and DNS servers behind this NAT to minimize load on internet bandwidth and to improve performance by reducing latency. When you are behind CGN:

Your public IP changes e.g. when you move.
Private IP you get (usually 10.x.x.x) is assigned by MNO's DHCP server, so it keeps on changing e.g. when the lease expires or when you reconnect.
Even if you get a fixed private IP, your ISP/MNO should forward ports from public IP to your private IP, which they don't. Because there could possibly be hundreds and thousands of customers wishing to forward the same port from same public IP to their devices.

So keeping incoming ports open in this setup serves no purpose except making the MNO's network vulnerable to attacks. And therefore most of the MNOs block incoming connections on all (or under 1024 or at least commonly used) ports. But it can't be tested because of CGN, which - as a side effect - is an additional layer of security, though not a firewall. You have a private IP, not routable on internet, no one can access you from outside, this should be considered security, more or less. That's why VoIP connections are always initiated from clients by letting the STUN server know where they are. And we have to go for solutions like this to accept incoming connections behind NAT.

there are a few devices (smart TV, game system, etc) which are not at all secure to put onto an open network.

Additionally your Android device is also doing NAT on traffic coming from tethered hosts. And there's no DMZ, UPnP or normal Port Forwarding set up on your Android device. It's another protection layer.

I have reason to believe my carrier's NAT does not block incoming connections

It would be really knowledgeable if you share how did you conclude this. However if you are sure that their NAT can be traversed/bypassed easily without any support from client side, or if you don't have trust on MNO or their firewalls, do consider setting up a strong firewall.
Common users are more focused on the apps installed on the phone; they are the actual spies. They collect personal data, leak information, do analytics, user profiling, tracking and targeted advertisement. So an outgoing firewall is of much importance.
Complicated firewall solutions for incoming connections are required on servers with listening ports. Android devices don't run servers (usually), except a local DHCP/DNS server (dnsmasq) for hotspot. If you run any services which accept connections from internet, it's another valid reason to setup firewall.


text:
How to tell if an SD Card is already internal storage?
I have a Nokia 6.1, and Android One phone, running Pie.  Is there any way to tell if my SD card is already formatted for internal storage?
Thanks

Execute df on a terminal app or adb shell and share output here.

When you go to settings>device maintenance>storage (it might be a different path for you I'm running 8.0) does it list your inserted SD card? If not then it's not available.

Do df | grep /mnt/expand on a terminal app or adb shell. If you see a dm-crypt virtual volume like /dev/block/dm-1 mounted on /mnt/expand/[UUID] and additionally /mnt/expand/[UUID] is mounted at /storage/media, then your external SD card is adopted as internal storage.
Otherwise it's /data/media mounted on /storage/emulated, and your SD card is mounted as Portable Storage.
RELATED: What is /storage/emulated/0?


text:
How to maintain 1 char at a time when holding down delete?
After about 2 seconds or so quickly deleting 1 char at a time holding down delete turns into quickly delete entire words or sentences at a time. To avoid this I end up having to:
press for about 1 second
then let go
press for about 1 second
then let go
press for about 1 second
then let go
Is there a way to change the behavior to maintain only 1 char at a time no matter how long you hold it down? Maybe have another key delete entire words or sentences at a time. This is using the Samsung keyboard, is there another keyboard that'll allow this?

This is a 'feature' of Samsung's keyboard, default on Samsung android phones. I did look at Samsung's settings and did not see the ability to alter this. Use another keyboard to fix, which I did, such as Gboard by Google.
While I do like the ability quickly delete word by word also, that should be provided by a another key, not shared with the character by character key.


text:
How to use Private DNS on Android Pie for tethering?
Is it possible to use Private DNS on my laptop that is connected to WiFi shared by my Android Pie smartphone with configured Private DNS?
I tried visiting https://1.1.1.1/help from my phone and it says DNS over TLS is used, but when I visit from my laptop it tells me that it uses plain unsecure DNS.

DNS has traditionally been part of libc. Android's Bionic libc depends on netd for traditional DNS as well as Private DNS (DoT) implementation. See this answer for more details.
Since every app runs in its own stance of Virtual Machine (ART) forked by zygote, so when an app creates a new connection to a remote hostname, DNS queries are made by the VM on behalf of the app, which makes use of DNS resolution in native code. So the whole thing is handled by Java runtime.
When using tethering, a DNS server needs to be run on Android device which listens to DNS queries received from connected hosts. These queries are then resolved as per configuration of DNS server. dnsmasq is current implementation of DHCP/DNS server on Android up to Pie. It's a native daemon, which receives nameservers from TetherController (a part of netd) or /etc/resolv.conf (if no-resolv argument is not passed) or /etc/dnsmasq.conf (using server= option).
So dnsmasq works independently and doesn't depend on libc or netd for DNS resolution. In other case if the tethered device is using some other public nameserver and not dnsmasq, the DNS queries are forwarded to internet as per routing policy and NAT rules. In each case the queries don't pass through Private DNS.
That said, you can use third party solution for encrypted DNS. Go for a robust solution: dnscrypt-proxy on rooted device. See this answer for an advanced setup.
Or use some VPN app like this. But VPN doesn't redirect hotspot traffic through VPN network as far as I have tested on Pie ROM. You have to modify routing table and forwarding rules. This works for me:
~# iptables -t mangle -I PREROUTING -i wlan0 -p udp --dport 53 -j MARK --set-mark 2
~# ip rule add fwmark 2 lookup 5000
~# ip route add default dev tun0 table 5000
~# iptables -I FORWARD -o wlan0 -i tun0 -j ACCEPT
~# iptables -I FORWARD -i wlan0 -o tun0 -j ACCEPT

Additionally NATing might also be needed for some situations. So it seems there isn't a non-root solution.
PS:
Most probably Android Q will have DoT on tethering too because dnsmasq is being replaced with a DHCP service inside Java runtime.
RELATED: How to share VPN connection with devices on hotspot?


text:
mounting multiple ext4 partitions in Android 7+
I am doing away with exFat for my Microsd card after  all my pictures  decayed ,  corrupted and the directory was locked. I cant seem to write into a specific directory. chkdsk will just plain abort saying :
The disk does not have enough space to replace bad clusters
detected in file \WhatsApp\.Shared of name 1.
Corruption was found while examining files in directory \WhatsApp\ (6).

 so I 'd like give a shot to Ext4 partitioning that cheap micro sd card , not just 2 ( the standard app2sd and sdcard1 design ) but 3. One for apps  and other 2 depending on the write activity , I  tweaked the block parameters etc. for each
I am able to mount the partitions &   a rooted Total Commander can see them all
BUT  other apps cannot see the partitions I created.As I understand vold helps other apps be aware of this. So How do I go about getting this 'formally' with sounding 'hackish'

what I did :
mkdir /storage/<my dir>
mount -t ext4 -o noatime,rw /dev/block/mmcblk(x)p(y) /storage/<my dir>
where x and y are variables from partitions file in the proc dir.

I read  about a fstab.<phonename> file out there that can be modified but it would be overwritten every boot.
even the 2nd partition that app2sd  ( or link2sd) creates can ONLY be approached as root. So prolly those apps that ask for root can see this stuff but other apps can write to it
Ext4 is linux .  Sounds like Android seems to ignore its own 'biological' kid ext4 and instead recognize a stepson 'exfat / FAT '

I am sure I am missing something here. Any ideas ?
I am rooted with Magisk  on a Galaxy j7 with of course TWRP ( 3.x) installed
Print env o/p

BUT other apps cannot see the partitions. Even with root access? Make sure this isn't because of Mount Namespace: https://android.stackexchange.com/a/200449/218526. Vold exposes only first partition on sdcard to apps. Try vold-posix if yours doesn't support Ext4. Directly writing to SD cards is restricted since KK or even before. Access you get is through SAF. Also may use bindfs (FUSE) to modify permissions of mountpoints so that apps can read the partitions, even from within /sdcard possibly (never tested though).

Ok just to clarify. app2sd Mount script puts script in magsik folder. On my phone magisk is at /sbin/magisk  folder  and I modified that manually to add the same logic now 2X more times for each additional partition. Strangely after I modified the script . After boot 2nd part & apps never showed up. I ran it manually and they all showed up . Also under TC I could see the additonal mount pts under /storage showing up as drives. Nothing changed AFAIK but now TC looks weird - all those Drives disappeared. After running script these pts under /storage will still be seen & su - TC can see it.

Coming to 2 other Q's from Irfan .Lot of common apps wont request root  access. I cant force em & they cant see these even if I invoke TC. By going to TC I can see all of them under /storage but invoking TC via System share - everything disappears. Your other Q Magisk is get to global namespace yes. That was the setting hitherto . HTH

Also my partitions are like these mmcblk1p1--> App2sd second partition

Also my partitions are like these mmcblk1p1--> App2sd second partition mmcblk1p2  user data part # 1 , p3 user data part # 2 ,- all Ext4. If vold exposes just  1st Part, how do I go about getting the other 2 "exposed" ?. How do I get vold-posix working. How do I use FUSE . My parts are under /storage and earlier like I mentioned they got 'picked up' & could be seen as separate drives .in TC . Now they show as folders ( mounted ) under /storage .  When the former situation existed I am not sure if apps could not access those ( prolly could .. my gallery app did ,

not   sure what caused the change of mind from separate drives .in TC to folders ( mounted ) under /storage. I know at that time app2sd use to give some alerts some of the apps are not mounted correctly should - use  the advanced op to recreate mount script  -->  click Y --> reboot. I wonder if at that time it moved the mount script location /

post the output of mount and printenv somewhere (pastebin) after mountscript

I dont see any place where I can paste the full o/p due to restrictions in #chars so I attached screenshots. Need to see that mount @ 300% I was able to read some - the file gets toned down in size & quality even if < 2mb  ( max allowed )

see pics attached

from mount what i can see your first partition is mounted twice. from printenv i can see you have knox?

Knox is disabled or removed. Prolly 1st