ruby-macrodroid 0.9.17 → 0.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - checksums.yaml.gz.sig +0 -0
 - data.tar.gz.sig +0 -0
 - data/lib/ruby-macrodroid/actions.rb +36 -8
 - data/lib/ruby-macrodroid/actionsnlp.rb +16 -0
 - metadata +2 -2
 - metadata.gz.sig +0 -0
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 98e47dfdd0c7a7f5eabe5a942e3d1ad19cbacbb8cdac3de74b301e51a6e9dbdc
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 462bf9fa2ffdb85fc51b93448c1a43b9469bd81bbec42a34549fdde9518a07ef
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e8e4d4e23d498cd394739002b387907209015e06fea55facfdccdd7983e72cf72372bf152427767388ca8c3ee031dfbbe7ff69be964e210025d54ac60be6e0ed
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c8150eccb7ba454409f7ab6d56a7418f9508050c6ee76021c0508b21b1203529e5fce79ff9dfd1aeadfab0f3aced27d95c2def9151517d3bc4eff32ba8e1d6b0
         
     | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | 
         Binary file 
     | 
    
        data.tar.gz.sig
    CHANGED
    
    | 
         Binary file 
     | 
| 
         @@ -36,18 +36,24 @@ APPS = { 
     | 
|
| 
       36 
36 
     | 
    
         
             
              'AutoBoy' => 'com.happyconz.blackbox',
         
     | 
| 
       37 
37 
     | 
    
         
             
              'Amazon Alexa' => 'com.amazon.dee.app',
         
     | 
| 
       38 
38 
     | 
    
         
             
              'Brave' => 'com.brave.browser',
         
     | 
| 
       39 
     | 
    
         
            -
              'Camera' => 'com. 
     | 
| 
      
 39 
     | 
    
         
            +
              'Camera' => 'com.mediatek.camera',
         
     | 
| 
       40 
40 
     | 
    
         
             
              'Cast to TV' => 'cast.video.screenmirroring.casttotv',
         
     | 
| 
      
 41 
     | 
    
         
            +
              'Calculator' => 'com.android.pri.calculator',
         
     | 
| 
      
 42 
     | 
    
         
            +
              'Calendar' => 'com.google.android.calendar',
         
     | 
| 
      
 43 
     | 
    
         
            +
              'Clock' => 'com.android.deskclock',
         
     | 
| 
       41 
44 
     | 
    
         
             
              'File Manager' => 'com.alphainventor.filemanager',
         
     | 
| 
       42 
45 
     | 
    
         
             
              'Firefox' => 'org.mozilla.firefox',
         
     | 
| 
       43 
46 
     | 
    
         
             
              'Google Chrome' => 'com.google.android.chrome',
         
     | 
| 
      
 47 
     | 
    
         
            +
              'Google Calendar' => 'com.google.android.calendar',
         
     | 
| 
       44 
48 
     | 
    
         
             
              'Chrome' => 'com.google.android.chrome',
         
     | 
| 
      
 49 
     | 
    
         
            +
              'Earth' => 'com.google.earth',
         
     | 
| 
       45 
50 
     | 
    
         
             
              'Google Home' => 'com.google.android.apps.chromecast.app',  
         
     | 
| 
       46 
51 
     | 
    
         
             
              'Google Play Music' => 'com.google.android.music',
         
     | 
| 
       47 
52 
     | 
    
         
             
              'MacroDroid' => 'com.arlosoft.macrodroid',
         
     | 
| 
       48 
53 
     | 
    
         
             
              'QuickEdit Text Editor Pro' => 'com.rhmsoft.edit.pro',
         
     | 
| 
       49 
54 
     | 
    
         
             
              'QR & Barcode Reader' => 'com.teacapps.barcodescanner',
         
     | 
| 
       50 
     | 
    
         
            -
              'Settings' => 'com. 
     | 
| 
      
 55 
     | 
    
         
            +
              'Settings' => 'com.android.settings',
         
     | 
| 
      
 56 
     | 
    
         
            +
              'Chrome' => 'com.google.android.street',
         
     | 
| 
       51 
57 
     | 
    
         
             
              'tinyCam PRO' => 'com.alexvas.dvr.pro',
         
     | 
| 
       52 
58 
     | 
    
         
             
              'Tor Browser' => 'org.torproject.torbrowser',
         
     | 
| 
       53 
59 
     | 
    
         
             
              'VLC' => 'org.videolan.vlc',
         
     | 
| 
         @@ -99,7 +105,7 @@ end 
     | 
|
| 
       99 
105 
     | 
    
         
             
            class LaunchActivityAction < ApplicationAction
         
     | 
| 
       100 
106 
     | 
    
         | 
| 
       101 
107 
     | 
    
         
             
              def initialize(h={})
         
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
      
 108 
     | 
    
         
            +
             
         
     | 
| 
       103 
109 
     | 
    
         
             
                # option 0 is by application name, 1 is launch by package name
         
     | 
| 
       104 
110 
     | 
    
         
             
                #
         
     | 
| 
       105 
111 
     | 
    
         
             
                options = {
         
     | 
| 
         @@ -152,13 +158,30 @@ end 
     | 
|
| 
       152 
158 
     | 
    
         
             
            #
         
     | 
| 
       153 
159 
     | 
    
         
             
            class LaunchShortcutAction < ApplicationAction
         
     | 
| 
       154 
160 
     | 
    
         | 
| 
       155 
     | 
    
         
            -
              def initialize( 
     | 
| 
      
 161 
     | 
    
         
            +
              def initialize(obj=nil)
         
     | 
| 
       156 
162 
     | 
    
         | 
| 
      
 163 
     | 
    
         
            +
                puts 'obj: ' + obj.inspect
         
     | 
| 
      
 164 
     | 
    
         
            +
                h = if obj.is_a? Hash then
         
     | 
| 
      
 165 
     | 
    
         
            +
                  obj
         
     | 
| 
      
 166 
     | 
    
         
            +
                else
         
     | 
| 
      
 167 
     | 
    
         
            +
                  obj[2] || {}
         
     | 
| 
      
 168 
     | 
    
         
            +
                end
         
     | 
| 
      
 169 
     | 
    
         
            +
                
         
     | 
| 
      
 170 
     | 
    
         
            +
                if h[:shortcut] and h[:shortcut] =~ /Ask Alexa/i then
         
     | 
| 
      
 171 
     | 
    
         
            +
                  h = {
         
     | 
| 
      
 172 
     | 
    
         
            +
                    :app_name=>"Amazon Alexa", :intent_encoded=>"#Intent;action=com." +   
         
     | 
| 
      
 173 
     | 
    
         
            +
                      "amazon.alexa.action.WIDGET_SHORTCUT;launchFlags=0x10000000;" + 
         
     | 
| 
      
 174 
     | 
    
         
            +
                      "component=com.amazon.dee.app/.ui.voice.LaunchAlexaActivity;end", 
         
     | 
| 
      
 175 
     | 
    
         
            +
                      :name=>"Ask Alexa"
         
     | 
| 
      
 176 
     | 
    
         
            +
                  }
         
     | 
| 
      
 177 
     | 
    
         
            +
                end    
         
     | 
| 
       157 
178 
     | 
    
         
             
                options = {
         
     | 
| 
       158 
179 
     | 
    
         
             
                  :app_name=>"Amazon Alexa", :intent_encoded=>"", :name=>"Ask Alexa"
         
     | 
| 
       159 
180 
     | 
    
         
             
                }
         
     | 
| 
       160 
181 
     | 
    
         | 
| 
       161 
182 
     | 
    
         
             
                super(options.merge h)
         
     | 
| 
      
 183 
     | 
    
         
            +
                
         
     | 
| 
      
 184 
     | 
    
         
            +
                #@list = %w(appName intentEncoded name)
         
     | 
| 
       162 
185 
     | 
    
         | 
| 
       163 
186 
     | 
    
         
             
              end
         
     | 
| 
       164 
187 
     | 
    
         | 
| 
         @@ -1398,7 +1421,11 @@ class SetAutoRotateAction < DeviceSettingsAction 
     | 
|
| 
       1398 
1421 
     | 
    
         
             
              end
         
     | 
| 
       1399 
1422 
     | 
    
         | 
| 
       1400 
1423 
     | 
    
         
             
              def to_s(colour: false, indent: 0)
         
     | 
| 
       1401 
     | 
    
         
            -
             
     | 
| 
      
 1424 
     | 
    
         
            +
                    
         
     | 
| 
      
 1425 
     | 
    
         
            +
                #'SetAutoRotateAction ' + @h.inspect
         
     | 
| 
      
 1426 
     | 
    
         
            +
                @s = 'Auto Rotate ' + %w(On Off Toggle)[@h[:state]]
         
     | 
| 
      
 1427 
     | 
    
         
            +
                super()
         
     | 
| 
      
 1428 
     | 
    
         
            +
                
         
     | 
| 
       1402 
1429 
     | 
    
         
             
              end
         
     | 
| 
       1403 
1430 
     | 
    
         | 
| 
       1404 
1431 
     | 
    
         
             
              alias to_summary to_s
         
     | 
| 
         @@ -2184,7 +2211,7 @@ class ControlMediaAction < MediaAction 
     | 
|
| 
       2184 
2211 
     | 
    
         
             
                  obj
         
     | 
| 
       2185 
2212 
     | 
    
         
             
                elsif obj.is_a? Array
         
     | 
| 
       2186 
2213 
     | 
    
         | 
| 
       2187 
     | 
    
         
            -
                  e, macro = obj      
         
     | 
| 
      
 2214 
     | 
    
         
            +
                  e, macro, h2 = obj      
         
     | 
| 
       2188 
2215 
     | 
    
         
             
                  s = e.text('item/description').to_s
         
     | 
| 
       2189 
2216 
     | 
    
         
             
                  app = s[/Simulate Media Button \(([^\)]+)/,1]
         
     | 
| 
       2190 
2217 
     | 
    
         | 
| 
         @@ -2193,12 +2220,13 @@ class ControlMediaAction < MediaAction 
     | 
|
| 
       2193 
2220 
     | 
    
         
             
                    {
         
     | 
| 
       2194 
2221 
     | 
    
         
             
                      application_name: app,  package_name: APPS[app], 
         
     | 
| 
       2195 
2222 
     | 
    
         
             
                      simulate_media_button: true
         
     | 
| 
       2196 
     | 
    
         
            -
                    }
         
     | 
| 
      
 2223 
     | 
    
         
            +
                    }.merge h2
         
     | 
| 
       2197 
2224 
     | 
    
         | 
| 
       2198 
2225 
     | 
    
         
             
                  else
         
     | 
| 
       2199 
2226 
     | 
    
         
             
                    {}
         
     | 
| 
       2200 
2227 
     | 
    
         
             
                  end
         
     | 
| 
       2201 
     | 
    
         
            -
                end 
     | 
| 
      
 2228 
     | 
    
         
            +
                end
         
     | 
| 
      
 2229 
     | 
    
         
            +
                #puts 'h: ' + h.inspect
         
     | 
| 
       2202 
2230 
     | 
    
         | 
| 
       2203 
2231 
     | 
    
         
             
                options = {
         
     | 
| 
       2204 
2232 
     | 
    
         
             
                  application_name: "Google Play Music", option: "Play/Pause", 
         
     | 
| 
         @@ -123,6 +123,14 @@ class ActionsNlp 
     | 
|
| 
       123 
123 
     | 
    
         
             
                  [VoiceSearchAction, {}]
         
     | 
| 
       124 
124 
     | 
    
         
             
                end           
         
     | 
| 
       125 
125 
     | 
    
         | 
| 
      
 126 
     | 
    
         
            +
                # -- Device settings ---------------------------------------
         
     | 
| 
      
 127 
     | 
    
         
            +
                
         
     | 
| 
      
 128 
     | 
    
         
            +
                get /^Auto Rotate (On|Off|Toggle)$/i do |state|
         
     | 
| 
      
 129 
     | 
    
         
            +
                  
         
     | 
| 
      
 130 
     | 
    
         
            +
                  a = %w(on off toggle)
         
     | 
| 
      
 131 
     | 
    
         
            +
                  
         
     | 
| 
      
 132 
     | 
    
         
            +
                  [SetAutoRotateAction, {state: a.map(&:downcase).index(state.downcase)}]
         
     | 
| 
      
 133 
     | 
    
         
            +
                end               
         
     | 
| 
       126 
134 
     | 
    
         | 
| 
       127 
135 
     | 
    
         
             
                # e.g. Display Notification: Hi there: This is the body of the message
         
     | 
| 
       128 
136 
     | 
    
         
             
                get /^Display Notification: ([^:]+): [^$]+$/i do |subject, text|
         
     | 
| 
         @@ -148,6 +156,14 @@ class ActionsNlp 
     | 
|
| 
       148 
156 
     | 
    
         
             
                  [PlaySoundAction, {file_path: name}]
         
     | 
| 
       149 
157 
     | 
    
         | 
| 
       150 
158 
     | 
    
         
             
                end     
         
     | 
| 
      
 159 
     | 
    
         
            +
             
     | 
| 
      
 160 
     | 
    
         
            +
                get /^Launch Shortcut:? (?:Amazon|Ask) Alexa$/i do
         
     | 
| 
      
 161 
     | 
    
         
            +
                  [LaunchShortcutAction, {shortcut: 'Ask Alexa'}]      
         
     | 
| 
      
 162 
     | 
    
         
            +
                end
         
     | 
| 
      
 163 
     | 
    
         
            +
                
         
     | 
| 
      
 164 
     | 
    
         
            +
                get /^Shortcut:? (?:Amazon|Ask) Alexa$/i do
         
     | 
| 
      
 165 
     | 
    
         
            +
                  [LaunchShortcutAction, {shortcut: 'Ask Alexa'}]      
         
     | 
| 
      
 166 
     | 
    
         
            +
                end    
         
     | 
| 
       151 
167 
     | 
    
         | 
| 
       152 
168 
     | 
    
         
             
                # e.g. Launch Settings
         
     | 
| 
       153 
169 
     | 
    
         
             
                get /^Launch (.*)$/i do |s|
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: ruby-macrodroid
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.9. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.9.18
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - James Robertson
         
     | 
| 
         @@ -35,7 +35,7 @@ cert_chain: 
     | 
|
| 
       35 
35 
     | 
    
         
             
              NZ2kdBIUDnAM24e0/wXdVxg4HnsZbdymxyzMQ4P5pKYcpI6oisBxI37p/Xy+wAg3
         
     | 
| 
       36 
36 
     | 
    
         
             
              SBHno3GEuuD8ZWj24IMJpfbp
         
     | 
| 
       37 
37 
     | 
    
         
             
              -----END CERTIFICATE-----
         
     | 
| 
       38 
     | 
    
         
            -
            date: 2020-10- 
     | 
| 
      
 38 
     | 
    
         
            +
            date: 2020-10-25 00:00:00.000000000 Z
         
     | 
| 
       39 
39 
     | 
    
         
             
            dependencies:
         
     | 
| 
       40 
40 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       41 
41 
     | 
    
         
             
              name: glw
         
     | 
    
        metadata.gz.sig
    CHANGED
    
    | 
         Binary file 
     |