mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +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 getLevel(); //Уровень доверия, насколько уникальные значения
|
||||||
|
|
||||||
|
int compare(HWID hwid);
|
||||||
|
|
||||||
boolean isNull();
|
boolean isNull();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue