Skip to content

Commit

Permalink
Merge branch 'develop' into security_audit
Browse files Browse the repository at this point in the history
  • Loading branch information
phuocbitmark committed Jul 29, 2024
2 parents 60beb42 + f6004d6 commit be3208c
Show file tree
Hide file tree
Showing 57 changed files with 720 additions and 477 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-release-appcenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
description: Using testnet (Default staging)
jobs:
build:
runs-on: macos-latest
runs-on: [self-hosted, macOS]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto_test_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# - update_autotest
jobs:
build:
runs-on: [self-hosted, Linux, ci-local-bmvn, X64]
runs-on: [self-hosted, macOS]
steps:
# Checkout code and get packages.
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto_test_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# - develop
jobs:
build:
runs-on: [self-hosted, macOS, X64, ci-local-bmvn-macos]
runs-on: [self-hosted, macOS]
steps:
# Checkout code and get packages.
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bmvn_build_appcenter_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
description: Using testnet (Default staging)
jobs:
build:
runs-on: [self-hosted, macm2, build-ci-local-bmvn, android]
runs-on: [self-hosted, macOS]
steps:
- name: Extract Build number for Testnet
id: extract-version-testnet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bmvn_build_appcenter_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:

jobs:
fastlane-deploy:
runs-on: [self-hosted, macm2, build-ci-local-bmvn, ios]
runs-on: [self-hosted, macOS]
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-release-appcenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
fastlane-deploy:
runs-on: macOS-13
runs-on: [self-hosted, macOS]
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
Expand Down
7 changes: 4 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<queries>
Expand Down Expand Up @@ -188,10 +188,10 @@
android:scheme="https" />

<data
android:host="feralfile-app.test.app.link"
android:host="feralfile-app.test-app.link"
android:scheme="https" />
<data
android:host="feralfile-app-alternate.test.app.link"
android:host="feralfile-app-alternate.test-app.link"
android:scheme="https" />
</intent-filter>
</activity>
Expand All @@ -200,6 +200,7 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

Expand Down
2 changes: 1 addition & 1 deletion assets
4 changes: 2 additions & 2 deletions ios/Runner-Inhouse-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
<string>app.feralfile.com</string>
<string>feralfile-app.app.link</string>
<string>feralfile-app-alternate.app.link</string>
<string>feralfile-app.test.app.link</string>
<string>feralfile-app-alternate.test.app.link</string>
<string>feralfile-app.test-app.link</string>
<string>feralfile-app-alternate.test-app.link</string>
</array>
<key>io.flutter.embedded_views_preview</key>
<true/>
Expand Down
4 changes: 2 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
<string>app.feralfile.com</string>
<string>feralfile-app.app.link</string>
<string>feralfile-app-alternate.app.link</string>
<string>feralfile-app.test.app.link</string>
<string>feralfile-app-alternate.test.app.link</string>
<string>feralfile-app.test-app.link</string>
<string>feralfile-app-alternate.test-app.link</string>
</array>
<key>io.flutter.embedded_views_preview</key>
<true/>
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Runner InhouseDebug.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>applinks:feralfile-app.app.link</string>
<string>applinks:feralfile-app-alternate.app.link</string>
<string>applinks:app.feralfile.com</string>
<string>feralfile-app.test-app.link</string>
<string>feralfile-app-alternate.test-app.link</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Runner-Inhouse.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>applinks:feralfile-app.app.link</string>
<string>applinks:feralfile-app-alternate.app.link</string>
<string>applinks:app.feralfile.com</string>
<string>feralfile-app.test-app.link</string>
<string>feralfile-app-alternate.test-app.link</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>applinks:feralfile-app.app.link</string>
<string>applinks:feralfile-app-alternate.app.link</string>
<string>applinks:app.feralfile.com</string>
<string>feralfile-app.test-app.link</string>
<string>feralfile-app-alternate.test-app.link</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/RunnerDebug.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>applinks:feralfile-app.app.link</string>
<string>applinks:feralfile-app-alternate.app.link</string>
<string>applinks:app.feralfile.com</string>
<string>feralfile-app.test-app.link</string>
<string>feralfile-app-alternate.test-app.link</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
Expand Down
1 change: 1 addition & 0 deletions lib/gateway/feralfile_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ abstract class FeralFileApi {
@Query('sortBy') String sortBy = 'index',
@Query('sortOrder') String sortOrder = 'ASC',
@Query('isViewable') bool? isViewable,
@Query('filterBurned') bool? filterBurned,
});

