FORUMS

AppContext [0.4.7.2] - Better application context for Tasker with Xposed! [4.0.3+]

90 posts
Thanks Meter: 85
 
By JayShortway, Member on 17th June 2017, 07:10 PM
Post Reply Email Thread
Announcement from JayShortway: Service support is here! (Experimentally, but still.)
19th June 2017, 02:41 PM |#11  
Senior Member
Thanks Meter: 683
 
More
Interesting Module. I always thought Tasker's app detection was a bit unreliable. Never thought it could be improved though. Thanks!

Wonder if Tasker Dev (Pent) will/can implement this as a "fix"
The Following User Says Thank You to Stupifier For This Useful Post: [ View ] Gift Stupifier Ad-Free
19th June 2017, 03:04 PM |#12  
Hi everyone,

The first update (0.3.1) is live! It is now available on Google Play, XDA Labs and the Xposed Module Repository.
It is just a quick bugfix update. It should fix the typo in the Tasker blurb, the crash when pressing 'back' in the 'Pick apps' screen and also enable Magisk systemless Xposed compatibility.

For those of you with Magisk: AppContext will probably complain it can't find the Xposed Framework, but if you enable the module and reboot, it should work (and AppContext stops complaining). I would be glad if someone could report back.
I will probably make a more elegant solution in a 0.4 update.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

Enjoy!
The Following User Says Thank You to JayShortway For This Useful Post: [ View ] Gift JayShortway Ad-Free
19th June 2017, 03:07 PM |#13  
Quote:
Originally Posted by Stupifier

Interesting Module. I always thought Tasker's app detection was a bit unreliable. Never thought it could be improved though. Thanks!

Wonder if Tasker Dev (Pent) will/can implement this as a "fix"

I'm glad you like it!
I don't think Tasker can implement this though, as AppContext hooks directly into Android-classes, which is only possible with Xposed.
19th June 2017, 04:14 PM |#14  
Senior Member
Thanks Meter: 18
 
More
Very nice! You should post it in http://www.reddit.com/r/Tasker too.

If I set an app context using your plugin, then navigate to the app and toggle the screen off and on, the profile deactivates and activates again. Is this deliberate? I'm actually not sure what the in-built app context's behaviour is. I found it confusing since in that case I haven't switched app, per se.
The Following User Says Thank You to richardkemp For This Useful Post: [ View ] Gift richardkemp Ad-Free
19th June 2017, 07:39 PM |#15  
Quote:
Originally Posted by richardkemp

Very nice! You should post it in http://www.reddit.com/r/Tasker too.

If I set an app context using your plugin, then navigate to the app and toggle the screen off and on, the profile deactivates and activates again. Is this deliberate? I'm actually not sure what the in-built app context's behaviour is. I found it confusing since in that case I haven't switched app, per se.

Good point. It is sort-of intended behavior, as AppContext simply checks whether the app's (or Activity's, actually) 'onStop' method is called. This method gets called when you turn the screen off. I might change this behavior in the future, or make it configurable. Until then, you could use the following workaround:
  1. Profile: Event --> Plugin --> AppContext --> Start --> pick the apps you want to act on
    1. Variables --> Variable Set
      • Name: %appsRunning
      • To: 1
  2. Either: Clone the previous Profile, then go into Configuration --> Menu (3-dots) --> Configure context --> Stop
    Or: Profile: Event --> Plugin --> AppContext --> Stop --> pick the same apps
    1. Task --> Wait
      • MS: 500 (You can play with this number: smaller for a quicker response, bigger for more reliability detecting screen state.)
    2. Task --> If
      • Condition: %SCREEN equals on
    3. Variables --> Variable Set
      • Name: %appsRunning
      • To: 0
    4. Task --> End If
  3. Profile: State --> Variables --> Variable Value --> %appsRunning equals 1
    1. Perform your Actions here.

I hope this works for you (and others)!

And thanks a lot for the heads-up on the subReddit, that's actually a very good suggestion!
The Following User Says Thank You to JayShortway For This Useful Post: [ View ] Gift JayShortway Ad-Free
20th June 2017, 04:09 AM |#16  
Member
Thanks Meter: 26
 
More
Nice! Checking this out. Thx!
The Following User Says Thank You to palmuse For This Useful Post: [ View ] Gift palmuse Ad-Free
22nd June 2017, 07:33 AM |#17  
Senior Member
Thanks Meter: 59
 
More
Suggestion: currently on lollipop+(I think), location toggle is unable to be used, even with root. The workaround is to use another plugin app with root/adb privs, but I was wondering whether this could be changed using xposed (changing the location hook?), as it should be visible to tasker that's been granted root).
22nd June 2017, 08:58 AM |#18  
Quote:
Originally Posted by Bladehawkz

Suggestion: currently on lollipop+(I think), location toggle is unable to be used, even with root. The workaround is to use another plugin app with root/adb privs, but I was wondering whether this could be changed using xposed (changing the location hook?), as it should be visible to tasker that's been granted root).

Do you mean something like a Tasker-compatible Xposed module that toggles location modes?
22nd June 2017, 10:36 AM |#19  
Senior Member
Thanks Meter: 59
 
More
Quote:
Originally Posted by JayShortway

Do you mean something like a Tasker-compatible Xposed module that toggles location modes?

More like editing tasker so that the location toggles work when it's granted root, instead of actually requiring you to download another app/plugin and granting that root.

Any location/GPS usage gets the message "For Android 2.3+ Google have made changes such that it is no longer possible for a normal app to change GPS without user-interaction. If you wish to continue.. blah blah blah.. consider rooting and installing the secure settings plugin".

Considering that Tasker is able to have root privileges granted, clearly it should be possible for it to toggle location.
The Following User Says Thank You to Bladehawkz For This Useful Post: [ View ] Gift Bladehawkz Ad-Free
22nd June 2017, 07:12 PM |#20  
Quote:
Originally Posted by Bladehawkz

More like editing tasker so that the location toggles work when it's granted root, instead of actually requiring you to download another app/plugin and granting that root.

Considering that Tasker is able to have root privileges granted, clearly it should be possible for it to toggle location.

Got it! It's a good point you make. However it would require either an Xposed module, or an actual adjustment/update to the Tasker app (by Pent). In case of the Xposed module, it would be interesting to see if and how this can be done.
22nd June 2017, 10:13 PM |#21  
Member
Thanks Meter: 26
 
More
Would it be possible to add a configuration to capture the native launch event (ie. prevent launch) after detecting the on Start apps? I want to implement a custom launch event (floating), but currently the app launches then I relaunch it as floating. Preventing the original launch would smooth out the process.

Thanks for considering.

Edit: Perhaps a better way to put this is to add a prelaunch event. App icon was clicked or launch called but the main activity has not displayed yet (and won't).
The Following User Says Thank You to palmuse For This Useful Post: [ View ] Gift palmuse Ad-Free
Post Reply Subscribe to Thread

Tags
appcontext, shortway, tasker, xposed

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes