text:
Network mode switch quick settings tile
I have a bootleggers ROM (Android 9 pie) installed on a Motorola Moto E 2015 phone. Can I add a quick settings tile that would switch between 2G only and 2G/3G/4G network modes?
In Lineage and ResurrectionRemix ROMs there is an "LTE" tile, which can achieve this, I think. But Bootleggers rom doesn't have it. I solved this with Shortcutter app, but it opens a list of network modes every time, so I have to click twice instead of once. Ideally, the tile should switch between these two network modes and display the current mode.

For everything you want to automate on your Android phone I highly recommend you to use Automate. Automate is a powerful visual scripting app. Imagine it to be the BluePrints for Android. Or should you know Scratch, it's just like that. Changing default Network Type is a system setting you can easily do using Automate.
Automate offers the "Quick Settings Tile Show" block that sets up an QS Tile and can be interacted with. For use of that block, refer to
https://llamalab.com/automate/doc/block/quick_settings_tile_show.html
This app is an scripting app. This means you still have to create your program according to your wishes, but I suppose that should not be a problem for you.
https://llamalab.com/automate/
Your script will look like this:

At first you need to set your preferred network type. Let's go with LTE here. You pick the "System Settings Set" Block, choose "Network Preferrence" and enter LTE. Note: The actual value your system uses to express "LTE" may vary from device to device. To find out which term YOUR device uses, you can utilize the "System Setting Get" block: In your settings, set LTE as preferred network. Then, within Automate, you use the System Setting Get block and ask for the current preferred network. You assign the block output to a variable (You don't need to manually create one. A variable with the name you enter will be created automatically), for example "Type". Then, you pick the "Toast Show" Block, and enter the name of the variable. Note: Automate uses text as primary input. You can change between these modes by clicking the "fx" icon right next to the input field.

It will change into a Stamp then. Text always has these "" around them, while variables don't. When entering the variable into the Toast Show block, be sure to switch into Variable input mode and enter the name of your variable without these "".
When you have found out how your device calls "LTE" in the settings, go back to our original script. Here you can add it to the System Setting Set block.
So far, our script has two blocks: The Flow Start and System Setting Set block. Now we add the Quick Settings Tile. For that, you pick the Quick Settings Tile Show block and set it up according to your wishes. For example you can call it LTE, choose an appropriate Icon and make it "Active".
Now, add another System Settings Set block, that changes the network preferrence to whatever you want to have instead, for example EDGE or WDCMA. To find out by which name your system calls these network types, you can recycle the "System Settings Get - Toast Show"-Script.
And then, once again, put another Quick Settings Tile Show block with the same input arguments, except for the "Active" button, which should be left inactive this time.

Comments are not for extended discussion; this conversation has been moved to chat.


text:
How to automate UI of a 3rd party applications?
I have a flow diagram in Automate that starts automatically with system. I want to add few blocks which will launch monitoring/diagnostic applications (CatLog, Network utilities, etc.) and will press certain buttons. How do I do this?

To start an application, select the "App start" block. Then choose the app you want to start and/or the activity, action that should be started when it is launched.
To  simulate a press or click on the screen, select the "Interact" or the "Interact touch" blocks. You can use the "Record interactions" of the Interact block to help click exactly where/what you want.

source: Stack Exchange

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

sort: votes


text:
Is it possible to make multiple adb commands a one-liner command? (case change bootanimation.zip)
Is it possible to make the following commands a one-liner command ? to change bootanimation.zip quickly and gain some
C:\Users\User\Desktop>adb push bootanimation /sdcard
C:\Users\User\Desktop>adb shell
$ su
# mount -o rw,remount /system
# cp /sdcard/bootanimation.zip /system/media/bootanimation.zip
# chmod 644 /system/media/bootanimation.zip
# reboot

Regards

Why not put your desired commands inside a shell script and simply invoke that?

To whom it may concern! Consider adding a comment when down-voting!

Much like @CzarMatt I'd suggest saving the commands ya want run within the Android device to a shell script such as adb_boot_animation_copy.sh on your PC...
#!/usr/bin/env sh

if ! [ -f "/sdcard/bootanimation.zip" ]; then
    printf 'No can do\n' >&2
    exit 1
fi

su || exit "$?"
mount -o rw,remount /system

cp /sdcard/bootanimation.zip /system/media/bootanimation.zip
chmod 644 /system/media/bootanimation.zip
reboot

Tip, #!/usr/bin/env sh is more portable than #!/bin/sh... this is not just because the Android dev. team thought it was a good idea to move things about when adopting Linux into Android, there are other unixish OSs that also got clever with where one can find an executable shell.

... then use redirection with either < or cat...
adb shell "$(cat "adb_boot_animation_copy.sh")"

Which essentially does the typing of the commands saved within the adb_boot_animation_copy.sh file for ya. Though I'm not certain that this kind of redirection will work on MS bound devices without some modifications.
Update
Another way to redirect output of one command into the input of another...
cat adb_boot_animation_copy.sh | adb shell

Note PowerShell does have the cat command, though ya might want to edit the file path from the above examples to be an absolute file path.

... which should result in the same behavior of redirecting commands from the adb_boot_animation_copy.sh file into the adb shell.
And yet another way would be to use the FOR \? syntax within a batch script...
FOR /F "tokens=* USEBACKQ" %%F IN (`type adb_boot_animation_copy.sh`) DO (
    SET var=%%F
)

... to save the continence of a file to a variable for later redirection into adb, eg something like adb shell "%var%", or use type in place of cat and >/< instead of |...
type adb_boot_animation_copy.sh > adb shell

If ya run into issues leave a comment and perhaps I'll make another edit with more ways of doing the same thing.

He used windows os.

@M.Rostami considering that PowerShell also has the cat command I don't think ya can blame me for the OP's reliance on MS products, nor should this answer be down voted as it is correct for Unix'ish devices and only requires a small amount of adjustment to likely get something that operates similarly on MS devices.

Finally I figured out how to do it in a one-liner adb command from Windows CMD Shell:
adb push bootanimation.zip /sdcard & adb shell "su -c 'mount -o rw,remount /system & rm /system/media/bootanimation.zip & cp /sdcard/bootanimation.zip /system/media & chmod 644 /system/media/bootanimation.zip & reboot'"

In order to make this one line useful in a batch file use && instead of &
adb push bootanimation.zip /sdcard && adb shell "su -c 'mount -o rw,remount /system && rm /system/media/bootanimation.zip && cp /sdcard/bootanimation.zip /system/media && chmod 644 /system/media/bootanimation.zip && reboot'"

Thank you for your time & contributions!

In short that's gross. And I think this should have been added to your answer as an edit so that readers can help ya in writing something saner, because what you've got there at the moment is not easily maintained, documented, debugged, or extended/edited.

I assume that you're one of the down-voters, but sorry your reply is out of the scope of the question and it's linux specific! cheers!

That would be your assumption... As for my reply/answer, if ya re-check it you'll find that there's been some MS related additions for how to do similar with non-Unix like Operating Systems, while also allowing for future debugging and/or expansion of features. Additionally if ya dig deeper into Android you'll find that it's based on the Linux Kernel and has many of the same utilities when at the shell level... though with some rather annoying differences of behavior, options, and file paths. Best of luck avoiding disaster with your endeavors.

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


text:
Enable data and sms on CDMA network programmed number Galaxy S7 Edge
My Galaxy S7 edge (G935P) sim card slot is broken. It doesn't recognize any sim card I put.
I managed to program my phone number into the phone using CDMA Network. I can make calls, but I can't send sms texts or enable data.
When I try to enable data I get a message "Insert sim card to access network service".
The same thing when I try to send a text "sending failed".
Is there any way to trick the phone to think there's a sim card when there isn't.

No... Why not just get a new SIM card?

(acejavelin) Read the question carefully before writing useless comments. The sim card is fine, it's the sim card slot that is broken.

lol... My mistake, I read to fast apparently and apologize. But my answer is still the same, no, in modern phones the SIM is required. Note you can get a replacement SIM tray for a very small investment, it is available on Amazon, eBay, and I imagine other similar sites depending on your location. https://www.amazon.com/Card-Holder-Slot-Samsung-Galaxy/dp/B01GDMDCYO


text:
Number of Vibrations for Notifications
My phone just updated to Android Pie, and like many hapless users I'm trying to adapt to the many changes. One thing that annoys me to no end, and that I can't seem to find any information on, is that the number of vibrations for a notification has jumped from two to five. I like having vibrations turned on for notifications, especially if I'm in a meeting or at a loud event, but if I'm getting five vibrations I'm going to assume it's a phone call.
Is there any way I can change this? Preferably back to two, and without rooting my phone.

You don't really say what model your device is (and you should) but it may be as simple as setting an appropriate vibration pattern in the panel for Notifications.

Kyocera Duraforce 2. I tried changing the pattern, but regardless of the pattern I choose it's always five repetitions, whereas it used to be two.


