text:
Why network activity is detected from apps after VPN firewall blocks them?
A few non-rooted (no rooted) Android 7 and 8 phones from (Huawei, ZTE, Neffos and Samsung) were tested in this simple firewall (NetGuard) experiment. A selection of apps (including apps from the phone manufacturer) was chosen to be blocked from accessing the Internet regardless using Mobile Data or WiFi, by using NetGuard.
Before the experiment, NetGuard and GlassWire for Android were installed. The GlassWire is activated to monitor if these apps still can access to the Internet. Throughout the experiment, GlassWire reported that some apps, that were blocked by NetGuard, had network traffic to the Internet.
Therefore, it seems that users who buy any Android phones are denied full control of the phone, even if they have installed privacy protection apps such as NetGuard. So, to make the experiment fair enough, this question is posted here, requesting help from experts out there, on whether what is the actual problem(s).
Is the problem caused because GlassWire reports false positives? Or NetGuard requires special configurations in order to block Internet for selected apps? Or Android phones disregard users and allow apps to access Internet even though NetGuard was installed?

Could we get some screenshots of the setup for both apps? Also perhaps some packets captured would be nice to see what kind of data is being sent (not sure if your app GlassWire does this or if you need to set up some kind of mitm proxy).

Is the problem caused because GlassWire reports false positives?

You are correct. This question appears to be related to the understanding of OSI Model. NetGuard is based on VPN which makes use of the TUN interface at OSI layer 3, while GlassWire collects data from NetworkStatsManagr which is something within Android's Java runtime e.g. the creation of sockets happens at top layers; Application or Transport. And the UID-based data usage is collected from qtaguid module of iptables which also operates at OSI layers above 3.
Making use of Per-app VPN configuration, NetGuard asks the OS to only send traffic from app XYZ through the TUN interface so that it can be forwarded through a VPN connection (which it never does). When we see apps from the top, it looks like the apps are sending network data which is moving out of the device, but in actuality, it's blocked at layer 3. So IP packets even don't hit the physical layer.
This fact is self-explained by the GlassWire app. It has a built-in firewall which is also based on VPN; no other possible way for non-root apps. When turning on this firewall, it warns that users will still get data usage stats for the blocked app. The reason is as stated above, data is measured on upper OSI layers, and blocking occurs at a lower level:

That's why sniffers work at OSI layer 2, or even better is to watch from outside e.g. using a proxy server or at the router.

Therefore, it seems that users who buy any Android phones are denied full control of the phone, even if they have installed privacy protection apps such as NetGuard.

Well, NetGuard and similar apps have become somewhat privacy protections apps just as a side effect of Android's VPNService API which wasn't intended for this usage. Such apps can do app filtering based on UIDs and/or SOcket_MARKs which Android uses to categorize the network traffic for different purposes. If they wanted to give users freedom of choosing which apps can access the internet and which can't, they could simply set Protection Level of android.permission.INTERNET dangerous, which doesn't favor their business model; consider the fact that Google is the biggest search engine and ads are their prime source of revenue.
Advanced users who want more fine-grained control of privacy usually root their devices and make use of lower-level things like Linux kernel's built-in firewall iptables. Also, some custom ROMs have such features built-in.
RELATED:

How to view network traffic requested by a specific app?
Are multiple-users protected from each other differently than apps?


text:
Get rid of Messages' notifications when application is connected to a PC
I am using and very enjoining the fact I can connect my base Android Messages application to its web counterpart on my PC and get much more flexibility in writing and managing all my SMSes.
But, I am pretty much irritated that it displays so many notifications about the fact that it is being connected to this or that PC:

I think that I see it dozen of times:

daily, each time I start a PC,
each time I restart my browser and
even each time my Messages application / mobile phone looses and regains connection to the Internet and thus Messages application and its browser counterpart reconnects each other.

Is there any way to disable this pseudo-security messages?
I can't find corresponding configuration option in either Messages application on my Android phone or in its web counter part. And I am afraid to force-block notifications from this mobile application in my Android settings becuase I think that I will loose all the notifications from it, i.e. not just those about being connected, but also notifications about received SMS message.
The same goes for notification about using mobile plan, in web counterpart:

Is there any way of getting rid of it permanently or do I have to close this nag everyday, every time I restart my browser?

Interesting, I've never had such a nagging problem with it like you describe. I reconnected mine to see just what it does for me, and my phone doesn't even tell me I'm connected to the web version.

For disabling first notifications (i.e. the one that appears on the phone when it is connected to PC) one must:

tap such notification (or select Messages for web from three-dot menu in Messages application),
tap three-dots menu and select Notifications and
uncheck Show presistent notification option.

As for disabling second notifications (i.e. the one appears in PC / Chrome / web browser version of Messages for web, about phone using mobile data) this is most likely solved in the Google-way.
Thus there is no way to disable this because Google thinks that you must see this and doesn't actually care what you really need or want, sorry.

source: Stack Exchange

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

sort: votes


