Giter Club home page Giter Club logo

Comments (2)

sudomain avatar sudomain commented on June 16, 2024

I think I'm experiencing the same issue but with sending a broadcast to a different app (KeyMapper). I'm trying to send an intent to KeyMapper with the following settings:
Screenshot_20230515-125337

I know it works from the KeyMapper side because I can trigger it with Termux's version on am:
am broadcast -a io.github.sds100.keymapper.ACTION_TRIGGER_KEYMAP_BY_UID --es io.github.sds100.keymapper.EXTRA_KEYMAP_UID 5344b82e-e269-473b-a19f-9c01cf4ed634

It seems the broadcast profile is broken

from easer.

bfabiszewski avatar bfabiszewski commented on June 16, 2024

The problem is that applyDynamics method ignores target package and target class. Without the data the broadcast is implicit which is not allowed on Android 8+. Also extras are lost here.
A quick fix is as follows. I did not go any deeper though, so it may break some other stuff as the class is used in other Intent actions. I also add ACCESS_BACKGROUND_LOCATION permission. I think it is needed to start background location in controlled app.

diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0b8d99ca..cf238990 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -8,6 +8,7 @@

     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
diff --git a/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java b/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java
index e39fbfac..c568bbd0 100644
--- a/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java
+++ b/app/src/main/java/ryey/easer/skills/operation/intent/IntentOperationData.java
@@ -225,7 +225,13 @@ public class IntentOperationData implements OperationData, Reused {
                 String type = extra.type;
                 extras.add(new ExtraItem(key, value, type));
             }
-            data.extras = Extras.mayConstruct(extras);
+            intentData.extras = Extras.mayConstruct(extras);
+        }
+        if (data.target_package != null) {
+            intentData.target_package = data.target_package;
+        }
+        if (data.target_class != null) {
+            intentData.target_class = data.target_class;
         }
         IntentOperationData ret = new IntentOperationData(intentData);
         ret.setSkillID(skillID());

from easer.

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.