[Help] App Preferences - Xposed General

Greetings,
Currently I'm trying to make a module but I require to save a few settings/preferences of the user.
But only problem is I have no clue how to let's say save settings in my own app and load the settings in a different app.
Would be nice to see some example code for this

Here is a simple module with preferences: https://github.com/rovo89/AllAppsInPlayStore
The most important part is MODE_WORLD_READABLE, as you will read the settings from the process of a different app, which usually doesn't have access to your app's settings.

Related

Tasker or another automate app working?

Hi,
I tried to find root cause, but unfortunately without success. Is there anybody, who using Tasker or another application for automatization of your phone without any issues?
My issue is, Tasker is still "delayed" - but same rules I used before on LG G3 (Android 6.0) - but now on P9 (DualSIM) didn't work.
I have task for Calendar Entry, where if I have appointment in my work calendar, during this time Sound mode is deactivated (only Vibrate).
Some suggestion? I tried white lists, etc. or another app with same bad behavior.
Thank you!
Well, I tried to deactivate power management app from Huawei over ADB and looks good now finally! Its workaround, but tasker now working very well as expected.
adb shell pm hide com.huawei.powergenie
Did you have "Run in Foreground" selected in Tasker's preferences?
My Tasker works fine with that selected, although I also have trusted the app in permissions manager, allowed it to auto launch & activated it as a device administrator in advanced settings/security.
Yeah, I tried every tip over Tasker or phone (EMUI settings) and only deactivate power management helps me.
I had the same problem with IFTTT. It worked perfectly with my LG G3, but was hopeless on the P9. No amount of white-listing or settings would work.
I even had the app in memory, with Google maps running, on GPS, screen on, and it still wouldn't trigger a location based profile.
I've had to revert to manually arming and dis-arming my home security system. Annoying.
I translate from spanish so I'm sorry if your phone shows menus with other name.
You must go to adjust > advanced adjusts > memory and store and at bottom of page "space clean". On new screen push on upper-right wheel, and now on last option "white list of memory clean". Finally look for your app and activate it.
If you don't include app here, clean system will close it on background and timers won't work. It solved my problems.
aidrabmol said:
I translate from spanish so I'm sorry if your phone shows menus with other name.
You must go to adjust > advanced adjusts > memory and store and at bottom of page "space clean". On new screen push on upper-right wheel, and now on last option "white list of memory clean". Finally look for your app and activate it.
If you don't include app here, clean system will close it on background and timers won't work. It solved my problems.
Click to expand...
Click to collapse
"Settings>Advanced settings>Memory & storage>Storage cleaner" and "Memory cleanup whitelist".
Using Agama, I can get an app to start following a reboot. However, I would like to start the App at every Startup. Does Automate or any other app let you do that?
carroamer said:
Using Agama, I can get an app to start following a reboot. However, I would like to start the App at every Startup. Does Automate or any other app let you do that?
Click to expand...
Click to collapse
Why would you need Tasker for that simple.
Settings, type in the Search Autostart and add your app to the list of apps to be started on every reboot.
You may also need to disable Battery Optimization for your app (to make sure it would still work in background when the phone sleeps with dark screen)
That should generally work for all Androids. I don't have Huawei P9 now for years, I remember that EMUI might have had specific Settings organization but there was also Autostart (or Auto start)...
zgfg said:
Why would you need Tasker for that simple.
Settings, type in the Search Autostart and add your app to the list of apps to be started on every reboot.
You may also need to disable Battery Optimization for your app (to make sure it would still work in background when the phone sleeps with dark screen)
That should generally work for all Androids. I don't have Huawei P9 now for years, I remember that EMUI might have had specific Settings organization but there was also Autostart (or Auto start)...
Click to expand...
Click to collapse
When I search 'Autostart' it produces 'No results'
carroamer said:
When I search 'Autostart' it produces 'No results'
Click to expand...
Click to collapse
I had P9 for three years (if you don't believe, you can find tons of my posts here back from 2017-2018)
Now, you have that phone, not me (I got rid of my last Huawei almost three years ago) - I cannot show you and I cannot look into the EMUI settings because I don't have the EMUI phone anymore
But I KNOW that there was a way in EMUI how to control which apps will be automatically started on boot - I know because I played with all that back in those years, II did need for many apps like AdAway, Find My Device and similar that required to be auto-started to operate correctly
Take your time and google and you'll find. Sorry, I tried to help you but I will no more waste my time on that. Huaweis are past time for me
And take your time, use your imagination, If not Autostart, google for EMUI startup manager or something similar to find the answer for your question on the Net

Settings Questions for Geeks

These are some settings that I fail to clearly understand so I thought no better place to find the right answers to them than XDA Developers where most android geeks are
1) The first question is exclusive to Huawei, it lies in (Settings - More - Link+ live update) ... What does this really do?
2) Second question is obviously present in any Android phone on Nougat, it's actually those settings in (Apps - Settings - Advanced - Special access) I can't quite understand some of them specially:
Ignore battery optimization, what should I expect if I set all apps not to ignore battery optimizations?
Do not disturb access, what would this add to an app like the Google App for example if I give it this access?
Draw over other apps, what's the difference between this and the Dropzone management setting in Huawei's built in Phone Manager app?
Write system settings, what's that??!
Unrestricted data access, if I turn that on from Mobile data settings I believe the amount of data usage for an app not given the restricted data access would be restricted to some level but my question is to what extent? And I also noticed that Google Play Services is unrestricted by default ... What would go wrong if I restrict it?
Usage access, what does it mean and what's the difference between this and Notification access?
Sorry for my long post and awaiting your helpful answers. Thanks in advance
Any replies??
????!!
..................
probably the only way you are gonna find out what these settings do, is to test your self, and see what happens , backup.