text:
Android 8 / LG 6: Add next alarm to lock screen?
On my previous Nexus 5 (which was running Android 6), the lock screen displayed this: 19:05 ⏰ 7:30 (indicating that it's now 19:05 and the next alarm would be at 7:30).
Now that I'm on Android 8 (on a LG G6), I cannot find any way to display the next alarm on my lockscreen. I've seen some videos about Facewidgets, but that only appears to be for Samsung phones. Even the "Always-on-display" doesn't include the next alarm.
Is there a way for me to do that? I've tried even looking at the Android API to see if I could build my own app to customize the displayed clock (there are functions allowing me to get the next alarm clock). I just can't find a way to manipulate what is displayed on the lock screen.
Any ideas is welcome!

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


text:
USB DAC not working with Galaxy S9+ on Android 9
I just got a USB DAC/AMP for my S9+ and I can't get any audio to be sent over USB.
Things I've tried:

Updating from Android 8.0.0 to Android 9
Confirmed the cable is OTG
Used Included OTG adaptor with DAC/AMP's included cable
Confirmed Setup works on friends Galaxy S8

When connecting the DAC/AMP to my S9+ it recognises that the USB device is connected but when I tap to change the USB settings it says that the USB connection is being controlled by the external device but when I tap to switch it to being controlled by the Phone is says "Couldn't Switch" and the DAC/AMP switches off because the connection has been refused.
When connected to my friends S8 it worked straight away no need to change any settings

How to enable USB “Audio Source” option on Android 9+?

I found that turning on Hardware Acceleration in Developer Options fixed the issue.


text:
An Android phone on my network keeps connecting to a malicious site
My wifes phone keeps reaching out a malicious site (udmserve.net), and it is being blocked by my router's Trend Micro network scanner. I ran Trend Micro's virus scan, as well as Clean Masters, but there are no results on her phone. Any idea of how to fix this? I enabled real-time protection from Trend Micro as well. It's a Samsung Galaxy Halo, which is a low-end Galaxy.

Clean Master might be the problem, that's a garbage collection of apps. Get rid of that. Or do like @GilCol says and factory reset and only install trusted apps, NO clean master garbage.

It sounds like the phone is infected by some kind of malware. You could do a factory reset to try to get rid of it. Doing a factory reset will remove all data (photos, sms, files, apps etc)! Don't forget to back up your data if you want to keep it.
After the factory reset, only install trusted apps (use your instinct / google) or you might end up getting the malware again. Not everything on google play store is safe.
You could also try to identify the malware and delete it if you think you are capable. You could try to look for apps installed on the device that have the internet permission (since the malicious app is trying to reach that website, it must have the permission) and use google to see if the app is known malware.


text:
Is there a way to setup a "Work Profile" for an arbitrary Exchange account?
I've worked at companies in the past where it was possible on Android to setup a "work profile" which remained totally separate from the personal profile. This meant separate apps for things like Gmail, Calendar, Docs, etc. that were totally isolated from each other.
The benefit of this is that the company can delete the entire work profile if they need to without touching any of the personal apps and data on the device.
If I go to setup a new Exchange account for a Microsoft domain, it asks me to give it full and total control of my device and the ability to delete everything at the discretion of the IT administration of the organization.
Is there a "work profile" mode for setting up a Gmail Exchange account or a way to do this with the Microsoft apps?
I'm on Android 9 on an original Pixel 1.


text:
Chrome browser frozen from scam tab. How to fix?
I got an ad popup in a new tab in the Chrome broswer from visiting a site & now that tab ad won't close or let me use Chrome.
Tried force stopping & clearing cache but Chrome is still frozen. Tried restarting phone. No change. See the photo for the tab that won't close.  It's the "critical..." one that has frozen Chrome. Can't close any tabs at all too. Any suggestions? Also,  Malwarebytes' scan result = nothing.

how bout turning wi fi and data off and trying to open Chrome again? Will it still be like this?

You didn't mention clearing data of Chrome app from Settings app. Are you avoiding it for some reason? That would definitely solve the problem.

You could always uninstall chrome, and then reinstall. That's assuming you don't have any bookmarks you care about.

If the app was preinstalled in your system you can 'uninstall updates' and force stop Chrome.

If you don't have a warranty on your phone anymore, you can root it and then uninstall 'preinstalled apps'.

Can you please provide instructions for both of them?

That depends a lot on the phone. But there's an app - One Click Root- that worked fine for two of my phones (LG G3 and Samsung Galaxy A5 2017). After you root your phone, install System App Remover, you can find it on play store or on One Click Root page at Root Apps. The through that app you can remove preinstalled apps from your Android device.
ADVICE: When rooting your phone, search and read carefully and make sure it's alright to root it. Nobody wants to brick their phone.

Just wipe user data, related to browser (Settings => Apps). No need for reinstall, wiping data+cache is the important step!


text:
Could malware be persisting on a tablet after factory reset?
Is there any other solution for my Sprint Slate besides factory reset?  When using certain aps the screen goes black even though sound can still be heard, it stutters and lags and freezes.  I used to be able to restart it and that would work but now even that doesn't seem to work.  Also when I tap icons the one that opens is often not the one I chose.  It worked for a while after the factory reset but now it is back to the way it was before.

The body of your question doesn't support the existence of a malware, let alone a persistent one. How did you conclude a persistent malware could be behind the problems you are facing?

If not Malware then what could be responsible?  I don't really care what the problem is-I just would like to fix it.

You need to change the title to follow what your explanation. What's your Android version? Do the device has enough memory? is the screen in perfect condition?


text:
Block PUBG completely from working in Android mobile
My relative's child is addicted to PUBG. She needs to block PUBG completely. Is there a way to block it from getting connected to PUBG servers, or crashing the app every time it opens?
Please note: My relative is not very tech-savvy. The simpler method, the more helpful it would be.

What about just forfeiting the phone?

https://www.wikihow.com/Block-Apps-on-Android

Cannot leave him without phone as we both travel

Either use the Parental Control in the PlayStore or simply remove the Network access in the App Settings.
If possible, ask them to spend some time with that kid. This addiction is not a serious issue if you can spend some good time with kid.

This adds nothing to the existing answer.

There are some methods that actually work for me.

Lock the game/app with an app or from the android if you have that function.
Go to Google Play-->Settings--->Parental controls. Once opened, you will be able to set up the restrictions you want.
Restrict the internet access to the game. You can do it from your system if you have this feature. Otherwise, just get an application from Google Play, search for "app internet restriction" for example.


text:
Taking photo and storing it directly to OneDrive/365
At work, we draw on white boards a lot and at the end of the session, we take pictures of the boards (with our personal camera phones) with a goal of putting the pictures on our intranet.
Whilst it's minor, having to plug my phone in to the computer via USB, find the relevant images, copy them to my computer and then add them to our Office 365 storage / OneDrive is just an additional process I'd like to remove.
I can't sync the DCIM folder because it would include personal pictures as well.
Is there way to always save images to OneDrive/365? I found http://www.uploadcamapp.com/ which is perfect other than it only uploads to Drive and Dropbox
It needs to be OneDrive/365 as that is what the business uses.

It appears as if OfficeLens does this, but it is slow and manual. With uploadcam the photo was just automatically uploaded where as OfficeLens asks you to choose where to upload on each photo taken


text:
Forced download
I had this icon in notification bar once I connected to wifi .. Google play auto update is disabled and application update comes with no red dot ... When I scrolled down the status bar, no notification about what is being downloaded ... In google play, no recent updated apps ... Any idea what was it or how to know what was being downloaded?
Kind regards,
Ahmed


text:
How do I disable screen timeout of Android?

I would like it to be disabled when I use in certain condition, such as during traveling with GPS.

Look in your gps app for an option "do not turn off the screen" or "keep the screen on" or similar. Most of them do have it.

I worry that there is no such option on google map. But in case  mine is different, can you help me please show how to do it?

No, Google Maps doesn't have it in map mode. But if you use it in navigation mode (which is not clear from your question), the screen won't turn off.

There is an feature on the Developer options that, when enabled and connected to a power source, the screen won't turn off

I maybe lack of knowledge about Android. Can you please show me that one you mentioned available in navigation mode?

What did you mean with Developer option? Can you show me please?

1. Use a script
You can use a script via the terminal to simulate a long action and prevent the screen from timing out. Create the script below and run via Terminal Emulator on your phone. It simulates pressing the letter r and Enter, then wait for a second before repeating the process for the number of times you choose with i.

Create a file and put the following inside of it.

#!/system/bin/sh

i=86400 #Put a big number here

while [ $i -gt 0 ]
do

i=$(( $i - 1 ))
input keyevent 46 #Write the letter r
input keyevent 66 #Simulate Enter key on the keyboard
sleep 1           #Do nothing for 1 second

done

Save the file, give it a name for example test.sh. Open the terminal and navigate to the folder where the file is saved (if you don't know the path, use your file manager to get the path) with the command:
cd /path/to/your/folder
Then execute the command:
sh test.sh

The script will start running. When you no longer need it to run, just close the terminal.
2. Use an app
Caffeinate add a tile in the quick settings. In Caffeinate Settings, click on Caiffeine Tile, enable "Skip To Infinite Mode". Open the quick settings, click on the app tile. The screen should stays on until you press the tile again or click cancel on its notification.

How to run this script? I have installed the Terminal Emulator, then I typed one by one your line, but I got error: /system/bin/sh: [86400: not found

@AirCraftLover I edited the post to show the steps on how to create and run the script

I copied and pasted the script into Notepad of Windows and I named as "timeout.sh" (without quote). Then I emailed it to my own email, then there I downloaded in my smart phone to /storage/emulated/0/Download. Then in Terminal Emulator I change the dir (cd) to the path, then I run command as: sh timeout.sh and then try again using command: sh ./timeout.sh. Both produced error: syntax error: 'done' unexpected. Then I deleted the "done" in the script, and I run again the command using sh and sh ./, and the command is: syntax error: 'done' unmatched. What probably the error? I use Android 4.4.4.

@AirCraftLover The error is simply because Windows and Unix systems (Android) don't save the end of file the same way :). Use the following command in the terminal to convert the file to the correct format: awk '{ sub("\r$", ""); print }' timeout.sh > timeout1.sh.  The command strips Windows' EOL from timeout 1.sh and write everything else to timeout1.sh.

I was in this /storage/emulated/0/Download directory. Then I run your command, then the error message is: /system/bin/sh: awk: not found

@AirCraftLover Download and install Notepad++ on your PC. Open the file you created in Windows with Notepad++. At the bottom, double click where it's written "Windows (CR LF)", then select "Unix (LF)". Save the file, send/copy it to your device.

Which file do you want me to open? the "timeout.sh" or the "timeout1.sh"?

@AirCraftLover timeout.sh since it is on your PC.

I copied and pasted the script you give since the line "#!/system/bin/sh" until "done". Just to make sure I didn't miss anything. Then, after "done", I hit enter. so, there is CR LF behind "done". I double clicked it as you asked, but nothing happened.

@AirCraftLover Open your file with Notepad++, click Edit -> EOL Conversion -> select Unix (LF). Save the file

Thank you my friend. It works perfectly. As my regard, I accepted your kind explanation, I accept your answer rather than the previous one. Thank you for your patient way.

If it's sufficient for you to only keep screen on when charging, you can turn on the Stay awake option in Developer options.
To do this:

Open Settings, navigate to About [device] (tablet, phone etc.)
Find Build number entry there. If there's none, it may be in Software information subsection.
Tap Build number 7 times
Make sure that a message pops up saying that you've become a developer (or that developer mode is already enabled)
Go back to Settings main menu
Find the newly-appeared Developer options item
Turn on Stay awake option

The app MacroDroid has  a feature to set screen timeout to never. I did not test it for long but the app is free, so you can give it a try.
Install the app and enable the permission "modify system settings". Afterwards, setup a macro like this:
Trigger: setup a Trigger of your liking.
Action: Screen Timeout -> never
Constraint: only if you need, otherwise, leave untouched.
Now, whenever the condition for the macro would be fulfilled/triggered the action would run and timeout for screen would be changed to never.
To change the timeout after your work is done, say you're done with Maps app, you need another macro which would work for the rest of your phone's usage.
The trigger is I believe needs dependent. You can try with app launch and closure based triggers, optionally coupled with some constraints.

If you are on LineageOS there is a custom tile called Caffeine which you can press repeatedly to increase screen timeout to infinity.
An app to replicate this is Caffeinate. Nougat (7.0+) is required to enable the quick settings tile.


text:
import words in android personal dictionary
I have a json file exported from a 3rd party app keyboard and I wanted to know if there is any way I can import it in Google Android Dictionary (so that gboard keyboard app can utilize it).

Finally, I did the job with User Dictionary Manager (UDM)!
Find it in Play-Store.
I just had to transform the json export file to plain text word-by-line file.


text:
android.database.sqlite.SQLiteException: Can't downgrade database from version X to Y when running an app
I have problem with TitaniumBackup. I had it installed on my Android tablet which is rooted and using Android 4.4.2. It was working fine, but I had to do factory reset and after that, if I try to launch TitaniumBackup, I get 'Unfortunately, Titanium Backup has stopped'.
This is the logcat with the lines that contain references to TitaniumBackup.
Line 111: E/AndroidRuntime(26306): Process: com.keramidas.TitaniumBackup, PID: 26306
Line 112: E/AndroidRuntime(26306): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keramidas.TitaniumBackup/com.keramidas.TitaniumBackup.MainActivity}: android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 6
Line 131: E/AndroidRuntime(26306):        at com.keramidas.TitaniumBackup.MainActivity.onCreate(Source)

The error mentions

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keramidas.TitaniumBackup/com.keramidas.TitaniumBackup.MainActivity}: android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 6

How to mitigate this issue?

Can't downgrade database from version 7 to 6: looks like the Titanium Backup you used before the factory reset is newer than the current one. Have you updated it?

No, i didn't update it.

Looks more that you downgraded your TitaniumBackup version. You have to use the same or newer version of TitaniumBackup you used for creating the backup.

I didn't downgraded but this shouldn't matter anyway. After factory reset everything is deleted, right? It should not be any traces of previous Titanium Backup versions.

You didn't mention the Android OS version, but on Android Marshmallow or later, app data can be backed up and automatically restored after doing factory reset/reinstall.

It's android 4.4.2.

[...] android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 6

This is caused when an app tries to downgrade an SQLite database from newer version, but failed since the code handle that is not implemented. (For more technical explanation: Can't downgrade database from version 2 to 1 even after fresh install and re-run).
This can also happen on Android Marshmallow (Android 6.x) or later when the data is backed up and restored after doing factory reset, leaving the data with newer version, but the app in older version.
What the user can do:

If the user wants to use the existing database: they have to find and use the version of the app that is using the current (7)/newer (>7) SQLite database version. Usually this means the user needs to update the app to the previous app's version (before the factory reset) or newer one (latest from the Play Store/developer's website).
If the user doesn't care about the existing database: depending on the database location, they can remove the database by e.g. deleting the file manually (probably need root access), cleaning the app data, etc. and let the app recreate a new database with older SQLite database version (big potential of data loss from the previous database).

Where is this database located?

I was able to manually downgrade the database version of an IceCatMobile database via sqlite3. Root is required.


text:
How do I know Google Play store apps are authentic and untampered with?
I use Linux a lot and Android on my phone only for a few things. However I want to install a new app (Signal) for the first time in ages.
Now... when I download and install linux apps I can check and verify authenticity of ISOs and other files with a hashing method (gpg, etc etc) and check the stuff I am installing is verified and kosher etc etc.
But... how do I know that the Signal app I download from Google play is authentic and un-adulterated with the same certainty?
Thanks

My answer on [security.se] is probably related.

Thanks Andrew, it sort of does -- all good tips! -- though I am slightly surprised (though not that much) there is not any more straight up user-friendly ways to do it.


text:
What exactly can Outlook remote-wipe when using multiple accounts and how I can I prevent havoc via root?
On my Huawei P20lite I can add multiple users or use the "Private Space" feature (which to my understanding boils down to just another user account as well). Now, from the screenshots in another SE question:

What gets me worried is the "Erase all data" permission. So assuming I'd set up a secondary account and my employers IT decides to trigger this remote wipe, will only that account's data be affected or would this concern the entire phone? What will happen to my SD card data?
My phone is rooted, is there any way I can ensure that this can only wipe Outlook data (if anything at all)?

The entire phone will be wiped! This can happens when you lost your device for exemple, then triggering a wipe will completly erase everything

@esQmo_ Can you post that as answer and back it up with details somehow? And I'm not asking about me triggering a desired wipe but about some IT department messing with what should only affect company data

What data can be wiped? All data on the device can be wiped, it can allow Outlook (actually Exchange server, hosted Exchange server in the case of Office 365) to perform a full factory reset without your intervention, meaning no PIN, no password, or other intervention from the user. If someone issued an erase all data command from the Exchange console to your device, it would be completely factory defaulted and you could not stop it. - Source is personal experience as a system administrator, and Perform a remote wipe on a mobile phone. This has been a feature in Exchange for well over 10 years so it is nothing new.
That sounds super scary, but in reality this is extremely common with connecting to any Exchange server, and although I personally think the other restrictions on this particular account are extreme, they are not uncommon, and maybe appropriate for your organization. The intent of these permissions is to secure your organization's data, plain and simple.
In my 25+ years of experience working in IT, I have only ever heard of this feature being used maliciously once but the company involved got sued for a hefty amount (again, this is hearsay, I cannot prove or document it to be true or false). My point in saying that is that illicit use of this feature is extremely rare and should not generally be considered a problem or issue worth worrying about. That said, I have heard more than one story of an employee being terminated and a wipe command issued and they lost all of their own personal data, that is considered acceptable and legal in most cases. I have been in situations where this had to be done, and if at all feasible we warn the employee that they must immediately delete their corporate account from their device, and have 24 hours, or until the end of the day, then we will issue a device wipe. If the account has been removed from the device, nothing will happen, if the account still exists the device will be wiped. This is really only an issue where organizations allow BYOD (Bring Your Own Device), organizations where data security is of the utmost importance generally do not allow this and will issue devices with this and various other security measures implemented.
Remember that if someone did issue a wipe command to your device, it would be logged, and if it was done maliciously then the most likely result is that person would be terminated immediately, if they were not I would strongly reconsider whether your employer is correct for you.
And you do not need root to "bypass" this restriction, just install an isolated Exchange client like Nine (as an example) which will allow full access to all Exchange services (email, calendar, contacts, etc) and give permission to Exchange to wipe the account information, NOT the entire device, if Exchange sends a wipe all data command, Nine will wipe all data related to that Exchange account. Be aware that using such a client, or a feature of your device that prevents this feature, may be in violation of your corporate security policy and you should verify that with your organization's IT staff. In many organizations, violation of IT security policy can be grounds for termination.

Thanks, I'll give said clients a shot after proper clarification with IT


text:
Why reading permission to /proc/1/maps is denied and why doesn't the denial appear in logcat?
I'm developing a native app for Android, and I'm occasionally confronted with permission denied which doesn't trigger a log in the logcat logs.
For example, trying to run:
shell@kltevzw:/ $ cat /proc/<some-not-shell-pid>/maps
/system/bin/sh: cat: /proc/<some-not-shell-pid>/maps: Permission denied

from the adb shell prompt results in a permission denied message sent to stderr, but nothing appears in the logcat. It's not a unix permissions problem as well, as anyone should be able to read the file. For example:
shell@kltevzw:/ $ ls -lZ /proc/1/maps
-r--r--r-- root     root              u:r:init:s0 maps

It happens in some other situations as well, in which I have less control of the environment.
Is it possible that this is caused by some dontaudit rules in the policy? I ran sesearch --dontaudit /sepolicy but didn't find there any relevant rules.
Does anyone here know why are some denials sent to the log and some don't, and how to debug such cases?
Thanks!

REASON 1:
Apart from traditional Discretionary Access Control (DAC), - that makes use of *NIX owner/group/mode of processes/files to allow/deny access - Android implements several other access control mechanisms of Linux kernel to make itself more secure, such as Seccomp Filter was implemented in Oreo.
REASON 2:
While DAC is allowed by-default, SELinux (a Mandatory Access Control) works in denied by-default mode. Any access attempt that isn't explicitly allowed in an SE Policy rule will be denied. Using same, access to /procfs has been tightened in Android O which won't let a non-privileged process/user read - e.g. - /proc/stat and /proc/filesystem. Same restricts you from reading /proc/1 when running as a non-root user from your app.
If SELinux on your device isn't Enforcing, you should be able to read /proc/1 but there are some other security restrictions which - unlike DAC and MAC - are specific to /proc pseudo filesystem.
REASON 3:
Android by-default mounts /proc with hidepid=2,gid=3009 options, which means a non-privileged user will be able to view only its own processes (running with same UID) (ref). So your app won't be able to see directory /proc/1. The only exception is the processes which are member of group AID_READPROC (GID 3009).
REASON 4:
But still if you (re-)mount /proc without option hidepid, you won't be able to read /proc/1/maps because Linux kernel only permits processes having capability SYS_PTRACE to read the details of currently mapped memory regions.
An example of working non-root process on Android is incidentd that runs with CAP_SYS_PTRACE as well as a member of group READPROC. Also the SE Policy rule like following should be defined to allow access:
allow incidentd init : file { read getattr open }

LOGGING:
As far as logging of permission denials is concerned, logd (the service from which logcat reads) is an Android specific logging daemon which necessarily logs events from within Android's native and Java framework (such as manifest permission denials), but optionally includes kernel events (which we can also see using native command line tool dmesg). SELinux denials are also logged to kernel log:
$ ls /proc/1
ls: cannot access '/proc/1': Permission denied

# dmesg | grep avc
[37914.650314] type=1400 audit(1548757064.171:33323): avc: denied { getattr } for pid=28576 comm="ls" path="/proc/1" dev="proc" ino=803674 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0

# logcat | grep avc
01-29 14:17:44.171 28576 28576 W ls      : type=1400 audit(0.0:33323): avc: denied { getattr } for path="/proc/1" dev="proc" ino=803674 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:r:init:s0 tclass=dir permissive=0

However Linux kernel may or may not log all of its internal permission denials depending on multiple build and runtime configurations including printk loglevel, DYNAMIC_DEBUG and/or others I'm not sure of. Therefore such messages may not appear in logs.
If you want to get logs related to security events, you can make use of Linux kernel's Auditing System. For that you need to use auditctl tool for defining rules (root required), and you would get details about the denials in logs through dmesg or logcat. Fo more details on how to define rules, see this answer.
PS:
Another reason of not being able to access a certain PID in procfs is PID namespace that isn't relevant on Android so far but very common for isolation mechanisms like containers. In a new PID namespace, any process from parent namespace isn't visible and a process could have same PID (including PID 1; init) as that of some other process in some other PID namespace.


text:
Android Apps will not stop updating, no matter what I try
I've searched extensively on this and I see many threads where the advice relates to drilling into the apps individual menu list and 'un-checking' the 'Enable auto-update' box.
Anyway, I'm at my wits end here now.  For whatever reason, I do not want ANY apps to update by themselves.  This functionality has been well supported in Android for a long time now and has worked.  However, it no longer does and it's extremely frustrating - I'm turning to the collective brain here to see if anyone is able to help me at all?
Here are the details:
Galaxy Note9 (SM-N960F UK)
Vodafone contract (UK)
Android 8.1.0
Sams Exper Version 9.5

Google playstore : Auto updates is turned OFF
Samsung Galaxy Apps: Auto update apps, is turned OFF
Every SINGLE app in the Play store list has been checked that the 'Enable auto-update' is NOT checked. (this is the one that everyone seems to immediately advise upon, however I have covered this off already)

And yet, at least 40-odd apps have recently auto-updated and continue to do so!
It's driving me nuts.
Is anyone else having the same experience and - is anyone able to assist at all please?  Many thanks in advance.

Does your phone have an alternative market app? Some manufacturers add their own market app to install and update apps. Also, when they get updated, did you confirm that it was the Google Play which updated them?

Current apps installed/updated via Playstore contain a special signature. Therefore it should be possible to check if an updated app was installed by Google Playstore or a 3rd party market. Additionally check the special app permissions for apps which can install other apps?

Thanks for the replies - interesting points.   I was aware that the Samsung Galaxy app also was able to update apps, but assumed it was restricted to only apps that originated from there.   But as far as I am aware, outside of the Play store and the Galaxy store, I can't think of another app that would a: have permission to update such a (seemingly) random array of apps and b: would even want to.   You mention there is a way to tell via the 'signature' which app has updated another app - I am not aware of how to do this, could you elaborate please?  Many thanks, Ash.


text:
Fix "android.process.acore keeps stopping" when the contacts provider can't load it's db
My phone just decided that it should spam an exception onto my screen that reopens as soon as I tap it away.
A look at logcat reveals the following being thrown multiple times per second:
SQLiteLog: (14) cannot open file at line 34327 of [605907e73a]
SQLiteLog: (14) os_unix.c:34327: (13) open(/data/user/0/com.android.providers.contacts/databases/contacts2.db-shm) -
SQLiteLog: (14) statement aborts at 1: [PRAGMA user_version;] unable to open database file
SQLiteLog: (14) cannot open file at line 34327 of [605907e73a]
SQLiteLog: (14) os_unix.c:34327: (13) open(/data/user/0/com.android.providers.contacts/databases/contacts2.db-shm) -
AndroidRuntime: FATAL EXCEPTION: Worker-1
AndroidRuntime: Process: android.process.acore, PID: 9149
AndroidRuntime: android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
AndroidRuntime:        at android.database.sqlite.SQLiteConnection.nativeExecuteForLong(Native Method)
AndroidRuntime:        at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:599)
AndroidRuntime:        at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:652)
AndroidRuntime:        at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:107)
AndroidRuntime:        at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:842)
AndroidRuntime:        at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:830)
AndroidRuntime:        at android.database.sqlite.SQLiteDatabase.getVersion(SQLiteDatabase.java:940)
AndroidRuntime:        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:311)
AndroidRuntime:        at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:262)
AndroidRuntime:        at com.android.providers.contacts.LegacyApiSupport.<init>(LegacyApiSupport.java:499)
AndroidRuntime:        at com.android.providers.contacts.ContactsProvider2.initForDefaultLocale(ContactsProvider2.java:1668)
AndroidRuntime:        at com.android.providers.contacts.ContactsProvider2.performBackgroundTask(ContactsProvider2.java:1759)
AndroidRuntime:        at com.android.providers.contacts.ContactsProvider2$1.onPerformTask(ContactsProvider2.java:1615)
AndroidRuntime:        at com.android.providers.contacts.ContactsTaskScheduler$MyHandler.handleMessage(ContactsTaskScheduler.java:77)
AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
AndroidRuntime:        at android.os.Looper.loop(Looper.java:164)
AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:65)

