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

Search This thread

palmuse

Senior Member
Dec 4, 2012
82
26
OnePlus 6T
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).
 
Last edited:
  • Like
Reactions: JayShortway

aadi50

Senior Member
Jun 15, 2014
129
35
Samsung Galaxy Tab A series
It works well. Nice module. :good:
It does exactly does what it says. But i have observed that if app is resumed from recents or anywhere else it doesnt detects ... as it now detects onStart and onStop.

Can u please add few more context for ... when app comes to focus and when app loses focus?? It will become more handy.
 
Last edited:
Aug 29, 2010
5
2
is there any way this can be made compatible with xposed v86? im still running suhide with topjohnwu' s v86.2 of xposed so i can bypass safetynet checks but this would be super helpful
 
  • Like
Reactions: JayShortway

JayShortway

Senior Member
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).

I think I see what you mean. Am I correct in saying you want some apps to be always launched floating? And you'd like to accomplish this by creating an AppContext Event Profile that triggers when the app is (attempted to be) launched, and then prevents that? And then you'd have your own Task that launches that app floating?

It's an interesting idea, and I'll see if I can come up with something. I can't promise anything though, as I am not certain it is possible. Maybe there's something in the ActivityManager that I can hook into.
 

JayShortway

Senior Member
It works well. Nice module. :good:
It does exactly does what it says. But i have observed that if app is resumed from recents or anywhere else it doesnt detects ... as it now detects onStart and onStop.

Can u please add few more context for ... when app comes to focus and when app loses focus?? It will become more handy.

Thanks for the feedback. It should, however, detect if an app is resumed from Recents if you're using Event Profiles. If it doesn't, than that would be a bug.
By 'losing focus', do you mean something like sliding down the notifications panel?
 

JayShortway

Senior Member
is there any way this can be made compatible with xposed v86? im still running suhide with topjohnwu' s v86.2 of xposed so i can bypass safetynet checks but this would be super helpful

I think that shouldn't be a problem. To be honest, I wasn't aware of a reason not to be on the latest Xposed Framework, but this is a pretty good one :)
 

palmuse

Senior Member
Dec 4, 2012
82
26
OnePlus 6T
I think I see what you mean. Am I correct in saying you want some apps to be always launched floating? And you'd like to accomplish this by creating an AppContext Event Profile that triggers when the app is (attempted to be) launched, and then prevents that? And then you'd have your own Task that launches that app floating?

It's an interesting idea, and I'll see if I can come up with something. I can't promise anything though, as I am not certain it is possible. Maybe there's something in the ActivityManager that I can hook into.

You got it exactly. :D I appreciate your looking into it.

If there isn't anything you can hook into, perhaps adding the option to block the launch intent on start while still capturing the event might work. (Oh! capturing the Launch Intent or Main Activity in a variable would be a huge plus too! $$)

Another use of this is, as an example, is redirecting.

I have a profile that launches 2 apps in specified order whenever my phone is idle on the home screen while charging with the screen on.

I first launch an app called Current Wallpaper (displays the wallpaper, live or not, in fullscreen). I then launch an app called Huge Clock with a transparent background. I end up with a nice clean desktop clock whenever my phone is idle. :cool: I have this up all night as my bedside clock.

Right now I have a profile set so that whenever I launch Current Wallpaper, Huge Clock launches automatically right after. Works well enough, but I cannot use the Current Wallpaper app in any other context.

If I could capture, but prevent, launch of Huge Clock, I could set up a App Context profile for Huge Clock itself to run a task launching the apps normally in order. Thus I get the end result by monitoring the target app while freeing up Current Wallpaper.

A bit of a Rube Goldberg scenario, but I like the simplicity of this combination. Have not found another app that accomplishes this minimalist look.

Anywho... I appreciate your investigation. Let me know if I can test anything for you.

BTW: combining the power of Xposed and Tasker is PURE GENIUS! My mind is swimming at the possibilities. If you have the time, I think you could make some money with a fleet of integration apps. :)
 
Last edited:
  • Like
Reactions: JayShortway

aadi50

Senior Member
Jun 15, 2014
129
35
Samsung Galaxy Tab A series
Thanks for the feedback. It should, however, detect if an app is resumed from Recents if you're using Event Profiles. If it doesn't, than that would be a bug.
By 'losing focus', do you mean something like sliding down the notifications panel?

