@@ -106,6 +106,11 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
106
106
return transferredFiles ;
107
107
}
108
108
109
+ public getDeviceHashService ( appIdentifier : string ) : Mobile . IAndroidDeviceHashService {
110
+ const adb = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : this . device . deviceInfo . identifier } ) ;
111
+ return this . $injector . resolve ( AndroidDeviceHashService , { adb, appIdentifier } ) ;
112
+ }
113
+
109
114
private async _transferFiles ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] ) : Promise < Mobile . ILocalToDevicePathData [ ] > {
110
115
await this . livesyncTool . sendFiles ( localToDevicePaths . map ( localToDevicePathData => localToDevicePathData . getLocalPath ( ) ) ) ;
111
116
@@ -121,19 +126,19 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
121
126
private async _transferDirectory ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] , projectFilesPath : string ) : Promise < Mobile . ILocalToDevicePathData [ ] > {
122
127
let transferredLocalToDevicePaths : Mobile . ILocalToDevicePathData [ ] ;
123
128
const deviceHashService = this . getDeviceHashService ( deviceAppData . appIdentifier ) ;
124
- const currentShasums : IStringDictionary = await deviceHashService . generateHashesFromLocalToDevicePaths ( localToDevicePaths ) ;
125
- const oldShasums = await deviceHashService . getShasumsFromDevice ( ) ;
129
+ const currentHashes = await deviceHashService . generateHashesFromLocalToDevicePaths ( localToDevicePaths ) ;
130
+ const oldHashes = await deviceHashService . getShasumsFromDevice ( ) ;
126
131
127
- if ( this . $options . force || ! oldShasums ) {
132
+ if ( this . $options . force || ! oldHashes ) {
128
133
await this . livesyncTool . sendDirectory ( projectFilesPath ) ;
129
- await deviceHashService . uploadHashFileToDevice ( currentShasums ) ;
134
+ await deviceHashService . uploadHashFileToDevice ( currentHashes ) ;
130
135
transferredLocalToDevicePaths = localToDevicePaths ;
131
136
} else {
132
- const changedShasums = deviceHashService . getChangedShasums ( oldShasums , currentShasums ) ;
137
+ const changedShasums = deviceHashService . getChangedShasums ( oldHashes , currentHashes ) ;
133
138
const changedFiles = _ . keys ( changedShasums ) ;
134
139
if ( changedFiles . length ) {
135
140
await this . livesyncTool . sendFiles ( changedFiles ) ;
136
- await deviceHashService . uploadHashFileToDevice ( currentShasums ) ;
141
+ await deviceHashService . uploadHashFileToDevice ( currentHashes ) ;
137
142
transferredLocalToDevicePaths = localToDevicePaths . filter ( localToDevicePathData => changedFiles . indexOf ( localToDevicePathData . getLocalPath ( ) ) >= 0 ) ;
138
143
} else {
139
144
transferredLocalToDevicePaths = [ ] ;
@@ -150,9 +155,4 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
150
155
appPlatformsPath : projectFilesPath
151
156
} ) ;
152
157
}
153
-
154
- public getDeviceHashService ( appIdentifier : string ) : Mobile . IAndroidDeviceHashService {
155
- const adb = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : this . device . deviceInfo . identifier } ) ;
156
- return this . $injector . resolve ( AndroidDeviceHashService , { adb, appIdentifier } ) ;
157
- }
158
158
}
0 commit comments