My guess would be, that - for whatever reason - the contacts provider was assigned a different user ID and has now lost access to it's own database. I would guess, that if I clear the database the issue is gone.
Still, I don't want to lose my contacts. I have a backup but that's old enough to say that I would lose some. I'm convinced that the file is still there and I can probably just open it as sqlite file once I gain access but I have no clue on how to achieve this. Trying to work with the com.android.providers.contacts package in adb always leaves me with "package not debuggable".
My Phone is a non-rooted Moto G5 Plus running Android 8.1
Is there a way to backup my contacts or are they gone? Also: Can I maybe just remove the *.db-shm file that seems to be the problem here? As far as I remember that's only some temp file for sqlite anyways.

I posted this question trying to find a solution for about an hour and just 10 minutes later I finally found it myself.
Going into the adb shell and running
pm clear com.android.providers.contacts

does not require root privileges and clears the cache, which seems to include the *.db-shm file.
I'm keeping this question here for future reference
EDIT: This was a misinformation. After further inspection I found out that, pm clear does in fact clear all app data, so don't run it if you only want to clear an app's cache. That command is essentially the same as clicking on the Clear Data button in the app preferences.
The reason why this worked out for me is, that the contacts themselves are stored separately. The com.android.providers.contacts package loads the contacts from that other place and provides it to other apps and therefore is called contacts provider.
The data in the provider's db seems to only be things like the call log and the contacts you recently shared something with. Deleting this data is totally fine and fixes the issue.