text:
New Samsung Note 9 battery charger compatibility
I just bought a new Samsung Note 9 (Exynos 9810). Little did I know that the model I ordered was the EU version and not the US version, so the charger I received was unusable with any of my power sockets. I ordered an adapter online but thanks to my impatience, instead of waiting for the adapter - decided to just charge the new device for the first time with my old Asus Zenfone charger. The Note 9 charged pretty slowly, even though the Asus charger is a fast charger (5V, 2A or 9V, 2A similar to the Samsung's 5V, 2A or 9V, 1.67A). I charged it to 100%.
I've been experiencing pretty average battery life, which is weird since the Note 9 has a 4000mah battery. I have however been using the phone pretty heavily as I've been setting it up with my accounts.
Did using the non-OEM charger for the first charge-up of the device - mess up the battery performance in any way?
I've been beating myself up over this, so I decided to do a Geekbench battery test (Partial Discharge), which returned a score of 4653 with "Medium confidence", which is lower than the score posted online (approx. 5000) However, I don't know if the online scores are for Partial Discharge, and the comparison scores my phone displayed for example for the Galaxy S8 were also lower on my phone than the ones posted online...
Am I worried over nothing? Would charging the battery for the first time with a non OEM charger hurt the battery/ phone? Is the battery charged at the factory with the OEM charger before it is sent to market?

Charging the device with a non-OEM charger is not likely to harm anything at all, as you have noted it will likely take longer. In fact it is probably better for the device to charge slower as there is less heat buildup in the battery while charging. And no, the battery is not charged with the OEM charger at the factory, the batteries are likely installed pre-charged prior to the package being sealed. Battery life is a tricky thing and can vary from device to device even within the same model do to a number of factors.

I agree.. just wondering if this being the first charge-up made any difference. FYI the battery was already at 48% out of the box when I charged it upto 100%. I expect the battery test results to be different... I'm gonna run the battery test once again to see how different it is just from instance to instance.

First charge up or last, shouldn't make a difference... although I don't have any information to verify that specifically. A slow charge is better for a battery than a fast one, regardless if it's the first or most recent charge. Most devices are shipped with the battery at 50-75%, as 50% is the optimal long-term storage level for LiOn or LiPo battery and their self-discharge rate is about 2-3% per month, plus keeping batteries stored at 100% or 0% charge is known to shorten their lifespan. BTW, I don't trust ANY of those battery testers in the real world, get GSAM and see where it's going.


text:
Unrooting phone
I bought a new phone from someone the other day and I would like to use it. The only problem is when I was going through it I noticed that they at some point rooted their phone and put some of there own system files and apps into the system. I can't access the root of this device; I have been trying for days now and I don't want to put my information into this phone till I have been able to wipe it clean of the old user's root system data. How can I force reset this phone to wipe not just the local user data but also the system user data they put into?

You will have to reflash it with the factory stock image. The system partition in memory cannot be returned to stock in any other way as in almost all devices there is no way to make to changes to the system without root access. What exact phone make and model do you have and we may be able to assist?

its the lg harmony 2 make is lm-x410cs. i would need someone to tell me how to do this in detail im new to all of this and have been for some time.

there is no official ROM available, so this is just theory https://www.youtube.com/watch?v=gJ_8xuuftZw but you can ask previous owner how to get root privileges


text:
How to factory reset phone when I can't find the factory reset option?
I have an old Samsung Galaxy S3 that's been sitting in my desk for years. I wanted to clear it off to give to a friend, but I'm not seeing the factory reset option anywhere. All guides I can find online indicate that it should be in the Settings app, but it's not. (There is no Privacy section anywhere in the Settings app.)
Is there any other way to factory-reset a phone? It's on 4.3 (Jellybean), according to the About Device screen. (I've tried to get to recovery mode with the power/volume down key trick, but it doesn't work; just continues to boot normally.)

Tried this recovery approach?

As Andy Yan already figured out, you just forgot the Home Button, its 3x Buttons for Samsung

Yes, @AndyYan - I had tried that as well, and it didn't work. I did figure out the issue, and posted as an answer in case anyone else runs into this.

Posting this as answer in case anyone else runs into this.
It turns out that I had manually disconnected my Google account years ago, when I switched to a new phone. By reconnecting the Google account, it added the Privacy section (including the Factory Reset option) back into the Settings app. Once that option became available again, the reset worked with no problem.

If you can't go to Recovery Mode, hence go to download mode and use Odin to flash your android device.

Reboot Phone and go to Download Mode. (press and hold Home + Power + Volume Down buttons)
Connect your android device to PC and wait until you get a blue sign in Odin.
Download a good verion of framework which is match with your device (build number, etc).
Add the downloaded firmware file to AP / PDA in Odin.
Make sure re-partition is NOT ticked.
Click the start button and wait few minutes.
After step 6, your phone will start, but it takes a few minuets at first time turing on.

for a simple reset, really?

OK, that's kind of overkill, plus, I couldn't get into download mode either.

Unfortunately, you have to change the internal storage chip.

@alecxs Yes, It's for a device which can't run recovery mode.


text:
How to disable automatic updates on Moto phone with Android Pie
I have magisk installed because of which updates are failing. Every few hours it will download the update in background, and try to install, and fail.
It's draining my battery and consuming my limited wifi internet.
I want to disable them until I have sometime to uninstall magisk and update it manually.
Note: I am fine with annoying notifications but don't want wifi/battery issues.

Which Motorola Phone is it?

@Firelord G6 Plus


text:
Samsung Galaxy S6 4.6MB/s Seqential Write (Why so slow?)
I bought a Samsung Galaxy S6 in Aug 2016. Everything was fine, until last week.
It got very slow. For example, when I draw my unlock pattern after a reboot, it takes such a long time to load the homescreen that the screen turns off. After a few tries, I get in but every tap takes very long until the device reacts. It takes  ~25 seconds just to load the keyboard.
I downloaded System Monitor but the CPU load was not on 100%, so there is no app/virus which consumes too much CPU time.
Geekbench 4 says that the CPU / GPU performance is even above average for the Galaxy S6.
But then I decided to test the storage speed. I ran Androbench and the results are very bad (see screenshot).

Normally, the performance should be like in this test.
So my questions now are: how can I find out why is the storage so slow?
Is it just flash wear? Is is a broken driver? If it's a hardware failure, what part do I have to replace?
If something is unclear, just comment and I will edit the question.
Thank you in advance!
UPDATE 2019/06/20 08:03: Tried reflashing the stock firmware and factory reset, but it didn't helped. The benchmark is even worse now. Ordered a new motherboard now.
UPDATE 2019/08/19 09:57: New motherboard finally arrived. After changing it, everything was fine. Problem solved.

Perform a full factory reset and retest with no setup or other apps installed... Either it will correct the problem or it will verify your internal storage is starting to fail (call it Flash Wear or whatever you wish, it's a hardware failure, just not a critical stop one, but it will be eventually). It is not likely a driver issue, that is a base kernel module, and lots of others would have noted it in the past, but this device has no history of that.

Check the device for malware running in background and remove it.

I'm getting 45 MB/s sequential write when it should be 120 MB/s. Read speeds are roughly the same as on the review though.
In your case, I would try full factory reset, reflashing the stock ROM or even a custom ROM with a different kernel to see if the benchmark would generate different results. If you get roughly the same results after all, it's a hardware problem.


text:
SystemUI.apk is not in /system/app
I tried to pull SystemUI.apk on my Samsung Android Pie/OneUI and it seems like it's either in some other directory than /system/app or has been renamed. I tried to pull this through adb. Tried different cases for it but didn't work. To anyone curious, I want to modify me status bar icons. Does someone know where it might be located?

Is your device rooted? Because modifying a system app requires root permissions.

No it's not. I didn't know it won't work without rooting. The guide I was using didn't make it clear.

Since Android 4.4, all privileged system apps including SystemUI have been moved to /system/priv-app.

P.S. You could've figured this out on your own with a simple find command... Also, the fact you're looking for it under the old path likely means you're following a very old guide which might not work now either.

Yea I think the same. Thank you.

To find its location, you can use this adb command:
adb shell pm list packages -f | grep systemui


text:
Is there ANY way to use Google services on a Huawei phone that has them blocked?
I just bought a Huawei phone and then realized that google play services had been blocked. So, I tried a workaround by installing the latest version of google play services apk, which doesn't work. The notification showed that google play services needs to be updated.
Did I do something wrong? If this workaround won't work at all, can I do something else? For example, if I format the phone and install another OS, would that help?

You can try to register your ANDROID_ID at Google: https://www.google.com/android/uncertified/ This should white-list your device and allow therefore Play Services.

Sorry for a delayed reply. I don't quite know how to use this method. So I turned to an easier way, using an app called "Device ID", but under "google service framework (GSF)" is written "not found".


text:
Mock Location a single app
Currently, enabling the mock location developer setting affects all applications. I am currently testing a single application and require that my real location is still available in other apps. Is this possible?


text:
How to debug error on installation from APK?
I'm working in a project. We are in a testing cycle and we are experiencing something that I don't know how to debug.
I built the APK. I installed it in my phone (S9+) and in many others with no problem. Then we sent the APK to some people to test it. 4 new Samsung S9. Totally new. No previous versions installed and same SDK and ONEUI and security patch as my own device.
When they try installing it they get an error on installation. I don't know what can be causing this and I don't know how to capture the error. How can I generate some log or debug it?

See my list of logging apps. One of the bug reporters might be helpful. Apart from that: development questions are off-topic here – so we won't answer with the part of how to include such code with your app directly.

Samsung offers a cloud device farm that allows to remotely operate real test devices. May be you can reproduce the problem on one of those devices.

Hi guys. Thanks for the answers. The problem was cause by Google Protect. I just disabled it and now works perfectly. Thanks!

Thanks for the answers. The problem was cause by Google Protect. I just disabled it and now works perfectly. Thanks!


text:
How can I access my android phone's storage from another device using LAN
How can I access my android phone's storage from another device such as android or PC using LAN?
With ES File Explorer, I used remote manager, but there I am to download files then I am able to use them.
But I want such a system, by which I can stream my audio, video from my android device's storage without downloading through LAN network.

Go for one of SSHFS, CIFS, NFS, ADBFS etc.

Install an DLNA server


text:
bootloader boot loop
I got a new Pixel 2 and wanted to load an TWRP backup from my previous Pixel 2 (with stock ROM) onto it, instead of setting it up freshly. So I

booted the new device
clicked through the settings
entered developer mode and oem unlock
rebooted
unlocked the bootloader
booted into TWRP (using fastboot boot)
copied my old /sdcard contents to the device using adb
used TWRP to restore the old backup (partitions boot, system and data.

At that point I hoped I was done, and could just boot into my system. But unfortunately, it always just boots into the bootloader.
What did I do wrong?
And what do I do now?

I tried to do a factory reset by using fastboot flashing lock, and it claimed it would reset the phone, but it doesn’t.
I tried to enter recovery from the bootloader, but it just boots into the bootloader.
I tried to flash an official image from https://developers.google.com/android/images#walleye using ./flash-all.sh but it fails to update the bootloader:
Sending 'bootloader_a' (38692 KB)                  OKAY [0.155s]
Writing 'bootloader_a'                             (bootloader) Updating: partition:0   @00002000 sz=0000B000
FAILED (remote: 'Command Flash Error')
fastboot: error: Command failed

and then fails do do more:
--------------------------------------------
Bootloader Version...: mw8998-002.0059.00
Baseband Version.....: g8998-00008-1902121845
Serial Number........: …
--------------------------------------------
extracting android-info.txt (0 MB) to RAM...
Checking 'product'                                 OKAY [0.000s]
Checking 'version-bootloader'                      FAILED

Device version-bootloader is 'mw8998-002.0059.00'.
Update requires 'mw8998-002.0076.00'.

fastboot: error: requirements not met!

I tried to boot twrp again, but that does not work:
$ fastboot boot twrp-3.3.0-0-walleye.img
downloading 'boot.img'...
OKAY [  0.115s]
booting...
FAILED (remote: Failed to load/authenticate boot image: Load Error)

What else should I try?

It seems that the script at https://forum.xda-developers.com/pixel-2-xl/development/tool-deuces-bootloop-recovery-flashing-t3704761 was able to apply a system update.


text:
Possible to connect Android phone to a port on router
My son wants to connect his Android phone to a port on his router. The details of phone and environment follow.  Any advice on whether this is possible would be much appreciated.
Phone: WIKO
Model: U FEEL
Android version 6.0 (08)
Developer Optoins: ON
USB Debugging: ON
Verify apps over USB: ON
Select USB Configuration:
(possible options)
- Charging
- MTP
- PTP
- RNDIS
- Audio Source
- MIDI
Disable USB audio routing: ON
Show all ANRs: ON

With "port" you mean an RJ45 Ethernet port, right? For doing so you need an USB Ethernet adapter and an USB OTG cable. Of course this requires that the device supports USB-OTG and USB-Ethernet adapters.

Possible duplicate of Which USB-C to RJ45 adapter for SONY Xperia XZ Just the device is different, which does not make a difference - it works for an device or not.

How to make Ethernet work on Android over OTG?

Sorry I violated the forum's strict posting rules....
I found answers to both my questions on a couple of other forums - so, sharing KNOWLEDGE
 1. both my son's WIKO and my SONY XPERIA XZ have reportedly had the driver removed or incapacitated in the Linux kernel and as neither phone is ROOTed there's no way strightforward way to install a driver
 2. and yes Robert, I meant the RJ45 Ethernet port


text:
How to do port forwarding over Android USB tethering?
So, for the time being I'm stuck plugging my phone into my PC and using USB tethering to connect to Wi-Fi.
One of my games requires port forwarding for online play, and I'm having trouble getting it to connect. I've gone to my router settings and forwarded the appropriate ports from the phone's internal IP address, but still nothing. Here are the ports needed in case it helps:

DirectPlay7 47624 47624 TCP/UDP
DirectPlay8 6073 6073 UDP
DPlay7&8 2300 2400 TCP/UDP
Outlaws 5310 5310 TCP

I've also been fiddling with Telnet and ADB, but to no effect. Any suggestions?

Either I'm misunderstanding, or something here is backwards. Port forwarding is done at the router to the device, not from the device to the router. Where are you setting up this forwarding? if correctly at the router, you will probably also have to do it again in the PC's connection share.

Just buy a cheap USB Wifi dongle and directly connect your computer to the Wifi.

When you use phone in tethering mode, it itself works as a router. So you have to forward ports on phone as well. Related: https://android.stackexchange.com/questions/168422/how-to-port-forward-internet-using-android-hotspot-to-pc/207342#207342

https://android.stackexchange.com/questions/66564/port-forwarding-during-usb-tethering


text:
App downloads big data again on every start
I have changed many of the permissions (especially by Play Store and Play Store Services). Now many apps works unusual and many doesn't work but doesn't give any understandable error.
One of them is a game "World of Tanks Blitz". Whenever I open the app, it asks for Google account login and then it starts to download the big data like GBs for every tank.
How can I fix or at least how can I understand the problem exactly?

If the game needs more data assets, I don't see how you would restrict it. Let it do its things

But on every start, it was getting the same data assets. I gave all permissions to Google Play Store, for now it looks like working properly. It seems like data assets are stored dependently on the Google account.

What do you mean with "changed many of the permissions"? Anyway this seem to be an app specific problem (bug in the app). Contact the author of the app, describe the problem and ask how to fix it.

I bought the phone a few days ago. I was checking/playing with the permissions. I saw that there are too many permissions for only Google Play Store and Google Play Store Services. I have taken many of the permissions. I don't remember exactly what permissions because I thought: if there is an error, it will show or ask what the permissions are required. But I didn't get any info from Google Play Store or Services. This game and another one did the same thing; asked login on every start, this looks solved now. Also Duolingo app cannot get my voice even though I gave all permissions to the app.


text:
Block my smA10 pro with IMEI
I wish to block phone Samsung galaxy  A10 pro with IMEI. The phone was stolen. I don't want the end user or thief to have access to my data. Also to render the useless and unuseable.

IMEI blacklisting is done by cellular service  providers, not by users. That said, the phone can still be used barring the functions which require cellular services. Your approach with IMEI blocking/blacklisting won't do any good to your data because it has no bearing on data.
If you had Find my Google enabled you can use it to remotely wipe data (subjected to the device connected to internet). If you are a user of a US based cellular service provider, they might be offering a service to report a stolen device for IMEI blacklisting.


text:
Why is the GPS Chip Not detected on ARCHOS Alba 4?
I am using Android Nougat, but there are no options for GPS in the locations menus (just battery saving >> wifi, bluetooth and cellular network only)
Other GPS apps do not even detect the chip in the first place... why?

Does the phone run an original ROM from the manufacturer or a custom ROM?

Are you sure that tablet has GPS at all? Does it say so in the specs? If it has no GPS chip, it obviously cannot be detected.

The phone has the original ROM, and it definitely does have a GPS chip (its a phone, not a tablet)

Starting in Android 7.0, Location Access menus have migrated under the Security Settings menus.  The exact menu area could be different depending on OEMs, however.

There is no location setting in the security menu....


text:
Why are android permission so broad?
I was reading a review for a game on the play store where someone gave a bad review saying that the game looked cool but it required access to photos, media and such which encouraged the user to uninstall rapidly. The developers replied to this person saying that they valued users privacy and what not but they didn't have a choice because they needed that to actually save the progress. This totally makes sense that they would require access to internal or external memory to save.
I was reading that some games also require access to phone call so that they could pause the game when you get a call which also makes sense. But the displayed message for the user is that the app will have access to your calls, can make calls (which could cost you money)  which is a red flag for some users.
I'm guessing that most games don't use permission in a malicious way but to prevent any why aren't permissions more restrictives/specific ? I'm assuming that the vast majority of games use file permission just to save and nothing else, why not make a save permission ? I also assume that having more restrictive permission might increase the number of required permission for some game which could potentially be annoying for the majority of user.

Or, the developer could be proactive and explain in detail the needed permissions. Some apps do this well and it seems to require little effort (see Easy Voice Recorder); the majority DO NOT, leaving the user to risk awarding the permission anyway. The additional effort, in my case, allows my feeling better about the app, the care placed into it, and the professionalism of the developer.

I don't think there's an answer for this as it is too subjective. What would you consider restrictive? Eg. Would you consider an app being able to autoplay sound require to have a "sound" permission?

@wbogacz I agree with u but for someone who is sceptic even if you, as a developpers, explain what you need in detail the reality is that in theory you could access anything on my phone so that's better of course but in no way safe.

@SSS Well for example there is a permission for camera (flashlight + camera) and a flashlight permission. So at some point someone said "needing the flashlight doesn't mean you need the camera", why no one said "needing to save stuff doesn't mean you need access to every data on our users phone, thats overkill and not safe". You're right though this might be too subjective.

As an Android developer, this is an especially frustrating aspect about delivering apps into mass market.
The wording on permission models have caused great grief, as you have pointed out, but it has gotten better.  In fact, prior to Android 5.1.1 (API 22) apps were required to request all of their permissions up-front, at install time.
Now, permissions are generally requested when they are needed - i.e., when a protected API is accessed at runtime - allowing developers in-app time to explain their intentions.
If the developer of an application were respecting the spirit of permissions enough, their applications would, ideally, still function without being granted a particular permissions.
Obviously, if you deny a photo app access to, say, the Pictures directory, the app experience might not be stellar.  However, an app should still continue to function - that is, without crashing - regardless of granted permissions.
Also, as others have pointed out in the comments, developers and publishers are encouraged to provide meaningful insight into why their app needs the permissions it is requesting.
Now, focusing on your main concern:

. . .why aren't permissions more restrictives/specific ?

They are becoming more restrictive/specific.  For example, Google has introduced Scoped Directory Access.

Apps such as photo apps usually just need access to specific
  directories in external storage, such as the Pictures directory.
  Existing approaches to accessing external storage aren't designed to
  easily provide targeted directory access for these types of apps. For
  example:

Requesting READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE in your
  manifest allows access to all public directories on external storage,
  which might be more access than what your app needs.

Note the bullet point - relating to the game you mention, the developers could leverage scoped directory access models to fine-tune their permission requests.  That, in tandem with clear and concise permission explanations, would strengthen trust for app's users.
Why haven't they, as well as many other apps out there, already utilized this feature?  Well, the scoped directory APIs become available in Android 7.0 - meaning only devices running Android 7.0+ can actually use it.  It is often simply a matter of prioritization for developers on whether or not to implement different behavior on different devices.  Personally, I believe in doing what's best for the platform, but I digress.  Feel free to reach out to the app's support channels requesting changes or deeper explanations for their permission requests.


text:
Can we make a Vpn server run on Android?
Can we make a Vpn server run on Android. Can applications do this? If yes, which protocols are supported and is this a good idea to use such apps? If not, what are some issues that we may face?

Yes we can run VPN server on Android, but not without root. Stock Android doesn't support VPN servers, even many protocols aren't supported as client too, so you have to install third party apps. There are apps like Servers Ultimate which offer VPN server, but I haven't tested. CLI keeps life simple:

Build openvpn static binary and copy to /system/bin.
Create a basic server configuration file:
### /etc/openvpn/server.conf

# basic configuration
port 69
proto udp
dev tun
mode server
tls-server
keepalive 10 120

# dynamic IP pool
server 10.8.0.0 255.255.255.0

# send RESTART command to clients if tunnel is restarted (UDP)
explicit-exit-notify 1

# configure like a "traditional" broadcast-based network
topology subnet
push "topology subnet"

# send all traffic from client to VPN
push "redirect-gateway def1 bypass-dhcp"

# DNS nameservers
push "dhcp-option DNS 1.1.1.1"
push "dhcp-option DNS 1.0.0.1"

# certificates and keys to use
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
tls-crypt tc.key

# cipher algorithm to use for encryption
cipher AES-256-CBC

# log files
log /data/media/0/openvpn.log
status /data/media/0/openvpn-status.log
verb 3

# do not recreate TUN interface on reset (SIGUSR1)
persist-tun

# do not reread key files on reset (SIGUSR1)
persist-key

Create server keys and certificates. tc.key can be created by executing openvpn --genkey --secret tc.key.
ca.crt, server.key, server.crt and dh2048.pem are built using EasyRSA. It can be done easily on a Linux/Windows PC, on Android it rquires some extra effort:
~$ easyrsa init-pki
~$ easyrsa build-ca
~$ easyrsa build-server-full server nopass
~$ easyrsa gen-dh

Copy configuration file, certificates and keys to /etc/openvpn/ and set permissions:
~# chmod 0600 /etc/openvpn/{ca.crt,dh2048.pem,server.crt,server.key,tc.key}
~# chmod 0644 /etc/openvpn/server.conf
~# chmod 0755 /system/bin/openvpn
~# chown -R 0.0 /etc/openvpn /system/bin/openvpn

In the same way build client key and certificate using EasyRSA:
~$ easyrsa --days=30 build-client-full client nopass

Copy the contents of ca.cert, client.key, client.crt and tc.key to client configuration file. Also add public IP address of Android device if want to connect from internet or local (WiFi/hotspot) IP address:
### client.ovpn

client
dev tun
auth-nocache
verb 3

remote-cert-tls server
cipher AES-256-CBC

pull
resolv-retry infinite

remote <IP_ADDRESS> 69 udp
nobind
connect-retry 5 5
connect-timeout 10

# only for Windows
#block-outside-dns

<ca> INSERT_HERE </ca>
<cert> INSERT_HERE </cert>
<key> INSERT_HERE </key>
<tls-crypt> INSERT_HERE </tls-crypt>

Android ignores main table at all, create custom rule and insert routes:
~# ip rule add table 5000 priority 5000
~# ip route add 10.8.0.0/24 dev tun0 table 5000
~# ip route add 192.168.43.0/24 dev wlan0 table 5000
~# ip route add default dev rmnet_data1 table 5000

Where rmnet_data1 is the interface connecting to Mobile Data and wlan0 is WiFi or hotspot. Adjust interface names and network addresses according to your device.
Setup forwarding and source NAT:
~# echo -n 1 >/proc/sys/net/ipv4/ip_forward
~# iptables -I FORWARD -i tun+ -j ACCEPT
~# iptables -I FORWARD -o tun+ -j ACCEPT
~# iptables -t nat -I POSTROUTING -o rmnet_data1 -j MASQUERADE

Run server, but first make a minor adjustment due to difference in Android vs. Linux:
~# mkdir /dev/net
~# ln -s /dev/tun /dev/net/tun

~# openvpn --cd /etc/openvpn/ --config server.conf

Import the client.ovpn in any OpenVPN client app (on Android / Windows / Linux) and connect.
You can do advanced configuration on server, run it as an Android init service, or what ever you want.

RELATED:

How to run SSH/SFTP server for multiple user logins with password authentication on Android?
How to use your Android phone as a proxy server?

Thanks @Irfan Latif. Tried your recipe ip route add 10.8.0.0/24 dev tun0 table 5000, should I execute it after each client connecting?


text:
Why deleting system files on a rooted Android says "device or resource is busy"?
I have FX Explorer, I was trying to delete some stuff in /system/app (the stuff are just empty folders) but it keep saying The operation isn't permitted on a mounted filesystem. What should I do to fix this?
(This issue is new, I used to delete whatever I want without problems)
I tried with the terminal, it says device or resource is busy.

If you are using Magisk modules, you must be trying to delete a bind mounted (1) directory. Enable Core Only Mode (no modules) in Magisk app and reboot. Then delete the stuff you want to.


text:
Screen lock types None and Swipe is disabled
When I tried to remove my screen lock, the screen lock types None and Swipe is disabled. It shows that "disabled by administrator, encryption policy , or credential storage". How can I change my screen lock to None ?

Is your device disk encrypted?

How can I check it?

Usually this means that you have installed a user certificate in the security section. Once you did that you can no longer "None" or "Swipe", you have to first execute "Remove all certificates" function in the security settings of Android.

I removed all the certificates and None and Swipe are enabled now. Thanks


text:
Remove the lock for the app
I installed one particular app two months ago. When I opened it the first time, a popup opened with a suggestion to enable the screen lock pin. And I enabled the screen lock. From that time whenever I opened the app it always asks for the pin. I used the app for the last two months without any problem. But from the last few days, I can't open the same application because it is showing to enter the pin even after I entered the correct pin. I thought it was a bug of that particular application and I reported it to them. They told me that the application does not asks for pin to access it. I was told to check access and security credentials in my phone, to open the apps and remove the app from the list of the apps. But I can't find any setting to check it on my phone. Could anyone tell how to check the access and security credentials to open the apps and how to remove it ?

Please provide a name and link to the app

https://play.google.com/store/apps/details?id=com.nextbillion.groww

If the app doesn't contain important data, then try Settings -> Apps. Find it and delete its data. It should be reset as the first time you used it.

@ReddyLutonadio thanks man, It worked.

When apps misbehave, usually clearing the cache or its data solve many issues. If the app doesn't contain important data, then try Settings -> Apps. Find it and delete its data. It should be reset as the first time you used it.
Then start it and set the settings to use it as before or change them for your new needs


text:
Virtual addresses managed by Android
I have the following questions:
How Android map virtual addresses to physical addresses?
Does Android use virtual memory like desktop OS?
What is the replacement algorithm used by Android?
These questions are quite simple to Desktop OS's and there are a lot of books about it, but Android looks like a black box in a matter of these concepts.
There are three questions and answers to any of them are welcome.

Mapping virtual addresses to physical addresses is handled in kernel space, not by applications in userspace. Since Android uses Linux kernel (with some modifications), what's true for Linux is also true for Android. Going in depth, it's a development related question, off-topic here.


text:
If I "swipe down to reject", will caller get a chance to leave voicemail?
A few times a year someone who isn't in my address book might call me, but every day I get several spam/scam calls. So basically anytime I see a plain number, I swipe down to make my phone stop ringing.
I've been assuming this sends the call straight to voicemail (so that if it is legit they can leave a message) but it strikes me that "rejecting" a call might hang up completely on the caller.
What happens when I "swipe down to reject" a call from the homescreen? Is there a way I can quickly ignore a call while still leaving the other party a chance to wait for it to go through to voicemail?
This is a fairly stock phone, an "Android One" Moto x4 bought from Google Fi but it does have some extra Motorola tentacles on it.
(I'm also interested in doing this automatically, but only if it uses a built-in feature and not some random app that you happen to trust, sorry.)

Google's Phone app Help implies that I can safely reject the calls:

To reject the call, swipe the white circle to the bottom of the screen when your phone is locked, or tap Dismiss.

followed by:

If you’ve set up a voice mailbox, rejected callers can leave a message.

That combined with some other research leads me to conclude that…

"rejecting"
"dismissing"
"declining"

…a call are all just different words for the same thing. And any of them will both make my phone stop ringing and send the caller to voicemail assuming it is available.
Whereas if my phone had a way to "silence" the call, it will make my own phone stop notifying me (ringing/vibrating) but the other caller will have to wait until it continues to ring for a while before it goes to voicemail.

If you want the phone to stop ringing, without you dismissing the call, I think you have two options: press one of the volume buttons, or enable the "Pick up to stop ringing" moto action (https://support.motorola.com/in/en/documents/MS123802/). At least on my old(er) motorola phone from 2015 both methods stop the ringing and vibration for current incoming call. The link says that the moto action switches your phone to vibrate, though.

@mnd Ah, that's a handy tip too, thanks! I always have my phone on vibrate anyway so that would be fine in my case.


text:
Disable back and recent keys while gaming
The title speaks of itself, I keep pressing them by mistake and lose my games progress , is there anything like Samsung game launcher to disable those keys? (I can't install game launcher for some reason)
My device is Samsung Galaxy J7 core and I have root privileges with magisk installed (and automagic if there's some automation trick)
Thank you

SOLVED!
I found a solution, by using Automagic and Tasker Autoinput plugin we can easily Remap everything in the screen.
In the flow below , when a game (brawl stars) starts then do the below actions (disable keys, display ongoing notification to enable keys whenever I want, and a toast)


text:
Get alarm alert when receiving an email from specific sender
Is there an app or setting in gmail where I can get alarmed for urgent email based on the sender.
From googling, it seems Gmail had a setting to set a ringtone for specific label, but this feature has been discontinued and no longer available in the newest version.

You are correct Gmail no longer allows to select individual sounds for labels. If messages from a particular sender are way too important to miss, then create a filter for that sender using Gmail via the browser not the app. Select a message from the sender, then on the right, click on the 3-dots and select "Filter similar messages". At the bottom, select "Create filter with this search".  Tick "Apply the label", then select "Choose Label" followed by "New label". Give you label a name and click OK. After creating the label, click on "Create Filter".
Open the Gmail app, go to Settings, select the account you have just created the filter and  label from, if Notifications is not selected, then select it. Click on "Manage Labels", select the label you created for the sender, enable "Label notifications" and "Notify for every message".
Go back and Disable notifications for the other labels.
It is the only way for now to get notifications for that sender only until the ability to select ringtones for labels is restored.


text:
want to use my phone as a public proxy
I have a rooted Samsung Galaxy S5 running Android 6.0.1. I want to use the phones mobile data as a proxy for my VPS. Obviously they are not in the same network so the proxy needs to be public for my vps to access it. Another problem might be the ISP's, who block the ports. Can anybody help me out on how I do that :D
thanks in advance

Check your MNO contract if such a scenario is allowed at all. Anyway blocked ports are usually not a "problem" but a insurmountable obstacle.

Related: https://android.stackexchange.com/a/205807/218526

@IrfanLatif I cant even manage to access the ssh server on my phone. I'm trying to access it form my pc connected to my home connection per cmd with the command: ssh IP -p 2222 it says either connection timed out or  network unreachable. The phone is connected to 4G Data. The IP shown on the ssh software - SSHDroid, SimpleSSHD etc. - differs from the public IP that I see when accessing sites like whatsmyip. So I guess Im sitting behind a CGNAT? How do I make the ssh server work and where can I run that command? ssh <phone_user>@ -p 2222. Sorry for asking so many questions, newbie here :S

@MeyvisArtur I think all of your queries are addressed in above mentioned answer. See this answer for a more detailed step by step guide. If you are not sure about a certain step, please edit your question to include that.


text:
How can I wholly delete Apps like News Republic, Zoe Video Editor?
Please see below screenshot. My grandma doesn't want any speck of 'Zoe Video Editor', not even "the factory version". But her HTC Desire 825 doesn't let her delete it. She hasn't rooted her phone.

If there are system apps then she won't be able to delete them unless the device is rooted.
With no root, you are left with disabling them. Settings -> Apps, select the app, then click on Disable.
If you are unable to disable them via the settings as indicated above, then try disabling them via adb as shown in this answer.

I upvoted, and thanks! I removed that bracketed assumption because you're correct!


text:
Samsung Galaxy S5 not connecting PC
I've been unable to connect my samsung galaxy s5 to pc despite having tried for a couple of hours.
I was able to connect to the same pc with a different s5 a few days ago and have tried connecting it to a different PC so the problem is definitely with the mobile, although I have tried installing drivers on PC.
Phone doesn't even show up in device manager.
The option to use the phone as a usb modem is greyed out as it says it is not connected to a PC.
The phone is charging notification doesn't show either.
I've tried different usb cables and different usb ports.
USB debugging is turned on, USB is configured to MDB + ATP (i tried changing it to other things then swapping back but it won't even let me change)
I've updated the phone's os.
If anyone has any other ideas would love to hear them as I need this working for debugging purposes.

The notification bar doesn't come down?

the notification bar comes down but the notification that the phone is charging doesn't (despite it charging, obviously)

Ah, ok. So the problem might certainly lies with your USB connector, this would need a cleaning or even a replacement


text:
Should I use the Android Q Beta?
The Android Q Beta has some great features and fixes the bad gesture navigation from before. I would really like to try it. From what I was able to gather, it's mostly fine, but I wasn't able to find a lot of resources detailing the downsides.
What I'm mostly concerned with is errors during the upgrading process, data loss and the running of the four most important apps for me:

WhatsApp
YouTube (music)
Firefox

I have already searched for issues, but wanted to make sure before I do something that could potentially create a huge hassle for me. I'm really thankful for any advice in advance!

In general productive usage of beta versions provided by Google is not recommended.
Google provides beta versions of upcoming Android versions for developers. Using the beta versions they are able to check if their apps will be compatible with the upcoming Android versions. Also developers can use those images to make some first test with upcoming new features.
Therefore I would strongly suggest to wait for the official release, especially if the apps that are important to you don't explicitly state that they are Android Q compatible.

Thank you for the advice! I have decided to wait, as you recommend.

I think you should wait until the official release of android q is made by Google because if you use it now you can get many errors while making an android app


text:
How to prevent an app's notification from updating while the screen is off?
I have a bootleggers ROM (Android 9 pie) installed on a Motorola Moto E 2015 phone. I have a setting, enabled in adaptive display settings, which makes the screen to turn on, when a new notification is received. It is a good feature, but my music player (AIMP) updates it's notification each time a new song starts playing, which makes the display to turn on (pulse) often and use additional battery. I could avoid that by turning off the notifications for AIMP completely, but I want to see the notification when the screen is on.
Is it possible to prevent the notification from updating while the screen is off?
Another way to solve this would be to turn off the notifications for AIMP, when the screen is turned off, and then turn them on again when the screen turns on (using tasker, for example). But the drawback of this approach is that once turned on, the notification does not appear until the next song, so it is not possible to see the current song in the notification this way.

The preferred way would be if your media player has an option in it's settings to disable notifications, do it that way.
The other method would be to use the embedded features of Android to disable the notifications, when a notification from your media player pops up, pull down the notification shade and long-press the notification tile, and select "Stop Notifications". This will disable the notifications by taking away the apps permissions to do so. To re-enable notifications, go to Settings - Apps and find the apps, and turn the notifications back on there.
Otherwise the device is working exactly as designed with the settings you have.

Yes, but I want to alter the way the device works with notifications. I don't want to disable the notification completely. I just don't want it to light up my screen when a song changes. Also I want it to keep lighting up the screen for other apps notifications.

@mnd Sadly, I don't believe that is possible unless the app can do it within itself. However, since you have a custom rom and I assume rooted, there is a tool called Tasker which allows things to be set in a  Trigger - Action method. You could set a Screen Off trigger and possible Action of disable notifications from the app, then the reverse when Screen On. Tasker is powerful, just not sure if it's granular enough for this task which is why I didn't include it in my answer.

Yes, Tasker can do that, maybe secure settings plugin is needed for it to be able to disable notifications per app. The only issue is that once the notifications for AIMP are disabled, and afterwards enabled - it does not appear until the song changes (and the notification is updated). So maybe the question should be - how to request the app or android to recall the ongoing notification which had been disabled and reenabled for that app.

@mnd Now you are really getting into tough spot... This could be done as apps can "see" if the display is on or off and I believe they can check if their notification is still active, but I think what you are asking for would have to implemented into the app itself.

Probably. I agree that trying to use the original notification of the app, the way I described it, might not be possible (at least with 3rd party apps and not as a function of the ROM, or android in general). So I have come up with another idea - all I would need to do is create a temporary notification with tasker or something else, which would display the currently playing track information and open the music player, when clicked. If the screen is on long enough, this additional notification would be needed only until the next track starts.

I think it should be possible for the temporary notification to "read" the current track info, the way that it is read by connected bluetooth devices for example, using some android media service, or something. This might not be the most efficient way to solve my problem, but I hope I'll get to try it just for the fun of it.

So, this may not be the most sophisticated solution, but I managed to do this by using the Automate app. This is not a universal solution for every app's notifications either, but it works for controlling a music player's notification (for AIMP at least), and that was what I wanted to do.
I used the "Display on" block to check when the screen is turned on or off. Also I added the condition to check if music is playing (using the "Media playing" block), so the notifications are only toggled on and off when the music is playing. And for the actual toggling of the AIMP's notifications I used the block "App notifications set state". Finally, to make the AIMP notification actually appear after it was enabled, I used the block "Audio player control" twice to pause and then immediately play the music again. This way the notification appears without waiting for the next song to start, and since the pause and play actions are executed in sequence without a delay, there is no audible pause in the music.
Currently, the only thing I would like to improve is to change the condition which checks if music is playing to a condition which checks if the music player app is started and would only then check when the screen is turned on and off. In hope that it would help save some battery. But I will have to see if there is a difference in battery consumption with my current Automate flow enabled and disabled. Maybe the constant check for screen on/off doesn't affect the standby battery consumption.
Also, I have to note, that I had achieved the same result using Tasker and Secure settings plugin. But it seemed this approach was not as responsive as Automate's way. This may be because my phone is quite low spec and there would be no difference on a more powerful device. But based on my short experience with Automate, it seems to be better optimized for my device and my typical usage. Probably because Tasker has to use an additional plugin and Automate has the functions I need built in. Though, if anybody's interested in the Tasker way, I may edit the answer to include it in more detail.

Nice question you have there.
To solve that, I recommend you using Automate, which, apparently, you already do.
You want to prevent your Music App from flashing the Ambient Screen every time it sends a notification, and you want to have that solved with Automate in a way as efficient as possible.
First of all, it is important to have a Flow that only runs when your Media Player is running. As you cannot set "Media Player Running?" as a condition to start your flow (You could make another flow that waits for your Media Player to start, but any way, you always have one flow running all the time), you can do a little workaround: You can start flows just WITH your Media Player App by using Automate. Make a flow that starts your Media Player AND the flow that enables/disables notifications later on:

This flow, when launched will start the Media Player and another flow that I'll show later on. Now: On the default Android Home Screen, you can add Shortcuts. For that, you can go into the Flowchart Editor, click the Flow Beginning block and then "Install Home Screen Shortcut". When you choose the flow we just created, you can open the flow and the media player by clicking on your new home screen button.
Now, we still need to properly control the notifications to prevent them from appearing while the screen is off whilst considering your wishes. Automate CAN check whether an app is running or not. When using the flows the way I described in here, we know that the Media Player WILL be running. What we can do is to stop the flow when it detects that the Media Player has been closed.
We want to prevent the Media Player from posting notifications while the screen is off. So, what we can do is to prevent the player from showing notifcations at all. We have a condition: Player Update == true | AND | Screen == 'on'
But, we are smart: We can simply wait for the player update, and THEN wait for the screen to turn on. This is most power efficient way. We have one programming step each time the track changes/is paused/is resumed/etc - We simply force a notification each time the track changes, or when the screen is turned on the next time after the last track change.

You are using the "Enable Notifications" block. In my example I chose "App OP mode set" which is because I use that block a lot for other things, but your block should be fine too.
NOTE: Disabling notifications whilst the screen is on might cancel the notification. If that applies to you, and the flow immediately cancels the notification after the Media Player posted it, you have to add a block that waits until the screen is turned off again.
ANOTHER NOTE: The first "Is Display On" is set to 'Immediately', whilst the second one is 'When changed'. This together makes a "Wait until: Screen On". You could also do that by using a "Is Display On" block set to immediately, where NO connects back into the input of the block, thus create a loop, but we don't want to have that.
Now, for battery efficiency we want to stop this flow when the Media Player is stopped. I thought it would be easy, but actually isn't. Automate has blocks to see which app is in foreground, but doesn't directly offer blocks for "Process running?". This has two obvious workarounds: Shell Commands. Linux offers the "ps" command to view running processes, and Automate can run Shell Commands, but there is a way much easier than that: Android Usage statistics. Android holds record of when which app has been used. We can make use from that and determine whether the app is being used right now. Because, when the last time it has been used is longer than 60 seconds ago, we can safely assume that it is closed right now. So, we check whether the app is running by comparing "App last time used" to "Current Time", and if these values are about the same, the app IS running.

With the "App Usage" block we can determine the moment an app has been used, and assign that value to a variable. I called it "Time". You get that block, and choose your Media Player as app package. The timestamp values can be ignored. With the "Expression True" block, you can now compare that value to current time:

I also added a 5 second buffer. Between the moment the app usage data is retrieved and the moment this block will be checked will pass some time, which might lead to the effect that it will always say that "Last Time Used" is smaller than "Now". NOTE: "Now" is a built-in variable. You do NOT need to replace that one.
Should the result be NO (App Running), it will wait 2 minutes until it asks again. I thought about a "Media Playing" set to "When Changed" block, but that would collide with the five seconds buffer. Should the result be YES (App not Running), it will proceed into a "Fiber Stop" block. With that block, you can stop specific fibers, even in other flows/scripts. All you need to do is to enter the URI the Notification Control flow has. You can find that one by going into the script of the Notification Control flow, clicking on the Flow Beginning block and scrolling to the bottom.
After all, you now have two flows:
The first flow opens the Media Player and the Second Flow, then waits for the Media Player to stop and then cancels the Second Flow.
The second flow controls the Media Players' notification by disabling them entirely, waiting for a track change, then forcing a notification, but only when the screen is on.
NOTE: My player is weird (I don't like to use it in general) and only reacts to Play/Pause. Usually, when you have an "When Media Playing" block set to "When Changed" it reacts to track changes. With my current player, it doesn't. Should you have the same problem, you can save music title into a variable and periodically compare that title to the title of the current track. I hope it doesn't have to come to such a thing.
Good luck!

Should these pictures be blurry to you (they are for me), you can click on the to get a full screen view. Should you have any problems or questions, ask me :)

Once again, ULTRACOMFY, I can't thank you enough for your interest and such comprehensive help in my android challenges. Unfortunately I will not be able to try your solution for myself and provide feedback in the following couple of days. Looking forward to it, though, and I will post my experience as soon as I have the time to test it. After having a quick look, I can only add one thing - we can't assume that the player will always be started by the shortcut. For example, when the phone is connected to bluetooth, it opens up the player and that would not start the second flow, probably.

Probably the bluetooth limitation could be easily solved by another flow which checks when the phone connects to a specific bluetooth device. But that makes it three flows for one task

@mnd Sure! Your phone automatically starts the Media Player App when connecting to Bluetooth? That's cool! There is no built-in way that does "When user opens App X, automatically open Y". You always need an app for that. And such an app just continuously monitors running processes. You can do such a thing with automate. If you are okay with continuous process monitoring (consumes battery power), you can simply put "App foreground" with your Media Player as input argument. That way, you don't even need the first flow :)

Yes, when connected to e.g. a car audio player through bluetooth, the music starts playing automatically, even if the music player app on the phone is turned off at the time. If monitoring the processes consumes more power than checking when the screen turns on and off, then this is not the preffered way. On the other hand, we could probably make a quick settings shortcut, which would turn on bluetooth and start the first flow. I hope having a quick settings tile, created and monitored by Automate consumes far less battery than monitoring processes or the screen state :)

The only drawback of the quick settings tile solution (again this is completely unique for my setup..) is that, I think, that when the player app is in the foreground and the phone connects to the car multimedia system, the music tags are not displayed correctly on the multimedia screen. But I'd have to make some some tests if I'll ever get to the bluetooth part of the Automate setup, to check that.

I have read through the comments of the other answer that has been posted and can come up with an answer: Yes! Just keep in mind that this solution DOES NOT feature Media Player control buttons.
What we want to do is two things:
1) Prevent the Media Player from posting Notifications while screen is turned off
2) Create a Notification when the screen turns back on, and only when the media player hasn't already created one. PLUS, delete our own notification as soon as soon as the Media Player posts one again.
The first thing is easy:

Utilizing the power of a "Display On?" block set to "When Changed", can precisely enable or disable notifications for your player app. When the screen state changes to off, the fiber will proceed through No. The AppOp block disables the permission to post notifications. You used the Allow Notifications block before, you can use that one either. After disabling them, the fiber returns into the "Display On?" block. Now, when the screen changes into "Turned On", it will proceed through Yes and execute the other AppOp block, enabling notifications again.
Now, this script is easy and will be running alongside our script that creates a notification as soon as the screen is turned back on. This will come in the second part:

The "Display On?" block at the very top is the first block we need. It is set to "When Changed" and only proceeds when the display is TURNED ON. As soon as that happens we want to know whether the Media Player has already posted a notification. To do that, we can use the "Notification Posted?" block (which, in the flow is labelled "Has notification"). It is set to Immediately and simply asks whether an app has posted a notification or not. Our app in this case is your Media Player. You need to write that into the block. If it already has, we don't need to create a notification, so the fiber returns to "Display On?". If it has NOT created a notification, we proceed to create our notification.
You want that notification to tell the Title and the Artist and or Album of the current running track. To find that info, we use the "Media Playing?" block set to "Immediately". You can assign a lot of values to variables, including Title, Album, Artist, Duration (in sec), Current Position (in sec) and more. Only Title, Album and Artist are relevant for us now.
Now, you need to listen up. We cannot simply tell Automate to cancel the notification after "Time X" (Timeout) or when "Media Player Changed". We need to do that manually. Automate does not feature a Timeout option for notifications (I'm not sure, but I think it did a long time ago..). So, we make one script that posts the notification and waits until it is clicked to open the Media Player, and make another one that CANCELS this notification as soon as the Media Player posted one by itself.

The script on the left creates a notification. It is set to "When clicked".

In this notification, you can set Title and Message. Instead of entering plain text, you can also use the content of variables, as known from java.println(). Be sure to go into Variable Enter mode, as it will otherwise process "Title" as text. You would then see "Title" in the message of your notification, not the content of the variable.
After that block, we can proceed. When you click the notification, the fiber will proceed through Yes and go into the "App start" block. In here, you can enter the package of your app. So, as soon as your notification is clicked, it will open the Media Player. PLUS: The notification already shows the title, album and artist of the currently running track. Now we just need to cancel the notification.
We cannot just wait until the Media Player has posted a new notification. That is important! We must wait until the TRACK HAS CHANGED.

In this part of the script, the fiber enters the "Media Playing?" block. This one is set to "When Changed" no further input arguments (other than the app package). It is just there to wait until the track has been changed or paused. As soon as that happens, we now want to remove our notification. To remove a notification using the "Notification Cancel" block, we need to specify the ID of the notification we want to remove. We don't have it, right now. BUT, the "Notification Posted?" block can help with that. We use the "Has Notification" block, and check whether the com.android.automate has posted a notification, and if yes, assign its ID to a variable. NOTE: Beware of the "Running..." notification! If you don't have it disabled already, you should do that now. Automate might return the ID of THAT notification, which is not the one we want to remove.
Now, the fiber continues into the Notification Cancel block, in which you need to enter the ID variable. As soon as the notification is cancelled, the Notification Show block will proceed through the NO-Path. This one leads back to "Display On?" at the beginning.
NOTE: We cannot wait for the Media Player to post a notfication instead for the track to change! Would we wait until the Media Player posts a new notification, we could have THIS scenario:
Screen On - Automate posts notification - Screen Off (Automate Notification persists) - Media Player track changes (but does not send a notification, because the screen is off) - Screen On - Automate still shows the notification from the track before (The notification is outdated).
The "When track changes" will delete Automates' notification. When the screen is on, the Media Player will post a new notification. But when the screen is off, our current notification will be deleted, and a new one created as soon as the screen is turned back on.
Here is the entire script with all of its parts. NOTE: Be aware of these Fork blocks. I haven't mentioned them in the answer.

I've uploaded this script to the community. You can find it HERE.
You now simply need to change the values in the blocks and the names of the app packages.
I hope this helps you! Good luck!
EDIT: This script does not include features my other answer did. This script does not automatically stop as soon as the Media Player is closed. And so far, you also need to start this script manually. Both things could be included though.

I'm sure I forgot to say something. There was something I wanted to tell you. Maybe it wasn't very important. For any questions, please ask :)

I've finally found the ultime answer to your question. I didn't think it would be that simple. I was blinded by the thought that immediately pausing and resuming playback would create an audible interruption. But you said it doesn't, so here it is:

Simply disable notifications when the screen is off, re-enable them when it does back on and force the first notification. Done.
One thing I kept thinking about: What if there was no playback? Any way, every time you turn on your screen, this script would resume playback. Even if you just paused it for a minute. That problem would be easily solved by asking for Media Playback right after the "Screen On?" block. Should it return "No" by proceeding through that path, you would just go back into the Display On? block.

Wow, ULTRACOMFY, you are on a roll :) really appreciate that. I hope I will be able to test all the solutions and compare which perform best and about the battery life. This will take some time, though. Because I don't get the chance to listen to music on the phone for an extended time, every day. But the most important thing is at first I thought that this type of customized notification handling is not even possible, and now you provided 3-4 different approaches. Which is spectacular and really demonstrates the flexibility of the app.

I noticed that this approach is similar to yours in the answer. The only difference is, that you have "Media Playing?" and if no, do not pause/resume plackback already integrated into your flow. You don't need the other "Media Playing?" block when the screen is turned off though. This is the most energy saving method you can find. It might be a bit inconvenient to have to manually start this flow. In my other answer I told you how to Install Home Screen Shortcuts, this might be helpful. PLUS: Using Automate, you can disable a lot of power consuming features you would otherwise not be able to.

I still haven't decided if I want to create a homescreen shortcut, or a quick settings tile to start and stop the flow. For now, I just keep the flow from my answer always running. I see a decrease in battery life, but it is not constant and I'm not sure it is because of Automate, unless Automate has something to do with com.google.android.location.ALARM_WAKEUP_ACTIVITY_DETECTION process.

And about the "Media Playing?" block when the screen is turned off - I added it so that the notifications would not be turned off when the music is not playing. Because if I would leave the media playing check only with screen on - the next time I would start playing music, the notification would not appear at first, only after turning the screen off and then back on.

@mnd What does this process have to do? By the way: Automate uses an intent to determine whether the screen gets turned off. Upon turning on/off the screen, the system broadcasts an Intent.ACTION_SCREEN_ON(/OFF)-Intent. Automate simply waits until this intent is received. I don't know which role your process/intent you stated up there has to do with that. To be honest, I'd prefer to find the reason WHY AIMP flashes the screen, while other notifications don't.

As I said, I don't think that Automate has anything to do with that process. I just noticed that stand-by battery life randomly decreases on some days, then I checked with BetterBatteryStats and saw that this process creates much more wakelocks (or alarms) than any other process. There must be a reason for that. I changed the ROM on my phone not long ago and spent some time to customize it, including some automation tasks using Tasker and Automate. And about the screen flashing for the notifications - It flashes for new notifications from any app, not just AIMP. It's a feature of the ROM :)

You can revoke apps from waking up your device using Automate :)


text:
Imitate a swipe down gesture periodically
There's an app that allows for monitoring of some specific process. This app gets locked every 5 minutes unless a screen activity is detected. The phone itself is not locked, the only app's interface is blocked. There's no way to configure the app's timeout to 10 or 30 or 60 minutes at all.
Is it possible to imitate a swipe down gesture periodically (for example, every 60 seconds)? I need it to run on Android 4.4.2.
I have seen AutoInput, but it appears it's not free.

Welcome to Android Enthusiasts! What do you want to accomplish while swiping down?

If you have root access, you can use Tasker and input command to do this. The app AutoInput might also be able to help here.

Use Macrodoid. It offers 5 macros for free.

On the Triggers tab, under the Device Events section, select Screen On/Off then Screen On.
On the Actions tab, under the Device Actions section, select UI Interaction. Enable Macrodroid UI interaction accessibility option. Select UI Interaction, choose Gesture, then enter the X and Y values (X and Y screen coordinates: where to start and end the swipe).
Save the macro and give it a name.
Edit the macro. On the Actions tab, under the Conditions/Loops section, select Repeat actions, choose While 'conditions repeat. Add a condition (I selected Screen On, under the Screen and Speaker section, then Screen On/Off.
On the Actions tab, under the Macrodroid Specific section, select Wait Before Next Action, and set the time to 1 minute.
Click the up and down arrows on the Actions block, then move the items from steps 2 and 5 to be under the While/Do condition.
Save the macro. Click the 3-dot, then Test macro.

The macro will be like the image below:

When I tested it, I set the start values at X=100, Y=300 and the end values at X=500, Y=300 to simulate a swipe from left to right. The values on the steps described above should try to swipe the status bar down. I advise to change the X and Y values so they be based on your screen resolution and needs.

Thank you! I have installed the app and using your detailed reply created the macro. Will tune it for my needs.


text:
How to backup contacts to Google from Samsung devices which don't export vcf file?
The Contact apps that ships with Samsung devices does not seem to have a function to reliably backup all contacts on the phone and SIM storage to Google accounts.
Is there any third-party app that'd let me reliably do so? Bonus points if it'd let me sort which contact goes to which Google accounts registered on the device.
As a last resort, if there's no such app, I don't mind if I can get to backup to storage with which I can transfer the contacts to a different device.
PS I intentionally point to a specific model because I need to do so from two different Samsung devices and both their contact apps did not let me move all contacts to Google account. One of them does have .vcf export, but the other doesn't. I want a more universal solution if at all possible.
PPS The device that can do .vcf export has Google accounts correctly setup on both the new and old devices but all contacts has not been synced, hence the question.

Most of the contacts backup apps lack one feature or the other e.g. they don't backup high resolution photo when creating .vcf file. So I prefer CLI method to extract contacts data directly from database file using some scripting, but it requires root. That's how I do scheduled back up of my contacts without Google account.
The following script doesn't save Google sync account information to .vcf file but you can extend the script to include/exclude any data if the concept is perceived.
Original credits to dump-contacts2db.sh.
#!/system/bin/bash -e

# dumps following fields of contacts from Android's sqlite database to vcf:
# Name, Phone Number, Email, Address, Photo, Title, Organization, Notes, Website
# required binaries: sqlite3, base64, xxd (all included with Android)

# contacts directory, database file and photos directory
CONT_PROVIDER='/data/user/0/com.android.providers.contacts'
DB="$CONT_PROVIDER/databases/contacts2.db"
PHOTO_DIR="$CONT_PROVIDER/files/photos"

# vcf file
VCF="/data/media/0/contacts_$(date '+%d-%b-%y_%H-%M-%S').vcf"

# delete backup file if error occurs
trap '[ $? -eq 0 ] || rm -f $VCF' EXIT

GEN_VCARD()
{
    # skip blank contact for first time
    [ -n "$name" ] || return 0

    # count number of contacts
    n=$((n+1))

    vcard="${name}${tel}${adr}${email}${url}${note}${org}${title}${photo}"
    vcard="BEGIN:VCARD"$'\n'"VERSION:3.0"$'\n'"${vcard}""END:VCARD"
    echo "$vcard" >>$VCF
    echo >>$VCF
}

# fetch contacts data from different columns of 'view_entities' table of contacts sqlite database
ROWS="$(
sqlite3 $DB "
SELECT
    view_entities._id, view_entities.mimetype_id, view_entities.data1, view_entities.data2, view_entities.data3,
    view_entities.data4, view_entities.data5, view_entities.data6, quote(view_entities.data15), view_entities.photo_uri
FROM view_entities
WHERE view_entities.deleted = 0
ORDER BY view_entities._id, view_entities.mimetype_id
")"

# to parse rows
IFS=$'\n'

# iterate through contacts data rows
for ROW in $ROWS
do
    # to parse columns from a row
    IFS="|"
    i=0

    # iterate through columns
    for COL in $ROW
    do
        i=$((i+1))

        # data included in each column
        case $i in
            1)  # Contact ID
                id=$COL;;

            2)  # Mime Type ID
                mime_id=$COL;;

            3)  # Phone Number, Website, Email, Notes, Address, Organization
                data=$COL;;

            4)  # Type ID of Phone No. / Email / Address, First Name
                first_name=$COL; type_id=$COL;;

            5)  # Name of Custom Phone No. Type / Email Type / Address Type, Last Name
                last_name=$COL; type=$COL;;

            6)  # Name Prefix, Title
                name_prefix=$COL; tytle=$COL;;

            7)  # Middle Name
                middle_name=$COL;;

            8)  # Name Suffix
                name_suffix=$COL;;

            9)  # Photo thumbnail hex data
                photo_hex=$COL;;

            10) # Full resolution Photo URI
                photo_uri=$COL;;
        esac
    done

    # start new contact when all rows of same contact ID are parsed
    if [ "$prev_id" != "$id" ]
    then
        # echo current vcard prior to resetting variables
        GEN_VCARD

        # init new vcard
        for i in name tel adr email url note photo org title; do eval "$i=''"; done
    fi

    # add current row to current vcard, 'mimetype' determines data type on every row
    case $mime_id in
        1)
            # Email
            case $type_id in
                0)  email_type=X-$type;;
                1)  email_type=HOME;;
                2)  email_type=WORK;;
                3)  email_type="";;
                4)  email_type=CELL;;
                *)  echo "Unknown email type of '$data'" >&2; exit 1;;
            esac

            email=$email'EMAIL;TYPE='$email_type':'$data$'\n';;

        4)
            # Organization, Title
            org='ORG:'$data$'\n'
            title='TITLE:'$tytle$'\n';;
        5)
            # Phone No.
            case $type_id in
                0)  tel_type=X-$type;;
                1)  tel_type=HOME;;
                2)  tel_type=CELL;;
                3)  tel_type=WORK;;
                7)  tel_type=VOICE;;
                12) tel_type=PREF;;
                *)  echo "Unknown phone no. type of '$data'" >&2; exit 1;;
            esac

            tel=$tel'TEL;TYPE='$tel_type':'$data$'\n';;

        7)
            # Name
            name="$name_prefix $first_name $middle_name $last_name $name_suffix"

            # remove leading/trailing spaces
            IFS=' ' read name <<<"$name"

            # always add complete name as First Name
            name="N:;"$name";;;"$'\n'"FN:"$name$'\n';;
        8)
            # Postal Address
            case $type_id in
                0)  adr_type=X-$type;;
                1)  adr_type=HOME;;
                2)  adr_type=WORK;;
                *)  echo "Unknown address type of '$data'" >&2; exit 1;;
            esac

            adr=$adr'ADR;TYPE='$adr_type':;;'$data';;;;'$'\n';;

        10)
            # Photo
            if [ $photo_hex != "NULL" ]
            then
                # look for high-resolution photo instead of thumbnail
                uri=$(echo $photo_uri | sed 's|content://com.android.contacts/display_photo|'"$PHOTO_DIR"'|')
                if [ -f $uri ]
                then
                    # convert binary to base64
                    foto="$(base64 -w 0 $uri)"
                else
                    # remove prefix/suffix from hex output, convert hex to binary to base64
                    foto=$(echo $photo_hex | sed "s/^X'//; s/'$//" | tr '[:upper:]' '[:lower:]' | xxd -pr | base64 -w 0)
                fi

                photo="PHOTO;ENCODING=BASE64;JPEG:"$foto$'\n'
            fi;;

        12)
            # Note
            note="NOTE:"$data$'\n';;

        14)
            # Website
            url=$url"URL:"$data$'\n';;

        *)  echo "Unknown mime type: '$(sqlite3 $DB "SELECT view_entities.mimetype FROM view_entities WHERE view_entities.mimetype_id = $mime_id" | head -n1)'" >&2; exit 1;;

    esac

    # preserve current ID to compare with next row
    prev_id=$id

    # reset IFS for parent loop to parse rows
    IFS=$'\n'
