Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.content.Context
import android.content.Intent
import android.content.pm.ServiceInfo
import android.graphics.BitmapFactory
import android.graphics.Color
import android.os.Build
import android.os.IBinder

Expand Down Expand Up @@ -219,12 +220,14 @@ class AndroidIrcxForegroundService : Service() {
context.getString(R.string.notification_channel_highlights),
context.getString(R.string.notification_channel_highlights_description),
NotificationManager.IMPORTANCE_DEFAULT,
alerting = true,
),
channel(
CHANNEL_QUERIES,
context.getString(R.string.notification_channel_queries),
context.getString(R.string.notification_channel_queries_description),
NotificationManager.IMPORTANCE_DEFAULT,
alerting = true,
),
channel(
CHANNEL_DCC_TRANSFERS,
Expand All @@ -243,6 +246,7 @@ class AndroidIrcxForegroundService : Service() {
context.getString(R.string.notification_channel_errors),
context.getString(R.string.notification_channel_errors_description),
NotificationManager.IMPORTANCE_HIGH,
alerting = true,
),
),
)
Expand All @@ -253,9 +257,19 @@ class AndroidIrcxForegroundService : Service() {
name: String,
description: String,
importance: Int,
alerting: Boolean = false,
): NotificationChannel {
return NotificationChannel(id, name, importance).apply {
this.description = description
if (alerting) {
// Vibration + notification LED for user-facing alerts.
// Users can still tune these per channel in system
// settings; existing installs keep their prior channel
// configuration (Android only applies this at creation).
enableVibration(true)
enableLights(true)
lightColor = Color.GREEN
}
}
}

Expand Down
Binary file added assets/sounds/bip.wav
Binary file not shown.
Binary file added assets/sounds/ctcp.wav
Binary file not shown.
Binary file added assets/sounds/cuac.wav
Binary file not shown.
Binary file added assets/sounds/deop.wav
Binary file not shown.
Binary file added assets/sounds/disconnected.wav
Binary file not shown.
Binary file added assets/sounds/fail.wav
Binary file not shown.
Binary file added assets/sounds/join.wav
Binary file not shown.
Binary file added assets/sounds/kick.wav
Binary file not shown.
Binary file added assets/sounds/login.wav
Binary file not shown.
Binary file added assets/sounds/notice.wav
Binary file not shown.
Binary file added assets/sounds/op.wav
Binary file not shown.
Binary file added assets/sounds/ring.wav
Binary file not shown.
Binary file added assets/sounds/send.wav
Binary file not shown.
58 changes: 36 additions & 22 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:androidircx/core/platform/foreground_connection_service.dart';
import 'package:androidircx/core/platform/screen_security.dart';
import 'package:androidircx/core/security/secret_storage.dart';
import 'package:androidircx/core/settings/app_settings_controller.dart';
import 'package:androidircx/core/sound/audioplayers_sound_player.dart';
import 'package:androidircx/core/sound/sound_service.dart';
import 'package:androidircx/core/storage/network_repository.dart';
import 'package:androidircx/core/storage/settings_repository.dart';
import 'package:androidircx/core/storage/shared_prefs_network_repository.dart';
Expand All @@ -31,6 +33,7 @@ class AndroidIrcxApp extends StatefulWidget {
this.monetizationController,
this.rewardedAdService,
this.purchaseService,
this.soundService,
});

