mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
a54ca799b9
* update rules of analysis_options.yaml. and solved all problems * refactor: fix remaining problems --------- Co-authored-by: Ushie <ushiekane@gmail.com>
49 lines
1.2 KiB
Dart
49 lines
1.2 KiB
Dart
import 'dart:convert';
|
|
import 'dart:typed_data';
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'patched_application.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class PatchedApplication {
|
|
PatchedApplication({
|
|
required this.name,
|
|
required this.packageName,
|
|
required this.originalPackageName,
|
|
required this.version,
|
|
required this.apkFilePath,
|
|
required this.icon,
|
|
required this.patchDate,
|
|
this.isRooted = false,
|
|
this.isFromStorage = false,
|
|
this.hasUpdates = false,
|
|
this.appliedPatches = const [],
|
|
this.changelog = const [],
|
|
});
|
|
|
|
factory PatchedApplication.fromJson(Map<String, dynamic> json) =>
|
|
_$PatchedApplicationFromJson(json);
|
|
String name;
|
|
String packageName;
|
|
String originalPackageName;
|
|
String version;
|
|
final String apkFilePath;
|
|
@JsonKey(
|
|
fromJson: decodeBase64,
|
|
toJson: encodeBase64,
|
|
)
|
|
Uint8List icon;
|
|
DateTime patchDate;
|
|
bool isRooted;
|
|
bool isFromStorage;
|
|
bool hasUpdates;
|
|
List<String> appliedPatches;
|
|
List<String> changelog;
|
|
|
|
Map<String, dynamic> toJson() => _$PatchedApplicationToJson(this);
|
|
|
|
static Uint8List decodeBase64(String icon) => base64.decode(icon);
|
|
|
|
static String encodeBase64(Uint8List bytes) => base64.encode(bytes);
|
|
}
|