akaMrNagar / Mindful

Your Ultimate Companion for Focus and Well-being.
https://bemindful.vercel.app/
GNU General Public License v2.0
159 stars 3 forks source link

[Feature] Compatibility with custom clients #66

Closed Yolomic closed 1 month ago

Yolomic commented 1 month ago

Is your feature request related to a problem? Please describe. Shorts blocking doesnt work on revanced youtube

Describe the solution you'd like Apply short blocker on all ..android.youtube

Additional context Add any other context or screenshots about the feature request here.

akaMrNagar commented 1 month ago

I initially thought about revanced but then i remember revanced already had a feature where you can completely turn off shorts. Although i can add that

akaMrNagar commented 1 month ago

One more thing to implement this feature for other clients Mindful needs their package names. As mindful only subscribe to accessibility events from the specified packages. Which eventually result in better privacy and low performance overhead.

If i let it receive events from all apps then it will drain more battery and also it is breach of trust.

akaMrNagar commented 1 month ago

So finally i added this feature without compromising performance and privacy. To block shorts on any youtube client the following conditions must be met:

  1. The package name of the app must end with ".android.youtube"
  2. The app must have set the open by default link to "www.youtube.com" just like the screenshot

Screenshot 2024-09-29 160410

Now technical details about how Mindful will work -

  1. It will check if there exist an app which can open "www.youtube.com".
  2. It will check if the app's package name ends with ".android.youtube"
  3. Lastly it will only subscribe to those apps for accessibility events.

In this way it does not need to get events from all apps

Yolomic commented 1 month ago

Thats what i somewhat explained thanks ill await for next release love the app so far great job

akaMrNagar commented 1 month ago

Fixed in #67 Now the user have to specifically make sure that the client has open by default enabled for "www.youtube.com"