done

# echo last vcard, loop is done
GEN_VCARD

echo "Backed up $n contacts."

If you prefer GUI or don't have root, you can use some app like Contacts VCF.

This is what I did when I need to have a backup of my contacts. Because I lost most of them in a factory reset. But some contacts were there in my gmail account and sim card. So I did,

I copy all the contacts to the gmail account I have connected.(copied to 2 accounts)
Using google contacts app I remove duplicated and empty contacts.
I have selected my gmail account as the default contact saving place (not the phone or sim card. Its directly save to the google)

Now I can use google contacts app on any device or just contacts.google.com using any web browser on pc or mobile to access my contacts anywhere anytime.


text:
When I tap on a phone number, why doesn't my HTC automatically call it?
Please see the screenshots beneath. When my grandma tapped 'Mobile' beneath in screenshot #1, her HTC Desire 825 failed to, but ought've, instantly connected. Rather, a "No Internet calling account" message appeared.
But when she input that 647 number manually, her phone connects perfectly as in Screenshot #3.

Do you have an application called "Voice Changer" installed? I've heard that it can cause this. Likewise, if you have google voice installed, do you have it set to "Never Dial with Google Voice"?
If those are not the reason, do you have any other "Telephone Linking" applications or "Sip Dialers" etc, remove them and check whether your issue stops.
If none of these options above work go to:
Settings > Call > Use Internet CallingChange this setting to "Just for Internet Calls" Additionally, Change WI-Fi Calling to Disabled