It is allowed to answer your own question.

@ReddyLutonadio I know, that's why I did it. As a stackoverflow user I hate when I find my exact issue in a question without an answer. I always wonder if people just gave up or didn't bother to provide a solution when they found it.


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

Yeah you can do this using a Bluetooth voice changer for example.

I would like to use a very common aux cable. the question is about the software side

Yes it's possible, depending on your headphone jack... It might be a Four pin jack with microphone pin... So a normal auxiliary won't work as it has 3 pin ( Ground, Right & Left speakers )

@zillinium I thank you for the information you are sharing. however the thing that matters to me is if there is software that directs what the microphone captures towards the audio jack output.

Yes, most of them are designed around being a Voice Changer.... It's just a little annoying to use with AUX cords

@zillinium I ask you directly: I look for an app that "hijacks" towards the headphone output, what is listening on the microphone. a realtime voice changer app, it might be fine, but I'd like my original voice.

It's rather easy to build, however It needs headphones to test the app or else it has feedback into the microphone... I understand that you specifically are not using the devices speakers... however the feedback issue usually stops the development of such apps... You can use a voice changer with no effect added to produce the realtime pass through ... I can build you one for testing purposes.

Updated answer.

here's a built one that I'm talking about....

Direct Download APK from my Google Drive
New Mic2Aux.apk

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

Hope this helps clarify how it works.

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


text:
how to restore keyboard on android - to enter locked screen password
My android phone as a screen lock password. Somehow, I've ended up in a situation where the phone no longer shows a keyboard when it boots up but shows "tap to speak" and that too does not work. I click on the "microphone" icon and nothing happens.
How do I go about restoring the keyboard.
The phone is on wifi as I can hear the beeps when I get messages etc...but can't get past the locked screen.
The device used to be on my google play (GP) device list but now it does not. How can I get the phone back on the GP recognized devices.
Would appreciate any help.
my apologies if this has already been answered.

The solution suggested by @Firelord worked perfectly.
I had to purchase a micro-USB to Female USB OTG cable to resolve my issue. The micro-USB end connects to the phone (where the power cable connects) and connect a keyboard into the female usb end.
Power cycle the phone (for the phone to recognize the keyboard ) and just enter the password using the keyboard.
I had struggled with this - installing adb and figuring out how to sideload (manually install) keyboard apps and all kinds of other suggestions from various sites.
I was just moments away from wiping my phone when I remembered Stackexchange.
Thanks everyone for helping out.
Greatly appreciated.


text:
My Chinese Redmi 4A showed me a step counter in the screen to the left of the home screen but my non-Chinese Redmi 6 does not
I bought my old Redmi 4A in China less than two years ago. I never installed most of the Google infrastructure on it. I did upgrade to MIUI 10.
I just bought a Redmi 6 in Taiwan so it does have all the Google infrastructure and lacks some of the Xiaomi and/or Chinese internet apps etc.
Recently I noticed if I swipe right on the home screen on the 4A I see among other info the number of steps I've walked today. I did not have a step counter app installed . The 4A had very little storage so you always delete apps you don't use.
On my new Redmi 6 I don't see the number of steps I've walked.
How can I enable this feature on my 6, or at least find out what app etc the 4A got this info from?

I found the answer myself after some Googling. This is a feature of the China ROM that is not present in the non-China ROM.
MIUI Forum: [Feature Request] Step counter absent!
This feature was reported missing since at least January 2018. So far I haven't found anything on whether it's going to be added to the non-China ROM.


text:
What's the downloaded_rom folder and what's its difference from the Download folder?
I have a Redmi phone with Android Nougat 7.1. In the file explorer I found the downloaded_rom folder, next to the Download folder. The first one is empty. What's its purpose?

To view, both Download and Downloaded_Rom folders, you may need to have file manager applications such as google's files go, es file explorer, default file manger(for mi devices -> Mi file manger/Explorer) on devices.
Download

Folder created on internal storage of android device by default. This folder is one among the other internal storage default folders such as Android, DCIM, media, Movies, Music, Pictures, Ringtones etc
It is used to store files that are downloaded from internet using mobile browser apps like chrome, firefox, and default browsers of each manufacturers.
Some devices provides Download access through Downloads app which is placed on app launcher. (Eg: Pixel, Xiaomi etc)

Downloaded_Rom

This folder is created on internal storage, which is commonly seen in xiaomi/Mi devices.
This folder contains the OTA update zip file(Stock ROM), which is downloaded using Updater application in Mi devices. stock ROM is the OS of the device which is released by the device manufacturer(Xiaomi).
Note: After, completing updation, the zip file will be automatically get cleared. So, this folder may be empty, until next OTA update notification and started downloading.
If you download OTA/update zip from xiaomi's website which is opened using browser application, the file is available on Download folder. Copy and paste zip file, to this folder and you can install this update through updater app.


text:
What's a good place for public SSH keys on my filesystem?
I'm using an SFTP server app on my Android phone (RedMi 3S); it's a typical Android app, not something requiring root or run as an ARM binary from the command-line). This server app lets me define some username+password combinations for connecting. So far - so good.
Now, I want to use some public keys to allow password-less connection from certain people/hosts. But - where should I put them? What's the equivalent of the faux-user's $HOME/.ssh directory?
I realize I can just put them anywhere and it'll work, I'm asking what's the customary location for this kind of data.

Are you using some Android app to run server or running from commandline? If it's app, which app? If using commandline, from where did you get the binaries? Are they standard Linux binaries or modified for Android?

If the SFTP app is well designed it would allow you to import the user public keys into it's app private directory below /data/data. That IMHO best place where such file(s) should be stored.

