mirror of
https://github.com/revanced/jadb.git
synced 2024-11-19 02:29:24 +01:00
#100 Various methods can be made less accessible to increase encapsulation
This commit is contained in:
parent
6c84fe6542
commit
93101d290b
@ -19,7 +19,7 @@ public class DeviceWatcher implements Runnable {
|
||||
}
|
||||
|
||||
@SuppressWarnings("squid:S2189") // watcher is stopped by closing transport
|
||||
public void watch() {
|
||||
private void watch() {
|
||||
try {
|
||||
while (true) {
|
||||
listener.onDetect(connection.parseDevices(transport.readString()));
|
||||
|
@ -45,11 +45,11 @@ public class SyncTransport {
|
||||
}
|
||||
}
|
||||
|
||||
public int readInt() throws IOException {
|
||||
private int readInt() throws IOException {
|
||||
return Integer.reverseBytes(input.readInt());
|
||||
}
|
||||
|
||||
public String readString(int length) throws IOException {
|
||||
private String readString(int length) throws IOException {
|
||||
byte[] buffer = new byte[length];
|
||||
input.readFully(buffer);
|
||||
return new String(buffer, StandardCharsets.UTF_8);
|
||||
|
@ -47,7 +47,7 @@ class Transport {
|
||||
return new String(responseBuffer, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public String getCommandLength(String command) {
|
||||
private String getCommandLength(String command) {
|
||||
return String.format("%04x", command.length());
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ class AdbProtocolHandler implements Runnable {
|
||||
return String.format("%04x", command.length());
|
||||
}
|
||||
|
||||
public void send(DataOutput writer, String response) throws IOException {
|
||||
private void send(DataOutput writer, String response) throws IOException {
|
||||
writer.writeBytes(getCommandLength(response));
|
||||
writer.writeBytes(response);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user