mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Сравнение HWID
This commit is contained in:
parent
6033703b9b
commit
920a15a6b2
2 changed files with 17 additions and 0 deletions
|
@ -5,5 +5,7 @@ public interface HWID {
|
|||
|
||||
int getLevel(); //Уровень доверия, насколько уникальные значения
|
||||
|
||||
int compare(HWID hwid);
|
||||
|
||||
boolean isNull();
|
||||
}
|
||||
|
|
|
@ -29,6 +29,21 @@ public int getLevel() //Уровень доверия, насколько уни
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(HWID hwid) {
|
||||
if(hwid instanceof OshiHWID)
|
||||
{
|
||||
int rate = 0;
|
||||
OshiHWID oshi = (OshiHWID) hwid;
|
||||
if(Math.abs(oshi.totalMemory - totalMemory) < 1024*1024) rate+=10;
|
||||
if(oshi.HWDiskSerial.equals(HWDiskSerial)) rate+=50;
|
||||
if(oshi.processorID.equals(processorID)) rate+=26;
|
||||
if(oshi.serialNumber.equals(serialNumber)) rate+=15;
|
||||
return rate;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNull() {
|
||||
return getLevel() < 2;
|
||||
|
|
Loading…
Reference in a new issue