4

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

 1 year ago
source link: https://forum.xda-developers.com/t/appcontext-0-4-7-2-better-application-context-for-tasker-with-xposed-4-0-3.3623272/page-8#post-87818991
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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

nickelnine

Senior Member
Sep 24, 2013 HTC One (M8) LG G5
I use Taskers built in Custom Settings. For Pixel and possibly most AOSP ROMs it's status_bar_clock. 1 to enable and 0 to disable. Some manufacturers and software may change the name for the status bar clock. You may have to do experiments to figure it out. Autotools has a nice way to figure out some custom settings too if you need help with them.
I'm also using custom settings to hide it with the help of AutoInput to detect when I'm on the home screen. Sorry if I wasn't clear, but I was asking how do you detect when you're on the home screen using AppContext in order to flip the value from 1 to 0 and back?

Reactions: JRJ442

JRJ442

Senior Member
I'm also using custom settings to hide it with the help of AutoInput to detect when I'm on the home screen. Sorry if I wasn't clear, but I was asking how do you detect when you're on the home screen using AppContext in order to flip the value from 1 to 0 and back?

Here's the profile I use for you to check out. Actually I went back to using Taskers built in app trigger for the profile. Seems like sometimes App Context and the new EdXposed don't play nice together. It would stop working for me. Basically what I do is select the apps that I want the status bar clock to show in, enter task turns the clock on via custom settings, exit task turns it off. With that profile you can just select the apps you want it to show in.
https://taskernet.com/shares/?user=...48eVI7K2VB0199A==&id=Profile:Status+Bar+Clock

Hi @JayShortway
I just found https://forum.xda-developers.com/xposed/modules/app-maxlock-applock-alternative-t2883624
This is an app lock. Interesting thing is it allows to select specific activity to lock or ignore.
AppContext also allows specific activity to ignore only & its not selectable. We have to manually find package name & activity name.
It would be nice if we can use specific activity to trigger something in tasker.

JayShortway

Senior Member
Apr 3, 2017
Hi @.:Addicted:., thanks for your feedback!
AppContext also allows specific activity to ignore only & its not selectable. We have to manually find package name & activity name.

Regarding ignored activities, if you want to add one, you can select auto mode. Then you'll see an AppContext notification. If you open the specific activity you wish to ignore, and then tap AppContext's notification, it should be added to the ignore-list.

It would be nice if we can use specific activity to trigger something in tasker.

This is a very good suggestion, and something I have been thinking about for a while! If I find the time, this will probably be one of the first things I work on.

kurci2

Senior Member
Aug 2, 2013
LogCat

Hello!
I am not familiar with precise mode of action of this plugin, bu have a question.
Would it be possible to replicate functionality of this plugin with newly added Logcat function of Tasker?
Thank you.

purgy

Senior Member
Aug 29, 2013 Sydney
@JayShortway
Not sure if this is really an issue, but appcontext is flooding the logs with

03-25 12:11:12.316 9834 9834 I EdXposed-Bridge: AppContext | Not hooking Services. Preference-file could not be read.

Every few seconds, along with the occasional

03-25 12:11:19.643 9947 9947 I EdXposed-Bridge: AppContext | Not hooking Services. Preference-file read succesfully, and it contains the right key.

Funny thing is that it's not set to hook services at all, so I'm not sure why this entry is even appearing?
Running android 9, pro version
Last edited: Mar 27, 2020

JayShortway

Senior Member
Apr 3, 2017
Hi @kurci2, regarding your question:
Would it be possible to replicate functionality of this plugin with newly added Logcat function of Tasker?

I think Android's ActivityManager does print something to logcat whenever apps are opened and closed, so you might be able to act on those with Tasker's logcat functionality.

JayShortway

Senior Member
Apr 3, 2017
Hi @purgy, thanks for your report! I have never tested AppContext with EdXposed, but I can have a look

cantenna

Senior Member
Aug 5, 2012 2,346 Newcastle
Hey dev, love this extension! I'm using it with media apps, is it possible to have a stop event not act on a display off even?

cantenna

Senior Member
Aug 5, 2012 2,346 Newcastle
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
  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
    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!
I tried this but [*]Profile: State --> Variables --> Variable Value --> %appsRunning equals 1 does not work despit Vars indicating %appsRunning eq 1

Seems this function of tasker is broken for me on Pie

JayShortway

Senior Member
Apr 3, 2017
I tried this but [*]Profile: State --> Variables --> Variable Value --> %appsRunning equals 1 does not work despit Vars indicating %appsRunning eq 1

Seems this function of tasker is broken for me on Pie
Hi @cantenna, which version of Tasker are you using? You could try if changing "%appsRunning eq 1" to "%appsRunning = 1" helps (so, using the = sign instead).

Reactions: cantenna

KostyaKos

