[FEATURE] Сравнение HWID

This commit is contained in:
Gravit 2019-03-08 18:02:54 +07:00
parent 6033703b9b
commit 920a15a6b2
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 17 additions and 0 deletions

View file

@ -5,5 +5,7 @@ public interface HWID {
int getLevel(); //Уровень доверия, насколько уникальные значения int getLevel(); //Уровень доверия, насколько уникальные значения
int compare(HWID hwid);
boolean isNull(); boolean isNull();
} }

View file

@ -29,6 +29,21 @@ public int getLevel() //Уровень доверия, насколько уни
return result; 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 @Override
public boolean isNull() { public boolean isNull() {
return getLevel() < 2; return getLevel() < 2;