Yeah sliding notification is surely another example of lost focus. But i actually meant... If i press home button to make the app run in Background... Then i think it is more like 'lostFocus'... Not stopped.

And I created a task to flash the %acpackage variable on all apps. And in result the alert appears only when app is started first time. And if i resume the same app the toast doesn't flash. So i think it doesnt detect on resuming apps.
 

JayShortway

Senior Member
You got it exactly. :D I appreciate your looking into it.

If there isn't anything you can hook into, perhaps adding the option to block the launch intent on start while still capturing the event might work.

Anywho... I appreciate your investigation. Let me know if I can test anything for you.

BTW: combining the power of Xposed and Tasker is PURE GENIUS! My mind is swimming at the possibilities. If you have the time, I think you could make some money with a fleet of integration apps. :)

Interesting setup you have :) I'll look into what I can do, and if I need anything tested I'll let you know. Thanks for that!
And thanks for the compliment haha. There are indeed lots of possibilities.
 

JayShortway

Senior Member
Yeah sliding notification is surely another example of lost focus. But i actually meant... If i press home button to make the app run in Background... Then i think it is more like 'lostFocus'... Not stopped.

And I created a task to flash the %acpackage variable on all apps. And in result the alert appears only when app is started first time. And if i resume the same app the toast doesn't flash. So i think it doesnt detect on resuming apps.

If you press the Home-button, the app's Activity is stopped, so it should fire the Stop Event.
Are you using Event Profiles for your %acpackage flash Task? If so, it should flash %acpackage each time you open the app, as long as you have switched to another app in between. If it doesn't, I'm afraid it's a bug :(
 

JayShortway

Senior Member
AppContext 0.3.2

Hi everyone,

I have just released AppContext 0.3.2! It is now available on Google Play, XDA Labs and the Xposed Module Repository.
It is another bugfix update. It downgrades the minimum required version of the Xposed Framework to 86 (as requested by @evilbluechickens), fixes the search bar being unresponsive sometimes, and handles the Xposed Framework installed (systemlessly) via Magisk more elegantly. It also fixes some other minor bugs.

I have made some progress on adding support for Services, which will most probably be the first new feature to be implemented. Not yet in this release though.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
 
  • Like
Reactions: user2k10 and aadi50
Aug 29, 2010
5
2
Hi everyone,

I have just released AppContext 0.3.2! It is now available on Google Play, XDA Labs and the Xposed Module Repository.
It is another bugfix update. It downgrades the minimum required version of the Xposed Framework to 86 (as requested by @evilbluechickens), fixes the search bar being unresponsive sometimes, and handles the Xposed Framework installed (systemlessly) via Magisk more elegantly. It also fixes some other minor bugs.

I have made some progress on adding support for Services, which will most probably be the first new feature to be implemented. Not yet in this release though.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!

awesome, testing it out now!
 
  • Like
Reactions: JayShortway

palmuse

Senior Member
Dec 4, 2012
82
26
OnePlus 6T
I may have had issues with the 0.3.2 version. I experienced a boot loop after install. Anyone else have this experience? It might have been another system issue on my device.

Edit: boot loop was NOT related to this app. All loaded up and working fine.
 
Last edited:
  • Like
Reactions: JayShortway

JayShortway

Senior Member
AppContext 0.4

Hi everyone,

Service support is here! (It is still experimental though.) I have just released AppContext 0.4! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

You can enable Service support under 'Experimental features'. It is currently only for Event Contexts. When you create a Context in Tasker with any app's Services, you'll have to reboot for it to take effect. You can check (and change) which apps have their Services hooked under 'Hooked Services'. Please let me know how it works for you.

Other changes in this release include a complete rewrite of the 'Pick apps' screen, making the Search bar a Search button, clearing up the Tasker blurbs and properly recognizing the website-version of Tasker. The RECEIVE_BOOT_COMPLETED permission is needed to update the list of hooked Services on pre-Marshmallow devices after a reboot.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

Enjoy!
 
  • Like
