Skip to content

Commit

Permalink
removed unused device_id
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Oct 28, 2024
1 parent 2344f96 commit 110c63e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
3 changes: 0 additions & 3 deletions lib/api/impl/privacy_idea_container_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import '../../model/riverpod_states/token_state.dart';
import '../../model/token_container.dart';
import '../../model/token_template.dart';
import '../../model/tokens/token.dart';
import '../../utils/app_info_utils.dart';
import '../../utils/globals.dart';
import '../../utils/identifiers.dart';
import '../../utils/logger.dart';
Expand Down Expand Up @@ -119,15 +118,13 @@ class PiContainerApi implements TokenContainerApi {
'|${container.timestamp.toIso8601String().replaceFirst('Z', '+00:00')}'
'|${container.serial}'
'|${container.registrationUrl}'
'|${AppInfoUtils.deviceId}'
'${passphrase != null ? '|$passphrase' : ''}';

final signature = eccUtils.signWithPrivateKey(ecPrivateClientKey, message);

final body = {
CONTAINER_CONTAINER_SERIAL: container.serial,
CONTAINER_PUBLIC_CLIENT_KEY: container.publicClientKey,
CONTAINER_DEVICE_ID: AppInfoUtils.deviceId,
CONTAINER_CHAL_SIGNATURE: signature,
};
return await _ioClient.doPost(url: container.registrationUrl, body: body, sslVerify: container.sslVerify);
Expand Down
4 changes: 0 additions & 4 deletions lib/utils/app_info_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class AppInfoUtils {
_appBuildNumber = packageInfo.buildNumber;
_androidInfo = !kIsWeb && Platform.isAndroid ? await _deviceInfo.androidInfo : null;
_iosInfo = !kIsWeb && Platform.isIOS ? await _deviceInfo.iosInfo : null;
_deviceId = !kIsWeb ? (Platform.isAndroid ? _androidInfo!.id : _iosInfo!.identifierForVendor ?? 'N/A') : 'Web: Not available.';

isInitialized = true;
}
Expand All @@ -59,9 +58,6 @@ class AppInfoUtils {
static String get currentBuildNumber => isInitialized ? _appBuildNumber : throw Exception('AppInfoUtils not initialized');
static late final String _appBuildNumber;

static String get deviceId => isInitialized ? _deviceId : throw Exception('AppInfoUtils not initialized');
static late final String _deviceId;

static String get dartVersion => Platform.version;
static String get platform => Platform.operatingSystem;

Expand Down
1 change: 0 additions & 1 deletion lib/utils/identifiers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ const String CONTAINER_SCOPE = 'scope';
// Container finalization:
const String CONTAINER_CONTAINER_SERIAL = 'container_serial';
const String CONTAINER_PUBLIC_CLIENT_KEY = 'public_client_key';
const String CONTAINER_DEVICE_ID = 'device_id';

// Container sync:
const String CONTAINER_SYNC_PUBLIC_CLIENT_KEY = 'public_enc_key_client';
Expand Down
2 changes: 1 addition & 1 deletion lib/views/splash_screen/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class _SplashScreenState extends ConsumerState<SplashScreen> {
_navigate();
},
).catchError((error) async {
Logger.error('Error while loading the app.');
Logger.error('Error while loading the app.', error: error, stackTrace: StackTrace.current);

if (!mounted) return [];
final tokenState = ref.read(tokenProvider);
Expand Down

0 comments on commit 110c63e

Please sign in to comment.