Supprimer le code inutilisé

This commit is contained in:
2025-10-24 16:44:31 -07:00
parent 70c9af1c80
commit d850ae95be

View File

@@ -79,19 +79,19 @@ public class Device
private Path deviceFile;
private Path deviceKeyFile;
protected byte[] deviceKey = new byte[DEVICE_KEY_SIZE];
protected String deviceClass;
protected String deviceSerial;
protected String deviceName;
protected String deviceType = "standalone";
protected String fingerprint;
private Map<String, String> versions = new HashMap<>(); // Stores device properties
protected final Logger LOGGER = Logger.getLogger( Device.class.getName() );
protected Device() {}
/**
* Main Device constructor.
*
@@ -265,7 +265,7 @@ public class Device
try
{
InetAddress localHost = InetAddress.getLocalHost();
// Get the hostname from the InetAddress object
deviceName = localHost.getHostName();
}
@@ -332,38 +332,6 @@ public class Device
}
}
/* *
* Static method to create and manage a common.Device instance, handling file existence.
*
* @param dirName Directory where to put files (.adept)
* @param hobbesVersion Hobbes (client version) to set
* @param randomSerial Create a random serial (new device each time) or not (serial computed from machine specs)
* @return A new or existing common.Device instance.
* @throws DeviceException if directory creation or file operations fail.
* @ param processor Instance of DRMProcessor
*/
// public static Device createDevice( String dirName, String hobbesVersion, boolean randomSerial )
// throws NoSuchAlgorithmException, UnknownHostException
// {
// // TODO: this can probably be moved to the device constructor, eliminating the need for
// // a factory method.
// Path dirPath = Paths.get( dirName );
// if (!Files.exists( dirPath ))
// {
// try
// {
// Files.createDirectories( dirPath ); // mkdir_p equivalent
// }
// catch (IOException e)
// {
// throw new DeviceException( DeviceException.DEV_MKPATH, "Unable to create directory: " + dirName, e );
// }
// }
// return new Device( dirPath.resolve( "device.xml" ),
// dirPath.resolve( "devicesalt" ),
// hobbesVersion, randomSerial );
// }
/**
* Returns the device key.
*
@@ -413,7 +381,7 @@ public class Device
deviceName = deviceInfo.getElementsByTagName( "adept:deviceName" ).item( 0 ).getTextContent();
deviceType = deviceInfo.getElementsByTagName( "adept:deviceType" ).item( 0 ).getTextContent();
fingerprint = deviceInfo.getElementsByTagName( "adept:fingerprint" ).item( 0 ).getTextContent();
NodeList elements = deviceInfo.getElementsByTagName( "adept:version" );
for (int i = 0; i < elements.getLength(); i++)
{
@@ -472,42 +440,42 @@ public class Device
{
return versions.get( "clientLocale" );
}
public String getClientOS()
{
return versions.get( "clientOS" );
}
public String getHobbes()
{
return versions.get( "hobbes" );
}
String getDeviceSerial()
{
return deviceSerial;
}
String getDeviceName()
{
return deviceName;
}
public String getFingerprint()
{
return fingerprint;
}
public String getDeviceType()
{
return deviceType;
}
public String getDeviceClass()
{
return deviceClass;
}
public void updateDeviceFiles( Path deviceFile, Path deviceKeyFile )
throws NoSuchAlgorithmException
{