From 76534820e95dc8759c331ed946590feea4f574f2 Mon Sep 17 00:00:00 2001 From: gorojack <1937047112@qq.com> Date: Fri, 19 Jul 2024 11:32:15 +0800 Subject: [PATCH] move app object --- dist/0.0.1_beta.json | 66 +++++++++++++++++++++----------------------- subscription.py | 5 +++- 2 files changed, 36 insertions(+), 35 deletions(-) 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, }