aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 10:08:52 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 10:08:52 -0700
commit22bd8bcc80b850dc2308be50cf2886c39b0655da (patch)
tree01f98cf67e21f06f94f85b8cc38ae63b8ec39df9 /src/main/java/org/traccar/protocol
parentc248ed30047a0525bf792730a0fbd4de0c89ad8e (diff)
downloadtrackermap-server-22bd8bcc80b850dc2308be50cf2886c39b0655da.tar.gz
trackermap-server-22bd8bcc80b850dc2308be50cf2886c39b0655da.tar.bz2
trackermap-server-22bd8bcc80b850dc2308be50cf2886c39b0655da.zip
Refactor device password
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java5
-rw-r--r--src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java
index 3ed828fc7..569f4a809 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolEncoder.java
@@ -20,6 +20,7 @@ import io.netty.buffer.Unpooled;
import org.traccar.BaseProtocolEncoder;
import org.traccar.Protocol;
import org.traccar.helper.Checksum;
+import org.traccar.helper.model.AttributeUtil;
import org.traccar.model.Command;
import java.nio.charset.StandardCharsets;
@@ -68,8 +69,8 @@ public class Gt06ProtocolEncoder extends BaseProtocolEncoder {
boolean alternative = getIdentityManager().lookupAttributeBoolean(
command.getDeviceId(), getProtocolName() + ".alternative", false, false, true);
- String password = getIdentityManager()
- .getDevicePassword(command.getDeviceId(), getProtocolName(), "123456");
+ String password = AttributeUtil.getDevicePassword(
+ getCacheManager(), command.getDeviceId(), getProtocolName(), "123456");
switch (command.getType()) {
case Command.TYPE_ENGINE_STOP:
diff --git a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
index c55c0624d..e9570ee11 100644
--- a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java
@@ -17,6 +17,7 @@ package org.traccar.protocol;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.helper.model.AttributeUtil;
import org.traccar.session.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
@@ -252,8 +253,8 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder {
sendAcknowledge(status, event, checksum, channel, remoteAddress);
- String devicePassword = getIdentityManager()
- .getDevicePassword(deviceSession.getDeviceId(), getProtocolName(), DEFAULT_DEVICE_PASSWORD);
+ String devicePassword = AttributeUtil.getDevicePassword(
+ getCacheManager(), deviceSession.getDeviceId(), getProtocolName(), DEFAULT_DEVICE_PASSWORD);
sendEventResponse(event, devicePassword, channel, remoteAddress);
}