diff --git a/build-profile.json5 b/build-profile.json5 index 5653ed880ca12edab4854bd5b6e19f022051ee6a..b62ce2868636905ec0a7c6a6e90d327d317a4eaa 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,6 +1,8 @@ +// [Start lock] { "app": { - "signingConfigs": [], + "signingConfigs": [ + ], "products": [ { "name": "official", @@ -85,4 +87,5 @@ ] } ] -} \ No newline at end of file +} +// [End lock] \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index fb20b581509887918d9ba3a24cc15d0381bb7475..e4e1a33aaa63382e38435e6b02fb4b8babd92e92 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -9,14 +9,13 @@ "obfuscation": { "ruleOptions": { "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] + "files": [] } } } }, ], + // [Start targets] "targets": [ { "name": "official", @@ -52,5 +51,6 @@ ] } }, - ] + ], + // [End targets] } \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index e13a98bb3e0c5a0f24840857e7a272869d8ed302..7db78edd13758206126b42268d73649f192ad3bc 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -13,6 +13,7 @@ * limitations under the License. */ import { MainPage } from 'myhar' +// [Start main_page] import { getName, getTitleName } from 'entry/VersionInfo' @Entry @@ -36,6 +37,7 @@ struct Index { .height(19) .margin({ top: 2 }) } + // [StartExclude main_page] .height(78) .width('100%') .alignItems(HorizontalAlign.Start) @@ -51,10 +53,14 @@ struct Index { .backgroundColor('#F1F3F5') } .layoutWeight(1) + // [EndExclude main_page] } + // [StartExclude main_page] .width('100%') .height('100%') .backgroundColor('#F1F3F5') .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) + // [EndExclude main_page] } -} \ No newline at end of file +} +// [End main_page] \ No newline at end of file diff --git a/entry/src/official_pages/VersionInfo.ets b/entry/src/official_pages/VersionInfo.ets index ffbd127da422fcb1657aec5de867642ea4630341..38bd207fa3fa2948f2a0fa1833ba09bcd3d62b58 100644 --- a/entry/src/official_pages/VersionInfo.ets +++ b/entry/src/official_pages/VersionInfo.ets @@ -12,5 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start getName] export const getName = () => "This is official version." -export const getTitleName = () => $r('app.string.title') \ No newline at end of file +export const getTitleName = () => $r('app.string.title') +// [End getName] \ No newline at end of file diff --git a/entry/src/test_pages/VersionInfo.ets b/entry/src/test_pages/VersionInfo.ets index c38a68b517274e806b6d1983df7b6880da2cfbce..3796036af6db2272ffe02b6e6ed7c1837878a4b4 100644 --- a/entry/src/test_pages/VersionInfo.ets +++ b/entry/src/test_pages/VersionInfo.ets @@ -12,5 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start test] export const getName = () => "This is test version." -export const getTitleName = () => $r('app.string.title') \ No newline at end of file +export const getTitleName = () => $r('app.string.title') +// [End test] \ No newline at end of file diff --git a/myhar/build-profile.json5 b/myhar/build-profile.json5 index 95a23bdfb828ff83c348b8e504c419ad0d90b257..1b5693a7678672496b7a441c12a0e778ceb76269 100644 --- a/myhar/build-profile.json5 +++ b/myhar/build-profile.json5 @@ -7,9 +7,7 @@ "obfuscation": { "ruleOptions": { "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] + "files": [] }, "consumerFiles": [ "./consumer-rules.txt" @@ -18,6 +16,7 @@ }, }, ], + // [Start official] "targets": [ { "name": "official", @@ -80,5 +79,6 @@ ] } } - ] + ], + // [End official] } diff --git a/myhar/src/main/ets/components/MainPage.ets b/myhar/src/main/ets/components/MainPage.ets index 4fed1c1172b5e4f9044de664ea328a55b0300d25..ef759ba8fefe46e6feff89ee0ac724b447049e59 100644 --- a/myhar/src/main/ets/components/MainPage.ets +++ b/myhar/src/main/ets/components/MainPage.ets @@ -12,12 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// [Start import] import BuildProfile from '../../../../BuildProfile'; import { OfficialSecond } from '../../../official_pages/OfficialSecondPage'; import { TestSecond } from '../../../test_pages/TestSecondPage'; +// [End import] @Component export struct MainPage { + // [Start page_Info] @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); @Builder @@ -28,11 +31,13 @@ export struct MainPage { TestSecond(); } } + // [End page_Info] build() { Navigation(this.pageInfos) { Row() { Column() { + // [Start text_Area] TextArea({ text: $r('app.string.title_description') }) .fontSize(16) .width('100%') @@ -44,7 +49,9 @@ export struct MainPage { .width('100%') .borderRadius(12) .padding({ top: 16 }) + // [End text_Area] Blank() + // [Start btn] Button($r('app.string.button_describe')) .fontSize(16) .height(40) @@ -52,6 +59,7 @@ export struct MainPage { .onClick(() => { this.pageInfos.pushPath({ name: BuildProfile.productName }); }) + // [End btn] } .width('100%') .height('100%') diff --git a/myhar/src/official_pages/OfficialSecondPage.ets b/myhar/src/official_pages/OfficialSecondPage.ets index c5b9e430a6fa76448ddb7d1cc52561cfbc732971..174f3eef2cdec65e70aede62a09bb291559813bf 100644 --- a/myhar/src/official_pages/OfficialSecondPage.ets +++ b/myhar/src/official_pages/OfficialSecondPage.ets @@ -30,7 +30,7 @@ export struct OfficialSecond { } customToast(str: ResourceStr) { - promptAction.showToast({ message: str, duration: 2000, bottom: '80vp' }) + this.getUIContext().getPromptAction().showToast({ message: str, duration: 2000, bottom: '80vp' }); } build() { diff --git a/myhar/src/test_pages/TestSecondPage.ets b/myhar/src/test_pages/TestSecondPage.ets index f6d492bed7a11cf44585713ae87a02806474c2fa..789e5ad2b6483326d9b84754a2b9fe97424ebf2d 100644 --- a/myhar/src/test_pages/TestSecondPage.ets +++ b/myhar/src/test_pages/TestSecondPage.ets @@ -44,7 +44,7 @@ export struct TestSecond { } customToast(str: ResourceStr) { - promptAction.showToast({ message: str, duration: 2000, bottom: '80vp' }) + this.getUIContext().getPromptAction().showToast({ message: str, duration: 2000, bottom: '80vp' }); } build() {