final NetworkRepository? networkRepository;
Expand All @@ -41,6 +44,9 @@ class AndroidIrcxApp extends StatefulWidget {
final RewardedAdService? rewardedAdService;
final StorePurchaseService? purchaseService;

/// Overridable for tests; defaults to the audioplayers-backed service.
final SoundService? soundService;

@override
State<AndroidIrcxApp> createState() => _AndroidIrcxAppState();
}
Expand All @@ -50,6 +56,7 @@ class _AndroidIrcxAppState extends State<AndroidIrcxApp> {
late final MonetizationController _monetizationController;
late final RewardedAdService _rewardedAdService;
late final StorePurchaseService _purchaseService;
late final SoundService _soundService;
late final bool _ownsMonetizationController;
late final bool _ownsRewardedAdService;
late final bool _ownsPurchaseService;
Expand All @@ -73,6 +80,9 @@ class _AndroidIrcxAppState extends State<AndroidIrcxApp> {
_purchaseService =
widget.purchaseService ??
StorePurchaseService(monetizationController: _monetizationController);
_soundService =
widget.soundService ?? SoundService(player: AudioplayersSoundPlayer());
unawaited(_soundService.load());
_settingsController.addListener(_applySettingsSideEffects);
_settingsController.load();
unawaited(_monetizationController.initialize());
Expand Down Expand Up @@ -122,29 +132,32 @@ class _AndroidIrcxAppState extends State<AndroidIrcxApp> {
controller: _monetizationController,
rewardedAdService: _rewardedAdService,
purchaseService: _purchaseService,
child: AppSettingsScope(
controller: _settingsController,
child: AnimatedBuilder(
animation: _settingsController,
builder: (context, _) {
return MaterialApp(
title: 'AndroidIRCx Flutter',
debugShowCheckedModeBanner: false,
theme: buildAppTheme(_settingsController.settings),
builder: (context, child) => AppLockGate(
enabled:
!_settingsController.isLoading &&
_settingsController.settings.appLockEnabled,
child: MonetizationBanner(
controller: _monetizationController,
onboardingCompleted:
_settingsController.settings.onboardingCompleted,
child: child ?? const SizedBox.shrink(),
child: SoundScope(
service: _soundService,
child: AppSettingsScope(
controller: _settingsController,
child: AnimatedBuilder(
animation: _settingsController,
builder: (context, _) {
return MaterialApp(
title: 'AndroidIRCx Flutter',
debugShowCheckedModeBanner: false,
theme: buildAppTheme(_settingsController.settings),
builder: (context, child) => AppLockGate(
enabled:
!_settingsController.isLoading &&
_settingsController.settings.appLockEnabled,
child: MonetizationBanner(
controller: _monetizationController,
onboardingCompleted:
_settingsController.settings.onboardingCompleted,
child: child ?? const SizedBox.shrink(),
),
),
),
home: _buildHome(),
);
},
home: _buildHome(),
);
},
),
),
),
);
Expand All @@ -171,6 +184,7 @@ class _AndroidIrcxAppState extends State<AndroidIrcxApp> {
networkRepository: widget.networkRepository,
foregroundConnectionService: widget.foregroundConnectionService,
historyRepositoryLoader: widget.historyRepositoryLoader,
soundService: _soundService,
);
}
}
5 changes: 4 additions & 1 deletion lib/app/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ class IrcUiTheme extends ThemeExtension<IrcUiTheme> {
topic: palette.topic,
messageBorder: palette.outline,
messageFontSize: 14 * settings.messageFontScale,
messageFontFamily: settings.monospaceMessages ? 'monospace' : null,
messageFontFamily: switch (settings.messageFontFamily) {
'system' => settings.monospaceMessages ? 'monospace' : null,
final family => family,
},
messagePadding: density.padding,
messageSpacing: density.spacing,
nickColorMode: settings.nickColorMode,
Expand Down
4 changes: 2 additions & 2 deletions lib/core/app/app_version.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const appVersionName = '1.0.10';
const appVersionCode = 14;
const appVersionName = '1.0.11';
const appVersionCode = 15;
const appVersion = '$appVersionName+$appVersionCode';

const ctcpVersionReply = 'AndroidIRCX Flutter v$appVersion';
6 changes: 3 additions & 3 deletions lib/core/backup/backup_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class BackupService {
required NetworkRepository networkRepository,
required SettingsRepository settingsRepository,
required IdentityProfileRepository profileRepository,
}) : _networks = networkRepository,
_settings = settingsRepository,
_profiles = profileRepository;
}) : _networks = networkRepository,
_settings = settingsRepository,
_profiles = profileRepository;

static const int backupVersion = 1;

Expand Down
10 changes: 2 additions & 8 deletions lib/core/diagnostics/crash_report_sanitizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ class CrashReportSanitizer {
}
var out = input;
out = out.replaceAll(_pemBlock, redaction);
out = out.replaceAllMapped(
_authCommand,
(m) => '${m.group(1)} $redaction',
);
out = out.replaceAllMapped(
_keyValue,
(m) => '${m.group(1)}=$redaction',
);
out = out.replaceAllMapped(_authCommand, (m) => '${m.group(1)} $redaction');
out = out.replaceAllMapped(_keyValue, (m) => '${m.group(1)}=$redaction');
out = out.replaceAll(_longToken, redaction);
return out;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/core/firebase/firebase_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ class FirebaseService {
}
await Firebase.initializeApp();
await FirebaseAppCheck.instance.activate(
providerAndroid:
kReleaseMode ? AndroidPlayIntegrityProvider() : AndroidDebugProvider(),
providerAndroid: kReleaseMode
? AndroidPlayIntegrityProvider()
: AndroidDebugProvider(),
);
_initialized = true;

Expand Down
Loading
Loading