@IrfanLatif: Using an app. See edit.

@einpoklum then best is what @Robert suggested. /data/data/<pkg_name> is a kind of HOME for Android apps because every app is a UNIX user and there is no /home on Android. /data/data/<pkg_name> is the most secure place because other apps can't access that directory. However if your app doesn't have option to import key, then you'll have to use /sdcard obviously. Termux also has a sshd server package and it uses /data/data/com.termux/files/home as $HOME.

@IrfanLatif: I don't have a folder named /data. At least - not that I can see, as a non-root user.

@einpoklum you can't access /data without root access. Only the installed app can access it data directory under /data/data/


text:
Phone wasn't used in 6 months. Is there a way to unlock it?
Unlock pattern forgotten. Developer mode on off. It asks for pattern to shutdown.
Laptop recognizes it but thats all. Drivers up to date. ADB doesnt recognize it as device.

Mind about factory reset? All data will be erased

You can reset the device from the recovery mode. So, you will have to give up your saved data inside the phone to get rid of the pattern which you have forgotten.


text:
What are the "dctp" and "did" files in my Android storage?
I have noticed two strange files in my Android storage. They are named "dctp" and "did". They don't have any extensions and my programs cannot read them. What are those files and what are their purposes?

It appears to me that those two files are present only in Xiaomi phones. https://duckduckgo.com/?q=%22dctp%22+%22did%22+android&atb=v151-5__&ia=web

These files are created by some of init daemons or some app on phones with MIUI ROM. I hade figured that out but can't remember exactly because I haven't been using MIUI for quite a while now. These files contain some plain text strings I think. You can delete them safely but they will reappear on reboot.


text:
Which component of the Android protocol stack performs cellular encryption?
I understand that the SIM Card plays a significant role in generating keys for the encryption and decryption of cellular traffic, but are these keys passed to the Android architecture so that it can use them?
Or does the actual encryption take place on the SIM Card?


text:
Text message is being divided into two messages
I use a pre-paid cellular service from T-mobile. Each text message is deducted from my account at a preset rate.
Too often, a text message I receive of 100 or less characters and spaces is broken into two texts, meaning I get hit for 2 texts instead of one. So for example, a 100 character & spaces text will arrive as a 60 character text and a 40 character text.
Is there anything I can do about this and still keep the same service?
Why are texts being divided if they are under the total character & spaces length of 130?

Does this always happen, or only from certain senders? Does the text message include non-ASCII character, like emoji, or foreign characters like Arabic/Russian/East Asian? This might be related: Adjust SMS length limit? and SMS Message Size

A single SMS can hold up to 160 characters. But that's only for text.
Since smartphones make a lot of use of emojis, the SMS cannot hold 160 characters anymore if you include an emoji. AFAIK, the default emoji (smiley) will take 2 characters, but the one with a custom skin tone can take 4 characters. Similarly, it varies from device to device and what kind of emoji it supports.

AFAIK your "smiley approximation" is too short. An SMS uses 7bit characters and a regular smiley requires 16bit. Therefore it uses more than two SMS characters, usually 4: Read https://www.nowsms.com/emoticons for details.

