1
1
import { cache } from "../common/decorators" ;
2
2
import { ValidatePlatformCommandBase } from "./command-base" ;
3
+ import { hasValidAndroidSigning } from "../common/helpers" ;
4
+ import { ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE } from "../constants" ;
3
5
4
6
export class DebugPlatformCommand extends ValidatePlatformCommandBase implements ICommand {
5
7
public allowedParameters : ICommandParameter [ ] = [ ] ;
@@ -155,7 +157,8 @@ export class DebugAndroidCommand implements ICommand {
155
157
private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
156
158
private $injector : IInjector ,
157
159
private $projectData : IProjectData ,
158
- private $markingModeService : IMarkingModeService ) {
160
+ private $markingModeService : IMarkingModeService ,
161
+ private $options : IOptions ) {
159
162
this . $projectData . initializeProjectData ( ) ;
160
163
}
161
164
@@ -164,8 +167,14 @@ export class DebugAndroidCommand implements ICommand {
164
167
return this . debugPlatformCommand . execute ( args ) ;
165
168
}
166
169
public async canExecute ( args : string [ ] ) : Promise < boolean > {
167
- const result = await this . debugPlatformCommand . canExecute ( args ) ;
168
- return result ;
170
+ const canExecuteBase = await this . debugPlatformCommand . canExecute ( args ) ;
171
+ if ( canExecuteBase ) {
172
+ if ( this . $options . aab && ! hasValidAndroidSigning ( this . $options ) ) {
173
+ this . $errors . failWithHelp ( ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE ) ;
174
+ }
175
+ }
176
+
177
+ return canExecuteBase ;
169
178
}
170
179
171
180
public platform = this . $devicePlatformsConstants . Android ;
0 commit comments