change archive library

This commit is contained in:
1xFF
2023-07-02 02:16:47 -07:00
parent 09056665c2
commit da027b7734
3 changed files with 14 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ import 'package:flutter_fgbg/flutter_fgbg.dart';
import 'package:obtainium/providers/source_provider.dart';
import 'package:http/http.dart';
import 'package:android_intent_plus/android_intent.dart';
import 'package:archive/archive_io.dart';
import 'package:flutter_archive/flutter_archive.dart';
class AppInMemory {
late App app;
@@ -264,7 +264,7 @@ class AppsProvider with ChangeNotifier {
} else {
// Assume XAPK
String xapkDirPath = '${downloadedFile.path}-dir';
unzipFile(downloadedFile.path, '${downloadedFile.path}-dir');
await unzipFile(downloadedFile.path, '${downloadedFile.path}-dir');
xapkDir = Directory(xapkDirPath);
var apks = xapkDir
.listSync()
@@ -334,10 +334,8 @@ class AppsProvider with ChangeNotifier {
}
}
void unzipFile(String filePath, String destinationPath) {
final inputStream = InputFileStream(filePath);
final archive = ZipDecoder().decodeBuffer(inputStream);
extractArchiveToDisk(archive, destinationPath);
Future<void> unzipFile(String filePath, String destinationPath) async {
await ZipFile.extractToDirectory(zipFile: File(filePath), destinationDir: Directory(destinationPath));
}
Future<void> installXApkDir(DownloadedXApkDir dir,

View File

@@ -35,7 +35,7 @@ packages:
source: hosted
version: "2.0.7"
archive:
dependency: "direct main"
dependency: transitive
description:
name: archive
sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a"
@@ -231,6 +231,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_archive:
dependency: "direct main"
description:
name: flutter_archive
sha256: aec85d1da65e5b33a529db00a86df0b8e92bda78088a7cfaeeba5187701d0d85
url: "https://pub.dev"
source: hosted
version: "5.0.0"
flutter_fgbg:
dependency: "direct main"
description:

View File

@@ -63,7 +63,7 @@ dependencies:
easy_localization: ^3.0.1
android_intent_plus: ^4.0.0
flutter_markdown: ^0.6.14
archive: ^3.3.7
flutter_archive: ^5.0.0
dev_dependencies: