mirror of
https://codeberg.org/mi6e4ka/openstore.git
synced 2025-06-30 04:59:59 +00:00
Compare commits
28 commits
Author | SHA1 | Date | |
---|---|---|---|
|
29f98db4a0 | ||
|
c95e5ff1e5 | ||
|
3ec85c61e1 | ||
|
040e56a2b4 | ||
|
5196f24fae | ||
|
0acc8bd157 | ||
|
6d2ab2e473 | ||
|
034a9fc86e | ||
|
b8ba1c4ccc | ||
|
6c028b9a34 | ||
|
e1cb87c8fd | ||
|
180cf8fdfb | ||
|
d12f4470fd | ||
|
de7dacaf6e | ||
|
fd871d3d21 | ||
|
5eea16223a | ||
|
65ba1bd5f7 | ||
|
20cca0a6d1 | ||
|
0d11e61e0c | ||
|
cbe138bee9 | ||
|
c4b625d114 | ||
|
5313adcc95 | ||
|
9c79e3c304 | ||
|
915d7da79d | ||
|
b2f84afafa | ||
|
ae78eb5ebd | ||
|
857c656b51 | ||
|
deed4ddd5a |
8 changed files with 279 additions and 19 deletions
149
.forgejo/workflows/build.yaml
Normal file
149
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
name: Flutter Build (Signed APK)
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- ci-dev
|
||||||
|
tags: ["*"]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FLUTTER_PATH: "flutter" # Путь к подмодулю Flutter
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: codeberg.org/mi6e4ka/android-build-ct:latest
|
||||||
|
env:
|
||||||
|
TAR_OPTIONS: "--no-same-owner"
|
||||||
|
# defaults:
|
||||||
|
# run:
|
||||||
|
# working-directory: /home/runner/openstore
|
||||||
|
steps:
|
||||||
|
# 1. Checkout репозиторий + подмодули
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# - name: Pull flutter tags
|
||||||
|
# run: |
|
||||||
|
# cd flutter && git fetch --tags --depth=1 && cd ..
|
||||||
|
|
||||||
|
# - name: Set up JDK 21
|
||||||
|
# uses: https://github.com/actions/setup-java@v3
|
||||||
|
# with:
|
||||||
|
# java-version: "21"
|
||||||
|
# distribution: "temurin"
|
||||||
|
|
||||||
|
# - name: Cache Android SDK
|
||||||
|
# uses: actions/cache@v3
|
||||||
|
# with:
|
||||||
|
# path: |
|
||||||
|
# ~/android-sdk
|
||||||
|
# ~/.android
|
||||||
|
# key: ${{ runner.os }}-android-${{ hashFiles('android/build.gradle.kts') }}
|
||||||
|
|
||||||
|
# - name: Setup Android SDK
|
||||||
|
# uses: https://github.com/android-actions/setup-android@v3
|
||||||
|
|
||||||
|
# - name: Cache Flutter
|
||||||
|
# uses: actions/cache@v3
|
||||||
|
# with:
|
||||||
|
# path: |
|
||||||
|
# ./flutter/bin/cache
|
||||||
|
# key: ${{ runner.os }}-flutter-${{ hashFiles('.gitmodules') }}
|
||||||
|
|
||||||
|
- name: Flutter install and check
|
||||||
|
run: ./flutter/bin/flutter doctor -v
|
||||||
|
|
||||||
|
# 3. Создаем key.properties и загружаем ключ (секреты Forgejo)
|
||||||
|
#- name: Setup signing keys
|
||||||
|
# run: |
|
||||||
|
# # Создаем директорию для ключа
|
||||||
|
# mkdir -p android/app
|
||||||
|
#
|
||||||
|
# # Создаем key.properties
|
||||||
|
# echo "storePassword=${{ secrets.KEY_PASSWORD }}" > android/key.properties
|
||||||
|
# echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
|
||||||
|
# echo "keyAlias=upload" >> android/key.properties
|
||||||
|
# echo "storeFile=key.jks" >> android/key.properties
|
||||||
|
#
|
||||||
|
# # Декодируем base64-ключ (хранится в secrets.KEYSTORE_BASE64)
|
||||||
|
# echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/key.jks
|
||||||
|
|
||||||
|
# 4. Кэширование
|
||||||
|
# - name: Cache dependencies
|
||||||
|
# uses: actions/cache@v4
|
||||||
|
# with:
|
||||||
|
# path: |
|
||||||
|
# flutter/bin/cache
|
||||||
|
# .dart_tool
|
||||||
|
# key: ${{ runner.os }}-flutter-${{ hashFiles('pubspec.lock') }}
|
||||||
|
|
||||||
|
# 6. Собираем подписанный APK
|
||||||
|
|
||||||
|
# - name: Cache Build
|
||||||
|
# uses: actions/cache@v3
|
||||||
|
# with:
|
||||||
|
# path: |
|
||||||
|
# ./android/.gradle
|
||||||
|
# ~/.gradle
|
||||||
|
# key: ${{ runner.os }}-android-${{ hashFiles('android/') }}
|
||||||
|
|
||||||
|
- name: Build unsigned APK
|
||||||
|
run: |
|
||||||
|
./flutter/bin/flutter build apk --release --split-per-abi -v
|
||||||
|
|
||||||
|
- name: Sign apk
|
||||||
|
uses: https://github.com/ilharp/sign-android-release@v2
|
||||||
|
id: sign_app
|
||||||
|
with:
|
||||||
|
releaseDir: build/app/outputs/flutter-apk
|
||||||
|
signingKey: ${{ secrets.KEYSTORE_BASE64 }}
|
||||||
|
keyAlias: upload
|
||||||
|
keyStorePassword: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Print build dir
|
||||||
|
run: pwd
|
||||||
|
|
||||||
|
- name: List release files
|
||||||
|
run: ls build/app/outputs/flutter-apk
|
||||||
|
|
||||||
|
# 7. Сохраняем артефакты
|
||||||
|
- name: Upload release apk
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: app-release
|
||||||
|
path: build/app/outputs/flutter-apk/*-signed.apk
|
||||||
|
|
||||||
|
- name: Get Release ID
|
||||||
|
id: get_release
|
||||||
|
run: |
|
||||||
|
RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/$GITHUB_REF_NAME)
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -n1 | grep -o '[0-9]*')
|
||||||
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
RELEASE_ID=null
|
||||||
|
fi
|
||||||
|
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload Asset
|
||||||
|
if: steps.get_release.outputs.release_id != 'null'
|
||||||
|
run: |
|
||||||
|
curl -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
-H "Content-Type: multipart/form-data" \
|
||||||
|
-F "attachment=@build/app/outputs/flutter-apk/app-arm64-v8a-release-signed.apk" \
|
||||||
|
"${{ env.GITHUB_API_URL }}/repos/${{ env.GITHUB_REPOSITORY }}/releases/${{ steps.get_release.outputs.release_id }}/assets?name=app-arm64-v8a-release.apk"
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
-H "Content-Type: multipart/form-data" \
|
||||||
|
-F "attachment=@build/app/outputs/flutter-apk/app-armeabi-v7a-release-signed.apk" \
|
||||||
|
"${{ env.GITHUB_API_URL }}/repos/${{ env.GITHUB_REPOSITORY }}/releases/${{ steps.get_release.outputs.release_id }}/assets?name=app-armeabi-v7a-release.apk"
|
||||||
|
|
||||||
|
curl -X POST -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
-H "Content-Type: multipart/form-data" \
|
||||||
|
-F "attachment=@build/app/outputs/flutter-apk/app-x86_64-release-signed.apk" \
|
||||||
|
"${{ env.GITHUB_API_URL }}/repos/${{ env.GITHUB_REPOSITORY }}/releases/${{ steps.get_release.outputs.release_id }}/assets?name=app-x86_64-release.apk"
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "flutter"]
|
||||||
|
path = flutter
|
||||||
|
url = https://github.com/flutter/flutter.git
|
5
SAFETY.md
Normal file
5
SAFETY.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# SAFETY
|
||||||
|
|
||||||
|
> Все приложения опубликованные в RuStore проходят обязательную проверку на вирусы и опасные разрешения, в том числе предоставленные из сторонних источников. Однако, вся ответственность за установленные приложения лежит на конечном пользователе.
|
||||||
|
|
||||||
|
[Как RuStore проверяет приложения](https://www.rustore.ru/help/users/authorization/trust-rustore)
|
|
@ -17,7 +17,8 @@ if (keystorePropertiesFile.exists()) {
|
||||||
android {
|
android {
|
||||||
namespace = "dev.mi6e4ka.openstore"
|
namespace = "dev.mi6e4ka.openstore"
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = flutter.compileSdkVersion
|
||||||
ndkVersion = flutter.ndkVersion
|
// ndkVersion = flutter.ndkVersion
|
||||||
|
ndkVersion = "27.2.12479018"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
@ -40,17 +41,19 @@ android {
|
||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
create("release") {
|
create("release") {
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
keyAlias = keystoreProperties["keyAlias"] as String
|
keyAlias = keystoreProperties["keyAlias"] as String
|
||||||
keyPassword = keystoreProperties["keyPassword"] as String
|
keyPassword = keystoreProperties["keyPassword"] as String
|
||||||
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
||||||
storePassword = keystoreProperties["storePassword"] as String
|
storePassword = keystoreProperties["storePassword"] as String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig = null
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
isMinifyEnabled = true
|
||||||
signingConfig = signingConfigs.getByName("release")
|
isShrinkResources = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependenciesInfo {
|
dependenciesInfo {
|
||||||
|
|
1
flutter
Submodule
1
flutter
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit c23637390482d4cf9598c3ce3f2be31aa7332daf
|
|
@ -11,6 +11,47 @@ class AppPage extends StatefulWidget {
|
||||||
State<AppPage> createState() => _AppPageState();
|
State<AppPage> createState() => _AppPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getAndroidVersion(int apiLevel) {
|
||||||
|
const versions = {
|
||||||
|
1: '1.0',
|
||||||
|
2: '1.1',
|
||||||
|
3: '1.5',
|
||||||
|
4: '1.6',
|
||||||
|
5: '2.0',
|
||||||
|
6: '2.0.1',
|
||||||
|
7: '2.1',
|
||||||
|
8: '2.2',
|
||||||
|
9: '2.3',
|
||||||
|
10: '2.3.3',
|
||||||
|
11: '3.0',
|
||||||
|
12: '3.1',
|
||||||
|
13: '3.2',
|
||||||
|
14: '4.0',
|
||||||
|
15: '4.0.3',
|
||||||
|
16: '4.1',
|
||||||
|
17: '4.2',
|
||||||
|
18: '4.3',
|
||||||
|
19: '4.4',
|
||||||
|
20: '4.4W', // Wear-версия
|
||||||
|
21: '5.0',
|
||||||
|
22: '5.1',
|
||||||
|
23: '6.0',
|
||||||
|
24: '7.0',
|
||||||
|
25: '7.1',
|
||||||
|
26: '8.0',
|
||||||
|
27: '8.1',
|
||||||
|
28: '9.0',
|
||||||
|
29: '10',
|
||||||
|
30: '11',
|
||||||
|
31: '12',
|
||||||
|
32: '12L', // Android 12L
|
||||||
|
33: '13',
|
||||||
|
34: '14',
|
||||||
|
};
|
||||||
|
|
||||||
|
return versions[apiLevel] ?? '? (API $apiLevel)';
|
||||||
|
}
|
||||||
|
|
||||||
class _AppPageState extends State<AppPage> {
|
class _AppPageState extends State<AppPage> {
|
||||||
Map? _appInfo;
|
Map? _appInfo;
|
||||||
@override
|
@override
|
||||||
|
@ -56,6 +97,41 @@ class _AppPageState extends State<AppPage> {
|
||||||
? ListView(
|
? ListView(
|
||||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 15),
|
padding: const EdgeInsets.fromLTRB(15, 0, 15, 15),
|
||||||
children: [
|
children: [
|
||||||
|
Card(
|
||||||
|
margin: const EdgeInsets.fromLTRB(0, 0, 0, 15),
|
||||||
|
surfaceTintColor: _appInfo?["aggregatorInfo"] == null
|
||||||
|
? const Color.fromARGB(255, 0, 255, 0)
|
||||||
|
: const Color.fromARGB(255, 255, 187, 0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Row(
|
||||||
|
spacing: 16,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.security,
|
||||||
|
size: 32,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"предоставлено ${_appInfo?["aggregatorInfo"]?["source"] ?? "RuStore"}",
|
||||||
|
style: TextStyle(fontSize: 16),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
_appInfo?["aggregatorInfo"] == null
|
||||||
|
? (_appInfo?["companyLegalForm"] ==
|
||||||
|
"INDIVIDUAL"
|
||||||
|
? "разработчик - частное лицо"
|
||||||
|
: "разработчик - компания")
|
||||||
|
: "разработчик: ${_appInfo?["aggregatorInfo"]?["companyName"]}",
|
||||||
|
style: const TextStyle(fontSize: 14),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -121,8 +197,9 @@ class _AppPageState extends State<AppPage> {
|
||||||
bottomText: "Версия",
|
bottomText: "Версия",
|
||||||
),
|
),
|
||||||
_InfoCard(
|
_InfoCard(
|
||||||
topText: _appInfo?["minSdkVersion"].toString() ?? "",
|
topText:
|
||||||
bottomText: "minSdkVersion",
|
"${getAndroidVersion(_appInfo?["minSdkVersion"] ?? 0)}+",
|
||||||
|
bottomText: "Android",
|
||||||
),
|
),
|
||||||
_InfoCard(
|
_InfoCard(
|
||||||
topText:
|
topText:
|
||||||
|
|
|
@ -22,7 +22,9 @@ final _router = GoRouter(
|
||||||
path: 'instruction',
|
path: 'instruction',
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
print(state.uri.queryParameters["utm_campaign"]);
|
print(state.uri.queryParameters["utm_campaign"]);
|
||||||
return AppPage(packageName: "ru.nspk.mirpay");
|
return AppPage(
|
||||||
|
packageName: state.uri.queryParameters["utm_campaign"] ??
|
||||||
|
"ru.nspk.mirpay");
|
||||||
})
|
})
|
||||||
]),
|
]),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
@ -45,10 +47,6 @@ class MyApp extends StatelessWidget {
|
||||||
builder: (lightColorScheme, darkColorScheme) => MaterialApp.router(
|
builder: (lightColorScheme, darkColorScheme) => MaterialApp.router(
|
||||||
title: 'OpenStore',
|
title: 'OpenStore',
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
pageTransitionsTheme: const PageTransitionsTheme(builders: {
|
|
||||||
TargetPlatform.android:
|
|
||||||
PredictiveBackPageTransitionsBuilder(),
|
|
||||||
}),
|
|
||||||
colorScheme: darkColorScheme ??
|
colorScheme: darkColorScheme ??
|
||||||
ColorScheme.fromSeed(
|
ColorScheme.fromSeed(
|
||||||
seedColor: Colors.blue,
|
seedColor: Colors.blue,
|
||||||
|
@ -74,7 +72,31 @@ class HomePage extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Container(),
|
Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
onTap: () => launchUrlString(
|
||||||
|
"https://codeberg.org/mi6e4ka/openstore/src/branch/main/SAFETY.md"),
|
||||||
|
child: const Card(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Row(
|
||||||
|
spacing: 8,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.info_rounded,
|
||||||
|
size: 32,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"О безопасности приложений",
|
||||||
|
style: TextStyle(fontSize: 18),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
@ -107,7 +129,7 @@ class HomePage extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async => await launchUrlString(
|
onTap: () async => await launchUrlString(
|
||||||
"https://git.mi6e4ka.dev/mi6e4ka/openstore"),
|
"https://codeberg.org/mi6e4ka/openstore"),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
"source code",
|
"source code",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -136,7 +158,7 @@ class HomePage extends StatelessWidget {
|
||||||
: Container(),
|
: Container(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Text("v1.2.1")
|
const Text("v1.3.1")
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.2.1+2
|
version: 1.3.1+4
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.4.3 <4.0.0"
|
sdk: ">=3.4.3 <4.0.0"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue