diff --git a/arkoala-arkts/application/.gitignore b/arkoala-arkts/application/.gitignore index e47d1641e54ff6cfa638143b654b5758f7e991a4..9085d4a755e0fea4b249cd725a4be76cef157e9a 100644 --- a/arkoala-arkts/application/.gitignore +++ b/arkoala-arkts/application/.gitignore @@ -1 +1,2 @@ -oh_modules \ No newline at end of file +oh_modules +generated \ No newline at end of file diff --git a/arkoala-arkts/application/package.json b/arkoala-arkts/application/package.json index bc02cec36bb2565bc63ba0a369623244f410e616..9d2d127b064462481174246f9b7b4e508b509f5a 100644 --- a/arkoala-arkts/application/package.json +++ b/arkoala-arkts/application/package.json @@ -3,15 +3,17 @@ "version": "1.4.1", "description": "", "scripts": { - "clean": "rimraf build generated unmemoized js_output abc lib ", + "clean": "rimraf shopping/entry/build shopping/generated shopping/oh_modules", - "build": "npm run cli-tools:check && cd shopping && ../command-line-tools/ohpm/bin/ohpm install --strict_ssl=false && DEVECO_SDK_HOME=../../../arkoala/ohos-sdk/ohos-sdk ../command-line-tools/hvigor/bin/hvigorw --mode module -p product=default assembleHap --analyze=normal --no-parallel --no-daemon", + "arkoala:har:arm32": "npm run arkoala:har-arm32 --prefix ../../arkoala-arkts", + "arkoala:har:arm64": "npm run arkoala:har-arm64 --prefix ../../arkoala-arkts", - "cli-tools:chmod:bz": "node ../../arkoala/ohos-sdk/scripts/openlab-cli.mjs chmod -p ./command-line-tools/ohpm/bin -b 755 && node ../../arkoala/ohos-sdk/scripts/openlab-cli.mjs chmod -p ./command-line-tools/hvigor/bin -b 755", - "cli-tools:chmod:yz": "node ../../../sdk/scripts/gitlab/gitlab-cli.mjs chmod -p ./command-line-tools/ohpm/bin -b 755 && node ../../../sdk/scripts/gitlab/gitlab-cli.mjs chmod -p ./command-line-tools/hvigor/bin -b 755", - "cli-tools:download:bz": "node ../../arkoala/ohos-sdk/scripts/openlab-cli.mjs download -p command-line-tools -v 5.0.3502 -f command-line-tools.5.0.3502.zip -d command-line-tools && npm run cli-tools:chmod:bz", - "cli-tools:download:yz": "node ../../../sdk/scripts/gitlab/gitlab-cli.mjs download -p deveco-tools -v 5.0.1300 -f deveco-tools.5.0.1300.zip -d command-line-tools && npm run cli-tools:chmod:yz", - "cli-tools:download": "test \"$KOALA_BZ\" = \"0\" && npm run cli-tools:download:yz || npm run cli-tools:download:bz", - "cli-tools:check": "test -d ./command-line-tools || npm run cli-tools:download" + "shopping:har:arm32": "npm run shopping:har-arm32 --prefix ../../arkoala-arkts", + "shopping:har:arm64": "npm run shopping:har-arm64 --prefix ../../arkoala-arkts", + + "build": "cd shopping && DEVECO_TOOLS_HOME=../../har/command-line-tools node ../../../arkoala/ohos-sdk/scripts/cli.mjs oh-build -i", + "sign": "cd shopping && DEVECO_TOOLS_HOME=../../har/command-line-tools node ../../../arkoala/ohos-sdk/scripts/cli.mjs oh-sign", + "exec": "cd shopping && DEVECO_TOOLS_HOME=../../har/command-line-tools node ../../../arkoala/ohos-sdk/scripts/cli.mjs oh-exec -i -r", + "launch": "npm run build && npm run sign && npm run exec" } } diff --git a/arkoala-arkts/application/shopping/AppScope/app.json5 b/arkoala-arkts/application/shopping/AppScope/app.json5 index 7e6080abeb951f5a5cc450e0d2ddc475d08c3d98..c9219fbc384c1823514ea1cf07e50676ffce92a4 100644 --- a/arkoala-arkts/application/shopping/AppScope/app.json5 +++ b/arkoala-arkts/application/shopping/AppScope/app.json5 @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.myapplicationteeeeeest", + "bundleName": "com.example.shopping.application", "vendor": "example", "versionCode": 1000000, "versionName": "1.0.0", diff --git a/arkoala-arkts/application/shopping/AppScope/resources/base/element/string.json b/arkoala-arkts/application/shopping/AppScope/resources/base/element/string.json index cda1d10aec95d95da2c561766addc3f536f1d770..ea81d75010c3f23eb68b489e90527f8cba9450b6 100644 --- a/arkoala-arkts/application/shopping/AppScope/resources/base/element/string.json +++ b/arkoala-arkts/application/shopping/AppScope/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "MyApplicationTEEEEEEST" + "value": "ShoppingApplication" } ] } diff --git a/arkoala-arkts/application/shopping/build-profile.json5 b/arkoala-arkts/application/shopping/build-profile.json5 index 6d93d9cd5af96ec9ec78db4738722a66c9464d7e..3ead1e058d9d9f02f77efdd11d0ff722c97cc8d4 100644 --- a/arkoala-arkts/application/shopping/build-profile.json5 +++ b/arkoala-arkts/application/shopping/build-profile.json5 @@ -5,13 +5,7 @@ "name": "default", "signingConfig": "default", "compatibleSdkVersion": "5.0.0(12)", - "runtimeOS": "HarmonyOS", - "buildOption": { - "strictMode": { - "caseSensitiveCheck": true, - "useNormalizedOHMUrl": true - } - } + "runtimeOS": "HarmonyOS" } ], "buildModeSet": [ diff --git a/arkoala-arkts/arkui/src/generated/ArkNavPathStackMaterialized.ts b/arkoala-arkts/arkui/src/generated/ArkNavPathStackMaterialized.ts index 3c9a3db8872af05f6a386611106e139138825d55..40ccacdc9413657f66eabf3ea6063478b7b41bc7 100644 --- a/arkoala-arkts/arkui/src/generated/ArkNavPathStackMaterialized.ts +++ b/arkoala-arkts/arkui/src/generated/ArkNavPathStackMaterialized.ts @@ -25,10 +25,11 @@ import { MaterializedBase } from "./MaterializedBase" import { Serializer } from "./peers/Serializer" import { isResource, isInstanceOf, runtimeType, RuntimeType, SerializerBase, registerCallback } from "./peers/SerializerBase" import { NativeModule } from "#components" -import { wrapCallback } from "@koalaui/interop" +import { wrapCallback, NativeBuffer } from "@koalaui/interop" import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./peers/CallbackTransformer" + import { int32, float32 @@ -46,8 +47,7 @@ import { KFloat32ArrayPtr, pointer } from "@koalaui/interop" - -import { NavPathStackExtender } from "../handwritten" +import {NavPathStackExtender} from "../handwritten"; export class NavPathStack implements MaterializedBase,INTERFACE_NavPathStack { _extender = new NavPathStackExtender() @@ -64,7 +64,7 @@ export class NavPathStack implements MaterializedBase,INTERFACE_NavPathStack { const retval = NativeModule._NavPathStack_ctor() return retval } - constructor() { + constructor() { { const ctorPtr : KPointer = NavPathStack.ctor() this.peer = new Finalizable(ctorPtr, NavPathStack.getFinalizer()) @@ -75,19 +75,19 @@ export class NavPathStack implements MaterializedBase,INTERFACE_NavPathStack { } pushPath(info: NavPathInfo, animated?: boolean | undefined | NavigationOptions | undefined): void { this._extender.push(info.name, info.param) - const info_type = runtimeType(info) - const animated_type = runtimeType(animated) - if ((((RuntimeType.OBJECT) == (info_type)) && (TypeChecker.isNavPathInfo(info, true, true, true, true))) && (((RuntimeType.BOOLEAN == animated_type)) || ((RuntimeType.UNDEFINED == animated_type)))) { - const info_casted = info as (NavPathInfo) - const animated_casted = animated as (boolean | undefined) - this.pushPath0_serialize(info_casted, animated_casted) - } - if ((((RuntimeType.OBJECT) == (info_type)) && (TypeChecker.isNavPathInfo(info, true, true, true, true))) && (((RuntimeType.OBJECT == animated_type)) || ((RuntimeType.UNDEFINED == animated_type)))) { - const info_casted = info as (NavPathInfo) - const animated_casted = animated as (NavigationOptions | undefined) - this.pushPath1_serialize(info_casted, animated_casted) - } - throw new Error("Can not select appropriate overload") + // const info_type = runtimeType(info) + // const animated_type = runtimeType(animated) + // if ((((RuntimeType.OBJECT) == (info_type)) && (TypeChecker.isNavPathInfo(info, true, true, true, true))) && (((RuntimeType.BOOLEAN == animated_type)) || ((RuntimeType.UNDEFINED == animated_type)))) { + // const info_casted = info as (NavPathInfo) + // const animated_casted = animated as (boolean | undefined) + // this.pushPath0_serialize(info_casted, animated_casted) + // } + // if ((((RuntimeType.OBJECT) == (info_type)) && (TypeChecker.isNavPathInfo(info, true, true, true, true))) && (((RuntimeType.OBJECT == animated_type)) || ((RuntimeType.UNDEFINED == animated_type)))) { + // const info_casted = info as (NavPathInfo) + // const animated_casted = animated as (NavigationOptions | undefined) + // this.pushPath1_serialize(info_casted, animated_casted) + // } + // throw new Error("Can not select appropriate overload") } pushDestination(info: NavPathInfo, animated?: boolean | undefined | NavigationOptions | undefined): Promise { this._extender.push(info.name, info.param) @@ -185,18 +185,19 @@ export class NavPathStack implements MaterializedBase,INTERFACE_NavPathStack { } pop(result?: Object | boolean | undefined, animated?: boolean): NavPathInfo | undefined { this._extender.pop() - const result_type = runtimeType(result) - const animated_type = runtimeType(animated) - if ((((RuntimeType.OBJECT == result_type))) && (((RuntimeType.BOOLEAN == animated_type)) || ((RuntimeType.UNDEFINED == animated_type)))) { - const result_casted = result as (Object) - const animated_casted = animated as (boolean | undefined) - return this.pop1_serialize(result_casted, animated_casted) - } - if ((((RuntimeType.BOOLEAN == result_type)) || ((RuntimeType.UNDEFINED == result_type))) && (((RuntimeType.UNDEFINED == animated_type)))) { - const result_casted = result as (boolean | undefined) - return this.pop0_serialize(result_casted) - } - throw new Error("Can not select appropriate overload") + // const result_type = runtimeType(result) + // const animated_type = runtimeType(animated) + // if ((((RuntimeType.OBJECT == result_type))) && (((RuntimeType.BOOLEAN == animated_type)) || ((RuntimeType.UNDEFINED == animated_type)))) { + // const result_casted = result as (Object) + // const animated_casted = animated as (boolean | undefined) + // return this.pop1_serialize(result_casted, animated_casted) + // } + // if ((((RuntimeType.BOOLEAN == result_type)) || ((RuntimeType.UNDEFINED == result_type))) && (((RuntimeType.UNDEFINED == animated_type)))) { + // const result_casted = result as (boolean | undefined) + // return this.pop0_serialize(result_casted) + // } + // throw new Error("Can not select appropriate overload") + return undefined } popToName(name: string, result?: Object | boolean | undefined, animated?: boolean): number { const name_type = runtimeType(name) @@ -254,8 +255,7 @@ export class NavPathStack implements MaterializedBase,INTERFACE_NavPathStack { return this.getParamByIndex_serialize(index_casted) } getParamByName(name: string): Array { - const name_casted = name as (string) - return this.getParamByName_serialize(name_casted) + return this._extender.getParamByName(name) } getIndexByName(name: string): Array { const name_casted = name as (string) diff --git a/arkoala-arkts/arkui/src/generated/peers/ArkNavDestinationPeer.ts b/arkoala-arkts/arkui/src/generated/peers/ArkNavDestinationPeer.ts index 23e71190639ba5cf638dc20590daeef4fbc5432c..23a137d65a8771eb9fad9e2bca7f423b9ca7dc69 100644 --- a/arkoala-arkts/arkui/src/generated/peers/ArkNavDestinationPeer.ts +++ b/arkoala-arkts/arkui/src/generated/peers/ArkNavDestinationPeer.ts @@ -50,7 +50,7 @@ export class ArkNavDestinationPeer extends ArkCommonMethodPeer { } public static create(component?: ComponentBase, flags: int32 = 0): ArkNavDestinationPeer { const peerId = PeerNode.nextId() - const _peerPtr = NativeModule._NavDestination_construct(peerId, flags) + const _peerPtr = NativeModule._Stack_construct(peerId, flags) const _peer = new ArkNavDestinationPeer(_peerPtr, peerId, "NavDestination", flags) component?.setPeer(_peer) return _peer diff --git a/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts b/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts index fa6908cfb21dbfa0eba6b2c6ee6c353678136977..dc190d595764ad53813f1859c7b17e8125a5d101 100644 --- a/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts +++ b/arkoala-arkts/arkui/src/handwritten/ArkNavPathStack.ts @@ -39,7 +39,7 @@ export class NavPathStackExtender { pop(): void { console.log(" ### pop = ") this._stack.pop() - const page = this._stack[this._stack.length - 1] + const page = this._stack.at(this._stack.length - 1) this.currentName.value = page?.name ?? "" if (page?.param != undefined) { this.currentParam = page?.param! diff --git a/arkoala-arkts/har/arkoala-har-bundle/loader.js b/arkoala-arkts/har/arkoala-har-bundle/loader.js index 163c1778f22b3839e69d80ee1008926a30c55183..d94ad9a46539b83e614e326671a6a164c6819853 100644 --- a/arkoala-arkts/har/arkoala-har-bundle/loader.js +++ b/arkoala-arkts/har/arkoala-har-bundle/loader.js @@ -107,7 +107,7 @@ export function checkLoader(variant) { } let result = nativeModule()._LoadVirtualMachine(vm, classPath, nativePath); if (result == 0) { - rootPointer = nativeModule()._StartApplication("TrivialApp", "ArkTSLoaderParam"); + rootPointer = nativeModule()._StartApplication("ShoppingApp", "ArkTSLoaderParam"); if (rootPointer != 0) { setTimeout(async () => runEventLoop(), 0); } diff --git a/arkoala-arkts/package.json b/arkoala-arkts/package.json index 829aaaa518fa575df87e48fc6bdca721902f4065..157dd8bc117cf2517ce8cc6325efe43913c2f9e4 100644 --- a/arkoala-arkts/package.json +++ b/arkoala-arkts/package.json @@ -55,7 +55,7 @@ "build:arkoala:inc": "npm run build:arkoala:components:inc && npm run link:arkoala", "link:arkoala": "mkdir -p build && ../incremental/tools/panda/arkts/arklink --output build/arkoala.abc -- ./arkui/build/arkui-no-common.abc ../arkoala/arkui-common/build/arkui-common.abc ../incremental/runtime/build/incremental.abc ../interop/build/interop.abc", "build:user": "npm run build:user --prefix user && mkdir -p ./build && cp -r user/build/user.abc ./build/", - "build:shopping": "npm run interface-sdk:download --prefix ../arkoala/arkui-common && npm run build:shopping --prefix shopping && mkdir -p ./build && cp -r shopping/build/shopping.abc ./build/", + "build:shopping": "npm run build:shopping --prefix shopping && mkdir -p ./build && cp -r shopping/build/shopping.abc ./build/", "run:node:user": "ACE_LIBRARY_PATH=build PANDA_HOME=../incremental/tools/panda/node_modules/@panda/sdk node build/index.js panda:TrivialApp", "run:node:user:navigation": "ACE_LIBRARY_PATH=build PANDA_HOME=../incremental/tools/panda/node_modules/@panda/sdk node build/index.js panda:NavigationApp", "run:node:shopping": "ACE_LIBRARY_PATH=build PANDA_HOME=../incremental/tools/panda/node_modules/@panda/sdk node build/index.js panda:ShoppingApp", @@ -70,6 +70,8 @@ "arkoala:har-arm64": "npm run compile:native:hzvm-ohos-arm64 && npm run build:arkoala && npm run har-arm64 --prefix har", "user:har-arm32": "npm run har-arm32 --prefix user", "user:har-arm64": "npm run har-arm64 --prefix user", + "shopping:har-arm32": "npm run har-arm32 --prefix shopping", + "shopping:har-arm64": "npm run har-arm64 --prefix shopping", "clean": "rimraf build", "clean:native": "npm run clean --prefix ../arkoala/framework", "clean:all": "npm run clean && npm run clean:incremental && npm run clean:interop && npm run clean:arkui-common && npm run clean:arkui-no-common && npm run clean:native && npm run clean --prefix har && npm run clean --prefix user" diff --git a/arkoala-arkts/shopping/package.json b/arkoala-arkts/shopping/package.json index c007e709c406c2f06a6765a186fa8ae69e6bbd26..518ddaa40dcd892d22698bc6b91d8c3e48a00540 100644 --- a/arkoala-arkts/shopping/package.json +++ b/arkoala-arkts/shopping/package.json @@ -11,7 +11,7 @@ "unmemoize:arkui-no-common": "npm run unmemoize --prefix ../arkui", "unmemoize:arkui-common": "npm run unmemoize --prefix ../../arkoala/arkui-common", "unmemoize:all": "npm run unmemoize:runtime && npm run unmemoize:arkui-no-common && npm run unmemoize:arkui-common && npm run unmemoize", - "build:shopping": "npm run unmemoize:all && npm run build:shopping:inc", + "build:shopping": "npm run interface-sdk:download --prefix ../../arkoala/arkui-common && npm run unmemoize:all && npm run build:shopping:inc", "build:shopping:inc": "fast-arktsc --input-files ./arktsconfig-run-unmemoized.json --output-dir ./build --compiler ../../incremental/tools/panda/arkts/arktsc --link-name shopping && ninja -f build/build.ninja", "pack": "npm run cli-tools:check && cd app && DEVECO_SDK_HOME=../../../arkoala/ohos-sdk/ohos-sdk ../command-line-tools/hvigor/bin/hvigorw --no-daemon --mode module -p product=default -p module=shopping@default assembleHar", diff --git a/arkoala/framework/native/src/generated/arkoala_api_generated.h b/arkoala/framework/native/src/generated/arkoala_api_generated.h index c85f629964eba9b8cac76bea7de251cbc1808958..e2405207a46d46a0fa36622e30ffd4a107ab4566 100644 --- a/arkoala/framework/native/src/generated/arkoala_api_generated.h +++ b/arkoala/framework/native/src/generated/arkoala_api_generated.h @@ -23,7 +23,7 @@ // The only include allowed in this file! Do not add anything else ever. #include -#define GENERATED_ARKUI_FULL_API_VERSION 108 +#define GENERATED_ARKUI_FULL_API_VERSION 110 #define GENERATED_ARKUI_NODE_API_VERSION GENERATED_ARKUI_FULL_API_VERSION #define GENERATED_ARKUI_BASIC_NODE_API_VERSION 1 diff --git a/arkoala/ohos-sdk/cacert/OpenHarmonyApplication.pem b/arkoala/ohos-sdk/cacert/OpenHarmonyApplication.pem new file mode 100644 index 0000000000000000000000000000000000000000..825abdc7bcc5f019625e6a438074375a8e891d14 --- /dev/null +++ b/arkoala/ohos-sdk/cacert/OpenHarmonyApplication.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui +QIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty +3SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD +ZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E +I2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX +1CumzkcYhgU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICYTCCAeWgAwIBAgIEHmXAPTAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE1MzJaFw00OTEyMzExMjE1MzJaMGMxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEjMCEG +A1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwdjAQBgcqhkjOPQIBBgUr +gQQAIgNiAAQhnu7Hna8XNa2KyqRf5+lBJScE4xqf89N0g0OuqAb2re8nGsvWkw26 +uDekfnBYicd+G3Cydqa2zFIwV7Talyg2ULW3r8KbGpyl84mJEPPRmCGJ+H9gtCsf ++OrJ4Y76LVWjYzBhMB8GA1UdIwQYMBaAFBc6EKGrGXzlAE+s0Zgnsphadw7NMA8G +A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTbhrciFtUL +oUu33SV7ufEFfaItRzAMBggqhkjOPQQDAwUAA2gAMGUCMG3cXjiDmXTvf7D4Omhf +qcc2nuO+EMfWE+N9ZhBP5UhV34mAGWi3SfLU6rcV0urWEQIxAMYIb3epOnKhUrcm +Lfu1WKzFlpYQwmw73RaCHP2I3k6NcuWOYeNwWXSNZ8o0nzvaLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy +MTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML +T3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT +H09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq +hkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG +JwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci +FtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl +cRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps +LMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o +zAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/ +-----END CERTIFICATE----- diff --git a/arkoala/ohos-sdk/scripts/cli.mjs b/arkoala/ohos-sdk/scripts/cli.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8375719aba0846fd8e65b619e82eaf5fead41f45 --- /dev/null +++ b/arkoala/ohos-sdk/scripts/cli.mjs @@ -0,0 +1,85 @@ +#!/usr/bin/env node + +/* + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Command } from "commander" +import path from "path" +import { fileURLToPath } from 'url' +import { ensureEnvVarSet } from "./utils.mjs" + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) + +ensureEnvVarSet("DEVECO_TOOLS_HOME", path.join(__dirname, "../../har/command-line-tools"), true) +ensureEnvVarSet("DEVECO_SDK_HOME", path.join(__dirname, "../ohos-sdk"), true) + +const app = new Command("arkoala") + +app.command("oh-sign") + .description("Sign the OpenHarmony project hap file") + .option("-m, --mod ", "project mode: app, test", "app") + // .option("-c, --oh-conf ", "path to .ohconf.json", "./.ohconf.json") + .action(async (options) => { + const { sign } = await import("./ohos-app/sign.mjs") + await sign(options) + }) + +app.command("oh-build") + .description("Build the OpenHarmony project") + .option("-m, --mod ", "project mode: app, test", "app") + // .option("-c, --oh-conf ", "path to .ohconf.json", "./.ohconf.json") + // .option("-s, --sync", "sync the project config ws well") + // .option("--sync-only", "sync the project config only") + .option("-i, --install-ohpm-deps", "install ohpm dependencies as well") + .option("--install-ohpm-deps-only", "install ohpm dependencies only") + .option("-s, --sign", "sign the project as well") + .option("-e, --extra-options ", "comma-separated pass extra options") + .option("-V, --verbose", "log commands") + .action(async (options) => { + const { build } = await import("./ohos-app/build.mjs") + await build(options) + if (options.sign) { + const { sign } = await import("./ohos-app/sign.mjs") + await sign({ + mod: options.mod + }) + } + }) + +app.command("oh-exec") + .description("Execute an instruction on an OpenHarmony device") + .option("-i, --install", "install the project hap file on a device") + .option("-u, --uninstall", "uninstall the project hap file from a device") + .option("-r, --run", "run the project app on a device") + .option("-t, --run-timeout ", "run the project app on a device with timeout in ms") + .option("-m, --mod ", "project mode: app, test", "app") + // .option("-c, --oh-conf ", "path to .ohconf.json", "./.ohconf.json") + .option("-l, --list-devices", "list connected devices") + .option("-o, --hdc-extra-opts ", "extra options to pass to the HDC tool") + .option("-V, --verbose", "log commands") + .option("-e, --extra ", "extra options which will be added to hdc command if supported", "") + .action(async (options) => { + const { install, uninstall, run } = await import("./ohos-app/exec-on-device.mjs") + + if (options.install) + await install(options) + if (options.uninstall) + await uninstall(options) + if (options.run || options.runTimeout) + await run(options) + }) + +app.parse() \ No newline at end of file diff --git a/arkoala/ohos-sdk/scripts/ohos-app/sign.mjs b/arkoala/ohos-sdk/scripts/ohos-app/sign.mjs index 3cbf0a3e62c21d02429fb090866795c46238f7a1..67ce98a9c29d5976f0d4b3366873a4e42692238a 100644 --- a/arkoala/ohos-sdk/scripts/ohos-app/sign.mjs +++ b/arkoala/ohos-sdk/scripts/ohos-app/sign.mjs @@ -37,7 +37,9 @@ const LZ_OUTPUT = lazy(() => ensureExists(path.join(LZ_OHCONF().root, "generated const LZ_APP_BUNDLE_NAME = lazy(() => LZ_OHCONF().bundleName()) const LZ_APP_PROFILE_TEMPLATE = lazy(() => path.join(LZ_OUTPUT(), "KoalaApplicationReleaseProfile.json")) const LZ_APP_SIGNED_PROFILE = lazy(() => path.join(LZ_OUTPUT(), `${LZ_APP_BUNDLE_NAME()}.p7b`)) -const LZ_APP_CERT = lazy(() => path.join(LZ_OUTPUT(), "KoalaApplicationRelease.pem")) +// const LZ_APP_CERT = lazy(() => path.join(LZ_OUTPUT(), "KoalaApplicationRelease.pem")) +// from https://gitee.com/openharmony/developtools_hapsigner.git +const LZ_APP_CERT = lazy(() => path.join(CACERT_ROOT, "OpenHarmonyApplication.pem")) const SIGN_ALG = "SHA256withECDSA" const MODE = "localSign" @@ -119,7 +121,8 @@ export async function sign(options) { console.log("Previously generated certificates will be used to sign: " + `${LZ_APP_CERT()}, ${path.basename(LZ_APP_SIGNED_PROFILE())}\n`) } else { - await generateAppCert() + // Use stock OpenHarmonyApplication.pem + // await generateAppCert() await copyProfileTemplate() await signProfile() } diff --git a/arkoala/ohos-sdk/scripts/utils.mjs b/arkoala/ohos-sdk/scripts/utils.mjs index 62385324073f0eef0d810999450eccc60b2d7bb3..635023d2f6c9e410e43fe8df0a6a959490f14797 100644 --- a/arkoala/ohos-sdk/scripts/utils.mjs +++ b/arkoala/ohos-sdk/scripts/utils.mjs @@ -375,4 +375,11 @@ export function splitFileLines(file) { return splitLines(content) } -export function noop(...args) {} \ No newline at end of file +export function noop(...args) {} + +export function ensureEnvVarSet(envVarName, defaultValue, log = false) { + if (!process.env[envVarName]) { + process.env[envVarName] = defaultValue + } + if (log) console.log(`> ${envVarName}=` + process.env[envVarName]) +} diff --git a/arkoala/tools/peer-generator/package.json b/arkoala/tools/peer-generator/package.json index acbedc1a792af90e6a72106409a9a5bc03c79c93..8f5d4fe25a85979a5a7567b6be8f8139950b0049 100644 --- a/arkoala/tools/peer-generator/package.json +++ b/arkoala/tools/peer-generator/package.json @@ -2,8 +2,8 @@ "name": "peer-generator", "description": "", "config": { - "idlize_version": "1.3.22", - "api_version": "108", + "idlize_version": "1.3.23", + "api_version": "110", "input_dir": "../../arkui-common/interface_sdk-js/api/@internal/component/ets/,../../arkui-common/interface_sdk-js/api/global" }, "scripts": { diff --git a/package.json b/package.json index 45b82045fc16ec5bd3c7f2bb06996006ac47b0e2..75b0ea907b9464d590204191f2e004a5e76c2f84 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "ets:plugin:compile": "npm run compile --prefix arkoala/ets-plugin", "compiler:plugin:compile": "npm run compile --prefix incremental/compiler-plugin", "plugins:compile": "npm run compiler:plugin:compile && npm run ets:plugin:compile", - "arkoala:plugin": "npm run plugins:compile && cd arkoala/tools/arkoala-transformer && npx rollup -c && cp -f arkoala-plugin.js ${HOS_SDK_HOME}/HarmonyOS-NEXT-DB1/openharmony/ets/build-tools/ets-loader/lib/fast_build/ets_ui", + "arkoala:plugin": "npm run plugins:compile && cd arkoala/tools/arkoala-transformer && npx rollup - && cp -f arkoala-plugin.js ${HOS_SDK_HOME}/HarmonyOS-NEXT-DB1/openharmony/ets/build-tools/ets-loader/lib/fast_build/ets_ui", "arkoala:har": "npm run all --prefix arkoala/har", "arkoala:har-arm32": "npm run all-arm32 --prefix arkoala/har" }