Change an option from Developer Options after every boot automatically

I want to change an option from Developer Options (specifically the background process limit) but now I have to do it manually because this option changes back to the default after every reboot. Is there a way for this change to happen automatically after every reboot, either using Tasker or any other app? I run on Android 9.
Much to my surprised amazement, looking into this for you I discovered the classic IntangibleObject Secure Settings plugin has resurrected itself with an update back in January 2019.
What you want is easy peasy with this plugin. It's under Root Actions -> Background App Processes
Without root also possible -> open dev settings -> scroll down -> autoinput
ktmom said:
Much to my surprised amazement, looking into this for you I discovered the classic IntangibleObject Secure Settings plugin has resurrected itself with an update back in January 2019.
What you want is easy peasy with this plugin. It's under Root Actions -> Background App Processes
Click to expand...
Click to collapse
Would you mind elaborating a bit more on how to do what I want, using Tasker and the app you suggest? If you have time for a step-by-step guide, I would really appreciate it. I have both apps now but I cannot figure out how to make it (it is the first time I am trying to use tasker)
huggarn said:
Without root also possible -> open dev settings -> scroll down -> autoinput
Click to expand...
Click to collapse
If you mean in the device's dev settings (which, in my device/rom are called Developer Options), there is no autoinput option.
If you are that new to Tasker, then you would really benefit from taking time to read up on it. There are countless write-ups, videos, posts here in this forum geared towards beginners...
Even if you're not planning to need/want a profile, work through a beginner tutorial anyway which will get you familiar with how to add profiles, tasks and connect them.
To use the secure settings plugin action, you do have to be rooted. That's why it's under "root actions". You just add an plug-in action in a task for the secure settings plugin. Then configure that action to run the background process to whatever setting you want.
I would guess in your case the profile context would be an event -> system -> device boot.
BTW, the advice of using AutoInput you were given is a plugin for Tasker also. It would be a non-root method of emulating the taps you otherwise do manually. The specific advice was assuming some familiarity with Tasker and was actually the (abbreviated) steps to achieve what you want using AutoInput.
Import this profile, if you gave Tasker required permissions, should work without root. Just change int value in task.
https://taskernet.com/shares/?user=...DV78XH3AUBaZitf5Llp0FupQY=&id=Profile:Profile

how to create task that will monitor system wide app installation...