text:
Not granting permission because it was previously installed without?
An app i installed fails at startup, in the logs i see this permission problem:
Not granting permission android.permission.ACCESS_FINE_LOCATION to package com.nianticlabs.pokemongo because it was previously installed without

and
Ignoring duplicate uses-permissions/uses-permissions-sdk-m: android.permission.READ_EXTERNAL_STORAGE in package: com.nianticlabs.pokemongo at: Binary XML file line #35

My phone is a Fairphone2, it runs Android 7.1.2
Buildnumber 18.09.2
Kernel-version 3.4.0-perf-geaadfcc5a2djenkins@lxc-slave05 #1 dd:20180928
The app in question is Pokemon go.
I have wiped and factory reset my phone at least 3 times, had the battery out and everything.
Is there any way to fix the permission problem via ADB?

The second message can probably be ignored, as it details a mistake in the app's AndroidManifest.xml file. To address the first one, could you try executing pm grant com.nianticlabs.pokemongo android.permission.ACCESS_FINE_LOCATION after running adb shell?

@DeathMaskSalesman if only, trying  to grant the permissions via adb causes the warnings. Is there any way i can alter the AndriodManifest.xml?


text:
Android NetHunter can't find several files
I'm trying to get KaliNethunter to work on my OnePlus5.
I'm facing a problem though, and I really don't know what to say of it. There are several errors and they're all No such file or directory.
This is the error log I get:
OnePlus5:/ # su -c bootkali
Mounting kali chroot...
mount: mounting /sdcard/kali-chroot.img on /data/local/nhsystem/kali-armhf failed: No such file or directory
/system/bin/bootkali: /data/data/com.offsec.nethunter/files/scripts/bootkali_init[268]: can't create /data/local/nhsystem/kali-armhf/etc/resolv.conf: No such file or directory
/system/bin/bootkali: /data/data/com.offsec.nethunter/files/scripts/bootkali_init[268]: can't create /data/local/nhsystem/kali-armhf/etc/resolv.conf: No such file or directory
/system/bin/bootkali: /data/data/com.offsec.nethunter/files/scripts/bootkali_init[268]: can't create /data/local/nhsystem/kali-armhf/etc/resolv.conf: No such file or directory
/system/bin/bootkali: /data/data/com.offsec.nethunter/files/scripts/bootkali_init[268]: can't create /data/local/nhsystem/kali-armhf/etc/resolv.conf: No such file or directory
/system/bin/bootkali: /data/data/com.offsec.nethunter/files/scripts/bootkali_init[268]: can't create /data/local/nhsystem/kali-armhf/etc/resolv.conf: No such file or directory
chmod: /data/local/nhsystem/kali-armhf/etc/resolv.conf: No such file or directory
chroot: can't execute '/bin/bash': No such file or directory

