From 3e28dc4729cea5f89ec55ba324fcc7448121e45e Mon Sep 17 00:00:00 2001 From: Vitaliy Zarubin Date: Mon, 5 Jun 2023 10:00:54 +0300 Subject: [PATCH] [init] Add base data, scripts --- .gitignore | 2 + AUTHORS.md | 7 ++ CODE_OF_CONDUCT.md | 83 ++++++++++++++++++ CONTRIBUTING.md | 169 ++++++++++++++++++++++++++++++++++++ LICENSE.BSD-3-CLAUSE.md | 30 +++++++ README.md | 17 ++++ script/build_example.sh | 96 ++++++++++++++++++++ script/vscode_properties.sh | 64 ++++++++++++++ 8 files changed, 468 insertions(+) create mode 100644 .gitignore create mode 100644 AUTHORS.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.BSD-3-CLAUSE.md create mode 100644 README.md create mode 100755 script/build_example.sh create mode 100755 script/vscode_properties.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2c8c65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.idea/ +/.vscode/ \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..12fa48c --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,7 @@ +# Authors + +* Denis Glazkov, + * Product owner, 2023 + * Maintainer, 2023 + +* Vitaliy Zarubin, diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f98331d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,83 @@ +# Code of Conduct + +## What is this code of conduct for? + +Code of conduct is a current set of rules of the Open Mobile Platform +which informs you how we expect +the members of the Open Mobile Platform community +will interact while contributing and communicating. +We are committed to providing a friendly, safe and welcoming +environment for all, regardless of gender, gender identity and expression, +sexual orientation, ability, physical appearance, body size, race, age, +socioeconomic status, religion (or lack thereof), +or other marginalized aspect of community members. +We expect all members of the Open Mobile Platform community +to abide by this Code of Conduct whenever interacting +in Open Mobile Platform venues +(merge requests, pull requests, issues, 1-1 or group chat, meetups, conferences, etc.) + +## Examples of appropriate behavior + +* Using welcoming and inclusive language. +* Being respectful of differing viewpoints and experiences. +* Gracefully accepting constructive criticism. +* Focusing on what is best for the community. +* Showing empathy towards other community members. + +## Examples of inappropriate behavior + +Because we come from a variety of backgrounds, +we do not want to assume that everyone has the same assumptions +about what is and is not appropriate. +Here are some examples of inappropriate behavior +that are incompatible with our community's ethos: + +* spamming, trolling, intentionally disrupting conversations, + or irrelevant solicitation or advertisement; +* making demeaning or discriminatory comments; +* making negative assumptions about someone's background, + abilities, or intentions; +* harassing or stalking individuals (online or in person). + +In general: treat others how you would like to be treated, +were you in their place. +Do ask questions. +Do keep conflicts productively focused on technical issues. +Do remember that we are all people, not robots, +and all equally deserving of sensitivity and respect. + +## What will organizers do about inappropriate behavior? + +If we notice you doing or saying something inappropriate, +an organizer will ask you to stop. +We will not demonize you. +But please do stop the inappropriate behavior +so we can get back to writing and discussing code in a safe environment. +If you have philosophical disagreements about what is actually inappropriate, +please take them to a separate public or private conversation +with an Open Mobile Platform maintainer +so we don't turn pull requests into an ethics debate. +If you keep doing unacceptable things, +we will likely ban you, report you to the administration, +or take other appropriate action. + +## What if I see or am subject to what feels like inappropriate behavior? + +Let us know. +Please notify a community organizer as soon as possible. +Full contact information is listed in the Contact Info section of this document. +All communications will be kept strictly confidential, +unless otherwise required by law. +No issue will be considered too inconsequential or unimportant for us +to have a conversation about. + +## Contact Info + +If you need to report an incident, +please contact . + +This work is licensed under a Creative Commons Attribution 3.0 Unported License +For attribution requirements: +«Open Mobile Platform Code of Conduct» +Copyright (c) 2021 Open Mobile Platform LLC, +used under a [Creative Commons Attribution Unported license](http://creativecommons.org/licenses/by/3.0/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..5fc75b6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,169 @@ +# Contributor License Agreements + +Thank you for your interest in contributing +to software projects managed by Open Mobile Platform («We» or «Us»). +This contributor agreement («Agreement») +documents the rights granted by contributors to Us. +To make this document effective, +please sign it and send it to Us by email or electronic submission. +This is a legally binding document, +so please read it carefully before agreeing to it. +The Agreement may cover more than one software project managed by Us. + +## 1. Definitions + +**«We» or «Us»** means Open Mobile Platform Limited Liability Company +(Open Mobile Platform LLC), +420500, Republic of Tatarstan, Verkhneuslonsky District, +Innopolis, Universitetskaya Street, h. 7, office 59, +OGRN (Primary State Registration Number) 1161690087020. + +**«You»** means the individual who Submits a Contribution to Us. + +**«Contribution»** means any work of authorship +that is Submitted by You to Us +in which You own or assert ownership of the Copyright. + +**«Copyright»** means all rights protecting works of authorship +owned or controlled by You, +including copyright, moral and neighboring rights, as appropriate, +for the full term of their existence including any extensions by You. + +**«Material»** means the work of authorship +which is made available by Us to third parties. +When this Agreement covers more than one software project, +the Material means the work of authorship +to which the Contribution was Submitted. +After You Submit the Contribution, +it may be included in the Material. + +**«Submit»** means any form of electronic, verbal, or written communication +sent to Us or our representatives, +including but not limited to electronic mailing lists, +source code control systems, and issue tracking systems +that are managed by, or on behalf of, Us +for the purpose of discussing and improving the Material, +but excluding communication that is conspicuously marked +or otherwise designated in writing by You as «Not a Contribution». + +**«Submission Date»** means the date +on which You Submit a Contribution to Us. + +**«Effective Date»** means the date You execute this Agreement +or the date You first Submit a Contribution to Us, +whichever is earlier. + +**«Media»** means any portion of a Contribution which is not software. + +## 2. Grant of Rights + +### 2.1. Copyright License + +(a) You retain ownership of the Copyright in Your Contribution +and have the same rights to use or license the Contribution +which You would have had without entering into the Agreement. + +(b) To the maximum extent permitted by the relevant law, +You grant to Us a perpetual, worldwide, non-exclusive, +transferable, royalty-free, irrevocable license +under the Copyright covering the Contribution, +with the right to sublicense +such rights through multiple tiers of sublicensees, +to reproduce, modify, display, perform and distribute +the Contribution as part of the Material; +provided that this license is conditioned upon compliance with Section 2.3. + +### 2.2. Patent License + +For patent claims including, without limitation, +method, process, and apparatus claims +which You own, control or have the right to grant, now or in the future, +You grant to Us a perpetual, worldwide, non-exclusive, +transferable, royalty-free, irrevocable patent license, +with the right to sublicense these rights to multiple tiers of sublicensees, +to make, have made, use, sell, offer for sale, import +and otherwise transfer the Contribution +and the Contribution in combination with the Material +(and portions of such combination). +This license is granted only to the extent +that the exercise of the licensed rights infringes such patent claims; +and provided that this license is conditioned upon compliance with Section 2.3. + +### 2.3. Outbound License + +Based on the grant of rights in Sections 2.1 and 2.2, +if We include Your Contribution in a Material, +We may license the Contribution under any license, +including copyleft, permissive, commercial, or proprietary licenses. +As a condition on the exercise of this right, +We agree to also license the Contribution +under the terms of the license or licenses +which We are using for the Material on the Submission Date. + +### 2.4. Our Rights + +You acknowledge that We are not obligated +to use Your Contribution as part of the Material +and may decide to include any Contribution We consider appropriate. + +## 3. Agreement + +You confirm that: + +(a) You have the legal authority to enter into this Agreement. + +(b) You own the Copyright and patent claims +covering the Contribution which are required +to grant the rights under Section 2. + +(c) The grant of rights under Section 2 +does not violate any grant of rights +which You have made to third parties, including Your employer. +If You are an employee, +You have had Your employer approve this Agreement +or sign the Entity version of this document. +If You are less than eighteen years old, +please have Your parents or guardian sign the Agreement. + +## 4. Disclaimer + +EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, +THE CONTRIBUTION IS PROVIDED «AS IS». +MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES +INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE +AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. +TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, +SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW. + +## 5. Miscellaneous + +5.1. This Agreement will be governed by and construed +in accordance with the laws of Russian Federation. + +5.2. This Agreement sets out the entire agreement between You +and Us for Your Contributions to Us +and overrides all other agreements or understandings. + +5.3. If You or We assign the rights or obligations +received through this Agreement to a third party, +as a condition of the assignment, +that third party must agree in writing +to abide by all the rights and obligations in the Agreement. + +5.4. The failure of either party to require performance +by the other party of any provision of this Agreement in one situation +shall not affect the right of a party +to require such performance at any time in the future. +A waiver of performance under a provision in one situation +shall not be considered a waiver of the performance +of the provision in the future or a waiver of the provision in its entirety. + +5.5. If any provision of this Agreement is found void and unenforceable, +such provision will be replaced to the extent possible with a provision +that comes closest to the meaning of the original provision +and which is enforceable. +The terms and conditions set forth in this Agreement +shall apply notwithstanding any failure of essential purpose +of this Agreement or any limited remedy +to the maximum extent possible under law. diff --git a/LICENSE.BSD-3-CLAUSE.md b/LICENSE.BSD-3-CLAUSE.md new file mode 100644 index 0000000..f040be6 --- /dev/null +++ b/LICENSE.BSD-3-CLAUSE.md @@ -0,0 +1,30 @@ +# The 3-Clause BSD License + +_Copyright (C) 2022 ru.auroraos_ + +Redistribution and use in source and binary forms, +with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain + the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce + the above copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1c10629 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Flutter Packages Aurora OS + +This repo is a companion repo to the main flutter repo. +It contains the source code for Aurora Flutter's packages (i.e., packages developed by the Aurora team). + +# Packages: + +* [battery_plus](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/battery_plus/battery_plus_aurora) - The Aurora implementation of [battery_plus](https://pub.dev/packages/battery_plus). +* [device_info_plus](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/device_info_plus/device_info_plus_aurora) - The Aurora implementation of [device_info_plus](https://pub.dev/packages/device_info_plus). +* [flutter_local_notifications](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/flutter_local_notifications/flutter_local_notifications_aurora) - The Aurora implementation of [flutter_local_notifications](https://pub.dev/packages/flutter_local_notifications). +* [flutter_secure_storage](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/flutter_secure_storage/flutter_secure_storage_aurora) - The Aurora implementation of [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage). +* [package_info_plus](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/package_info_plus/package_info_plus_aurora) - The Aurora implementation of [package_info_plus](https://pub.dev/packages/package_info_plus). +* [path_provider](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/path_provider/path_provider_aurora) - The Aurora implementation of [path_provider](https://pub.dev/packages/path_provider). +* [shared_preferences](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/shared_preferences/shared_preferences_aurora) - The Aurora implementation of [shared_preferences](https://pub.dev/packages/shared_preferences). +* [sqflite](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/sqflite/sqflite_aurora) - The Aurora OS implementation of [sqflite](https://pub.dev/packages/sqflite). +* [wakelock](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/wakelock/wakelock_aurora) - The Aurora OS implementation of [wakelock](https://pub.dev/packages/wakelock). +* [xdga_directories](https://os-git.omprussia.ru/non-oss/flutter/flutter-plugins/-/tree/dev/packages/xdga_directories) - A Dart package for reading directory path on Aurora OS. diff --git a/script/build_example.sh b/script/build_example.sh new file mode 100755 index 0000000..27a835c --- /dev/null +++ b/script/build_example.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +## Build example, sign rpm, upload/install/run rpm to device + +## Usage +## +## chmod +x ./build_example.sh +## +## ./build_example.sh \ +## -p xdga_directories \ +## -d : \ +## -s /home/user/sign/system_keys + +## Flatter path +# FLATTER="$HOME/.local/opt/flutter-sdk/bin/flutter" + +## https://developer.auroraos.ru/doc/software_development/psdk/setup +## Install Platform SDK path +## You may not have set the PSDK_DIR environment variable. +## export PSDK_DIR=$HOME/AuroraPlatformSDK/sdks/aurora_psdk + +while getopts p:d:s: flag; do + case "${flag}" in + p) package=${OPTARG} ;; + d) device=${OPTARG} ;; + s) sign=${OPTARG} ;; + *) + echo "usage: $0 [-p] [-d] [-s]" >&2 + exit 1 + ;; + esac +done + +if [ -z "$package" ]; then + echo "Specify a build package" + exit +else + cd "../packages/$package" 2>/dev/null || eval 'echo "Package \"$package\" not found." && exit' + ## Update dependency + $FLATTER pub get + ## Run ffigen if has + $FLATTER pub run ffigen --config ffigen.yaml 2>/dev/null + ## Open example dir + cd "example" || exit + ## Build aurora example app + { + $FLATTER build aurora --release + } || { + exit 1; + } +fi + +if [ -n "$sign" ]; then + + key=$(ls "$sign"/*key.pem) + + if [ -z "$key" ]; then + echo "Key *key.pem not found." + exit + fi + + cert=$(ls "$sign"/*cert.pem) + + if [ -z "$cert" ]; then + echo "Key *cert.pem not found." + exit + fi + + ## Sign rpm system key + "$PSDK_DIR"/sdk-chroot rpmsign-external sign \ + --key "$key" \ + --cert "$cert" \ + build/aurora/arm/release/RPMS/*.rpm +fi + +if [ -n "$device" ]; then + + IFS=':' read -ra ADDR <<< "$device" + IFS='/' read -ra ADDP <<< "$package" + + D_IP="${ADDR[0]}" + D_PASS="${ADDR[1]}" + APP_KEY="${ADDP[-1]}" + + # shellcheck disable=SC2012 + rpm=$(ls "$PWD"/build/aurora/arm/release/RPMS/*.rpm | sort -r | head -n 1) + + # upload rpm + scp "$rpm" defaultuser@"$D_IP:/home/defaultuser/Downloads" + + # install rpm + ssh -t defaultuser@$D_IP "echo $D_PASS | devel-su pkcon -y install-local /home/defaultuser/Downloads/*$APP_KEY*.rpm" + + # run application + ssh -t defaultuser@$D_IP "/usr/bin/com.example.${APP_KEY}_example" +fi diff --git a/script/vscode_properties.sh b/script/vscode_properties.sh new file mode 100755 index 0000000..8211e26 --- /dev/null +++ b/script/vscode_properties.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +## Script create c_cpp_properties.json with dependencies for flutter aurora + +## Usage +## +## chmod +x ./vscode_properties.sh +## ./vscode_properties.sh + +## https://developer.auroraos.ru/doc/software_development/psdk/setup +## Install Platform SDK path +## You may not have set the PSDK_DIR environment variable. +## export PSDK_DIR=$HOME/AuroraPlatformSDK/sdks/aurora_psdk + +cd ../ + +## check file +[ -f .vscode/c_cpp_properties.json ] && { echo "File c_cpp_properties.json already exist!"; exit; } + +## find target +TARGET=$($PSDK_DIR/sdk-chroot sdk-assistant list | grep armv | grep default | sed 's/^.*A/A/g' | sed 's/\s.*//g') + +## mkdir .vscode if not exist +[ -d .vscode ] || mkdir .vscode + +## find targets path +TARGETS_PATH=$(cd "$PSDK_DIR/../../" && pwd)/targets + +## save file +tee -a .vscode/c_cpp_properties.json << END +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "\${workspaceFolder}/**", + "$TARGETS_PATH/$TARGET/usr/include", + "$TARGETS_PATH/$TARGET/usr/include/dconf", + "$TARGETS_PATH/$TARGET/usr/include/flutter-embedder", + "$TARGETS_PATH/$TARGET/usr/include/maliit", + "$TARGETS_PATH/$TARGET/usr/include/appmanifest-cpp", + "$TARGETS_PATH/$TARGET/usr/include/glib-2.0", + "$TARGETS_PATH/$TARGET/usr/lib/glib-2.0/include", + "$TARGETS_PATH/$TARGET/usr/include/sailfishapp", + "$TARGETS_PATH/$TARGET/usr/include/qt5", + "$TARGETS_PATH/$TARGET/usr/include/qt5/QtConcurrent", + "$TARGETS_PATH/$TARGET/usr/include/qt5/QtCore", + "$TARGETS_PATH/$TARGET/usr/include/qt5/QtDBus", + "$TARGETS_PATH/$TARGET/usr/include/qt5/QtGui", + "$TARGETS_PATH/$TARGET/usr/include/qt5/QtMultimedia", + "$TARGETS_PATH/$TARGET/usr/include/qt5/QtQuick" + ], + "defines": [ + "__ARM_PCS_VFP" + ], + "compilerPath": "/usr/bin/g++", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "clang-x64" + } + ], + "version": 4 +} +END