From 322a67dd2fa53ea0464fd06272879829e05dfc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E9=91=AB?= Date: Fri, 14 Mar 2025 20:27:47 +0800 Subject: [PATCH 1/2] hash_securitylabel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周鑫 --- .../src/mod_hash/ani/ets/@ohos.file.hash.ets | 90 +++++++++++++++++-- .../kits/js/src/mod_hash/ani/hash_ani.cpp | 2 +- .../kits/js/src/mod_hash/ani/hash_ani.h | 2 +- .../ani/ets/@ohos.file.securityLabel.ets | 54 ++++++++++- .../ani/securitylabel_ani.cpp | 12 +-- .../mod_securitylabel/ani/securitylabel_ani.h | 4 +- 6 files changed, 144 insertions(+), 20 deletions(-) diff --git a/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets b/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets index d291adce..e2145a27 100644 --- a/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets +++ b/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets @@ -1,11 +1,51 @@ -import type { AsyncCallback } from './@ohos.base'; -import stream from './@ohos.util.stream'; +import { AsyncCallback, BusinessError } from '@ohos.base'; -declare namespace hash { - native function hash(path: string, algorithm: string): Promise; +class BusinessErrorInner implements BusinessError { + code: number; + data?: T; + name: string = ""; + message: string = ""; + stack?: string = ""; +} + +export default namespace hash { + loadLibrary("ani_hash_class"); - native function hash(path: string, algorithm: string, callback: AsyncCallback): void; + export function hash(path: string, algorithm: string): Promise { + let pvoid: Promise = new Promise((resolve: (result: string) => void, + reject: (e: BusinessError) => void): void => { + let promise = taskpool.execute((path: string, algorithm: string): string => hashSync(path, algorithm), path, algorithm); + promise.then((ret: NullishType) => { + if (ret === null || ret === undefined) { + let err = new BusinessErrorInner(); + err.code = -1; + reject(err); + } else { + let r = ret as string; + resolve(r); + } + }); + }); + return pvoid; + } + + export function hash(path: string, algorithm: string, callback: AsyncCallback): void { + let p1 = taskpool.execute((path: string, algorithm: string): void => hashSync(path, algorithm), path, algorithm); + p1.then((ret: NullishType) => { + let err = new BusinessErrorInner(); + if (ret === null || ret === undefined) { + err.code = -1 + callback(err, "") + } else { + err.code = 0 + let r = ret as string; + callback(err, r); + } + }); + } + + native function hashSync(path: string, algorithm: string): string; void; class HashStream extends stream.Transform { native digest(): string; @@ -16,4 +56,42 @@ declare namespace hash { native function createHash(algorithm: string): HashStream; } -export default hash; \ No newline at end of file +function main():void { + loadLibrary("ani_hash_class"); + + try { + await hash.hash("/data/local/tmp/hello.txt", "md5").then((result: string) => { + console.info(`hash promise: ${result}`) + }); + } catch (error) { + console.error("Promise: Error getting temp dir:", error); + } + console.info("hash Promise async end"); + + hash.hash("/data/local/tmp/hello.txt", "md5", (err: BusinessError, data?: string) => { + if (err.code) { + console.error("Callback: Error hash:", err); + } else { + console.info(`hash callback: ${data}`) + } + }); + console.println("hash callback async end"); + + try { + await hash.hash("/data/local/tmp/hello.txt", "sha1").then((result: string) => { + console.info(`hash promise: ${result}`) + }); + } catch (error) { + console.error("Promise: Error getting temp dir:", error); + } + console.info("hash Promise async end"); + + try { + await hash.hash("/data/local/tmp/hello.txt", "sha256").then((result: string) => { + console.info(`hash promise: ${result}`) + }); + } catch (error) { + console.error("Promise: Error getting temp dir:", error); + } + console.info("hash Promise async end"); +} \ No newline at end of file diff --git a/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp b/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp index c8bffc53..222b8734 100644 --- a/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp +++ b/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp @@ -27,7 +27,7 @@ namespace ANI { using namespace std; using namespace OHOS::FileManagement::ModuleFileIO; -ani_string HashAni::HashSync(ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string algorithm) +ani_string HashAni::HashSync(ani_env *env, ani_string path, ani_string algorithm) { auto [succPath, srcPath] = TypeConverter::ToUTF8String(env, path); if (!succPath) { diff --git a/interfaces/kits/js/src/mod_hash/ani/hash_ani.h b/interfaces/kits/js/src/mod_hash/ani/hash_ani.h index 7b0890fe..20e095d5 100644 --- a/interfaces/kits/js/src/mod_hash/ani/hash_ani.h +++ b/interfaces/kits/js/src/mod_hash/ani/hash_ani.h @@ -25,7 +25,7 @@ namespace ANI { class HashAni final { public: - static ani_string HashSync(ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string algorithm); + static ani_string HashSync(ani_env *env, ani_string path, ani_string algorithm); }; } // namespace ANI diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets b/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets index 47841fcd..93dd45ed 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets +++ b/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets @@ -1,11 +1,47 @@ -import type { AsyncCallback } from './@ohos.base'; +import { AsyncCallback, BusinessError } from '@ohos.base'; + +class BusinessErrorInner implements BusinessError { + code: number; + data?: T; + name: string = ""; + message: string = ""; + stack?: string = ""; +} declare namespace securityLabel { + loadLibrary("ani_securitylabel_class"); type DataLevel = 's0' | 's1' | 's2' | 's3' | 's4'; - native function setSecurityLabel(path: string, type: DataLevel): Promise; + export function setSecurityLabel(path: string, type: DataLevel): Promise { + let pvoid: Promise = new Promise((resolve: (result: undefined) => void, + reject: (e: BusinessError) => void): void => { + let promise = taskpool.execute((path: string, type: DataLevel): void => setSecurityLabelSync(path, type), path, type); + promise.then((ret: NullishType) => { + if (ret === null || ret === undefined) { + let err = new BusinessErrorInner(); + err.code = -1; + reject(err); + } else { + resolve(undefined); + } + }); + }); + return pvoid; + } - native function setSecurityLabel(path: string, type: DataLevel, callback: AsyncCallback): void; + export function setSecurityLabel(path: string, type: DataLevel, callback: AsyncCallback): void { + let p1 = taskpool.execute((path: string, type: DataLevel): void =>setSecurityLabelSync(path, type), path, type); + p1.then((ret: NullishType) => { + let err = new BusinessErrorInner(); + if (ret === null || ret === undefined) { + err.code = -1 + callback(err, undefined) + } else { + err.code = 0 + callback(err, undefined); + } + }); + } native function setSecurityLabelSync(path: string, type: DataLevel): void; @@ -16,4 +52,14 @@ declare namespace securityLabel { native function getSecurityLabelSync(path: string): string; } -export default securityLabel; \ No newline at end of file +export default securityLabel; + +function main():void { + loadLibrary("ani_securitylabel_class"); + console.info("hello world") + securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s1"); + securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s2"); + securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s3"); + securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s2"); + // console.info(`access: ${result}`) +} \ No newline at end of file diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp index 35f28cc7..fbcd2d23 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp +++ b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp @@ -28,28 +28,28 @@ using namespace std; using namespace OHOS::FileManagement::ModuleFileIO; using namespace OHOS::FileManagement::ModuleSecurityLabel; -ani_int SecurityLabelAni::SetSecurityLabelSync( - ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string level) +void SecurityLabelAni::SetSecurityLabelSync( + ani_env *env, ani_string path, ani_string level) { auto [succPath, srcPath] = TypeConverter::ToUTF8String(env, path); if (!succPath) { HILOGE("Invalid path"); - return -1; + return; } auto [succLevel, dataLevel] = TypeConverter::ToUTF8String(env, level); if (!succLevel) { HILOGE("Invalid dataLevel"); - return -1; + return; } auto ret = DoSetSecurityLabel(srcPath, dataLevel); if (!ret.IsSuccess()) { HILOGE("Set securitylabel failed"); - return -1; + return; } - return 0; + return; } } // namespace ANI diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h index b99fa8bc..06380227 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h +++ b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h @@ -25,8 +25,8 @@ namespace ANI { class SecurityLabelAni final { public: - static ani_int SetSecurityLabelSync( - ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string level); + static void SetSecurityLabelSync( + ani_env *env, ani_string path, ani_string level); }; } // namespace ANI -- Gitee From a1147aa117fdce65c4850b39e6019d46e4c95019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E9=91=AB?= Date: Fri, 14 Mar 2025 21:10:11 +0800 Subject: [PATCH 2/2] xxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周鑫 --- .../src/mod_hash/ani/bind_function_class.cpp | 2 +- .../src/mod_hash/ani/ets/@ohos.file.hash.ets | 108 ++++++------------ .../kits/js/src/mod_hash/ani/hash_ani.cpp | 2 +- .../kits/js/src/mod_hash/ani/hash_ani.h | 2 +- .../ani/bind_function_class.cpp | 4 +- .../ani/ets/@ohos.file.securityLabel.ets | 72 ++++++------ .../ani/securitylabel_ani.cpp | 2 +- .../mod_securitylabel/ani/securitylabel_ani.h | 2 +- 8 files changed, 80 insertions(+), 114 deletions(-) diff --git a/interfaces/kits/js/src/mod_hash/ani/bind_function_class.cpp b/interfaces/kits/js/src/mod_hash/ani/bind_function_class.cpp index e0c81d4e..fc2bd3c0 100644 --- a/interfaces/kits/js/src/mod_hash/ani/bind_function_class.cpp +++ b/interfaces/kits/js/src/mod_hash/ani/bind_function_class.cpp @@ -21,7 +21,7 @@ using namespace OHOS::FileManagement::ModuleFileIO::ANI; static ani_status BindStaticMethods(ani_env *env) { - static const char *className = "Lfile_hash_class/hash;"; + static const char *className = "L@ohos/file/hash/hash;"; std::array methods = { ani_native_function { "hashSync", "Lstd/core/String;Lstd/core/String;:Lstd/core/String;", reinterpret_cast(HashAni::HashSync) }, diff --git a/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets b/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets index e2145a27..71d5a8ba 100644 --- a/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets +++ b/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets @@ -1,24 +1,41 @@ - -import { AsyncCallback, BusinessError } from '@ohos.base'; - -class BusinessErrorInner implements BusinessError { - code: number; +/* + * Copyright (c) 2025 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. + */ + +export default hash; + +export class BusinessError { + code: number = 0; data?: T; - name: string = ""; - message: string = ""; - stack?: string = ""; } -export default namespace hash { - loadLibrary("ani_hash_class"); +export type AsyncCallback = (err: BusinessError, data?: T) => void; + +class hash { + + static { + loadLibrary("ani_hash_class"); + } + + static native hashSync(path: string, algorithm: string): string; - export function hash(path: string, algorithm: string): Promise { - let pvoid: Promise = new Promise((resolve: (result: string) => void, - reject: (e: BusinessError) => void): void => { - let promise = taskpool.execute((path: string, algorithm: string): string => hashSync(path, algorithm), path, algorithm); + static hash(path: string, algorithm: string): Promise { + return new Promise((resolve: (result: string) => void, reject: (e: BusinessError) => void) => { + let promise = taskpool.execute(hash.hashSync, path, algorithm); promise.then((ret: NullishType) => { if (ret === null || ret === undefined) { - let err = new BusinessErrorInner(); + let err = new BusinessError(); err.code = -1; reject(err); } else { @@ -27,16 +44,15 @@ export default namespace hash { } }); }); - return pvoid; } - - export function hash(path: string, algorithm: string, callback: AsyncCallback): void { - let p1 = taskpool.execute((path: string, algorithm: string): void => hashSync(path, algorithm), path, algorithm); + + static hash(path: string, algorithm: string, callback: AsyncCallback): void { + let p1 = taskpool.execute(hash.hashSync, path, algorithm); p1.then((ret: NullishType) => { - let err = new BusinessErrorInner(); + let err = new BusinessError(); if (ret === null || ret === undefined) { err.code = -1 - callback(err, "") + callback(err, undefined) } else { err.code = 0 let r = ret as string; @@ -44,54 +60,4 @@ export default namespace hash { } }); } - - native function hashSync(path: string, algorithm: string): string; void; - - class HashStream extends stream.Transform { - native digest(): string; - - native update(data: ArrayBuffer): void; - } - - native function createHash(algorithm: string): HashStream; } - -function main():void { - loadLibrary("ani_hash_class"); - - try { - await hash.hash("/data/local/tmp/hello.txt", "md5").then((result: string) => { - console.info(`hash promise: ${result}`) - }); - } catch (error) { - console.error("Promise: Error getting temp dir:", error); - } - console.info("hash Promise async end"); - - hash.hash("/data/local/tmp/hello.txt", "md5", (err: BusinessError, data?: string) => { - if (err.code) { - console.error("Callback: Error hash:", err); - } else { - console.info(`hash callback: ${data}`) - } - }); - console.println("hash callback async end"); - - try { - await hash.hash("/data/local/tmp/hello.txt", "sha1").then((result: string) => { - console.info(`hash promise: ${result}`) - }); - } catch (error) { - console.error("Promise: Error getting temp dir:", error); - } - console.info("hash Promise async end"); - - try { - await hash.hash("/data/local/tmp/hello.txt", "sha256").then((result: string) => { - console.info(`hash promise: ${result}`) - }); - } catch (error) { - console.error("Promise: Error getting temp dir:", error); - } - console.info("hash Promise async end"); -} \ No newline at end of file diff --git a/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp b/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp index 222b8734..c8bffc53 100644 --- a/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp +++ b/interfaces/kits/js/src/mod_hash/ani/hash_ani.cpp @@ -27,7 +27,7 @@ namespace ANI { using namespace std; using namespace OHOS::FileManagement::ModuleFileIO; -ani_string HashAni::HashSync(ani_env *env, ani_string path, ani_string algorithm) +ani_string HashAni::HashSync(ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string algorithm) { auto [succPath, srcPath] = TypeConverter::ToUTF8String(env, path); if (!succPath) { diff --git a/interfaces/kits/js/src/mod_hash/ani/hash_ani.h b/interfaces/kits/js/src/mod_hash/ani/hash_ani.h index 20e095d5..7b0890fe 100644 --- a/interfaces/kits/js/src/mod_hash/ani/hash_ani.h +++ b/interfaces/kits/js/src/mod_hash/ani/hash_ani.h @@ -25,7 +25,7 @@ namespace ANI { class HashAni final { public: - static ani_string HashSync(ani_env *env, ani_string path, ani_string algorithm); + static ani_string HashSync(ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string algorithm); }; } // namespace ANI diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/bind_function_class.cpp b/interfaces/kits/js/src/mod_securitylabel/ani/bind_function_class.cpp index 157773f9..74c9466d 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/bind_function_class.cpp +++ b/interfaces/kits/js/src/mod_securitylabel/ani/bind_function_class.cpp @@ -21,9 +21,9 @@ using namespace OHOS::FileManagement::ModuleFileIO::ANI; static ani_status BindStaticMethods(ani_env *env) { - static const char *className = "Lfile_securitylabel_class/securitylabel;"; + static const char *className = "L@ohos/file/securityLabel/securitylabel;"; std::array methods = { - ani_native_function { "setSecurityLabelSync", "Lstd/core/String;Lstd/core/String;:I", + ani_native_function { "setSecurityLabelSync", "Lstd/core/String;Lstd/core/String;:V", reinterpret_cast(SecurityLabelAni::SetSecurityLabelSync) }, }; return BindClass(env, className, methods); diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets b/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets index 93dd45ed..21af3c74 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets +++ b/interfaces/kits/js/src/mod_securitylabel/ani/ets/@ohos.file.securityLabel.ets @@ -1,24 +1,44 @@ -import { AsyncCallback, BusinessError } from '@ohos.base'; +/* + * Copyright (c) 2025 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. + */ -class BusinessErrorInner implements BusinessError { - code: number; - data?: T; - name: string = ""; - message: string = ""; - stack?: string = ""; +export default securitylabel; + +export class BusinessError { + code: number = 0; + data?: T; } -declare namespace securityLabel { - loadLibrary("ani_securitylabel_class"); - type DataLevel = 's0' | 's1' | 's2' | 's3' | 's4'; +export type AsyncCallback = (err: BusinessError, data?: T) => void; + +type DataLevel = 's0' | 's1' | 's2' | 's3' | 's4'; + +class securitylabel { + + static { + loadLibrary("ani_securitylabel_class"); + } + + static native setSecurityLabelSync(path: string, type: DataLevel): void; - export function setSecurityLabel(path: string, type: DataLevel): Promise { + static setSecurityLabel(path: string, type: DataLevel): Promise { let pvoid: Promise = new Promise((resolve: (result: undefined) => void, reject: (e: BusinessError) => void): void => { - let promise = taskpool.execute((path: string, type: DataLevel): void => setSecurityLabelSync(path, type), path, type); + let promise = taskpool.execute((path: string, type: DataLevel): void => securitylabel.setSecurityLabelSync(path, type), path, type); promise.then((ret: NullishType) => { if (ret === null || ret === undefined) { - let err = new BusinessErrorInner(); + let err = new BusinessError(); err.code = -1; reject(err); } else { @@ -29,10 +49,10 @@ declare namespace securityLabel { return pvoid; } - export function setSecurityLabel(path: string, type: DataLevel, callback: AsyncCallback): void { - let p1 = taskpool.execute((path: string, type: DataLevel): void =>setSecurityLabelSync(path, type), path, type); + static setSecurityLabel(path: string, type: DataLevel, callback: AsyncCallback): void { + let p1 = taskpool.execute((path: string, type: DataLevel): void => securitylabel.setSecurityLabelSync(path, type), path, type); p1.then((ret: NullishType) => { - let err = new BusinessErrorInner(); + let err = new BusinessError(); if (ret === null || ret === undefined) { err.code = -1 callback(err, undefined) @@ -42,24 +62,4 @@ declare namespace securityLabel { } }); } - - native function setSecurityLabelSync(path: string, type: DataLevel): void; - - native function getSecurityLabel(path: string): Promise; - - native function getSecurityLabel(path: string, callback: AsyncCallback): void; - - native function getSecurityLabelSync(path: string): string; } - -export default securityLabel; - -function main():void { - loadLibrary("ani_securitylabel_class"); - console.info("hello world") - securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s1"); - securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s2"); - securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s3"); - securityLabel.setSecurityLabel("/data/local/tmp/hello.txt", "s2"); - // console.info(`access: ${result}`) -} \ No newline at end of file diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp index fbcd2d23..91f11da8 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp +++ b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.cpp @@ -29,7 +29,7 @@ using namespace OHOS::FileManagement::ModuleFileIO; using namespace OHOS::FileManagement::ModuleSecurityLabel; void SecurityLabelAni::SetSecurityLabelSync( - ani_env *env, ani_string path, ani_string level) + ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string level) { auto [succPath, srcPath] = TypeConverter::ToUTF8String(env, path); if (!succPath) { diff --git a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h index 06380227..571e4643 100644 --- a/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h +++ b/interfaces/kits/js/src/mod_securitylabel/ani/securitylabel_ani.h @@ -26,7 +26,7 @@ namespace ANI { class SecurityLabelAni final { public: static void SetSecurityLabelSync( - ani_env *env, ani_string path, ani_string level); + ani_env *env, [[maybe_unused]] ani_class clazz, ani_string path, ani_string level); }; } // namespace ANI -- Gitee