so basically i want to monitor system wide app installation and uninstallation, including sideloading with dates? if possible to have it create a log and store it in a specific folder that is locked or can't be accessed or deleted without code. and to do a daily or weekly check to see if any changes were made.
also is there a task to block all installations including sideloading?
any help would be appreciated.
@ktmom
So tracking installed and uninstalled apps is straightforward.
I'm not aware of a way to lock the resulting file per se. Encrypt it, probably. But to prevent any other app from accessing it, I don't know how to do that. It could be uploaded to the cloud, e.g. Google drive. Then the local copy deleted. That's kinda fussy. Saving it as a variable array is doable, then Tasker can be locked.
If on every install / uninstall, the log is updated, why does there need to be a daily/weekly check?
I would have to test and see if the package manager can be "locked".
Is the device in question rooted?
This kinda sounds like something I might do to my kids phone [emoji6]. If this is actually the case, the file could be sent to your device or email on update. It wouldn't matter if the local copy was edited. You also could know immediately if an app had changed.
I asked in the other thread, do you have any familiarity with tasker?
@ktmom
device is non rooted,
file sent to email would be fine if that will get rid of daily/weekly checks. (<--- this was just something I wanted that maybe i'll just use in notepad++ to highlight the differences for a quick way of seeing changes.)
i have dabbled in tasker many years ago, only to enable/disable wifi and turn on vpn in geo fenced locations.
I haven't forgotten you. I should post a solution by the weekend. I'm just spending some time to make sure the kinks are out. You will need the MailTask plugin. I personally use a script in termux (requires cURL) to send via Google servers, but that is harder to setup, particularly with OATH. The plugin makes life much easier.
ktmom said:
I haven't forgotten you. I should post a solution by the weekend. I'm just spending some time to make sure the kinks are out. You will need the MailTask plugin. I personally use a script in termux (requires cURL) to send via Google servers, but that is harder to setup, particularly with OATH. The plugin makes life much easier.
Click to expand...
Click to collapse
ok great, thank you!
@BobMcGeez
Finally, I think I have this stable and able to handle multiple consecutive app installations and removals. I am working under the assumption that the use for this project is to monitor possible dangerous activity on a child’s device. I do not condone the use of this for monitoring a device without adult consent.
This project will send an email notification when a new app is installed or an existing app is removed. The email will include a CSV file with the remaining still installed apps. It should ignore apps that are being updated (they remove then install). The emails are sent silently and there should not be any indication to the user this is happening in the background. The CSV file is saved in the {storage}/Tasker/tasks/ directory. Each time an email is sent, the stored file is also updated. One instance of the previous file is saved as well.
First, you need MailTask installed. Please ensure that the MailTask plugin is fully configured and tested before installing this project. We are using OAuth Gmail authentication, so ignore SMTP stuffs.
Also, IMHO, I would use a GMail account maybe even created for this purpose, but at least one not setup to routinely access by the device user. This way, the user’s account will not reflect the sent messages.
To configure and test MailTask
Open MailTask from the app drawer on your device
Perform “Authorize Gmail Access” Use the account for the “from” you want to use in this project
Perform “Grant access to primary storage”
If your device has an SDcard, perform “Grant access to Sd card”
Now if you want, you can create a task in your Tasker installation to test the MailTask plugin
Create a test task
Add a MailTask action (Plugin -> MailTask -. send email)
Configuration:
From = Account used to Authorize Gmail Access above
To = Account where to send email
Subject = Testing MailTask
Body = Some text to take up space
Attachments = choose a basic file using the paperclip icon just for there to be an attachment
Test plugin by manually running the task.
If all is good, you can delete this test
Now install the project (taskernet link). On install, accept enabling the profiles. If you do, then the Installation task should run automatically. If you prefer not to, or if you need to re-run the installation, manually run the “Initial Setup” task.
This project may be shared under GNU v2. You may share, modify and use it provide you don't charge, the code is open and credit is provided.

How To Guide Fix missing/not working VPN on A12 stock ROM

Not all users could have it, but VPN "bug" (I use quotes since I'm not so sure it's a bug and not a wanted behaviour...) on stock ROM appears on post Feb23 A12 builds to date (don't know if root related or not).
It's composed by two parts (fact which lead me to be suspect...):
1. - VPN menu is missing in Network & Internet section
2. - every VPN app (not already installed before the Feb23 build) fail to work
To date there is NO official fix from Motorola, from others or... from me.
BUT I've found a couple of workaround for both issues which can be applied to have your preferred VPN app working fine (and that's the important thing! ).
I'm sorry but root is needed (well, not at all, but we'll see it in details after...) to fix both the issues...
Let's see in details...
1) VPN menù exists & works fine, it's only hidden in Settings.
The workaround is to create a direct "shortcut" to the VPN menu using one of the shortcuts apps you can find on Play Store or, as in my case, using the "Create shortcut to Activity" function embedded in my launcher (Nova).
The name of VPN menu is: .Settings$vpnSettingsActivity
You'll get an Icon you can use to open VPN Settings!!
2) Now that you have the settings back you could think that your VPN apps will work. Wrong!
It's needed a second step...
I've studied a lot the issue and I've found that when your app should show a confirm dialog to create the needed VPN it doesn't show anything at all and no VPN is created...
Looking better I've found that this happens because the system directly deny the permission instead to let app to ask user!!
So... to correct this (wrong) behaviour the simplest fix is to use an app called App Ops Permission Manager (available on Play Store) which allow us to modify app permissions values.
We just have to go to our VPN app and modify the activate VPN value from ask to allow!!
If you use several VPN apps this has to be done for everyone...
Only problem is that App Ops requires Shizuku to run and Shizuku requires... root!
Well, not exactly to be honest... Shizuku can be actived without root too using the "Wireless debug USB" trick they well described in their app. I can confirm it works fine. Only issue is that it has to be enabled again at every boot, BUT I think modify done by App Ops should be "permanent" until app is not removed (or updated... not sure about this...), so Shizuko start could be needed a single time or so (in any way once VPN has been created in VPN settings the VPN app should be happy with it and shouldn't ask any more confirm!).
I hope you'll find all this clear & useful...

Categories

Resources