diff --git a/dist/0.0.1_beta.json b/dist/0.0.1_beta.json index bccbcdc..b0cc3c4 100644 --- a/dist/0.0.1_beta.json +++ b/dist/0.0.1_beta.json @@ -2,39 +2,6 @@ "key": -1, "name": "Test Subscription", "version": "0.0.1_beta", - "apps": { - "hhjapp": { - "hhjapp": { - "packageName": "tech.cqxqg.hhjapp", - "name": "小新记账", - "version": "1.0.0", - "rules": [ - { - "key": 0, - "selector": "[text='记账']", - "action": "click" - }, - { - "key": 1, - "selector": "[desc='备注'] + Button + EditText", - "action": "click", - "actionDelay": 50, - "activityId": "tech.cqxqg.hhjapp.MainActivity", - "classId": "" - }, - { - "key": 2, - "selecotr": "[desc='备注'] + Button + EditText]", - "preAction": 1, - "action": "setText", - "args": "自动填充内容", - "activityId": "tech.cqxqg.hhjapp.MainActivity", - "classId": "" - } - ] - } - } - }, "global": { "name": "全局测试", "rules": [ @@ -51,5 +18,36 @@ "enable": true } ] - } + }, + "apps": [ + { + "packageName": "tech.cqxqg.hhjapp", + "name": "小新记账", + "version": "1.0.0", + "rules": [ + { + "key": 0, + "selector": "[text='记账']", + "action": "click" + }, + { + "key": 1, + "selector": "[desc='备注'] + Button + EditText", + "action": "click", + "actionDelay": 50, + "activityId": "tech.cqxqg.hhjapp.MainActivity", + "classId": "" + }, + { + "key": 2, + "selecotr": "[desc='备注'] + Button + EditText]", + "preAction": 1, + "action": "setText", + "args": "自动填充内容", + "activityId": "tech.cqxqg.hhjapp.MainActivity", + "classId": "" + } + ] + } + ] } \ No newline at end of file diff --git a/subscription.py b/subscription.py index 3fd6660..09fa208 100644 --- a/subscription.py +++ b/subscription.py @@ -10,12 +10,15 @@ version = "0.0.1_beta" def get_subscription(): apps_folder = "apps" apps = get_global_vars_from_apps(apps_folder) + apps_arr = [] + for app_name in apps: + apps_arr.append(apps[app_name][app_name]) return { "key": key, "name": name, "version": version, - "apps": apps, "global": global_rules, + "apps": apps_arr, }