New member
Aug 15, 2017 Kyiv
I've just installed Android 10 on my Sams Note 9 and found that AppContext doesn't work at all - it can't detect application starting Any idea?

purgy

Senior Member
Aug 29, 2013 Sydney
Just wondering if this is viable with lsposed, does it need to hook every app, or does it monitor Android system or something to detect apps status?

Reactions: Chocolatetrain

ajolly

Senior Member
Aug 24, 2006
Anyone have a copy of this app? Its no longer available on play store.

Top Liked Posts

  • All 5-star Play Store reviews disappear right after they are posted for some reason.
    If you want to give a 5-star rating, please first give a 4-star rating and then update it to 5 stars.
    Thanks!​
    AppContext was featured on XDA Portal!
    banner_shortway_512.jpg
    Hi everyone!

    After years of reading, flashing, and gaining a lot of Android-knowledge on XDA-Developers, I felt it was time to create my own Xposed Module.
    So hereby I proudly present to you my first app:
    AppContext
    Better application context for Tasker with Xposed!
    Now available on Google Play, XDA Labs and the Xposed Module Repository.
    With AppContext, you can have Tasker react on running applications, without the downsides of the default implementation.

    The default application context of Tasker has several downsides:
    • it is inaccurate (in Android versions after KitKat)
    • it needs an accessibility service (which disables screen lock for enhanced data encryption, but this can be re-enabled)
    • it checks frequently which app is running
    Especially the last point is inconvenient, as frequent checks may drain battery and infrequent checks means Tasker is slow to react.

    AppContext solves these problems by utilizing the power of Xposed! It hooks directly into the Activity-class, letting Tasker react immediately when an app starts. This means no more periodic checking which app is running, so no more battery drain and no more slow reactions. It's also perfectly accurate and doesn't need an accessibility service, so your device's screen lock can be used for enhanced data protection again.
    (Experimental support for reacting on Services is also present.)

    AppContext may also work with other apps using the Locale API, such as Locale, Llama, Automate, Automagic and others. However, this is not tested extensively.

    To support development, AppContext contains non-intrusive ads. These can be removed with a small in-app purchase. (Note that if you donate through PayPal on XDA, ads are not removed. Nevertheless, it is still highly appreciated)

    Please understand that AppContext is still considered to be in beta. There may be bugs. Please report them in this thread, or by using the in-app Feedback button or sending an email to [email protected].
    Constructive criticism is highly appreciated!

    DOWNLOAD
    Google Play
    XDA Labs
    Xposed Module Repository

    COMPATIBILITY
    • Android 4.0.3 and higher
    • Xposed Framework
    • Tasker (or equivalent)

    CREDITS
    • Crafty Apps EU/Pent for creating Tasker
    • rovo89 for creating the Xposed Framework
    • Google Play and the Google Play logo are trademarks of Google Inc.

    XDA:DevDB Information
    AppContext, Xposed for all devices (see above for details)

    Contributors
    JayShortway
    Xposed Package Name: io.shortway.appcontext

    Version Information
    Status: Beta
    Current Beta Version: 0.4.7.2
    Beta Release Date: 2018-07-09

    Created 2017-06-17
    Last Updated 2018-07-09
    Changelog

    0.4.7.2 (Announcement)
    Please report any bugs in this thread, or by sending an email to [email protected].
    • [FEATURE] Added Chinese (Simplified) translation (thanks to @smailzhu).
    • [FIX] Some fixes to the Chinese (Traditional) translation (thanks to @smailzhu).
    • [FIX] Bug-fixes.
    AppContext 0.4.4

    Hi everyone,

    I have just released AppContext 0.4.4! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

    This is a minor update, because I have been in London for the past week which means I didn't have much development time. There were still some minor bugs reported via Google Play. This version fixes all those. Further, some inconsistencies/imperfections in the UI have been corrected, including an old overflow/menu button on pre-Lollipop devices. I have also started some work on optimizations. Lastly, this version targets Android 8.0 Oreo. There is of course no Xposed for Oreo, but it's best to be ready .

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

    Enjoy!
    AppContext 0.4.7

    Hi everyone,

    I have just released AppContext 0.4.7! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

    The Requirements-section now collapses automatically when all requirements are met. I also tested it with the official Xposed for Nougat and found no problems. Please let me know if it works for you as well. Furthermore, a crash preventing AppContext to be launched should be fixed now. Lastly, I fixed some minor bugs.

    I'd also like to thank rovo89 for the release of the official Xposed for Nougat. I'm very excited about this!

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

    Enjoy!
    • it needs an accessibility service, which prevents using screen lock to enhance data encryption
    FYI you can still use disk encryption password with accessibility services. when you enable the service it disables the 'require passcode on boot' but you can just re-enable from the security settings and it works

    great module by the way! thanks

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK