Skip to content

Commit

Permalink
Merge branch 'master' into create-a-pkpass
Browse files Browse the repository at this point in the history
  • Loading branch information
ueman committed Aug 29, 2024
2 parents d2f311c + 3bab9c9 commit 3cff433
Show file tree
Hide file tree
Showing 59 changed files with 1,454 additions and 555 deletions.
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/app_bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 🐞 Bug Report
description: Describe the problem
labels: ["bug", "package: app"]
body:
- type: input
id: version
attributes:
label: Version
description: Which version of the App do you use?
placeholder: 1.2.3 ← should look like this
validations:
required: true

- type: textarea
id: repro
attributes:
label: Steps to Reproduce
description: How can we see what you're seeing? Specific is terrific.
placeholder: |-
1. foo
2. bar
3. baz
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Result
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Result
description: Logs? Screenshots? Yes, please.
validations:
required: true

- type: textarea
id: passkit_file
attributes:
label: Upload ".pkpass" or ".pkpasses" file
description: If possible & relevant, please attach the non-working file. Change the file extension to zip and drop it into this field.
validations:
required: false
36 changes: 15 additions & 21 deletions .github/workflows/build_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,22 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: app/pubspec.yaml # path to pubspec.yaml
# write key.properties
#- run: echo "$KEY_PROPERTIES" > android/key.properties
# env:
# KEY_PROPERTIES: ${{ secrets.key_properties }}
# write key.keystore
#- run: mkdir android/key
#- run: echo "$KEY_KEYSTORE" | base64 --decode > android/key/key.keystore
# env:
# KEY_KEYSTORE: ${{ secrets.key_keystore }}
flutter-version-file: app/pubspec.yaml
- run: flutter pub get
- run: flutter analyze .
#- run: flutter build apk --build-number $GITHUB_RUN_NUMBER
- run: flutter build apk --build-number ${{ inputs.buildNumber }} --build-name ${{ inputs.versionName }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
- name: Decode Keystore
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE_BASE64 }}
DECODED_KEYSTORE_PATH: android/app/keystore.jks
run: |
echo $ENCODED_KEYSTORE > keystore_base64.txt
base64 -d keystore_base64.txt > $DECODED_KEYSTORE_PATH
#- run: flutter build apk --build-number $GITHUB_RUN_NUMBER
- run: flutter build aab --build-number ${{ inputs.buildNumber }} --build-name ${{ inputs.versionName }}
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
name: App Release ${{ inputs.versionName }}-${{ inputs.buildNumber }}
tag_name: app-${{ inputs.buildNumber }}
draft: false
prerelease: true
files: ./app/build/app/outputs/apk/release/app-release.apk
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: dev.uekoetter.passkit
releaseFiles: app/build/app/outputs/bundle/release/app-release.aab
track: production
2 changes: 2 additions & 0 deletions app/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ analyzer:
missing_required_param: error
missing_return: error
todo: ignore
exclude:
- '**/*.g.dart'
11 changes: 10 additions & 1 deletion app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@ android {
defaultConfig {
applicationId "dev.uekoetter.passkit"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
targetSdkVersion 35 //flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

signingConfigs {
release {
storeFile file("keystore.jks")
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias "cards_keystore"
keyPassword System.getenv("KEY_PASSWORD")
}
}

buildTypes {
release {
signingConfig signingConfigs.debug
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>
Binary file modified app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions app/lib/db/database.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import 'package:app/db/db.dart';
import 'dart:async';
import 'dart:typed_data';
import 'package:floor/floor.dart';
import 'package:sqflite/sqflite.dart' as sqflite;

late final AppDatabase database;
void initDb() {
database = AppDatabase();
import 'pass_entry_dao.dart';
import 'pass_entry.dart';

part 'database.g.dart';

@Database(version: 1, entities: [PassEntry])
abstract class AppDatabase extends FloorDatabase {
PassEntryDao get passEntryDao;
}
170 changes: 170 additions & 0 deletions app/lib/db/database.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 4 additions & 32 deletions app/lib/db/db.dart
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
import 'dart:io';
import 'package:app/db/database.dart';

import 'package:drift/drift.dart';
import 'package:drift/native.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;
late final AppDatabase db;

part 'db.g.dart';

class Pass extends Table {
TextColumn get id => text()();
BlobColumn get binaryPass => blob()();

@override
Set<Column> get primaryKey => {id};
}

@DriftDatabase(tables: [Pass])
class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());

@override
int get schemaVersion => 1;
}

LazyDatabase _openConnection() {
// the LazyDatabase util lets us find the right location for the file async.
return LazyDatabase(() async {
// put the database file, called db.sqlite here, into the documents folder
// for your app.
final dbFolder = await getApplicationDocumentsDirectory();
final file = File(p.join(dbFolder.path, 'db.sqlite'));
return NativeDatabase.createInBackground(file);
});
Future<void> initDb() async {
db = await $FloorAppDatabase.databaseBuilder('app_database.db').build();
}
Loading

0 comments on commit 3cff433

Please sign in to comment.