@Robert I just tested this up on my SMS app (I'm using SMS Organizer from Microsoft if that matters) and the regular emojis (the yellow ones) are taking up 2 chars. However, for ones that I long tap and choose skin color, they consume 4. Probably things have changed. Yes, if I'm not wrong, the emojis used to consume more for me in the past. Else this Microsoft app is counting characters wrongly.


text:
ES File Explorer Remote Manager is gone?
I've lost the option to send files to my device using ES file Explorer. Until yesterday, I would open ES file Explorer, go to Network, Select Remote Management and turn it on. From there, I could transfer files from my PC using FTP.
Yesterday, I couldn't connect using FTP. I opened ES file Explorer, went to Network, the option for Remote Management is gone. If I select FTP under Network, it no longer gives the option to turn it on or off.
I've tried uninstalling ES File Explorer, but still have the same problem. Would appreciate any suggestions.

Its not, in newer versions of the application it is located under Network → View on PC;
and it can be started/stopped using the interface provided under that option:

Alternatively pulling down the notification also brings you to the interface where you can stop the server.
The other FTP option you mentioned is not an FTP sever instead it is an FTP client that allows you to view the shared folders (from other devices/servers) via FTP.


text:
How can Users from a company download private apps
In order to keep our react-native app updateable and private, we decided to use this approach to upload an APK to the Play Store privately. Apparently, our client has to have G Suite set up for this to work. I suppose, with G Suite, the client can "add" user accounts to the company and with that, somehow allow them to download our app (by whitelisting it?).
But how/where can the Users download and install the private app after it has been published? Can they just search for it on the play store and see/download it there?

I think you need to make your own store portal on Google Play..  I was looking into this a while back, the best solution was to release a beta version and add people to the beta testers..

https://support.google.com/googleplay/work/answer/6145139?hl=en


text:
Keeping whatsapp installed on second device
If I transfer everything over wireless to my new android device (included whatsapp) from the old one, when I open Whatsapp it does not ask a verification code for the new device (where I have my sim). And in the old device, with just wifi, the old whatsapp still works.
How can that be possible?

Saying "transfer (included whatsapp)" you mean what? Did you install whatsapp on the new phone? Can you start WA on the new phone?

From the old android phone to the new android phone all apps (whatsapp included) were copied through wireless. So i didn't install any app. All the apps in the old device were found in the new device. And upon opening whatsapp I just entered in the chat page without the app asking me any verification code

Are you trying to say that WhatsApp is now working on both devices at the same time?

I uninstalled whatsapp on the old device after 10 minutes. So I don't know if the app would have stopped by itself automatically or not. But in those 10 minutes yes I could open both

Do you know how could that be possible?


text:
how to change hotspot auto-off time using ADB command o Root?
Hi guys I'm looking for a solution on how to change the auto-off time of the hotspot with ADB command o Root, defatul is set to 5 minutes: "the hotspot will be turned off if no device will connect within 5 minutes" ... it's really stressful. .. does anyone know the command o root solutions? many thanks in advance...
PS: phone I have to use it only as a hotspot, I dont care about the battery or anything else, now its use is only as a hotspot...
specifications:
Model: Meizu M2 mini
O.S: Android 5.1 Lollipop
Root: at the moment I removed the root because I restored it to use it only as a hotspot, but I can ReRoot in 5 minutes without problems.
WiFi: good WiFi power, dual band 2.4 & 5Ghz.


text:
Hide apps in Evie Launcher app drawer
I'm in love with the Evie Launcher however one complaint I have is that there seems no way to hide apps in the app drawer. According to this article the Nova launcher has this feature but i like Evie a lot and I don't want to change my launcher.
Is there a way to do this in Evie launcher?

At your homescreen longpress on a blank space and choose Settings. Under Customization header you would find the option "Hide Apps".


text:
What is "com.samsung.android.dqagent_SA_SDK" user certificate? Is it safe?
My user certificates has the following: com.samsung.android.dqagent_SA_SDK.
It seems so strange, it looks like someone put it on there. Is that normal?

From the name com.samsung.android.dqagent_SA_SDK, looks like the certificate is installed and used by DQA (also known as Device Quality Agent), a Samsung system app.
From some reports (in German and Russian), the certificate will automatically be reinstalled if it's removed, presumably by the app itself, since it also contains the certificate (from the report of reverse.it)
While I cannot certainly determine if it's safe or not, at least it's related to Samsung's own system app, so the possibility of a rogue certificate is lower (though not 0%). However, looks like you can disable the app without any side effects.


text:
How to enable/disable lock screen from shell script when a special wifi SSID is present?
My Java skills are low, but I'm mastering shell.
Is use LineageOS 14.1 (forked from cyanogenmod).
I would like to create a shell script on a rooted devive to enable/disable lockscreen (PIN).
I would like to unlock my screen at home when a special SSID is present.
I'm able to discover my known network by running :
#!/bin/bash

iw dev wlan0 scan | grep MY_SSID

Now, is there a command line to disable/enable the PIN based lock screen depending of the output of this command please ?
Maybe something based on
am <something> <stop|start>

Tried to make a diff from ps with and without lockscreen, but I only have cyanogenmod.snap as diff, tried to kill the process, but still the lockscreen.
Any hint please ?

Not directly answering you but this is trivial with Tasker: https://forums.androidcentral.com/ambassador-guides-tips-how-tos/562081-how-tasker-marshmallow-unlock-when-connected-wifi.html

Thanks but I prefer a CLI or free solution, I don't have play store to buy paid apps. There's  another apps like this, but seems not trusted sources and weird warnings/limitations

The script below is a partial solution. Partial because it will not disable the Pin. What it does is to wake the device up when it is connected to a chosen wifi, input your password and unlock it.
#!/system/bin/sh

mySSID="no wifi present"

connected_wifi()
{
    #Get the network
    mySSID=`dumpsys netstats | awk -F '[/=|,]' '/iface/ {print $8}' | head -1`

}

echo 'Start running script\n\n'

connected_wifi

while true
do
#Check if connected to wifi or mobile data. If connected string is not empty
    if [ "$mySSID" != '' ]
    then

        if [ "$mySSID" == "YourHomeSSID" ] #connected to home wifi
        then

            echo "Connected to $mySSID\n"
            #Check if the screen is on or off
            screen_status=`dumpsys power | awk -F '[/=]' '/Display Power/ {print $2}'`

            if [ "$screen_status" == "OFF" ]
            then
                echo 'The screen is off, Will now input the password'
                #Press the power button to switch the screen on
                input keyevent 26
                #Simulate swipe up gesture
                input touchscreen swipe 320 940 320 100
                #Input your PIN. Change XXXX with your PIN
                input text XXXX
                #Simulate OK/Enter
                input keyevent 66

            fi

        fi

    fi #not connected to wifi nor mobile data

    #Wait for 3 seconds, then check again if connected to home wifi
    sleep 3
    connected_wifi

done

The main disadvantage of the script is that the screen will be on nearly all the time when connected to your home wifi. To stop the script from running, press CTRL+C from the terminal.
My phone doesn't have iw command. I had to use dumpsys netstats to get the networkID.


text:
How to restore data from Google Drive?
My Samsung Galaxy SGH-T99 broke recently. I can see the backup of my data on Google Drive. I will not repair the device and want to restore my data. How can I do that? Please provide guidance.

Google should ideally offer you to restore a cloud backup when you set up a new device using the same Google account. Works well on my Nokia phones. I do not know if Samsung as a varied implementation.


text:
How to handle the Play Store country restriction for those who live in multiple countries?
I had already a lot of trouble with the Play Store country change in Canada. Now I'm living for a while in Singapore and I have the same trouble again.
In Canada/USA, I was not able to download the online banking app of my bank RBC and the service app of my phone carrier Virgin because I couldn't change my country in the Play Store. Now I have the same trouble in Singapore. Bank accounts here are not easy to get (a lot of paperwork) and will cost money. That totally blocks me from downloading free service apps.
I only have one bank account in Germany for my credit card and all payments and I want to keep it like that. I don't want to pay for other bank accounts, credit cards, or want to manage different bank accounts in many countries and currencies. I don't even want to talk about the hustle with the tax office. That was already enough with the one Canadian bank account.
Is there another way to change the Play Store country than to open a bank account with a credit card in every country you're staying in?

Note: I removed the additional question about Apple AppStore because this site focuses on Android expertise. For questions about Apple products, feel free to ask them on our sister site [apple.se].

How about just creating a new Google account for this purpose and adding it to the phone. You will obviously not need a payments profile to download the free apps. But I believe you can still create a payments profile and use your existing card (German, Canadian) in the new account. Or better just buy Google Play gift cards (the offline scratchable ones).
It is very easy to switch the account within Play Store. So, that won't hurt much.
That's the only solution I can think of. I have already had a lot of pain to revert my account country from Canada to India. Because a lot of my apps were showing as unavailable.

Thanks, I will try that. I though about that already but I was scared that I might break some google policies with it and risk to loose my accounts.


text:
How do I load an unsigned Kernel Module to my signature enforcing Kernel?
I compiled a kernel module (wacom.ko) using the proper kernel source for my device and Google toolchain. When I tried to insmod the module, an error message popped up saying

required keys not available

I researched and found out that you need to sign the module to load it into the kernel if the latter uses signature enforcement (which in my case, it does). I assume there is no way of obtaining the private key which the kernel used originally while compiling. But it also doesn't make sense when I think about how any developer would be able to extend the kernel by writing modules if this barrier is in place.
Is there a way to disable signature enforcement of the kernel and load the module that I created? Alternatively, can I somehow sign my module and load it?

Building out-of-tree kernel modules is not usually recommended for newbies like me so that to avoid problems like vermagic mismatch:

config MODVERSIONS
  ...
  Usually, you have to use modules compiled with your kernel. Saying Y here makes it sometimes possible to use modules compiled for different kernels, by adding enough information to the modules to (hopefully) spot any changes which would make them incompatible with the kernel you are running.

Also the warning:

loading out-of-tree module taints kernel

Forced module loading may lead to situations like undefined symbols / references (functions / variables exported and available at /proc/kallsyms).

I researched and found out that you need to sign the module to load it
  ...
  But it also doesn't make sense when I think about how any developer would be able to extend the kernel by writing modules if this barrier is in place.

It's the intended behavior:

Module signing increases security by making it harder to load a malicious module into the kernel.

And that's why MODULE_SIG_FORCE is there. On PCs UEFI Secure Boot necessarily requires kernel and modules to be signed as a part of secure boot chain. Android's Verified Boot signs whole boot partition though, which then - using dm-verity - secures /system and /vendor; the partitions which may possibly include kernel's loadable modules. So signing modules doesn't seem necessary:

Module signing isn't mandatory and isn't tested against

Quoted from Loadable Kernel Modules.

I assume there is no way of obtaining the private key which the kernel used originally while compiling.

You are right. Public / private key pair is generated (using openssl) when building kernel. Public key is built into the kernel and can be viewed in /proc/keys or by:
~# keyctl list %:.system_keyring

If kernel was built with IKCONFIG_PROC, hash algorithm can be seen by:
~# zcat /proc/config.gz | grep MODULE_SIG_HASH

A perl script is also part of kernel source tree which can be used to sign modules:
~$ sign-file <algorithm> <priv_key_file> <pub_key_file> <module>.ko

Is there a way to disable signature enforcement of the kernel and load the module that I created?

No.

Alternatively, can I somehow sign my module and load it?

Ask the kernel developer to provide the same private key (if possible), otherwise only option is to rebuild whole kernel. Get configuration of running kernel from /proc/config.gz if available and required. Don't forget to unset CONFIG_MODULE_SIG or set CONFIG_MODULE_SIG_ALL.
SOURCE: Building External Modules


text:
Backing up/save files on android with a broken screen
My phone's screen is broken and is useless, but it has important files on it. Is there a way to back the files up or get the phone back?

You can only back data up yourself, if the phone is functioning (apart from the screen obviously). Make sure it shows some kind of life signal when you plug it in/turn it on/press the volume keys/etc. It could be something like the charging LED lighting up or vibration. If you have the SIM card in there, you could also call it and check that way. If none of these work, then the only solution is to take it to a data recovery center (it can cost a couple hundred dollars, so make sure those photos are irreplacable).
So, first of all, a broken screen could mean a couple of things:
1.: The digitizer (touch screen glass) is broken
This is the easiest problem to solve. If you have an OTG cable (a cable with a micro USB end and a female USB on the other), you can connect a mouse to the phone and use that to back everything up. It's very rare nowadays for a phone (especially phablets) to not support this feature.

You could also just buy a new screen and either apply it yourself or take it to a repair shop if you want to keep the phone.
2.: The LCD (the display) doesn't work
If you see a black screen or random lines on the screen, when you turn it on, then the LCD is broken. This has a bunch of different types too.
If you're lucky and the phone goes into file transfer mode, when plugged into a computer, then you can just take the files off, so make sure to try this first.
a.: Water damage
If you dropped your phone in water and it got damaged, then either a chip got fried or something got corroded. It's usually impossible to tell which one it is, so the phone has to be disassembled and cleaned. It's not really worth it to buy a screen at this point, LCD don't really mind water that much. However, If you're "lucky" and only the backlight is faulty (or the connectors got corroded), then you can just take a strong flashlight, hold it up against the screen (possibly somewhere with a white/light area of pixels). Make sure to try this out, in my experience, even some repair shops forget to check it. I've had it on a friend's phone recently and it looked like this:

(That's the vodaphone logo btw)
If it's not the backlight, then probably some video output chip got damaged. Backing up data in this case is very hard. You could try using one of the tools designed for this but it's a gamble whether they work and even if they do, they might require you to turn on USB debugging (which is hard without seeing anything). I also don't like to install random programs on my computer.
In some cases, removing the corrosion from the device can also solve some problems. If you want to keep the warranty, take it to a repair shop and let them clean it. If you don't care however, iFixit has some really nice guides to disassemble almost any phone. Make sure to remove every board from the device, then take an unused tootbrush and some Isopropyl alcohol and give it a good scrub. Clean the adapters and the ends of the cables too. You're essentially looking for some blueish-greenish goo:

If you don't want to void warranty and you can't take it to a repair shop either, then you could theoretically put it in a tub of alcohol, but I haven't tried it and it certainly won't have the same effect.
After this, assemble the phone again without missing anything out and test it. Hopefully it works. If not, check the general advices part.
b.: Blunt damage
If you dropped your phone on concrete and the screen won't turn on again, it's either because the LCD got damaged or a cable got loose (the latter is very unlikely, I've only had it happen once and only with a vibration motor). If it turns on, but you see lines one the screen (see image below), then the LCD is broken.

(This is an iphone, but you get the point)
In any case, it's usually worth it to get a new screen if it's still in production. Make sure to not touch the glass too much, the small glass shards don't mix well with your finger.
c.: General advices
If nothing above worked for you, there's a small chance going through a software based solution will work too.
If you have USB debugging enabled, install adb, pull up the command line of your choice, connect the phone to the computer through USB (pray to your choice of deity) and type "adb devices" without the quotes. If your phone show up in the list, you can continue. Type "adb pull mnt/sdcard/DCIM/Camera/" without quotes. This will pull the images from your phone. You can also do "adb pull mnt/sdcard/" if you want every file on there, because you have some sick scores in temple run you want to keep.

Quick note: I compiled this list because I found the general lack of a comprehensive guide, which went into hardware and software frustrating.


text:
Send an SMS from an Android 8.0 using adb
A lot of docs are explaining how to send an SMS from an Android using adb command line, but none of these work for the newer Android version 8.
I am eager to know where are the docs for
service call isms [args...]

Thanks in advance.

Now, I finally can send SMS through the command line on an Android 8.0-oreo performing next steps:

Installing the ShellMS app on the phone (once for ever)
Going on the phone to Settings > Apps > ShellMS > Permissions > Enable all the permissions (once for ever). This step will no longer be necessary once an issue about permissions will be fixed
Connecting the phone to the computer with USB (and giving permission on the phone for accessing data, if asked)
Issuing next script on the computer:

#!/bin/bash
phonenumber="$1"
message="$2"
# escape double quotes
message=${message//\"/\\\"}
adb shell "am startservice --user 0 -n com.android.shellms/.sendSMS -e contact \"$phonenumber\" -e msg \"$message\""


text:
How to disable the in-app update notification on Google Photos?
When opening Google Photos and if there is a newer version, it says that I need to upgrade. You can of course click no, but it is very troublesome to do it always.
Is there any way to disable this popup without upgrading the app?
I got a rooted device.

Related: Any way to disable "update now" popup upon opening Google Photos App?

Go to the Android Settings
Find the Google Photos app
Disable background data

When you get the notification next time, long press it and you will get the Settings or the details option based on the version of Android running on your device. Once you select the option, you will be taken to the notification settings page of the app and from there you can choose to turn off the notification for that particular popup category or for the entire app.

Apparently this is a pop-up notification inside the app, not an Android system notification. AFAIK, it can't be disabled from any settings. (ref: Any way to disable "update now" popup upon opening Google Photos App?)

Alright, I have a solution, more of a workaround and not the best one, but it works for me, I used MacroDroid to dismiss that window automatically. I'm using Photos v5.52.
Application Launched (Photos) > Wait 750 ms, Repeat 7 times{Click[com.google.android.apps.photos:id/negative_button], Wait 100 ms}
It's the UI interaction action and identify in app function.
Didn't find any other solution.. tried LuckyPatcher to change some components, detaching from store, XprivacyLua, but no luck.
Macro here: http://bit.ly/3HAHwBc


text:
My Tab SM-T380 no longer accepts my PIN
Set a PIN to unlock my Tab before using. Worked fine for a long time. Today when I enter the PIN it loops back to the enter PIN screen over and over. Tried to reboot but the restart/power off screen loops me back to the enter PIN screen. Tried hard reboot: vol up/power down/home screen. No affect.

Mine did this also. Press and hold the Power button and the Volume button down simultaneously for more than 7 seconds to restart it. This worked for me.

This happened to me too. I knew the pin was correct as if I deliberately entered an incorrect pin it came up with the message saying it was incorrect. I tried the reboot too but it doesn't work as the "loop" won't let you turn it off. So I let the battery run down completely (which took a week as it is obviously using very little power; then I found you can have the torch on and that helped the drain). Then once completely dead, plugged in the charger and lo and behold back to normal!

It's a sign of a security thread because the system changed the PIN by itself. wait for 24 hours by removing the battery and try it after the day or just do a factory reset by going on recovery mode.


text:
How to press & long press the "back" key with a terminal command?
We manage Zebra Mobile computing units running on Android 6.0 Marshmallow through an MDM. For some reason, the MDM interface doesn't show the Android buttons at the bottom of the screen (back, home, menu, etc).
I was able to find the script for the home screen on this site.
Is there a way to send the script for other buttons as well?

Have you tried KeyEvents? ADB Shell Input Events

adb shell input keyevent 4 this should trigger the back key


text:
System crashed and not rebooting on Xiaomi Redmi 5 Plus
I have a Xiaomi Redmi 5 Plus with MIUI 8. My system crashed today and then the phone tried to reboot but is stuck eternally in the boot screen with the Mi and Android logo. I only had 100 MB free space, so maybe the system cannot boot because of that? I tried to clear caches with fastboot but it says "device is locked. Cannot erase". Also flashing TWRP is not possible. When trying to start adb shell it only says "error: closed". The newest version of Mi PC Suite cannot connect and an older MiPhoneAssistant version is only able to flash the ROM.
So I really tried a lot, but maybe someone has another idea with which I don't lose my data?
EDIT: So, instead of starting the bootloader I left the phone in the booting process and then I could connect with adb shell. But without root permission I don't have access to user data.

I don't think there is anything we can do about it you will loose the data. Download the Mi Flash tool. And flash the stock firmware.

Hm, when I use MiPhoneAssistant it proposes to flash the newest ROM without losing user data. I also found this testpoint method to start edl mode, maybe this could be a solution.


text:
Gmail notification on lock screen does not show subject
On my new Samsung Galaxy S9 running Android Oreo, new email notifications (Gmail app) do not show the email subject. This happens even if I just have a single email notification. If I unlock the phone and check the notification shade, it has all the required details.
I am wondering if there is a setting on Samsung phones that causes notification details to be hidden on the lock screen for the sake of privacy.
This was working fine on my Pixel.

Found it! The setting to change is here:
Open the Gmail app. Go to Settings > (Email address) > Manage Notifications > Lock screen > Show content

There should be an app setting (Settings > Apps > Gmail) to allow or disallow sensitive content on the lock screen.
There should also be a standard setting in Settings > Security to disallow sensitive notifications on the lock screen.
I am not very sure of how Samsung implements them. But should be there somewhere.


text:
LG K10 Rooting and Bootloader Unlock without a computer
How I go about unloacking the bootloader on a LG K10 without a PC?  Can it be done or do I need a computer.   Thanks in advance

You will need a PC to run the required fastboot commands. So, yes, it cannot be done without a PC.
One alternative can be to use another rooted Android phone with ADB and Fastboot binaries installed. Then connect the two phones using a USB OTG connector/cable and you should be able to use the fastboot commands.


text:
View list of registered document providers
How do I check in Android which applications have registered their document providers? I hope no code is needed (I need it from user perspective), but if that's the only way then I can attempt that.

Are you talking about apps with "content providers" (app acts as data source) or are you talking about apps that have registered file types (mime types), e.g. a PDF viewer that can receive and display pdf files?

I assume were referring to the file types the different apps can open.
On a rooted device you can get the list the following way:
The mime types and the applications for the default user are stored in the file /data/system/users/0/package-restrictions.xml
Therefore you can execute the following PC to get the full list on a smartphone connected via USB (an enabled ADB):
adb shell "su -c 'cat /data/system/users/0/package-restrictions.xml'"


text:
How to check which app changes home background image
The background of my homescreen keeps changing and I do not know what causes it. I can change the background manually, but after a certain moment of time it just changes automatically to another background. It is really annoying. I mean... I do not hate baby's. But I do not want them randomly eating biscuits on the background of my phone .

Do you use a custom launcher?

I mean a third-party launcher

Have set any live wallpaper?

I am using the default Oneplus launcher, but same kept happening, using the Nova launcher. I do not think I have a live wallpaper (how can I check that?). And isn't the live wallpaper overwritten anyway when I select a new background?

An app must have the permission android.permission.SET_WALLPAPER to change wallpaper. I suggest you find out which apps have that permission and than try to disable or remove some of those app one by one until you no longer have that problem.
You can use a permission checker app to find those app. User Izzy maintains a nice list here if you need help finding one. I have used aSpotCat earlier so I'm showing you how you can use it to list all the apps having that permission.

Launch the app.
Choose List apps by permission
Scroll down and choose Misc. Permission
Tap the three horizontal line icon next the Misc. Permission to list the permissions instead of the apps.
In the search bar (tap the lens icon) type android.permission.SET_WALLPAPER
Under Set Wallpaper category you can find the apps which have the permission to change wallpaper.


text:
Does Huawei's super charging affect the battery?
I have a Huawei P20 pro and it came with a "super charger" that can take full charge the phone's battery really quickly. Sometimes in less than an hour.
I wonder if this affects the battery's lifespan! Will the battery degrade overtime due to how fast the super charger works?
I'm interested specifically in Huawei's super chargers.

I don't think so. fast charging feature is related to its processor.

please go through this link which describe technically, https://www.quora.com/What-is-fast-charging-How-does-it-work

I don't think that you will get a definitive answer to that topic. However in general the battery temperature increases more with fast charging. And high temperatures can fasten battery degrade.

Battery charging is an ongoing field. There isn't conclusive evidence that fast charging itself is bad. However, fast charging have a measurable impact on battery life in the field
https://www6.slac.stanford.edu/news/2014-09-14-study-sheds-new-light-why-batteries-go-bad.aspx
http://ecec.mne.psu.edu/Pubs/2018_Yang_JPS.pdf
Other variables include discharge rate or temperature also have an effect on battery life too. Like any engineering problem, fast charging is a trade off. The loss of battery life may not be pronounced as the normal 2-year life span usage rate.
Please note, fast charging is not part of the USB standard. Qualcomm, Huawei, Oppo and Apple create their own implementations.
Even worse, lots of cables break the USB C power spec.
https://www.theverge.com/tldr/2016/11/8/13564460/usb-c-spec-apple-cables-port-future-macbook
https://bensonapprovedcom.wordpress.com/
Benson Leung regularly validates cables ever since a third party cable kill a chrome pixel.
I am not sure what will happen if you mix up different chargers.


text:
Extraordinarily fast battery consumption
I have been using Xiaomi Mi Max (4/128) (now running on MIUI 10.2.1.0) for over two and a half years and as the time passed, my battery started to die pretty quick - I used AccuBattery to check the battery's health and it was about 40% after 30 charging sessions. On average it could last about 3-4 hours on screen and about 12 hours standby.
My decision was to change the battery and I did it, but the phone still does not work for 8+ hours on screen (as it did before the battery started dying that quick). I took a look at the power usage graph and the thing that suprised me the most was the distribution of power. I know it should be rather exponential than linear, but it was different - first 30% (from 100 to ~70 percent) has been drained in less than an hour, next 45% was used linearly (approximately 10% per hour), and the rest lasted for 20 minutes, going rapidly down to 0%.
Up to now I deleted apps which I was not using, turned on the auto-brightness and the battery saver. I was thinking about doing a factory reset, but at the moment I am unable to save all my photos and data, so I would like to get any ideas what else could I do instead, in order to lenghten the time the battery can last.

Your device may not have recognized the changed battery. Use your device until it turns off and the load it while it is turned off.

@Robert will try it soon, I'm gonna tell you if it helps later.

@Robert I have done it twice now, battery consumtion looks pretty similar (it discharges from 100 to 70 and from 25 to 0 percent pretty quick), but it works nicely on 70-25%. Is there any way of making it a bit more linear?

Looks like a software issue for me. I had the same issue on my max 2. I flashed the firmware again using Mi flash tool and there's no battery drainage now.


text:
How to grant write access to external SDcard using ADB in Android tv?
I can't get ES file explorer and winrar to write (copy or cut from internal storage and paste to external storage) to SDCard external storage in Android TV. It says that there will be an "open from" window where I can enable it, but the window won't appear like it did in my android tablet. Is there an ADB command to grant writing access to external SDCard?
I tried to use these commands:
adb shell appops set com.estrongs.android.pop WRITE_EXTERNAL_STORAGE allow
adb shell appops set com.estrongs.android.pop READ_EXTERNAL_STORAGE allow

That was the code for es file explorer, for winrar I just replace com.estrongs.android.pop with com.rarlab.rar The codes executed with no errors, however, I still can't write to the external SDcard, the suggestion to enable it in the supposedly upcoming popup window still appears and the popup window still did not appear. Please help

Android Marshmellow (API 23) or above you need to grant runtime permission. This can be done through an adb shell with the command:
adb shell pm grant com.your.app.package android.permission.WRITE_EXTERNAL_STORAGE

If you ever need to revoke the permission the use this command:
adb shell pm grant com.your.app.package android.permission.READ_EXTERNAL_STORAGE

Hi Bo, Sorry I just managed to try out your suggestion. unfortunately it does not work. Here's the exact code:  adb shell pm grant com.estrongs.android.pop android.permission.WRITE_EXTERNAL_STORAGE Any other ideas?


text:
TWRP unable to mount anything except external-sd (invalid argument)
I'm trying to install Magisk on my Leagoo T8s but there's errors even before Magisk installation:
E:Primary block device '/dev/block/platform/bootdevice/by-name/userdata' for mount point '/data' is not present!
Failed to mount '/data' (invalid argument)
Failed to mount '/cache' (invalid argument)
Failed to mount '/system' (invalid argument)

What can I do ?

Start by taking a deeper look into whats happening through an elevated privileged adb shell with this command: adb shell  then elevate privileges with su last post the out put from e2fsck /dev/block/platform/bootdevice/by-name/userdata

I don't have su, my phone isn't rooted...

That is one of the fantastic things about TWRP. It runs its shell with elevated privileges. It might fix the partition but at least it might return some useful information. If its easier the get thr /cache/recovery/last_log that will most likely have some helpful information. A snippet of escalating the adbd daemon to root: Always start adbd on userdebug and eng builds on property:ro.debuggable=1 #write /sys/class/android_usb/android0/enable 1 #start adbd setprop service.adb.root 1 # Restart adbd so it can run as root on property:service.adb.root=1 write


text:
Is the Android F-Droid client still actively maintained?
According to the G-Droid app description on the F-Droid website, "the F-Droid client is not [actively maintained] any more".
I could not find evidence that this is true.
Is the Android F-Droid client still actively maintained?

Given the update history of F-Droid,
it seems to be actively updated.  https://f-droid.org/en/packages/org.fdroid.fdroid/

The app has asked me to update it at least 3 times in the past week.

@SiXandSeven8ths Hmmm... something doesn't sound right on your end.  According to the link Firelord posted, the app hasn't been updated since the first week of this year.

Remember that apps are presented that are compatible with your device and its capabilities. In spite of F-Droid version currently at 1.5.1, my device reports 1.4 as the latest available compatible version. It is also dependent on the app signature, which may not be upgradeable from the source you are currently viewing. Possibly the app was originally installed from some other distribution line, which is no longer maintained. Perhaps an uninstall/re-install from your desired repository would allow 1.5.1 for you?

I just performed the last statement in my former comment: Uninstall/Reinstall, and now have v1.5.1, updated repositories, and reports of updates to other apps, which didn't report with v1.4. Clearly, provenance matters when using this app installer and repositories.

Yes, F-Droid get's updates and commits.
G-Droid does not get commits anymore.
The message by G-Droid was removed in d53a33c8

Thank you.  Great find with the commit removing that message (and ironically stating that G-Droid is actively maintained).


text:
Tell TWRP to decrypt for ota
Old versions of TWRP would prompt for the password to decrypt the phone prior to performing an ota, however new versions are able to apply otas without requiring decryption. This is great in practise but does mean that magisk is removed by the ota (when decrypted it would run some scripts after the ota installed, this doesn't happen when the phone is still encrypted) Is there anyway to tell TWRP I want it to always decrypt the phone?
Edit: the feature was added in twrp 3.2.2)
Running Lineage 15.1 and magisk v18.0 on a op3t

Possible duplicate: https://android.stackexchange.com/a/189716/116800

Not a duplicate, that question was asked in Jan 18, the version of twrp which installs otas without decryption was only released in July 18 (version 3.2.2)

I understand that's why possible. The command line interface is still same decrypt password : decrypt /data with provided password. Password could be numeric, alphanumeric. Pattern: Use the table bellow to determine what your password will be:
1 2 3
4 5 6
7 8 9
1 2 3 4
5 6 7 8
9 : ; <
= > ? @
1 2 3 4 5
6 7 8 9 :
; < = > ?
@ A B C D
E F G H I
Example: if your pattern is a "U" shape in the middle of the 5x5, enter twrp decrypt '79' in the terminal or ADB shell. Note that characters ;<>? are special to the shell and require backslash escaping or single quotes around the string

That's not the question though, OTAs install fine automatically and just hitting the mount button prompts for a password if I'm installing manually so that's ok, I'm asking if there's a way to tell twrp 3.2.2 + to promote for the password during the automatic installs so the magisk post update scripts can run (or equally a way to move magisk somewhere it can run without requiring decrypt)

There doesn't currently seem to be a way to tell TWRP to decrypt /data before an OTA. As you've said, this prevents the Magisk addon.d script to work, since the main part of that script itself resides in the /data partition. (But it also seems to require other things from the /data partition, so we can't just move it).
Here's a workaround:
Since you're on LineageOS, you can install your OTA update manually in TWRP, after decrypting. First download (not install) the OTA in the LineageOS updater. Then reboot to recovery manually and select the OTA zip from /data/lineageos_updates.
It's a bit more cumbersome than automatic-recovery-OTA, but at least it doesn't require adb or manually downloading the zip to your internal storage, where it is writable by any app with Storage permission...


text:
Android GUI: Y Axis Inversion
Somehow the Y-axis of my Android display became inverted. I'm looking for a way to return it to normal. At this stage I don't care if it's a real solution to the original problem or a workaround.
Only the visual display is inverted, not the touch sensor; the two are out of phase with each other. In other words, the home button that usually lives at the bottom of the screen, appears up the top, but the trigger is still down the bottom. It's.. frustrating.
Yes, I've tried a factory reset.
No, rotation isn't a solution. I made this to demonstrate the difference:

I read somewhere that I need to change ro.sf.hwrotation=180 to ro.sf.hwrotation=0 in /system/build.prop, but that line isn't present on my device; an old LG Nexus 5 (Hammerhead). I'm hoping SurfaceFlinger might have some kind of config file somewhere that I can edit or something like that. Any ideas?


text:
One specific game/app refuses to install
As the title says, one single game on the app store that I had installed beforehand without issues, now refuses to install at all. The playstore keeps giving me error -506 over and over, and that's when it installs the game, it downloads the game as it should but does not get past the installing stage because it keeps tossing error -506. Googling didn't help either because googling it only gives me topics about other error codes that are not related to mine at all. Please, if anyone knows the solution or possible fixes to this, suggest them to me here so I can finally play the game again.

Check this article https://www.maketecheasier.com/fix-error-code-506-google-play-store/

Possibly the error is because you have got a dead data directory corpse somewhere from that one specific app from a previous install of the app. Once you uninstalled it it did not clean up after its self properly. You can try adb to get the remnants of the app with the command:
adb uninstall (package_name)
Looking like:
adb uninstall com.one.specificAPK
If that does not work and you have rooted privledges then use a root explorer and navigate to /data/data/ once there look for that one specific apps corpse. It should be a white file delete it.
If that is unsuccessful then there is an app called SdMaid (no affiliation) that has a corpse cleaner that should do the trick.
If that does not work then try Google's suggestion of one of the following:
METHOD 1:

Go to Setting >> Go to Application Setting (In some devices application setting is named as apps).
  Go to, All the apps > >Find the Google Play Store >> Clear Data and Cache
  Once you have clear everything, Next you need to Force Stop the application.
  Similarly, Find the Google Play Service >> Clear Data and Cache
  Also, Find Google Services Framework >> Open Google Services Framework >> Clear cache and data
  Now, Restart your device and try to download the app.
  It has worked for many users and hopefully it will work for you also. If it didn’t worked for you, go to next method.

METHOD 2:

Go to Setting >> Storage >> Scroll down and select “Unmount SD card”
  Open Google Play Store >> Download the app again that was giving you the error message
  After successful installation, Go back to Settings >> Storage  >> tap on “mount SD card”
  If above steps didn’t work, also try removing your SD card before installing.

METHOD 3:

Go to Setting >> Accounts >> Google
  Remove all your Google accounts
  Go back to Google play store and Sign–in your account information
  Accept all the Google terms and setup Google settings then Run Google Play Store and download the app.
  Removing and adding the Google Account has solved the issue for many users as there was problem with the Google account. If this help you to fix the error then the job is done otherwise head to next method.

METHOD 4:

Most of the users have found this solution to be working fine. After changing the storage setting users were able to download the app without any error message displaying on-screen.
  Steps to change the Storage Setting:
Go to Setting >> Storage >> Preferred install location
  Tap on Preferred install location, a box will pop-up with different option
  Select “Let the system decide” option
  Open Google Play Store >> Download the app again that was giving you the error.