From e009742619ddb5d5745f8d2506728cbae6ee782d Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Mon, 16 Jun 2025 14:48:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liveviewlockscreenlibrary/build-profile.json5 | 2 +- liveviewlockscreensample/build-profile.json5 | 3 --- liveviewlockscreensample/obfuscation-rules.txt | 1 + liveviewlockscreensample/oh-package-lock.json5 | 3 ++- liveviewlockscreensample/src/main/module.json5 | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/liveviewlockscreenlibrary/build-profile.json5 b/liveviewlockscreenlibrary/build-profile.json5 index cda3307..312d38e 100644 --- a/liveviewlockscreenlibrary/build-profile.json5 +++ b/liveviewlockscreenlibrary/build-profile.json5 @@ -8,7 +8,7 @@ "arkOptions": { "obfuscation": { "ruleOptions": { - "enable": false, + "enable": true, "files": [ "./obfuscation-rules.txt" ] diff --git a/liveviewlockscreensample/build-profile.json5 b/liveviewlockscreensample/build-profile.json5 index b695582..808380f 100644 --- a/liveviewlockscreensample/build-profile.json5 +++ b/liveviewlockscreensample/build-profile.json5 @@ -20,9 +20,6 @@ "targets": [ { "name": "default" - }, - { - "name": "ohosTest", } ] } \ No newline at end of file diff --git a/liveviewlockscreensample/obfuscation-rules.txt b/liveviewlockscreensample/obfuscation-rules.txt index 46686c4..272efb6 100644 --- a/liveviewlockscreensample/obfuscation-rules.txt +++ b/liveviewlockscreensample/obfuscation-rules.txt @@ -19,4 +19,5 @@ -enable-property-obfuscation -enable-toplevel-obfuscation +-enable-filename-obfuscation -enable-export-obfuscation \ No newline at end of file diff --git a/liveviewlockscreensample/oh-package-lock.json5 b/liveviewlockscreensample/oh-package-lock.json5 index 3142a4d..0246ee2 100644 --- a/liveviewlockscreensample/oh-package-lock.json5 +++ b/liveviewlockscreensample/oh-package-lock.json5 @@ -1,6 +1,7 @@ { "meta": { - "stableOrder": true + "stableOrder": true, + "enableUnifiedLockfile": false }, "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", diff --git a/liveviewlockscreensample/src/main/module.json5 b/liveviewlockscreensample/src/main/module.json5 index ff9557d..325564c 100644 --- a/liveviewlockscreensample/src/main/module.json5 +++ b/liveviewlockscreensample/src/main/module.json5 @@ -21,7 +21,7 @@ "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", - "exported": true, + "exported": false, "backgroundModes": [ 'location' ], -- Gitee From 348be7b6e68afcdee8ff7186381b8069b7ff7543 Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Mon, 16 Jun 2025 16:22:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/liveview/LockScreenPage.ets | 3 --- .../src/main/ets/utils/LiveView.ets | 17 ----------------- .../src/main/ets/utils/LiveViewUtil.ets | 7 ------- liveviewlockscreensample/src/main/module.json5 | 4 ---- 4 files changed, 31 deletions(-) diff --git a/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets b/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets index 702675d..a160027 100644 --- a/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets +++ b/liveviewlockscreenlibrary/src/main/ets/liveview/LockScreenPage.ets @@ -22,7 +22,6 @@ let storage: LocalStorage = LocalStorage.getShared(); @Entry(storage) @Component export struct LockScreenPage { - // [Start layoutBasedOnVerticalBreakpoint] @StorageLink('currentHeightBreakpoint') currentHeightBreakpoint: string = BreakpointTypeEnum.SM; @LocalStorageProp('laneData') roadInfo: LaneData | undefined = undefined; @@ -42,6 +41,4 @@ export struct LockScreenPage { .width('100%') .height('100%') } - - // [End layoutBasedOnVerticalBreakpoint] } \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets index 71759a2..cc8fc39 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveView.ets @@ -14,12 +14,8 @@ */ import { appManager, WantAgent, wantAgent } from '@kit.AbilityKit'; -// [Start startContinuousRunningTask] import { backgroundTaskManager } from '@kit.BackgroundTasksKit'; -// [StartExclude startContinuousRunningTask] -// [Start pushCommonEvent] import { BusinessError, commonEventManager } from '@kit.BasicServicesKit'; -// [StartExclude pushCommonEvent] import { hilog } from '@kit.PerformanceAnalysisKit'; import { RouteData } from '../model/RouteDataModel'; import { LiveViewUtil } from './LiveViewUtil'; @@ -54,7 +50,6 @@ export class LiveView { // Initialize live view and start background tasks this.liveViewController.startLiveView(getRouteData()).then(() => { this.startContinuousRunningTask(); - // [Start getRunningProcessInfo] // Set up periodic state checking this.updateInterval = setInterval(() => { // Monitor application state changes @@ -62,10 +57,8 @@ export class LiveView { hilog.info(0x0000, TAG, '%{public}s', 'Success to getRunningProcessInformation'); // Handle background state if (data[0].state === appManager.ProcessState.STATE_BACKGROUND) { - // [StartExclude getRunningProcessInfo] let routeInfo: RouteData = getRouteData(); this.liveViewController.updateLiveView(routeInfo); - // [EndExclude pushCommonEvent] // Prepare common event data let options: commonEventManager.CommonEventPublishData = { data: 'data', @@ -83,33 +76,27 @@ export class LiveView { hilog.info(0x0000, TAG, '%{public}s', 'Succeeded in publishing commonEvent.') } }); - // [End pushCommonEvent] - // [EndExclude getRunningProcessInfo] } }).catch((error: BusinessError) => { hilog.error(0x0000, TAG, '%{public}s', `Failed to getRunningProcessInformation. code is ${error.code} message is ${error.message}`); }); }, 2000) - // [End getRunningProcessInfo] }) } // Cleanup method to stop all live view activities public finishLiveView() { - // [Start clearPeriodicUpdates] // Clear periodic updates if (this.updateInterval !== undefined) { clearInterval(this.updateInterval); this.updateInterval = undefined; hilog.info(0x0000, TAG, '%{public}s', 'Timer has been cleared'); } - // [End clearPeriodicUpdates] // Shutdown live view components this.liveViewController.closeLiveView(); - // [Start stopBackgroundRunning] // Stop background tasks try { backgroundTaskManager.stopBackgroundRunning(this.context).then(() => { @@ -122,10 +109,8 @@ export class LiveView { hilog.error(0x0000, TAG, '%{public}s', `Operation stopBackgroundRunning failed. code is ${(error as BusinessError).code} message is ${(error as BusinessError).message}`); } - // [End stopBackgroundRunning] } - // [EndExclude startContinuousRunningTask] // Internal method to manage background tasks private startContinuousRunningTask() { // Configure WantAgent for background operation @@ -165,6 +150,4 @@ export class LiveView { `Failed to Operation getWantAgent. code is ${(error as BusinessError).code} message is ${(error as BusinessError).message}`); } } - - // [End startContinuousRunningTask] } \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets index a76b662..e860c88 100644 --- a/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets +++ b/liveviewlockscreenlibrary/src/main/ets/utils/LiveViewUtil.ets @@ -15,9 +15,7 @@ import { application, Want, wantAgent } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; -// [Start createLiveView] import { liveViewManager } from '@kit.LiveViewKit'; -// [StartExclude createLiveView] import { hilog } from '@kit.PerformanceAnalysisKit'; import { RouteData } from '../model/RouteDataModel'; @@ -60,7 +58,6 @@ export class LiveViewUtil { } } - // [Start closeLiveView] // Close live view. public async closeLiveView() { // Ensure that the sequence is greater than the current live window page. @@ -77,8 +74,6 @@ export class LiveViewUtil { return; } - // [End closeLiveView] - private static async isLiveViewEnabled(): Promise { return await liveViewManager.isLiveViewEnabled(); } @@ -120,7 +115,6 @@ export class LiveViewUtil { } private async createPrimaryLiveVie(): Promise { - // [EndExclude createLiveView] // Construct live window request body. let liveView: liveViewManager.LiveView = { id: 0, @@ -148,7 +142,6 @@ export class LiveViewUtil { } } }; - // [End createLiveView] return liveView; } diff --git a/liveviewlockscreensample/src/main/module.json5 b/liveviewlockscreensample/src/main/module.json5 index 325564c..aa80929 100644 --- a/liveviewlockscreensample/src/main/module.json5 +++ b/liveviewlockscreensample/src/main/module.json5 @@ -37,7 +37,6 @@ ] } ], - // [Start addLiveViewLockScreenExtensionAbilityName] "extensionAbilities": [ { // Keep it consistent with LiveViewLockScreenExtensionAbility name in live view instance @@ -48,8 +47,6 @@ "exported": false } ], - // [End addLiveViewLockScreenExtensionAbilityName] - // [Start requestPermissions] "requestPermissions": [ { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", @@ -62,6 +59,5 @@ } }, ], - // [End requestPermissions] } } \ No newline at end of file -- Gitee From 13555b95583eb709e08b29786e5c0c6834f138d8 Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Mon, 16 Jun 2025 17:36:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/pages/LiveViewLockScreenPage.ets | 2 +- .../src/main/resources/base/element/string.json | 4 ---- .../src/main/resources/en_US/element/string.json | 4 ---- .../src/main/resources/zh_CN/element/string.json | 4 ---- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets b/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets index 511d614..4b33d94 100644 --- a/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets +++ b/liveviewlockscreenlibrary/src/main/ets/pages/LiveViewLockScreenPage.ets @@ -107,4 +107,4 @@ export struct LiveViewLockScreenPage { .width('100%') .height('100%') } -} +} \ No newline at end of file diff --git a/liveviewlockscreenlibrary/src/main/resources/base/element/string.json b/liveviewlockscreenlibrary/src/main/resources/base/element/string.json index 056f708..46b8d3a 100644 --- a/liveviewlockscreenlibrary/src/main/resources/base/element/string.json +++ b/liveviewlockscreenlibrary/src/main/resources/base/element/string.json @@ -72,10 +72,6 @@ "name": "then", "value": "然后" }, - { - "name": "toast", - "value": "提醒:锁屏沉浸实况窗须申请相关权限才可体验" - }, { "name": "Continue", "value": "继续导航" diff --git a/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json b/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json index 2e470b4..a12041f 100644 --- a/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json +++ b/liveviewlockscreenlibrary/src/main/resources/en_US/element/string.json @@ -72,10 +72,6 @@ "name": "then", "value": "Then" }, - { - "name": "toast", - "value": "Tip: You must apply for relevant permissions to experience the lock screen live view." - }, { "name": "Continue", "value": "Continue" diff --git a/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json b/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json index 056f708..46b8d3a 100644 --- a/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json +++ b/liveviewlockscreenlibrary/src/main/resources/zh_CN/element/string.json @@ -72,10 +72,6 @@ "name": "then", "value": "然后" }, - { - "name": "toast", - "value": "提醒:锁屏沉浸实况窗须申请相关权限才可体验" - }, { "name": "Continue", "value": "继续导航" -- Gitee From 33c25a5c19f8df210d6acc320ec98bc0ad2df929 Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Mon, 16 Jun 2025 17:43:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liveviewlockscreensample/src/main/module.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liveviewlockscreensample/src/main/module.json5 b/liveviewlockscreensample/src/main/module.json5 index aa80929..fca9f25 100644 --- a/liveviewlockscreensample/src/main/module.json5 +++ b/liveviewlockscreensample/src/main/module.json5 @@ -1,7 +1,7 @@ { "module": { "name": "liveviewlockscreensample", - "type": "entry", + "type": "feature", "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ -- Gitee