Skip to content

Commit

Permalink
Fix apks not installing
Browse files Browse the repository at this point in the history
  • Loading branch information
alesimula committed Feb 15, 2022
1 parent 0c65853 commit d880d9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/android/reader_apk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ class ApkReader extends IsolateRunner<String, APK_READER_FLAGS> {

/// Retrieves installation type (whether installing for the first time, reinstalling the same version, upgrading or downgrading)
static Future loadInstallType(String package, int versionCode) async {if (package.isNotEmpty) {
GState.androidPort;
String ipAddress = await GState.ipAddress.whenReady();
int port = await GState.androidPort.whenReady();

Expand Down
2 changes: 1 addition & 1 deletion lib/apk_installer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class _ApkInstallerState extends State<ApkInstaller> {
checked: true,
style: installType == InstallType.DOWNGRADE ? warningButtonTheme : null,
onChanged: !canInstall ? null : (_){
if (Constants.packageType.directInstall) ApkInstaller.installApk(ApkReader.APK_FILE, ipAddress, port, lang, installType == InstallType.DOWNGRADE);
if (Constants.packageType.directInstall) ApkInstaller.installApk(Constants.packageFile, ipAddress, port, lang, installType == InstallType.DOWNGRADE);
else GState.installCallback.$?.call(ipAddress, port, lang, installType == InstallType.DOWNGRADE);
},
)),
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ bool get isDesktop {

class Constants {
//static late final List<String> args;
static late final String packageFile;
static late final AppPackage packageType;
static late final bool installMode;
static late final IsolateRef<dynamic, APK_READER_FLAGS>? isolate;
Expand All @@ -200,6 +201,7 @@ void main(List<String> arguments) async {

AppOptions.init();
Constants.installMode = arguments.isNotEmpty;
Constants.packageFile = Constants.installMode ? arguments.first : '';
Constants.packageType = AppPackageType.fromArguments(arguments);
Constants.isolate = Constants.installMode ? Constants.packageType.read(arguments.first) : null;

Expand Down

0 comments on commit d880d9c

Please sign in to comment.