Giter Club home page Giter Club logo

Comments (3)

timschneeb avatar timschneeb commented on May 27, 2024

Hi,
I already thought about that; however, until now, I didn't implement something like that because Android's background restrictions prevent me from doing that.

In order to launch a media projection, I need to obtain an authorization token to start a media projection from Android.

To do that, I need to start a special system activity (= permission prompt, in this case) to obtain it.
Android will then decide whether to show the media capture permission prompt to the user or not depending on PROJECT_MEDIA among other requirements and give me the authorization token if granted. I cannot skip this step even with PROJECT_MEDIA set to allow.

The problem is that Android disallows apps to send these kinds of Intents from the background unless specific conditions are met. (see here: https://developer.android.com/guide/components/activities/background-starts#exceptions).

The only exception that is viable for this use case would be:

This is the 'allow apps to draw over other apps' permission and is required here because it grants me to open other apps unprompted from the background, including the system app that decides whether to open a permission prompt.

I'll try to implement that as a workaround soon.

from rootlessjamesdsp.

mariobrostech avatar mariobrostech commented on May 27, 2024

That sounds good, thank you! I don't know if it accomplishes quite the same effect, but I've seen other apps like K-9 Mail use Android's Alarms & Reminders permissions to achieve a similar effect so it can scan for push emails in the background. Maybe that's something that could be explored as well. As far as I know, it's completely transparent to the user since it's enabled by default for any app that requests it. The user can disable this functionality, but they wouldn't know that it even existed unless they go into the App Info page where it's displayed as an option.

from rootlessjamesdsp.

timschneeb avatar timschneeb commented on May 27, 2024

I tried to use the Alarms & Reminders permissions, but unfortunately, it only allows background processes to launch foreground services but not activities. I used the approach I talked about earlier instead.

It requires the SYSTEM_ALERT_WINDOW permission which can be granted in Android's settings or using this ADB command:

appops set me.timschneeberger.rootlessjamesdsp SYSTEM_ALERT_WINDOW allow

If a user sets the app up using Shizuku, all of that is done automatically. Otherwise, the instructions for ADB setup mention this as an optional step. You can now also go to 'Settings > Misc > Optional permissions' to check if the permissions are already granted and whether auto-start is available.


Updated APKs (v1.5.0) are already available here: ThePBone/RootlessJamesDSP/actions/runs/4514747380
(Signed with the same key as the Play Store release, so you can easily update without uninstalling due to package signature conflicts.)

The actual Google Play release probably takes until Monday because the app reviewing process is slower on weekends.

from rootlessjamesdsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.