@buaa_smat/hometrans 0.1.0 → 0.1.2

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.
Files changed (136) hide show
  1. package/README.md +141 -124
  2. package/agents/build-fixer.md +1 -0
  3. package/agents/code-review-fix.md +1 -0
  4. package/agents/code-reviewer.md +1 -0
  5. package/agents/logic-coding.md +1 -0
  6. package/agents/logic-context-builder.md +1 -0
  7. package/agents/review-fixer.md +1 -0
  8. package/agents/self-test-fixer.md +1 -0
  9. package/agents/self-tester.md +260 -233
  10. package/agents/spec-generator.md +1 -0
  11. package/agents/test-tools/autotest/README.md +223 -0
  12. package/agents/test-tools/autotest/config.yaml.example +58 -0
  13. package/agents/test-tools/autotest/pyproject.toml +16 -0
  14. package/agents/test-tools/autotest/report_tool.py +759 -0
  15. package/agents/test-tools/autotest/self_test_runner.py +773 -0
  16. package/agents/test-tools/autotest/testcases_schema.md +143 -0
  17. package/agents/test-tools/autotest/testcases_tool.py +215 -0
  18. package/agents/test-tools/autotest/uv.lock +3156 -0
  19. package/agents/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
  20. package/agents/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
  21. package/agents/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
  22. package/agents/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
  23. package/agents/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
  24. package/agents/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
  25. package/dist/cli/config-store.js +27 -2
  26. package/dist/cli/config.js +17 -6
  27. package/dist/cli/index.js +3 -2
  28. package/dist/cli/init.js +135 -22
  29. package/dist/cli/mcp.js +2 -2
  30. package/dist/context/index.js +165 -69
  31. package/package.json +59 -60
  32. package/skills/code-dev-review-fix/SKILL.md +279 -0
  33. package/skills/code-dev-review-fix-workspace/evals/evals.json +56 -0
  34. package/skills/code-dev-review-fix-workspace/iteration-1/routing-results.md +23 -0
  35. package/skills/convert_pipeline/SKILL.md +423 -439
  36. package/skills/hmos-resources-convert/SKILL.md +623 -0
  37. package/skills/hmos-resources-convert/evals/evals.json +171 -0
  38. package/skills/hmos-resources-convert/references/conversion-rules.md +663 -0
  39. package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +388 -0
  40. package/skills/hmos-resources-convert/references/resource-mapping-rules.md +457 -0
  41. package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +513 -0
  42. package/skills/hmos-resources-convert/template/AppScope/app.json5 +10 -0
  43. package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +8 -0
  44. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
  45. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
  46. package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +7 -0
  47. package/skills/hmos-resources-convert/template/build-profile.json5 +42 -0
  48. package/skills/hmos-resources-convert/template/code-linter.json5 +32 -0
  49. package/skills/hmos-resources-convert/template/entry/build-profile.json5 +33 -0
  50. package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +6 -0
  51. package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +23 -0
  52. package/skills/hmos-resources-convert/template/entry/oh-package.json5 +10 -0
  53. package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +48 -0
  54. package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +16 -0
  55. package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +23 -0
  56. package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +55 -0
  57. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +8 -0
  58. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +8 -0
  59. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +16 -0
  60. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
  61. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
  62. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +7 -0
  63. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
  64. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +3 -0
  65. package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +5 -0
  66. package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +8 -0
  67. package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +2 -0
  68. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +35 -0
  69. package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +5 -0
  70. package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +16 -0
  71. package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +5 -0
  72. package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +33 -0
  73. package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +23 -0
  74. package/skills/hmos-resources-convert/template/hvigorfile.ts +6 -0
  75. package/skills/hmos-resources-convert/template/oh-package-lock.json5 +28 -0
  76. package/skills/hmos-resources-convert/template/oh-package.json5 +10 -0
  77. package/skills/hmos-resources-convert/tools/apktool.bat +85 -0
  78. package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
  79. package/skills/hmos-ui-align/SKILL.md +182 -0
  80. package/skills/hmos-ui-align/config-example.json +11 -0
  81. package/skills/hmos-ui-align/config.json +11 -0
  82. package/skills/hmos-ui-align/diff_analysis.md +53 -0
  83. package/skills/hmos-ui-align/page_align.md +62 -0
  84. package/skills/hmos-ui-align/readme.md +231 -0
  85. package/skills/hmos-ui-align/references/Comparison_Template.md +2 -0
  86. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -0
  87. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2089 -0
  88. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -0
  89. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -0
  90. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -0
  91. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -0
  92. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -0
  93. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +903 -0
  94. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -0
  95. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -0
  96. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -0
  97. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -0
  98. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +355 -0
  99. package/skills/hmos-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -0
  100. package/skills/hmos-ui-align/references/UI_Analysis_Template.md +4 -0
  101. package/skills/hmos-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2535 -0
  102. package/skills/hmos-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -0
  103. package/skills/hmos-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -0
  104. package/skills/hmos-ui-align/scripts/app_feature_verify.py +443 -0
  105. package/skills/hmos-ui-align/scripts/navigation-capure.md +37 -0
  106. package/skills/hmos-ui-align/scripts/page_capture.py +592 -0
  107. package/skills/hmos-ui-align-batch/SKILL.md +99 -0
  108. package/skills/hmos-ui-align-batch/references/conversion-procedure.md +180 -0
  109. package/skills/hmos-ui-align-batch/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2535 -0
  110. package/skills/hmos-ui-align-batch/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -0
  111. package/skills/hmos-ui-align-batch/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -0
  112. package/skills/hmos-ui-align-batch/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -0
  113. package/skills/hmos-ui-align-batch/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2089 -0
  114. package/skills/hmos-ui-align-batch/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -0
  115. package/skills/hmos-ui-align-batch/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -0
  116. package/skills/hmos-ui-align-batch/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -0
  117. package/skills/hmos-ui-align-batch/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -0
  118. package/skills/hmos-ui-align-batch/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -0
  119. package/skills/hmos-ui-align-batch/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +903 -0
  120. package/skills/hmos-ui-align-batch/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -0
  121. package/skills/hmos-ui-align-batch/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -0
  122. package/skills/hmos-ui-align-batch/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -0
  123. package/skills/hmos-ui-align-batch/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +355 -0
  124. package/skills/hmos-ui-align-batch/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -0
  125. package/skills/hmos-ui-align-batch/scripts/android_parse_fast.py +1606 -0
  126. package/skills/self-test/SKILL.md +369 -0
  127. package/skills/self-test/readme.md +309 -0
  128. package/skills/spec-generator-skill/SKILL.md +332 -0
  129. package/skills/spec-generator-skill/references/android-platform-tokens.md +105 -0
  130. package/skills/spec-generator-skill/references/spec-sample-1.md +78 -0
  131. package/skills/spec-generator-skill/references/spec-sample-2.md +58 -0
  132. package/skills/spec-generator-skill/references/spec-sample-3.md +116 -0
  133. package/skills/spec-generator-skill/references/step4-report-template.md +33 -0
  134. package/agents/self-test-setup.md +0 -165
  135. package/dist/context/resources/sdkConfig.json +0 -24
  136. package/src/context/resources/sdkConfig.json +0 -24
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "entry",
3
+ "version": "1.0.0",
4
+ "description": "Please describe the basic information.",
5
+ "main": "",
6
+ "author": "",
7
+ "license": "",
8
+ "dependencies": {}
9
+ }
10
+
@@ -0,0 +1,48 @@
1
+ import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit';
2
+ import { hilog } from '@kit.PerformanceAnalysisKit';
3
+ import { window } from '@kit.ArkUI';
4
+
5
+ const DOMAIN = 0x0000;
6
+
7
+ export default class EntryAbility extends UIAbility {
8
+ onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
9
+ try {
10
+ this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
11
+ } catch (err) {
12
+ hilog.error(DOMAIN, 'testTag', 'Failed to set colorMode. Cause: %{public}s', JSON.stringify(err));
13
+ }
14
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate');
15
+ }
16
+
17
+ onDestroy(): void {
18
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onDestroy');
19
+ }
20
+
21
+ onWindowStageCreate(windowStage: window.WindowStage): void {
22
+ // Main window is created, set main page for this ability
23
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
24
+
25
+ windowStage.loadContent('pages/Index', (err) => {
26
+ if (err.code) {
27
+ hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err));
28
+ return;
29
+ }
30
+ hilog.info(DOMAIN, 'testTag', 'Succeeded in loading the content.');
31
+ });
32
+ }
33
+
34
+ onWindowStageDestroy(): void {
35
+ // Main window is destroyed, release UI related resources
36
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
37
+ }
38
+
39
+ onForeground(): void {
40
+ // Ability has brought to foreground
41
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground');
42
+ }
43
+
44
+ onBackground(): void {
45
+ // Ability has back to background
46
+ hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground');
47
+ }
48
+ }
@@ -0,0 +1,16 @@
1
+ import { hilog } from '@kit.PerformanceAnalysisKit';
2
+ import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
3
+
4
+ const DOMAIN = 0x0000;
5
+
6
+ export default class EntryBackupAbility extends BackupExtensionAbility {
7
+ async onBackup() {
8
+ hilog.info(DOMAIN, 'testTag', 'onBackup ok');
9
+ await Promise.resolve();
10
+ }
11
+
12
+ async onRestore(bundleVersion: BundleVersion) {
13
+ hilog.info(DOMAIN, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
14
+ await Promise.resolve();
15
+ }
16
+ }
@@ -0,0 +1,23 @@
1
+ @Entry
2
+ @Component
3
+ struct Index {
4
+ @State message: string = 'Hello World';
5
+
6
+ build() {
7
+ RelativeContainer() {
8
+ Text(this.message)
9
+ .id('HelloWorld')
10
+ .fontSize($r('app.float.page_text_font_size'))
11
+ .fontWeight(FontWeight.Bold)
12
+ .alignRules({
13
+ center: { anchor: '__container__', align: VerticalAlign.Center },
14
+ middle: { anchor: '__container__', align: HorizontalAlign.Center }
15
+ })
16
+ .onClick(() => {
17
+ this.message = 'Welcome';
18
+ })
19
+ }
20
+ .height('100%')
21
+ .width('100%')
22
+ }
23
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "module": {
3
+ "name": "entry",
4
+ "type": "entry",
5
+ "description": "$string:module_desc",
6
+ "mainElement": "EntryAbility",
7
+ "deviceTypes": [
8
+ "phone",
9
+ "tablet",
10
+ "2in1",
11
+ "car",
12
+ "wearable",
13
+ "tv"
14
+ ],
15
+ "deliveryWithInstall": true,
16
+ "installationFree": false,
17
+ "pages": "$profile:main_pages",
18
+ "abilities": [
19
+ {
20
+ "name": "EntryAbility",
21
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
22
+ "description": "$string:EntryAbility_desc",
23
+ "icon": "$media:layered_image",
24
+ "label": "$string:EntryAbility_label",
25
+ "startWindowIcon": "$media:startIcon",
26
+ "startWindowBackground": "$color:start_window_background",
27
+ "exported": true,
28
+ "skills": [
29
+ {
30
+ "entities": [
31
+ "entity.system.home"
32
+ ],
33
+ "actions": [
34
+ "ohos.want.action.home"
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "extensionAbilities": [
41
+ {
42
+ "name": "EntryBackupAbility",
43
+ "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
44
+ "type": "backup",
45
+ "exported": false,
46
+ "metadata": [
47
+ {
48
+ "name": "ohos.extension.backup",
49
+ "resource": "$profile:backup_config"
50
+ }
51
+ ],
52
+ }
53
+ ]
54
+ }
55
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "float": [
3
+ {
4
+ "name": "page_text_font_size",
5
+ "value": "50fp"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": "module description"
6
+ },
7
+ {
8
+ "name": "EntryAbility_desc",
9
+ "value": "description"
10
+ },
11
+ {
12
+ "name": "EntryAbility_label",
13
+ "value": "label"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "layered-image":
3
+ {
4
+ "background" : "$media:background",
5
+ "foreground" : "$media:foreground"
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#000000"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,35 @@
1
+ import { hilog } from '@kit.PerformanceAnalysisKit';
2
+ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
3
+
4
+ export default function abilityTest() {
5
+ describe('ActsAbilityTest', () => {
6
+ // Defines a test suite. Two parameters are supported: test suite name and test suite function.
7
+ beforeAll(() => {
8
+ // Presets an action, which is performed only once before all test cases of the test suite start.
9
+ // This API supports only one parameter: preset action function.
10
+ })
11
+ beforeEach(() => {
12
+ // Presets an action, which is performed before each unit test case starts.
13
+ // The number of execution times is the same as the number of test cases defined by **it**.
14
+ // This API supports only one parameter: preset action function.
15
+ })
16
+ afterEach(() => {
17
+ // Presets a clear action, which is performed after each unit test case ends.
18
+ // The number of execution times is the same as the number of test cases defined by **it**.
19
+ // This API supports only one parameter: clear action function.
20
+ })
21
+ afterAll(() => {
22
+ // Presets a clear action, which is performed after all test cases of the test suite end.
23
+ // This API supports only one parameter: clear action function.
24
+ })
25
+ it('assertContain', 0, () => {
26
+ // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
27
+ hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
28
+ let a = 'abc';
29
+ let b = 'b';
30
+ // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
31
+ expect(a).assertContain(b);
32
+ expect(a).assertEqual(a);
33
+ })
34
+ })
35
+ }
@@ -0,0 +1,5 @@
1
+ import abilityTest from './Ability.test';
2
+
3
+ export default function testsuite() {
4
+ abilityTest();
5
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "module": {
3
+ "name": "entry_test",
4
+ "type": "feature",
5
+ "deviceTypes": [
6
+ "phone",
7
+ "tablet",
8
+ "2in1",
9
+ "car",
10
+ "wearable",
11
+ "tv"
12
+ ],
13
+ "deliveryWithInstall": true,
14
+ "installationFree": false
15
+ }
16
+ }
@@ -0,0 +1,5 @@
1
+ import localUnitTest from './LocalUnit.test';
2
+
3
+ export default function testsuite() {
4
+ localUnitTest();
5
+ }
@@ -0,0 +1,33 @@
1
+ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
2
+
3
+ export default function localUnitTest() {
4
+ describe('localUnitTest', () => {
5
+ // Defines a test suite. Two parameters are supported: test suite name and test suite function.
6
+ beforeAll(() => {
7
+ // Presets an action, which is performed only once before all test cases of the test suite start.
8
+ // This API supports only one parameter: preset action function.
9
+ });
10
+ beforeEach(() => {
11
+ // Presets an action, which is performed before each unit test case starts.
12
+ // The number of execution times is the same as the number of test cases defined by **it**.
13
+ // This API supports only one parameter: preset action function.
14
+ });
15
+ afterEach(() => {
16
+ // Presets a clear action, which is performed after each unit test case ends.
17
+ // The number of execution times is the same as the number of test cases defined by **it**.
18
+ // This API supports only one parameter: clear action function.
19
+ });
20
+ afterAll(() => {
21
+ // Presets a clear action, which is performed after all test cases of the test suite end.
22
+ // This API supports only one parameter: clear action function.
23
+ });
24
+ it('assertContain', 0, () => {
25
+ // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
26
+ let a = 'abc';
27
+ let b = 'b';
28
+ // Defines a variety of assertion methods, which are used to declare expected boolean conditions.
29
+ expect(a).assertContain(b);
30
+ expect(a).assertEqual(a);
31
+ });
32
+ });
33
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "modelVersion": "6.0.2",
3
+ "dependencies": {
4
+ },
5
+ "execution": {
6
+ // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | "ultrafine" | false ]. Default: "normal" */
7
+ // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
8
+ // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
9
+ // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
10
+ // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
11
+ // "optimizationStrategy": "memory" /* Define the optimization strategy. Value: [ "memory" | "performance" ]. Default: "memory" */
12
+ },
13
+ "logging": {
14
+ // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
15
+ },
16
+ "debugging": {
17
+ // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
18
+ },
19
+ "nodeOptions": {
20
+ // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
21
+ // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/
22
+ }
23
+ }
@@ -0,0 +1,6 @@
1
+ import { appTasks } from '@ohos/hvigor-ohos-plugin';
2
+
3
+ export default {
4
+ system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
+ plugins: [] /* Custom plugin to extend the functionality of Hvigor. */
6
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "meta": {
3
+ "stableOrder": true,
4
+ "enableUnifiedLockfile": false
5
+ },
6
+ "lockfileVersion": 3,
7
+ "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
8
+ "specifiers": {
9
+ "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0",
10
+ "@ohos/hypium@1.0.25": "@ohos/hypium@1.0.25"
11
+ },
12
+ "packages": {
13
+ "@ohos/hamock@1.0.0": {
14
+ "name": "@ohos/hamock",
15
+ "version": "1.0.0",
16
+ "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==",
17
+ "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har",
18
+ "registryType": "ohpm"
19
+ },
20
+ "@ohos/hypium@1.0.25": {
21
+ "name": "@ohos/hypium",
22
+ "version": "1.0.25",
23
+ "integrity": "sha512-l6uO2pjl8HyEKdekLqQt7tUpWbDqX/42zoAzkagtUVZAW9jT6lMvbe54MVjoLxq/RwQGygRvi6j4GpypSMFSHw==",
24
+ "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.25.har",
25
+ "registryType": "ohpm"
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "modelVersion": "6.0.2",
3
+ "description": "Please describe the basic information.",
4
+ "dependencies": {
5
+ },
6
+ "devDependencies": {
7
+ "@ohos/hypium": "1.0.25",
8
+ "@ohos/hamock": "1.0.0"
9
+ }
10
+ }
@@ -0,0 +1,85 @@
1
+ @echo off
2
+ setlocal
3
+ set BASENAME=apktool_
4
+ chcp 65001 2>nul >nul
5
+
6
+ set java_exe=java.exe
7
+
8
+ if defined JAVA_HOME (
9
+ set "java_exe=%JAVA_HOME%\bin\java.exe"
10
+ )
11
+
12
+ rem Find the highest version .jar available in the same directory as the script
13
+ setlocal EnableDelayedExpansion
14
+ pushd "%~dp0"
15
+ if exist apktool.jar (
16
+ set BASENAME=apktool
17
+ goto skipversioned
18
+ )
19
+
20
+ set BASENAME=apktool
21
+ set max_major=0
22
+ set max_minor=0
23
+ set max_patch=0
24
+
25
+ rem Loop through all versioned .jar files matching the basename
26
+ for %%F in (%BASENAME%*.jar) do (
27
+ set "filename=%%~nF"
28
+
29
+ rem Extract version part (apktool-X.Y.Z)
30
+ for /f "tokens=2 delims=_-" %%A in ("!filename!") do (
31
+ for /f "tokens=1,2,3 delims=." %%B in ("%%A") do (
32
+ set "major=%%B"
33
+ set "minor=%%C"
34
+ set "patch=%%D"
35
+
36
+ rem Set Default minor/patch to 0
37
+ if "!minor!"=="" set "minor=0"
38
+ if "!patch!"=="" set "patch=0"
39
+
40
+ rem Compare major version
41
+ if !major! gtr !max_major! (
42
+ set "max_major=!major!"
43
+ set "max_minor=!minor!"
44
+ set "max_patch=!patch!"
45
+ ) else if !major! == !max_major! (
46
+ rem Compare minor version
47
+ if !minor! gtr !max_minor! (
48
+ set "max_minor=!minor!"
49
+ set "max_patch=!patch!"
50
+ ) else if !minor! == !max_minor! (
51
+ rem Compare patch version
52
+ if !patch! gtr !max_patch! (
53
+ set "max_patch=!patch!"
54
+ )
55
+ )
56
+ )
57
+ )
58
+ )
59
+ )
60
+
61
+ rem Construct full version string
62
+ set "max=_!max_major!.!max_minor!.!max_patch!"
63
+
64
+ :skipversioned
65
+ popd
66
+ setlocal DisableDelayedExpansion
67
+
68
+ rem Find out if the commandline is a parameterless .jar or directory, for fast unpack/repack
69
+ if "%~1"=="" goto load
70
+ if not "%~2"=="" goto load
71
+ set ATTR=%~a1
72
+ if "%ATTR:~0,1%"=="d" (
73
+ rem Directory, rebuild
74
+ set fastCommand=b
75
+ )
76
+ if "%ATTR:~0,1%"=="-" if "%~x1"==".apk" (
77
+ rem APK file, unpack
78
+ set fastCommand=d
79
+ )
80
+
81
+ :load
82
+ "%java_exe%" -jar -Xmx1024M -Duser.language=en -Dfile.encoding=UTF8 -Djdk.util.zip.disableZip64ExtraFieldValidation=true -Djdk.nio.zipfs.allowDotZipEntry=true "%~dp0%BASENAME%%max%.jar" %fastCommand% %*
83
+
84
+ rem Pause when ran non interactively
85
+ for %%i in (%cmdcmdline%) do if /i "%%~i"=="/c" pause & exit /b