@POST('/api/web3/messages/action')
Expand Down
2 changes: 2 additions & 0 deletions lib/gateway/feralfile_api.g.dart

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

4 changes: 0 additions & 4 deletions lib/model/ff_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class FFArtist {
final String alias;
final String? slug;
final bool? verified;
final bool? isArtist;
final String? fullName;
final String? avatarURI;
final String? accountNumber;
Expand All @@ -38,7 +37,6 @@ class FFArtist {
this.alias,
this.slug,
this.verified,
this.isArtist,
this.fullName,
this.avatarURI,
this.accountNumber,
Expand All @@ -50,7 +48,6 @@ class FFArtist {
json['alias'] as String,
json['slug'] as String?,
json['verified'] as bool?,
json['isArtist'] as bool?,
json['fullName'] as String?,
json['avatarURI'] as String?,
json['accountNumber'] as String?,
Expand All @@ -62,7 +59,6 @@ class FFArtist {
'alias': alias,
'slug': slug,
'verified': verified,
'isArtist': isArtist,
'fullName': fullName,
'avatarURI': avatarURI,
'accountNumber': accountNumber,
Expand Down
23 changes: 17 additions & 6 deletions lib/screen/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class AppRouter {
final personaBloc = PersonaBloc(
injector<CloudDatabase>(),
injector(),
injector<AuditService>(),
);
final connectionsBloc = injector<ConnectionsBloc>();
final identityBloc = IdentityBloc(injector<AppDatabase>(), injector());
Expand All @@ -261,6 +260,8 @@ class AppRouter {
injector(),
);

final royaltyBloc = RoyaltyBloc(injector());

switch (settings.name) {
case artistsListPage:
return PageTransition(
Expand Down Expand Up @@ -321,6 +322,9 @@ class AppRouter {
injector(),
),
),
BlocProvider(
create: (_) => personaBloc,
),
], child: const OnboardingPage()),
);

Expand Down Expand Up @@ -706,7 +710,7 @@ class AppRouter {
providers: [
BlocProvider.value(value: accountsBloc),
BlocProvider(create: (_) => identityBloc),
BlocProvider(create: (_) => RoyaltyBloc(injector())),
BlocProvider(create: (_) => royaltyBloc),
BlocProvider(
create: (_) => ArtworkDetailBloc(
injector(),
Expand Down Expand Up @@ -734,7 +738,7 @@ class AppRouter {
providers: [
BlocProvider.value(value: accountsBloc),
BlocProvider(create: (_) => identityBloc),
BlocProvider(create: (_) => RoyaltyBloc(injector())),
BlocProvider(create: (_) => royaltyBloc),
BlocProvider(create: (_) => TravelInfoBloc()),
BlocProvider(create: (_) => postcardDetailBloc),
],
Expand Down Expand Up @@ -873,9 +877,16 @@ class AppRouter {
case ffArtworkPreviewPage:
return CupertinoPageRoute(
settings: settings,
builder: (context) => FeralFileArtworkPreviewPage(
payload:
settings.arguments! as FeralFileArtworkPreviewPagePayload));
builder: (context) => MultiBlocProvider(
providers: [
BlocProvider(
create: (_) => royaltyBloc,
),
],
child: FeralFileArtworkPreviewPage(
payload: settings.arguments!
as FeralFileArtworkPreviewPagePayload),
));

case feralFileSeriesPage:
return CupertinoPageRoute(
Expand Down
42 changes: 1 addition & 41 deletions lib/screen/bloc/persona/persona_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:autonomy_flutter/au_bloc.dart';
import 'package:autonomy_flutter/database/cloud_database.dart';
import 'package:autonomy_flutter/database/entity/persona.dart';
import 'package:autonomy_flutter/service/account_service.dart';
import 'package:autonomy_flutter/service/audit_service.dart';
import 'package:autonomy_flutter/util/string_ext.dart';
import 'package:autonomy_flutter/util/ui_helper.dart';
import 'package:autonomy_flutter/util/wallet_storage_ext.dart';
Expand All @@ -20,33 +19,8 @@ part 'persona_state.dart';
class PersonaBloc extends AuBloc<PersonaEvent, PersonaState> {
final CloudDatabase _cloudDB;
final AccountService _accountService;
final AuditService _auditService;

PersonaBloc(this._cloudDB, this._accountService, this._auditService)
: super(PersonaState()) {
/*
on<CreatePersonaEvent>((event, emit) async {
emit(PersonaState(createAccountState: ActionState.loading));
// await Future.delayed(SHOW_DIALOG_DURATION);
if (!_configurationService.isDoneOnboarding()) {
final account = await _accountService.getDefaultAccount();
final persona = await _cloudDB.personaDao.findById(account.uuid);
emit(PersonaState(
createAccountState: ActionState.done, persona: persona));
} else {
final persona = await _accountService.createPersona();
emit(PersonaState(
createAccountState: ActionState.done, persona: persona));
}
await Future.delayed(const Duration(microseconds: 500), () {
emit(state.copyWith(createAccountState: ActionState.notRequested));
});
});
*/

PersonaBloc(this._cloudDB, this._accountService) : super(PersonaState()) {
on<GetListPersonaEvent>((event, emit) async {
final personas = await _cloudDB.personaDao.getPersonas();
List<Persona> namedPersonas = [];
Expand All @@ -73,20 +47,6 @@ class PersonaBloc extends AuBloc<PersonaEvent, PersonaState> {
emit(state.copyWith(persona: persona));
});

on<NamePersonaEvent>((event, emit) async {
final oldPersona = state.persona;
if (oldPersona == null) return;
emit(state.copyWith(namePersonaState: ActionState.loading));

await oldPersona.wallet().updateName(event.name);
final updatedPersona = oldPersona.copyWith(name: event.name);
await _cloudDB.personaDao.updatePersona(updatedPersona);
await _auditService.auditPersonaAction('name', updatedPersona);

emit(state.copyWith(
namePersonaState: ActionState.done, persona: updatedPersona));
});

on<DeletePersonaEvent>((event, emit) async {
await _accountService.deletePersona(event.persona);
emit(state.copyWith(deletePersonaState: ActionState.done));
Expand Down
27 changes: 10 additions & 17 deletions lib/screen/bloc/persona/persona_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ part of 'persona_bloc.dart';
abstract class PersonaEvent {}

class CreatePersonaAddressesEvent extends PersonaEvent {
final String name;
final String? name;
final WalletType walletType;

CreatePersonaAddressesEvent(this.name, this.walletType);
CreatePersonaAddressesEvent(this.walletType, {this.name});
}

class GetListPersonaEvent extends PersonaEvent {
Expand Down Expand Up @@ -43,12 +43,6 @@ class DeletePersonaEvent extends PersonaEvent {
DeletePersonaEvent(this.persona);
}

class NamePersonaEvent extends PersonaEvent {
final String name;

NamePersonaEvent(this.name);
}

class PersonaState {
ActionState createAccountState = ActionState.notRequested;
ActionState namePersonaState = ActionState.notRequested;
Expand All @@ -71,13 +65,12 @@ class PersonaState {
ActionState? deletePersonaState,
Persona? persona,
List<Persona>? personas,
}) {
return PersonaState(
createAccountState: createAccountState ?? this.createAccountState,
namePersonaState: namePersonaState ?? this.namePersonaState,
deletePersonaState: deletePersonaState ?? this.deletePersonaState,
persona: persona ?? this.persona,
personas: personas ?? this.personas,
);
}
}) =>
PersonaState(
createAccountState: createAccountState ?? this.createAccountState,
namePersonaState: namePersonaState ?? this.namePersonaState,
deletePersonaState: deletePersonaState ?? this.deletePersonaState,
persona: persona ?? this.persona,
personas: personas ?? this.personas,
);
}
Loading

0 comments on commit be3208c

Please sign in to comment.