Reactions: Crsmsg

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    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 shortwaystudio@gmail.com.
    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
    6
    Changelog

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


    0.4.7.1 (Announcement)
    Please report any bugs in this thread, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] Added Chinese (Traditional) translation (thanks to @smailzhu).
    • [FEATURE] Compiled for Android 8.1.0 (API 27).
    0.4.7 (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] The Requirements-section collapses automatically when all are met.
    • [FEATURE] Works with *official* Xposed for Nougat! Yay!
    • [FIX] A crash preventing AppContext to be launched is fixed.
    • [FIX] Minor bug fixes.
    0.4.6 - Yet another minor one (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] The Requirements are more descriptive.
    • [FEATURE] Merged the 2 Tasker requirements ('installed' and 'enabled').
    • [FEATURE] You can now collapse the Requirements-section.
    • [FIX] Some bugs in the Dialogs are fixed.
    • [FIX] Internal code restructuring.
    • [ALSO] Migrated to the Play Billing Library.
    0.4.5 - Another minor update (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] Opening an existing Context now shows a Snackbar with 'Configure' button.
    • [FEATURE] The Requirements-section is clearer.
    • [FEATURE] Minor optimizations. Mainly foundations to be implemented later.
    • [FIX] Rewrote some of the Dialogs.
    • [FIX] Minor bugfixes.
    0.4.4 - Minor update (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] Compiled for Android 8.0 Oreo. (No Xposed for Oreo, so ¯\_(ツ)_/¯.)
    • [FEATURE] Slight optimizations.
    • [FIX] All currently reported bugs fixed.
    • [FIX] Some UI tweaks.
    0.4.3 - Moar bugfixes (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] Changed hooking of Services again, to prevent some problems.
    • [FEATURE] Toggling the experimental Services feature now requires a reboot to take effect.
    • [FEATURE] Moved 'Ignore Recents' to experimental features.
    • [FEATURE] Improved app detection.
    • [FIX] Another attempt to fix random crashes.
    • [FIX] Fixed some Xposed-related errors.
    0.4.2 - Another bugfix release. (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] Completely different way of hooking Services...
    • [FEATURE] ...which removes the reboot requirement...
    • [FEATURE] ...and should work much better.
    • [FIX] Another attempt to fix random crashes. If they still occur, please keep reporting them. Thanks!
    • [FIX] Minor bug-fixes.
    • Tested on unofficial Xposed for Nougat.
    • Some code restructuring.
    0.4.1 - Bugfix release. (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FIX] Sometimes not all apps were shown in the 'Pick apps' screen. Shouldn't happen anymore. (Thanks for testing @Infy_AsiX & @JKL22.)
    • [FIX] Some Xposed-related errors were fixed. (Thanks for testing @JKL22.)
    • [FIX] Hopefully fixed the random crashes. If not, please keep reporting them. Thanks!
    0.4 - Service support is here! (Experimentally, but still.) (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to shortwaystudio@gmail.com.
    • [FEATURE] Now supports Services for Event Contexts. Enable it under 'Experimental features'.
    • [FEATURE] Completely rewrote the 'Pick apps' screen.
    • [FEATURE] The Search bar is now a Search button.
    • [FIXED] Tasker blurbs are a bit clearer now.
    • [FIXED] The website-version of Tasker is properly recognized.
    • [FIXED] Some other minor bugs.
    0.3.2 - Another bugfix release. (Announcement)
    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com.
    • [FIXED] AppContext recognizes the Xposed Framework properly when installed (systemlessly) via Magisk.
    • [FIXED] The search bar was sometimes unresponsive. Not anymore.
    • [FIXED] The minimum Xposed Framework version required was downgraded to 86, as per request.
    • [FIXED] Some other minor bugs.
    0.3.1 - Bugfix release. (Announcement)
    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com.
    • [FIXED] If AppContext's module is enabled, it won't complain about not being able to find the Xposed Framework.
    • [FIXED] Pressing 'back' when picking apps to act on does not crash the app anymore.
    • [FIXED] The Tasker blurb in a State profile makes sense now.
    0.3 - Initial release.
    • Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com.
    6
    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 :D.

    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to shortwaystudio@gmail.com. Thanks!

    Enjoy!
    6
    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 shortwaystudio@gmail.com. Thanks!

    Enjoy!
    3
    • 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