diff --git a/app/src/full/java/kellinwood/security/zipsigner/HexDumpEncoder.java b/app/src/full/java/kellinwood/security/zipsigner/HexDumpEncoder.java index 1d3e29fc4..79e5495ae 100644 --- a/app/src/full/java/kellinwood/security/zipsigner/HexDumpEncoder.java +++ b/app/src/full/java/kellinwood/security/zipsigner/HexDumpEncoder.java @@ -52,8 +52,9 @@ public class HexDumpEncoder { if ((j + 2) % 4 == 0) hexOut.append(' '); int dataChar = data[j / 2]; - if (dataChar >= 32 && dataChar < 127) chrOut.append(Character.valueOf((char) dataChar)); - else chrOut.append('.'); + if (dataChar >= 32 && dataChar < 127) { + chrOut.append(Character.valueOf((char) dataChar)); + } else chrOut.append('.'); } hexDumpOut.append(hexOut.toString()); diff --git a/app/src/full/java/kellinwood/security/zipsigner/ResourceAdapter.java b/app/src/full/java/kellinwood/security/zipsigner/ResourceAdapter.java index bb7228333..993749ed3 100644 --- a/app/src/full/java/kellinwood/security/zipsigner/ResourceAdapter.java +++ b/app/src/full/java/kellinwood/security/zipsigner/ResourceAdapter.java @@ -14,7 +14,7 @@ public interface ResourceAdapter { GENERATING_SIGNATURE_FILE, GENERATING_SIGNATURE_BLOCK, COPYING_ZIP_ENTRY - }; + } public String getString(Item item, Object... args); } diff --git a/app/src/full/java/kellinwood/zipio/CentralEnd.java b/app/src/full/java/kellinwood/zipio/CentralEnd.java index 5c554a155..590e0dd2b 100644 --- a/app/src/full/java/kellinwood/zipio/CentralEnd.java +++ b/app/src/full/java/kellinwood/zipio/CentralEnd.java @@ -62,13 +62,19 @@ public class CentralEnd { if (debug) log.debug(String.format("This disk number: 0x%04x", numberThisDisk)); centralStartDisk = input.readShort(); - if (debug) log.debug(String.format("Central dir start disk number: 0x%04x", centralStartDisk)); + if (debug) { + log.debug(String.format("Central dir start disk number: 0x%04x", centralStartDisk)); + } numCentralEntries = input.readShort(); - if (debug) log.debug(String.format("Central entries on this disk: 0x%04x", numCentralEntries)); + if (debug) { + log.debug(String.format("Central entries on this disk: 0x%04x", numCentralEntries)); + } totalCentralEntries = input.readShort(); - if (debug) log.debug(String.format("Total number of central entries: 0x%04x", totalCentralEntries)); + if (debug) { + log.debug(String.format("Total number of central entries: 0x%04x", totalCentralEntries)); + } centralDirectorySize = input.readInt(); if (debug) log.debug(String.format("Central directory size: 0x%08x", centralDirectorySize)); diff --git a/app/src/full/java/kellinwood/zipio/ZioEntry.java b/app/src/full/java/kellinwood/zipio/ZioEntry.java index 3a29eb832..c3246bab3 100644 --- a/app/src/full/java/kellinwood/zipio/ZioEntry.java +++ b/app/src/full/java/kellinwood/zipio/ZioEntry.java @@ -149,7 +149,9 @@ public class ZioEntry implements Cloneable { input.seek(localHeaderOffset); - if (debug) getLogger().debug(String.format("FILE POSITION: 0x%08x", input.getFilePointer())); + if (debug) { + getLogger().debug(String.format("FILE POSITION: 0x%08x", input.getFilePointer())); + } // 0 4 Local file header signature = 0x04034b50 int signature = input.readInt(); @@ -169,12 +171,16 @@ public class ZioEntry implements Cloneable { // 4 2 Version needed to extract (minimum) /* versionRequired */ tmpShort = input.readShort(); - if (debug) log.debug(String.format("Version required: 0x%04x", tmpShort /*versionRequired*/)); + if (debug) { + log.debug(String.format("Version required: 0x%04x", tmpShort /*versionRequired*/)); + } // 6 2 General purpose bit flag /* generalPurposeBits */ tmpShort = input.readShort(); - if (debug) log.debug(String.format("General purpose bits: 0x%04x", tmpShort /* generalPurposeBits */)); + if (debug) { + log.debug(String.format("General purpose bits: 0x%04x", tmpShort /* generalPurposeBits */)); + } // 8 2 Compression method /* compression */ @@ -184,12 +190,16 @@ public class ZioEntry implements Cloneable { // 10 2 File last modification time /* modificationTime */ tmpShort = input.readShort(); - if (debug) log.debug(String.format("Modification time: 0x%04x", tmpShort /* modificationTime */)); + if (debug) { + log.debug(String.format("Modification time: 0x%04x", tmpShort /* modificationTime */)); + } // 12 2 File last modification date /* modificationDate */ tmpShort = input.readShort(); - if (debug) log.debug(String.format("Modification date: 0x%04x", tmpShort /* modificationDate */)); + if (debug) { + log.debug(String.format("Modification date: 0x%04x", tmpShort /* modificationDate */)); + } // 14 4 CRC-32 /* crc32 */ @@ -289,10 +299,14 @@ public class ZioEntry implements Cloneable { output.writeBytes(alignBytes, 0, numAlignBytes); } - if (debug) getLogger().debug(String.format(Locale.ENGLISH, "Data position 0x%08x", output.getFilePointer())); + if (debug) { + getLogger().debug(String.format(Locale.ENGLISH, "Data position 0x%08x", output.getFilePointer())); + } if (data != null) { output.writeBytes(data); - if (debug) getLogger().debug(String.format(Locale.ENGLISH, "Wrote %d bytes", data.length)); + if (debug) { + getLogger().debug(String.format(Locale.ENGLISH, "Wrote %d bytes", data.length)); + } } else { if (debug) getLogger().debug(String.format("Seeking to position 0x%08x", dataPosition)); @@ -306,7 +320,9 @@ public class ZioEntry implements Cloneable { int numRead = zipInput.in.read(buffer, 0, (int) Math.min(compressedSize - totalCount, bufferSize)); if (numRead > 0) { output.writeBytes(buffer, 0, numRead); - if (debug) getLogger().debug(String.format(Locale.ENGLISH, "Wrote %d bytes", numRead)); + if (debug) { + getLogger().debug(String.format(Locale.ENGLISH, "Wrote %d bytes", numRead)); + } totalCount += numRead; } else throw new IllegalStateException(String.format(Locale.ENGLISH, "EOF reached while copying %s with %d bytes left to go", filename, compressedSize - totalCount)); diff --git a/app/src/full/java/kellinwood/zipio/ZioEntryInputStream.java b/app/src/full/java/kellinwood/zipio/ZioEntryInputStream.java index 8992f592d..e0567ad7e 100644 --- a/app/src/full/java/kellinwood/zipio/ZioEntryInputStream.java +++ b/app/src/full/java/kellinwood/zipio/ZioEntryInputStream.java @@ -47,7 +47,9 @@ public class ZioEntryInputStream extends InputStream { raf = entry.getZipInput().in; long dpos = entry.getDataPosition(); if (dpos >= 0) { - if (debug) log.debug(String.format(Locale.ENGLISH, "Seeking to %d", entry.getDataPosition())); + if (debug) { + log.debug(String.format(Locale.ENGLISH, "Seeking to %d", entry.getDataPosition())); + } raf.seek(entry.getDataPosition()); } else { // seeks to, then reads, the local header, causing the @@ -118,7 +120,9 @@ public class ZioEntryInputStream extends InputStream { if (monitor != null) monitor.write(b, off, numRead); offset += numRead; } - if (debug) log.debug(String.format(Locale.ENGLISH, "Read %d bytes for read(b,%d,%d)", numRead, off, len)); + if (debug) { + log.debug(String.format(Locale.ENGLISH, "Read %d bytes for read(b,%d,%d)", numRead, off, len)); + } return numRead; } diff --git a/app/src/full/java/kellinwood/zipio/ZipInput.java b/app/src/full/java/kellinwood/zipio/ZipInput.java index 31e7b02c1..c74b6fee4 100644 --- a/app/src/full/java/kellinwood/zipio/ZipInput.java +++ b/app/src/full/java/kellinwood/zipio/ZipInput.java @@ -87,7 +87,9 @@ public class ZipInput implements Closeable { * to get the root entries. */ public Collection list(String path) { - if (!path.endsWith("/")) throw new IllegalArgumentException("Invalid path -- does not end with '/'"); + if (!path.endsWith("/")) { + throw new IllegalArgumentException("Invalid path -- does not end with '/'"); + } if (path.startsWith("/")) path = path.substring(1); diff --git a/app/src/full/java/kellinwood/zipio/ZipListingHelper.java b/app/src/full/java/kellinwood/zipio/ZipListingHelper.java index c70e0d063..2b22bf60f 100644 --- a/app/src/full/java/kellinwood/zipio/ZipListingHelper.java +++ b/app/src/full/java/kellinwood/zipio/ZipListingHelper.java @@ -37,7 +37,9 @@ public class ZipListingHelper { public static void listEntry(LoggerInterface log, ZioEntry entry) { int ratio = 0; - if (entry.getSize() > 0) ratio = (100 * (entry.getSize() - entry.getCompressedSize())) / entry.getSize(); + if (entry.getSize() > 0) { + ratio = (100 * (entry.getSize() - entry.getCompressedSize())) / entry.getSize(); + } log.debug(String.format(Locale.ENGLISH, "%8d %6s %8d %4d%% %s %08x %s", entry.getSize(), entry.getCompression() == 0 ? "Stored" : "Defl:N", diff --git a/app/src/full/java/org/fdroid/fdroid/nearby/LocalHTTPD.java b/app/src/full/java/org/fdroid/fdroid/nearby/LocalHTTPD.java index 33b5a9164..23be4ae4a 100644 --- a/app/src/full/java/org/fdroid/fdroid/nearby/LocalHTTPD.java +++ b/app/src/full/java/org/fdroid/fdroid/nearby/LocalHTTPD.java @@ -72,8 +72,7 @@ import fi.iki.elonen.NanoHTTPD.Response.IStatus; *

* This is mostly just synced from {@code SimpleWebServer.java} from NanoHTTPD. * - * @see - * webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java + * @see webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java */ public class LocalHTTPD extends NanoHTTPD { private static final String TAG = "LocalHTTPD"; diff --git a/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java b/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java index 83a671609..ce00dd094 100644 --- a/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java +++ b/app/src/full/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java @@ -85,10 +85,10 @@ public class WifiStateChangeService extends Worker { public static void registerReceiver(Context context) { ContextCompat.registerReceiver( - context, - new WifiStateChangeReceiver(), - new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION), - ContextCompat.RECEIVER_NOT_EXPORTED); + context, + new WifiStateChangeReceiver(), + new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION), + ContextCompat.RECEIVER_NOT_EXPORTED); } public static void start(Context context, @Nullable Intent intent) {