Skip to content

Commit

Permalink
ohos init
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed Oct 6, 2024
1 parent cfa2388 commit 33d68c6
Show file tree
Hide file tree
Showing 34 changed files with 746 additions and 15 deletions.
19 changes: 8 additions & 11 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: "ba393198430278b6595976de84fe170f553cc728"
channel: "stable"
revision: 83f55c5e8f67fccb923968536b0bf457a8414d1a
channel: dev

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
- platform: macos
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
- platform: windows
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 83f55c5e8f67fccb923968536b0bf457a8414d1a
base_revision: 83f55c5e8f67fccb923968536b0bf457a8414d1a
- platform: ohos
create_revision: 83f55c5e8f67fccb923968536b0bf457a8414d1a
base_revision: 83f55c5e8f67fccb923968536b0bf457a8414d1a

# User provided section

Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"support": "Support",
"support_message": "Feedbacks and contributions are welcomed :)",
"tag": "Tag",
"task_progress": "Progress",
"task_progress": "Download progress",
"terms": "Terms of use",
"thanks": "Thank you",
"theme": "Theme",
Expand Down Expand Up @@ -225,7 +225,7 @@
"clear_old_format_file_message": "without _p0",
"login_error_message": "Incorrect account or password, or using a weak password, may cause login failure",
"translate": "translate",
"retry_seed_task": "retry seed task",
"retry_seed_task": "retry init task",
"manga_detail_page_quality":"Manga quality (Details page)",
"follow_after_star":"follow after star",
"default_title": "Default",
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/intl_en_US.arb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"support": "Support",
"support_message": "Feedbacks and contributions are welcomed :)",
"tag": "Tag",
"task_progress": "Progress",
"task_progress": "Download progress",
"terms": "Terms of use",
"thanks": "Thank you",
"theme": "Theme",
Expand Down Expand Up @@ -234,7 +234,7 @@
"clear_old_format_file_message": "without _p0",
"login_error_message": "Incorrect account or password, or using a weak password, may cause login failure",
"translate": "translate",
"retry_seed_task": "retry seed task",
"retry_seed_task": "retry init task",
"manga_detail_page_quality": "Manga quality (Details page)",
"follow_after_star": "Follow after star",
"default_title": "Default",
Expand Down
19 changes: 19 additions & 0 deletions ohos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
*.har
**/BuildProfile.ets
**/oh-package-lock.json5

**/src/main/resources/rawfile/flutter_assets/
**/libs/arm64-v8a/libapp.so
**/libs/arm64-v8a/libflutter.so
**/libs/arm64-v8a/libvmservice_snapshot.so
10 changes: 10 additions & 0 deletions ohos/AppScope/app.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"app": {
"bundleName": "com.perol.pixez_flutter",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}
8 changes: 8 additions & 0 deletions ohos/AppScope/resources/base/element/string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"string": [
{
"name": "app_name",
"value": "pixez_flutter"
}
]
}
Binary file added ohos/AppScope/resources/base/media/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions ohos/build-profile.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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.
*/

{
"app": {
"signingConfigs": [],
"products": [
{
"name": "default",
"signingConfig": "default",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS",
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
7 changes: 7 additions & 0 deletions ohos/entry/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
29 changes: 29 additions & 0 deletions ohos/entry/build-profile.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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.
*/

{
"apiType": 'stageMode',
"buildOption": {
},
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
]
}
17 changes: 17 additions & 0 deletions ohos/entry/hvigorfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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.
*/

// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { hapTasks } from '@ohos/hvigor-ohos-plugin';
26 changes: 26 additions & 0 deletions ohos/entry/oh-package.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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.
*/

{
"name": "entry",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {
},
}

24 changes: 24 additions & 0 deletions ohos/entry/src/main/ets/entryability/EntryAbility.ets
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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 { FlutterAbility, FlutterEngine } from '@ohos/flutter_ohos';
import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant';

export default class EntryAbility extends FlutterAbility {
configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
}
38 changes: 38 additions & 0 deletions ohos/entry/src/main/ets/pages/Index.ets
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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 common from '@ohos.app.ability.common';
import { FlutterPage } from '@ohos/flutter_ohos'

let storage = LocalStorage.getShared()
const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS'

@Entry(storage)
@Component
struct Index {
private context = getContext(this) as common.UIAbilityContext
@LocalStorageLink('viewId') viewId: string = "";

build() {
Column() {
FlutterPage({ viewId: this.viewId })
}
}

onBackPress(): boolean {
this.context.eventHub.emit(EVENT_BACK_PRESS)
return true
}
}
53 changes: 53 additions & 0 deletions ohos/entry/src/main/module.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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.
*/
{
"module": {
"name": "entry",
"type": "entry",
"description": "$string:module_desc",
"mainElement": "EntryAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
],
"requestPermissions": [
{"name" : "ohos.permission.INTERNET"},
]
}
}
8 changes: 8 additions & 0 deletions ohos/entry/src/main/resources/base/element/color.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}
16 changes: 16 additions & 0 deletions ohos/entry/src/main/resources/base/element/string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "pixez_flutter"
}
]
}
Binary file added ohos/entry/src/main/resources/base/media/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ohos/entry/src/main/resources/base/profile/main_pages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src": [
"pages/Index"
]
}
Loading

0 comments on commit 33d68c6

Please sign in to comment.