For the most part it seems I figured it out, but am still asking for assistance.
There is directory at /data/local/nhsystem/kali-armhf/ however /data/local/nhsystem/kali-armhf/etc/ isn't there. It exists in /data/local/nhsystem/kali-armhf/system/etc/.
So now I can either edit the bootkali script or mount the directory (I don't know how).
Kali Nethunter isn't necessarily supported with my device but is supported by older devices e.g. OnePlus3(T).

You can try creating directory yourself before executing script: mkdir -p /data/local/nhsystem/kali-armhf.


text:
Can't downgrade from EMUI 9.1 with dload
I used the dload method to upgrade my dual-SIM Huawei P20 Lite (ANE-LX3 C605) with bootloader locked from EMUI 8.1 to 9.1. It is actually the first time I ever do something to this phone, so I am not completely sure how this works.
I think my phone was rebranded to C432 because the name of the firmware I downloaded is Huawei P20 Lite ANE-LX1 ANE-L01 ANE-L21 hw eu Anne-L01 Anne-L21 9.1.0.132(C432E5R1P7T8) Firmware 9.0.0 r3 EMUI9.1.0 05014YWN 05014YXX.zip.
EMUI 9.1 works like a charm, but I want to downgrade to EMUI 8 in order to have an earlier version of Google Play services.
I have download a few different firmware from androidhost.ru:

Huawei P20 Lite ANE-LX3 ANE-L23 claro la Anne-L23 8.0.0.152(C605) Firmware 8.0.0 r1 EMUI8.0 05015ATQ
Huawei P20 Lite ANE-LX1 ANE-L21 hw eu Anne-L21 8.0.0.150(C432) Firmware 8.0.0 r1 EMUI8.0 05014YWN
Huawei P20 Lite ANE-LX1 ANE-L21 hw eu HLRCF Anne-L21 8.0.0.180(C432) Firmware 8.0.0 r1 EMUI8.0 05014YXX

With 1. and 3. it says "Software install failed! Get help from www.emui.com"
With 2. it says that the software package is not compatible with the current version .
I have attached a couple of screenshots with info on the version and build number as seen currently.

Any help with this matter would be much appreciated, thanks in advance.

Downgrade because of Google Play Service!? Those services will automatically update once you managed the downgrade.

Right. So I will uninstall the updates and keep it from updating

how will you prevent google services from updating? this is only possible with app cn.wq.disableservice (and afaik requires root permissions)

Note: this question was also posted on XDA Forum.

I read about that, you need to downgrade one by one. Emui 9.1 To Emui 9.0, then Emui 9.0 to Emui 8.0.

Hello. This might actually be true, but could you mention the link where you read about this solution?


text:
How to connect to a SSH server from Android client?
I can install and run an SSH server on my Android 6.0 phone (Banana SSH server), and I can run an SSH client on it (Termius), so how do I invoke the client from on the command line that the server provides?  I type ssh and it's not a recognized command.  I want to use the phone to link through to other servers.

You don't need to install server in order to use client. Install openssh package on Termux, that has both; server and client. To connect to a server, do: ssh <user>@<server-IP>. Mention port with -p option if different than default (22), such as Termux server uses 2222 8022 (corrected by @Steve).
Or if you want to stick to GUI, you can go for Termius or ConnectBot etc.
In order to run SSH server, just execute sshd from Termux, but that gets killed with app. Or for a more complicated setup see: How to run SSH/SFTP server for multiple user logins with password authentication on Android?


text:
How to factory reset a locked phone when you cant access fastboot or usb debug mode
I have a Hyundai Orbit android phone.  The situation is as follows:

The phone has a pin which we don't know
The phone was never signed into any google or other accounts
USB debugging is not turned on
We have tried starting the phone while holding all combinations of buttons and it always just boots normally, never into fastboot/recovery mode.  We have been able to boot with "Safe mode" in the bottom right hand corner of the screen

Is there any way to do a factory reset under these conditions?

i cannot believe that fastboot is not reachable. Anyway, last (and most awkward) option is SP Flash Tool. You don't have stock ROM, and you don't have scatter file. So you must perform memory test to get size, then you can create a full ROM dump. From this ROM dump, you can create a scatter file with WwR MTK v2.50. from this scatter file, you can use the start address and size of userdata partition, and format this area of the memory from SP Flash Tool. All this can be done off (without battery) with VCOM Preloader drivers, no button is needed. I won't give detailed instruction, request a link

@alecxs Can you please give me the link with instructions?  I have SP flash tools working, but I'm not sure how to interpret the memory test output.

https://forum.xda-developers.com/apps/magisk/mod-magisk-v1-universal-systemless-t3432382/post77795016
don't do this unless you have splitted the ROM dump (for backup purposes in case something get wrong)
https://forum.hovatek.com/thread-21638.html please note, this erases the partition. Maybe you must flash a empty ext4 partition image with exact same size (you need linux for creating)

So you think just erasing the user partition might make the phone unbootable?  Do you know that or is it just a guess?  Maybe android would rebuild the partition after erasing and then booting?

i know it is unbootable when erasing cache partition. in case of userdata it may bring you to recovery, which then automatically recreates the partition - just a guess. but not a big deal, you can create userdata ext4 image with dd + mke2fs / anyway i would give a try what @Ezekiel answered, first!

https://forum.hovatek.com/thread-21970.html

if you are lucky then it brings you to recovery, and from recovery to bootloader - where you can fastboot oem unlock (or fastboot format:ext4 userdata)

I got it to work!  I dumped the memory with SP flash tools, then cut the partitions up with WwR MTK.  Then I mounted the userdata.img file and deleted gatekeeper.password.key, gatekeeper.pattern.key, locksetting.db, locksetting.db-shm and locksettings.db-wal from /system.  I then flashed the userdata.img back on to the phone with SP flash tools and when the phone rebooted, the lock screen was gone.  Thanks for the help.

:Good: You mean /data/system/locksettings.db* thats where it is mounted... This is of course only possible for unencrypted phones

Some phone needs to be plugged to light before it can boot to recovery mode/hard reset. Try putting the plugged charger in the phone when it's switched off and immediately it shows the charging signal press the volume down⬇key+power key, if that doesn't work try volume up⬆key+power key.
The both work for my phone innjoo i2s.

I tried this and it didn't work.


text:
Is there a way to push the results of an adb query to a file?
I have a couple of adb commands that I'm running in PowerShell. Specifically:
adb shell settings get secure bluetooth_address; adb get-serialno

Is there a way to do an 'adb push' of that data to a text file on the same tethered device?

Try the following:
./adb shell settings get secure bluetooth_address > results.txt ; ./adb get-serialno >> results.txt ; ./adb push results.txt /path/to/save/file

Explaination: The results from the first 2 commands are saved in a file on your PC, then the file is pushed to your device.