@@ -214,111 +214,6 @@ - (NSString *)adjVendorId {
214214 return @" " ;
215215}
216216
217- - (NSString *)adjDeviceId : (ADJDeviceInfo *)deviceInfo {
218- int languageMaxLength = 16 ;
219- NSString *language = deviceInfo.languageCode ;
220- NSString *binaryLanguage = [ADJUtil stringToBinaryString: language];
221- NSString *binaryLanguageFormatted = [ADJUtil enforceParameterLength: binaryLanguage withMaxlength: languageMaxLength];
222-
223- int hardwareNameMaxLength = 48 ;
224- NSString *hardwareName = deviceInfo.machineModel ;
225- NSString *binaryHardwareName = [ADJUtil stringToBinaryString: hardwareName];
226- NSString *binaryHardwareNameFormatted = [ADJUtil enforceParameterLength: binaryHardwareName withMaxlength: hardwareNameMaxLength];
227-
228- NSArray *versionParts = [deviceInfo.systemVersion componentsSeparatedByString: @" ." ];
229- int osVersionMajor = [[versionParts objectAtIndex: 0 ] intValue ];
230- int osVersionMinor = [[versionParts objectAtIndex: 1 ] intValue ];
231- int osVersionPatch = [versionParts count ] == 3 ? [[versionParts objectAtIndex: 2 ] intValue ] : 0 ;
232-
233- int osVersionMajorMaxLength = 8 ;
234- NSString *binaryOsVersionMajor = [ADJUtil decimalToBinaryString: osVersionMajor];
235- NSString *binaryOsVersionMajorFormatted = [ADJUtil enforceParameterLength: binaryOsVersionMajor withMaxlength: osVersionMajorMaxLength];
236-
237- int osVersionMinorMaxLength = 8 ;
238- NSString *binaryOsVersionMinor = [ADJUtil decimalToBinaryString: osVersionMinor];
239- NSString *binaryOsVersionMinorFormatted = [ADJUtil enforceParameterLength: binaryOsVersionMinor withMaxlength: osVersionMinorMaxLength];
240-
241- int osVersionPatchMaxLength = 8 ;
242- NSString *binaryOsVersionPatch = [ADJUtil decimalToBinaryString: osVersionPatch];
243- NSString *binaryOsVersionPatchFormatted = [ADJUtil enforceParameterLength: binaryOsVersionPatch withMaxlength: osVersionPatchMaxLength];
244-
245- int mccMaxLength = 24 ;
246- NSString *mcc = [ADJUtil readMCC ];
247- NSString *binaryMcc = [ADJUtil stringToBinaryString: mcc];
248- NSString *binaryMccFormatted = [ADJUtil enforceParameterLength: binaryMcc withMaxlength: mccMaxLength];
249-
250- int mncMaxLength = 24 ;
251- NSString *mnc = [ADJUtil readMNC ];
252- NSString *binaryMnc = [ADJUtil stringToBinaryString: mnc];
253- NSString *binaryMncFormatted = [ADJUtil enforceParameterLength: binaryMnc withMaxlength: mncMaxLength];
254-
255- int chargingStatusMaxLength = 8 ;
256- NSUInteger chargingStatus = [ADJSystemProfile chargingStatus ];
257- NSString *binaryChargingStatus = [ADJUtil decimalToBinaryString: chargingStatus];
258- NSString *binaryChargingStatusFormatted = [ADJUtil enforceParameterLength: binaryChargingStatus withMaxlength: chargingStatusMaxLength];
259-
260- int batteryLevelMaxSize = 8 ;
261- NSUInteger batteryLevel = [ADJSystemProfile batteryLevel ];
262- NSString *binaryBatteryLevel = [ADJUtil decimalToBinaryString: batteryLevel];
263- NSString *binaryBatteryLevelFormatted = [ADJUtil enforceParameterLength: binaryBatteryLevel withMaxlength: batteryLevelMaxSize];
264-
265- int totalSpaceMaxSize = 24 ;
266- NSUInteger totalSpace = [ADJSystemProfile totalDiskSpace ];
267- NSString *binaryTotalSpace = [ADJUtil decimalToBinaryString: totalSpace];
268- NSString *binaryTotalSpaceFormatted = [ADJUtil enforceParameterLength: binaryTotalSpace withMaxlength: totalSpaceMaxSize];
269-
270- int freeSpaceMaxSize = 24 ;
271- NSUInteger freeSpace = [ADJSystemProfile freeDiskSpace ];
272- NSString *binaryFreeSpace = [ADJUtil decimalToBinaryString: freeSpace];
273- NSString *binaryFreeSpaceFormatted = [ADJUtil enforceParameterLength: binaryFreeSpace withMaxlength: freeSpaceMaxSize];
274-
275- int systemUptimeMaxSize = 24 ;
276- NSUInteger systemUptime = [ADJSystemProfile systemUptime ];
277- NSString *binarySystemUptime = [ADJUtil decimalToBinaryString: systemUptime];
278- NSString *binarySystemUptimeFormatted = [ADJUtil enforceParameterLength: binarySystemUptime withMaxlength: systemUptimeMaxSize];
279-
280- int lastBootTimeMaxSize = 32 ;
281- NSUInteger lastBootTime = [ADJSystemProfile lastBootTime ];
282- NSString *binaryLastBootTime = [ADJUtil decimalToBinaryString: lastBootTime];
283- NSString *binaryLastBootTimeFormatted = [ADJUtil enforceParameterLength: binaryLastBootTime withMaxlength: lastBootTimeMaxSize];
284-
285- NSString *concatenated = [NSString stringWithFormat: @" %@%@%@%@%@%@%@%@%@%@%@%@%@ " ,
286- binaryLanguageFormatted,
287- binaryHardwareNameFormatted,
288- binaryOsVersionMajorFormatted,
289- binaryOsVersionMinorFormatted,
290- binaryOsVersionPatchFormatted,
291- binaryMccFormatted,
292- binaryMncFormatted,
293- binaryChargingStatusFormatted,
294- binaryBatteryLevelFormatted,
295- binaryTotalSpaceFormatted,
296- binaryFreeSpaceFormatted,
297- binarySystemUptimeFormatted,
298- binaryLastBootTimeFormatted];
299-
300- // make sure concatenated string length is multiple of 4
301- if (concatenated.length % 4 != 0 ) {
302- int numberOfBits = concatenated.length % 4 ;
303- while (numberOfBits != 4 ) {
304- concatenated = [@" 0" stringByAppendingString: concatenated];
305- numberOfBits += 1 ;
306- }
307- }
308-
309- NSString *mParameter = @" " ;
310- for (NSUInteger i = 0 ; i < concatenated.length ; i += 4 ) {
311- // get fourplet substring
312- NSString *fourplet = [concatenated substringWithRange: NSMakeRange (i, 4 )];
313- // convert fourplet to decimal number
314- long decimalFourplet = strtol ([fourplet UTF8String ], NULL , 2 );
315- // append hex value of fourplet to final parameter
316- mParameter = [mParameter stringByAppendingString: [NSString stringWithFormat: @" %lX " , decimalFourplet]];
317- }
318-
319- return mParameter;
320- }
321-
322217- (void )adjCheckForiAd : (ADJActivityHandler *)activityHandler queue : (dispatch_queue_t )queue {
323218 // if no tries for iad v3 left, stop trying
324219 id <ADJLogger> logger = [ADJAdjustFactory logger ];
0 commit comments