whitespace fixes from spotless applying AOSP code format

This commit is contained in:
Hans-Christoph Steiner 2023-06-21 12:11:35 +02:00
parent 560b24a006
commit 48a10cac17
84 changed files with 79 additions and 210 deletions

View File

@ -40,5 +40,4 @@ public class AssetUtils {
}
return tempFile;
}
}

View File

@ -368,6 +368,5 @@ public class Netstat {
",Status=" + status +
"]";
}
}
}

View File

@ -445,5 +445,4 @@ public class ApkVerifierTest {
}
assertTrue(ApkVerifier.requestedPermissionsEqual(expectedPermissions, apk.requestedPermissions));
}
}

View File

@ -33,5 +33,4 @@ public class HidingManager {
public static void showHideDialog(final Context context) {
throw new IllegalStateException("unimplemented");
}
}

View File

@ -59,8 +59,7 @@ public class FDroidServiceInfo extends ServiceInfoImpl implements Parcelable {
in.readInt(),
in.readInt(),
in.readByte() != 0,
readBytes(in)
);
readBytes(in));
int addressCount = in.readInt();
for (int i = 0; i < addressCount; i++) {

View File

@ -29,7 +29,6 @@ public interface LoggerInterface {
public void error(String message, Throwable t);
public boolean isWarningEnabled();
public void warning(String message);
@ -47,6 +46,4 @@ public interface LoggerInterface {
public void debug(String message);
public void debug(String message, Throwable t);
}

View File

@ -66,5 +66,4 @@ public class NullLoggerFactory implements LoggerFactory {
public LoggerInterface getLogger(String category) {
return logger;
}
}

View File

@ -32,5 +32,4 @@ public class StreamLogger extends AbstractLogger {
out.print(format(level, message));
if (t != null) t.printStackTrace(out);
}
}

View File

@ -1,4 +1,3 @@
package kellinwood.security.zipsigner;
public class AutoKeyException extends RuntimeException {

View File

@ -1,4 +1,3 @@
package kellinwood.security.zipsigner;
import java.util.Locale;
@ -31,6 +30,5 @@ public class DefaultResourceAdapter implements ResourceAdapter {
default:
throw new IllegalArgumentException("Unknown item " + item);
}
}
}

View File

@ -14,8 +14,6 @@
* limitations under the License.
*/
package kellinwood.security.zipsigner;
import org.bouncycastle.util.encoders.HexEncoder;
@ -56,7 +54,6 @@ public class HexDumpEncoder {
int dataChar = data[j / 2];
if (dataChar >= 32 && dataChar < 127) chrOut.append(Character.valueOf((char) dataChar));
else chrOut.append('.');
}
hexDumpOut.append(hexOut.toString());
@ -71,5 +68,4 @@ public class HexDumpEncoder {
throw new IllegalStateException(x.getClass().getName() + ": " + x.getMessage());
}
}
}

View File

@ -48,5 +48,4 @@ public class ProgressEvent {
public void setPriority(int priority) {
this.priority = priority;
}
}

View File

@ -1,4 +1,3 @@
package kellinwood.security.zipsigner;
/**
@ -15,9 +14,7 @@ public interface ResourceAdapter {
GENERATING_SIGNATURE_FILE,
GENERATING_SIGNATURE_BLOCK,
COPYING_ZIP_ENTRY
}
;
};
public String getString(Item item, Object... args);
}

View File

@ -22,11 +22,10 @@
* - removal of main()
* - switch to a signature generation method that verifies
* in Android recovery
* - eliminated dependency on sun.security and sun.misc APIs by
* - eliminated dependency on sun.security and sun.misc APIs by
* using signature block template files.
*/
package kellinwood.security.zipsigner;
import android.util.Base64;
@ -135,7 +134,6 @@ public class ZipSigner {
autoKeyDetect.put("e60418c4b638f20d0721e115674ca11f", "platform");
autoKeyDetect.put("3e24e49741b60c215c010dc6048fca7d", "shared");
autoKeyDetect.put("dab2cead827ef5313f28e22b6fa8479f", "testkey");
}
public ResourceAdapter getResourceAdapter() {
@ -170,14 +168,12 @@ public class ZipSigner {
return SUPPORTED_KEY_MODES;
}
protected String autoDetectKey(String mode, Map<String, ZioEntry> zioEntries)
throws NoSuchAlgorithmException, IOException {
boolean debug = getLogger().isDebugEnabled();
if (!mode.startsWith(MODE_AUTO)) return mode;
// Auto-determine which keys to use
String keyName = null;
// Start by finding the signature block file in the input.
@ -185,11 +181,11 @@ public class ZipSigner {
String entryName = entry.getKey();
if (entryName.startsWith("META-INF/") && entryName.endsWith(".RSA")) {
// Compute MD5 of the first 1458 bytes, which is the size of our signature block templates --
// e.g., the portion of the sig block file that is the same for a given certificate.
// Compute MD5 of the first 1458 bytes, which is the size of our signature block templates --
// e.g., the portion of the sig block file that is the same for a given certificate.
MessageDigest md5 = MessageDigest.getInstance("MD5");
byte[] entryData = entry.getValue().getData();
if (entryData.length < 1458) break; // sig block too short to be a supported key
if (entryData.length < 1458) break; // sig block too short to be a supported key
md5.update(entryData, 0, 1458);
byte[] rawDigest = md5.digest();
@ -203,7 +199,6 @@ public class ZipSigner {
// Lookup the key name
keyName = autoKeyDetect.get(md5String);
if (debug) {
if (keyName != null) {
getLogger().debug(String.format("Auto-determined key=%s using md5=%s", keyName, md5String));
@ -559,7 +554,6 @@ public class ZipSigner {
ZioEntry inEntry = input.get(name);
inEntry.setTime(timestamp);
output.write(inEntry);
}
}
@ -604,7 +598,6 @@ public class ZipSigner {
IOException, GeneralSecurityException {
InputStream keystoreStream = null;
try {
KeyStore keystore = null;
if (keystoreType == null) keystoreType = KeyStore.getDefaultType();
@ -625,7 +618,6 @@ public class ZipSigner {
}
}
/**
* Sign the input with the default test key and certificate.
* Save result to output file.
@ -636,7 +628,6 @@ public class ZipSigner {
signZip(zioEntries, new FileOutputStream(outputZipFilename), outputZipFilename);
}
/**
* Sign the file using the given public key cert, private key,
* and signature block template. The signature block template
@ -690,15 +681,12 @@ public class ZipSigner {
autoKeyObservable.notifyObservers(keyName);
loadKeys(keyName);
}
ZipOutput zipOutput = null;
try {
zipOutput = new ZipOutput(outputStream);
if (KEY_NONE.equals(keySet.getName())) {
@ -735,7 +723,6 @@ public class ZipSigner {
manifest.write(ze.getOutputStream());
zipOutput.write(ze);
// CERT.SF
ze = new ZioEntry(CERT_SF_NAME);
ze.setTime(timestamp);
@ -783,13 +770,11 @@ public class ZipSigner {
progressHelper.removeProgressListener(l);
}
public static class AutoKeyObservable extends Observable {
@Override
public void notifyObservers(Object arg) {
super.setChanged();
super.notifyObservers(arg);
}
}
}

View File

@ -1,4 +1,3 @@
package kellinwood.security.zipsigner.optional;
import org.bouncycastle.cert.jcajce.JcaCertStore;
@ -58,5 +57,4 @@ public class SignatureBlockGenerator {
throw new RuntimeException(x.getMessage(), x);
}
}
}

View File

@ -23,7 +23,7 @@ import kellinwood.logging.LoggerManager;
public class CentralEnd {
public int signature = 0x06054b50; // end of central dir signature 4 bytes
public short numberThisDisk = 0; // number of this disk 2 bytes
public short numberThisDisk = 0; // number of this disk 2 bytes
public short centralStartDisk = 0; // number of the disk with the start of the central directory 2 bytes
public short numCentralEntries; // total number of entries in the central directory on this disk 2 bytes
public short totalCentralEntries; // total number of entries in the central directory 2 bytes
@ -54,7 +54,6 @@ public class CentralEnd {
return log;
}
private void doRead(ZipInput input) throws IOException {
boolean debug = getLogger().isDebugEnabled();
@ -80,11 +79,8 @@ public class CentralEnd {
short zipFileCommentLen = input.readShort();
fileComment = input.readString(zipFileCommentLen);
if (debug) log.debug(".ZIP file comment: " + fileComment);
}
public void write(ZipOutput output) throws IOException {
boolean debug = getLogger().isDebugEnabled();
@ -98,8 +94,5 @@ public class CentralEnd {
output.writeInt(centralStartOffset);
output.writeShort((short) fileComment.length());
output.writeString(fileComment);
}
}

View File

@ -59,7 +59,6 @@ public class ZioEntry implements Cloneable {
private byte[] data = null;
private ZioEntryOutputStream entryOut = null;
private static byte[] alignBytes = new byte[4];
private static LoggerInterface log;
@ -81,7 +80,6 @@ public class ZioEntry implements Cloneable {
setTime(System.currentTimeMillis());
}
public ZioEntry(String name, String sourceDataFile)
throws IOException {
zipInput = new ZipInput(sourceDataFile);
@ -216,7 +214,7 @@ public class ZioEntry implements Cloneable {
short extraLen = input.readShort();
if (debug) log.debug(String.format("Extra length: 0x%04x", extraLen));
// 30 n File name
// 30 n File name
String filename = input.readString(fileNameLen);
if (debug) log.debug("Filename: " + filename);
@ -226,7 +224,6 @@ public class ZioEntry implements Cloneable {
// Record the file position of this entry's data.
dataPosition = input.getFilePointer();
if (debug) log.debug(String.format("Data position: 0x%08x", dataPosition));
}
public void writeLocalEntry(ZipOutput output) throws IOException {
@ -278,7 +275,6 @@ public class ZioEntry implements Cloneable {
}
}
// 28 2 Extra field length (m)
output.writeShort((short) (extraData.length + numAlignBytes));
@ -401,7 +397,7 @@ public class ZioEntry implements Cloneable {
localHeaderOffset = input.readInt();
if (debug) log.debug(String.format("Local header offset: 0x%08x", localHeaderOffset));
// 30 n File name
// 30 n File name
filename = input.readString(fileNameLen);
if (debug) log.debug("Filename: " + filename);
@ -418,7 +414,6 @@ public class ZioEntry implements Cloneable {
compression = 0;
crc32 = 0;
}
}
/**
@ -441,12 +436,12 @@ public class ZioEntry implements Cloneable {
return tmpdata;
}
// Returns an input stream for reading the entry's data.
// Returns an input stream for reading the entry's data.
public InputStream getInputStream() throws IOException {
return getInputStream(null);
}
// Returns an input stream for reading the entry's data.
// Returns an input stream for reading the entry's data.
public InputStream getInputStream(OutputStream monitorStream) throws IOException {
if (entryOut != null) {
@ -459,8 +454,8 @@ public class ZioEntry implements Cloneable {
InputStream rawis = new ByteArrayInputStream(data);
if (compression == 0) return rawis;
else {
// Hacky, inflate using a sequence of input streams that returns 1 byte more than the actual length of the data.
// This extra dummy byte is required by InflaterInputStream when the data doesn't have the header and crc fields (as it is in zip files).
// Hacky, inflate using a sequence of input streams that returns 1 byte more than the actual length of the data.
// This extra dummy byte is required by InflaterInputStream when the data doesn't have the header and crc fields (as it is in zip files).
return new InflaterInputStream(new SequenceInputStream(rawis, new ByteArrayInputStream(new byte[1])), new Inflater(true));
}
}
@ -469,8 +464,8 @@ public class ZioEntry implements Cloneable {
dataStream = new ZioEntryInputStream(this);
if (monitorStream != null) dataStream.setMonitorStream(monitorStream);
if (compression != 0) {
// Note: When using nowrap=true with Inflater it is also necessary to provide
// an extra "dummy" byte as input. This is required by the ZLIB native library
// Note: When using nowrap=true with Inflater it is also necessary to provide
// an extra "dummy" byte as input. This is required by the ZLIB native library
// in order to support certain optimizations.
dataStream.setReturnDummyByte(true);
return new InflaterInputStream(dataStream, new Inflater(true));
@ -483,11 +478,9 @@ public class ZioEntry implements Cloneable {
return entryOut;
}
public void write(ZipOutput output) throws IOException {
boolean debug = getLogger().isDebugEnabled();
output.writeInt(0x02014b50);
output.writeShort(versionMadeBy);
output.writeShort(versionRequired);
@ -510,7 +503,6 @@ public class ZioEntry implements Cloneable {
output.writeBytes(extraData);
if (numAlignBytes > 0) output.writeBytes(alignBytes, 0, numAlignBytes);
output.writeString(fileComment);
}
/*
@ -628,5 +620,4 @@ public class ZioEntry implements Cloneable {
public ZipInput getZipInput() {
return zipInput;
}
}

View File

@ -25,7 +25,6 @@ import java.util.Locale;
import kellinwood.logging.LoggerInterface;
import kellinwood.logging.LoggerManager;
/**
* Input stream used to read just the data from a zip file entry.
*/
@ -51,11 +50,10 @@ public class ZioEntryInputStream extends InputStream {
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
// seeks to, then reads, the local header, causing the
// file pointer to be positioned at the start of the data.
entry.readLocalHeader();
}
}
public void setReturnDummyByte(boolean returnExtraByte) {
@ -137,5 +135,3 @@ public class ZioEntryInputStream extends InputStream {
return numToSkip;
}
}

View File

@ -23,7 +23,7 @@ import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;
public class ZioEntryOutputStream extends OutputStream {
int size = 0; // tracks uncompressed size of data
int size = 0; // tracks uncompressed size of data
CRC32 crc = new CRC32();
int crcValue = 0;
OutputStream wrapped;
@ -82,6 +82,4 @@ public class ZioEntryOutputStream extends OutputStream {
public OutputStream getWrappedStream() {
return wrapped;
}
}

View File

@ -73,7 +73,6 @@ public class ZipInput implements Closeable {
return zipInput;
}
public ZioEntry getEntry(String filename) {
return zioEntries.get(filename);
}
@ -140,7 +139,6 @@ public class ZipInput implements Closeable {
return scanForEOCDR(size * 2);
}
private void doRead() {
try {
int bufferSize = 256;
@ -232,5 +230,3 @@ public class ZipInput implements Closeable {
return in.read(b, offset, length);
}
}

View File

@ -33,7 +33,6 @@ public class ZipListingHelper {
public static void listHeader(LoggerInterface log) {
log.debug(" Length Method Size Ratio Date Time CRC-32 Name");
log.debug("-------- ------ ------- ----- ---- ---- ------ ----");
}
public static void listEntry(LoggerInterface log, ZioEntry entry) {
@ -49,5 +48,3 @@ public class ZipListingHelper {
entry.getName()));
}
}

View File

@ -28,9 +28,6 @@ import java.util.Set;
import kellinwood.logging.LoggerInterface;
import kellinwood.logging.LoggerManager;
/**
*
*/
public class ZipOutput {
static LoggerInterface log;
@ -58,7 +55,6 @@ public class ZipOutput {
if (ofile.exists()) ofile.delete();
out = new FileOutputStream(ofile);
if (getLogger().isDebugEnabled()) ZipListingHelper.listHeader(getLogger());
}
public ZipOutput(OutputStream os) throws IOException {
@ -80,10 +76,8 @@ public class ZipOutput {
entriesWritten.add(entry);
namesWritten.add(entryName);
if (getLogger().isDebugEnabled()) ZipListingHelper.listEntry(getLogger(), entry);
}
public void close() throws IOException {
CentralEnd centralEnd = new CentralEnd();
@ -109,7 +103,6 @@ public class ZipOutput {
return filePointer;
}
public void writeInt(int value) throws IOException {
byte[] data = new byte[4];
for (int i = 0; i < 4; i++) {
@ -148,7 +141,4 @@ public class ZipOutput {
out.write(value, offset, length);
filePointer += length;
}
}

View File

@ -134,7 +134,6 @@ public class BluetoothServer extends Thread {
}
connection.closeQuietly();
}
private Response handleRequest(Request request) {
@ -344,5 +343,4 @@ public class BluetoothServer extends Thread {
return null;
}
}
}

View File

@ -374,5 +374,4 @@ public final class LocalRepoKeyStore {
return wrapped.getServerAliases(keyType, issuers);
}
}
}

View File

@ -295,7 +295,5 @@ public final class LocalRepoManager {
} finally {
attemptToDelete(indexJarUnsigned);
}
}
}

View File

@ -162,5 +162,4 @@ public class SDCardScannerService extends IntentService {
Utils.closeQuietly(inputStream);
}
}
}

View File

@ -219,5 +219,4 @@ public class SelectAppsView extends SwapView {
this(packageInfo.packageName, Utils.getApplicationLabel(context, packageInfo.packageName));
}
}
}

View File

@ -33,7 +33,6 @@ import android.util.Log;
import org.fdroid.fdroid.views.main.NearbyViewBinder;
/**
* This is just a shim to receive {@link UsbManager#ACTION_USB_ACCESSORY_ATTACHED}
* events.
@ -41,7 +40,6 @@ import org.fdroid.fdroid.views.main.NearbyViewBinder;
public class UsbDeviceAttachedReceiver extends BroadcastReceiver {
public static final String TAG = "UsbDeviceAttachedReceiv";
@Override
public void onReceive(final Context context, Intent intent) {

View File

@ -157,5 +157,4 @@ public class CalculatorActivity extends AppCompatActivity {
}
return s;
}
}

View File

@ -29,5 +29,4 @@ public class ExitActivity extends AppCompatActivity {
});
}
}

View File

@ -284,5 +284,4 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
builder.setView(R.layout.dialog_app_hiding);
builder.create().show();
}
}

View File

@ -110,5 +110,4 @@ public final class Contents {
ContactsContract.Intents.Insert.SECONDARY_EMAIL_TYPE,
ContactsContract.Intents.Insert.TERTIARY_EMAIL_TYPE,
};
}

View File

@ -181,7 +181,6 @@ public final class QRCodeEncoder {
contents = null;
displayContents = null;
}
}
break;
case Contents.Type.LOCATION:

View File

@ -105,7 +105,7 @@ import java.util.Map;
* @author Isaac Potoczny-Jones
* @author Brad Drehmer
* @author gcstang
*/
*/
@SuppressWarnings("LineLength")
public class IntentIntegrator {
@ -438,5 +438,4 @@ public class IntentIntegrator {
}
}
}
}

View File

@ -86,5 +86,4 @@ public final class IntentResult {
return "Format: " + formatName + '\n' + "Contents: " + contents + '\n' + "Raw bytes: (" + rawBytesLength
+ " bytes)\n" + "Orientation: " + orientation + '\n' + "EC level: " + errorCorrectionLevel + '\n';
}
}

View File

@ -96,5 +96,4 @@ public class Hasher {
}
return rawdata;
}
}

View File

@ -200,5 +200,4 @@ public final class Languages {
new Locale("uk"),
new Locale("vi"),
};
}

View File

@ -38,7 +38,7 @@ public class NfcHelper {
try {
appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
Uri[] uris = {
Uri.parse("file://" + appInfo.publicSourceDir),
Uri.parse("file://" + appInfo.publicSourceDir),
};
nfcAdapter.setBeamPushUris(uris, activity);
} catch (PackageManager.NameNotFoundException e) {
@ -53,5 +53,4 @@ public class NfcHelper {
nfcAdapter.setBeamPushUris(null, activity);
}
}
}

View File

@ -681,5 +681,4 @@ public final class Preferences implements SharedPreferences.OnSharedPreferenceCh
}
return instance;
}
}

View File

@ -111,7 +111,7 @@ public final class Utils {
private static final int BUFFER_SIZE = 4096;
private static final String[] FRIENDLY_SIZE_FORMAT = {
"%.0f B", "%.0f KiB", "%.1f MiB", "%.2f GiB",
"%.0f B", "%.0f KiB", "%.1f MiB", "%.2f GiB",
};
private static RequestOptions iconRequestOptions;
@ -272,37 +272,37 @@ public final class Utils {
}
private static final String[] ANDROID_VERSION_NAMES = {
"?", // 0, undefined
"1.0", // 1
"1.1", // 2
"1.5", // 3
"1.6", // 4
"2.0", // 5
"2.0.1", // 6
"2.1", // 7
"2.2", // 8
"2.3", // 9
"2.3.3", // 10
"3.0", // 11
"3.1", // 12
"3.2", // 13
"4.0", // 14
"4.0.3", // 15
"4.1", // 16
"4.2", // 17
"4.3", // 18
"4.4", // 19
"4.4W", // 20
"5.0", // 21
"5.1", // 22
"6.0", // 23
"7.0", // 24
"7.1", // 25
"8.0", // 26
"8.1", // 27
"9.0", // 28
"10.0", // 29
"11.0", // 30
"?", // 0, undefined
"1.0", // 1
"1.1", // 2
"1.5", // 3
"1.6", // 4
"2.0", // 5
"2.0.1", // 6
"2.1", // 7
"2.2", // 8
"2.3", // 9
"2.3.3", // 10
"3.0", // 11
"3.1", // 12
"3.2", // 13
"4.0", // 14
"4.0.3", // 15
"4.1", // 16
"4.2", // 17
"4.3", // 18
"4.4", // 19
"4.4W", // 20
"5.0", // 21
"5.1", // 22
"6.0", // 23
"7.0", // 24
"7.1", // 25
"8.0", // 26
"8.1", // 27
"9.0", // 28
"10.0", // 29
"11.0", // 30
};
public static String getAndroidVersionName(int sdkLevel) {

View File

@ -39,7 +39,6 @@ public class FileCompat {
// Do nothing...
}
}
}
static void symlinkOs(SanitizedFile source, SanitizedFile dest) {
@ -75,5 +74,4 @@ public class FileCompat {
Log.e(TAG, "Could not symlink " + source.getAbsolutePath() + " to " + dest.getAbsolutePath(), e);
}
}
}

View File

@ -31,15 +31,14 @@ public class PackageManagerCompat {
if (Build.VERSION.SDK_INT >= 30) return; // not working anymore on this SDK level
try {
if (Build.VERSION.SDK_INT >= 24 && PrivilegedInstaller.isDefault(context)) {
mPm.setInstallerPackageName(packageName, PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME);
mPm.setInstallerPackageName(
packageName, PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME);
} else {
mPm.setInstallerPackageName(packageName, BuildConfig.APPLICATION_ID);
}
Utils.debugLog(TAG, "Installer package name for " + packageName + " set successfully");
} catch (SecurityException | IllegalArgumentException e) {
Log.e(TAG, "Could not set installer package name for " +
packageName, e);
Log.e(TAG, "Could not set installer package name for " + packageName, e);
}
}
}

View File

@ -86,6 +86,7 @@ public class App implements Comparable<App>, Parcelable {
* True if compatible with the device (i.e. if at least one apk is)
*/
public boolean compatible;
public Apk installedApk; // might be null if not installed
public String installedSigner;
public long installedVersionCode;
@ -825,5 +826,4 @@ public class App implements Comparable<App>, Parcelable {
return null;
}
}

View File

@ -44,8 +44,17 @@ final class ContentProviderMigrator {
List<Repository> repos = repoDao.getRepositories();
int weight = repos.isEmpty() ? 0 : repos.get(repos.size() - 1).getWeight();
String[] projection = new String[]{"name", "address", "pubkey", "inuse", "userMirrors", "disabledMirrors",
"username", "password"};
String[] projection =
new String[] {
"name",
"address",
"pubkey",
"inuse",
"userMirrors",
"disabledMirrors",
"username",
"password"
};
try (Cursor c = oldDb.query("fdroid_repo", projection, null, null, null, null, null)) {
while (c.moveToNext()) {
String name = c.getString(c.getColumnIndexOrThrow("name"));

View File

@ -232,5 +232,4 @@ public class DBHelper {
+ repoItems.size() + " % " + (REPO_XML_ITEM_COUNT - 1) + " != 0");
return new LinkedList<>();
}
}

View File

@ -66,5 +66,4 @@ public class SanitizedFile extends File {
public static SanitizedFile knownSanitized(File file) {
return new SanitizedFile(file);
}
}

View File

@ -105,5 +105,4 @@ public class ApkFileProvider extends FileProvider {
return Uri.fromFile(tempFile);
}
}
}

View File

@ -138,5 +138,4 @@ class ApkVerifier {
super(message);
}
}
}

View File

@ -202,5 +202,4 @@ public class DefaultInstallerActivity extends FragmentActivity {
// after doing the broadcasts, finish this transparent wrapper activity
finish();
}
}

View File

@ -41,6 +41,7 @@ public class FileInstallerActivity extends FragmentActivity {
private App app;
private Apk apk;
private Uri localApkUri;
/**
* @see InstallManagerService
*/
@ -77,7 +78,6 @@ public class FileInstallerActivity extends FragmentActivity {
} else {
throw new IllegalStateException("Intent action not specified!");
}
}
private boolean hasStoragePermission() {

View File

@ -50,13 +50,14 @@ public class InstallHistoryService extends JobIntentService {
public static final String TAG = "InstallHistoryService";
private static final int JOB_ID = TAG.hashCode();
public static final Uri LOG_URI = Uri.parse("content://" + Installer.AUTHORITY + "/install_history/all");
public static final Uri LOG_URI =
Uri.parse("content://" + Installer.AUTHORITY + "/install_history/all");
private static BroadcastReceiver broadcastReceiver;
public static void register(Context context) {
if (broadcastReceiver != null) {
return; // already registered
return; // already registered
}
IntentFilter intentFilter = new IntentFilter();
intentFilter.addDataScheme("http");

View File

@ -245,5 +245,4 @@ public class SessionInstallManager extends BroadcastReceiver {
// TODO check targetSdk Android 14 sources have been published, just a guess so far
return Build.VERSION.SDK_INT == 34 && targetSdk >= 31;
}
}

View File

@ -39,5 +39,4 @@ class SessionInstaller extends Installer {
// may not always be unattended, but no easy way to find out up-front
return SessionInstallManager.canBeUsed(context);
}
}

View File

@ -14,5 +14,4 @@ class BluetoothConstants {
// This UUID is just from mashing random hex characters on the keyboard.
return UUID.fromString("cd59ba31-5729-b3bb-cb29-732b59eb61aa");
}
}

View File

@ -10,5 +10,4 @@ public class ContentLengthHeader extends Header {
public void handle(FileDetails details, String value) {
details.setFileSize(Integer.parseInt(value));
}
}

View File

@ -10,5 +10,4 @@ public class ETagHeader extends Header {
public void handle(FileDetails details, String value) {
details.setCacheTag(value);
}
}

View File

@ -22,5 +22,4 @@ public abstract class Header {
}
}
}
}

View File

@ -190,7 +190,6 @@ public final class Request {
} else {
break;
}
}
return headers;
}
@ -202,5 +201,4 @@ public final class Request {
public String getMethod() {
return method;
}
}

View File

@ -117,7 +117,6 @@ public class Response {
}
output.flush();
}
public static class Builder {
@ -163,6 +162,5 @@ public class Response {
return new Response(statusCode, headers, contentStream);
}
}
}

View File

@ -109,5 +109,4 @@ public class BluetoothDownloader extends Downloader {
connection.closeQuietly();
}
}
}

View File

@ -95,7 +95,7 @@ public class TreeUriDownloader extends Downloader {
@Override
public boolean hasChanged() {
return true; // TODO how should this actually be implemented?
return true; // TODO how should this actually be implemented?
}
@Override

View File

@ -130,7 +130,6 @@ public class AppSecurityPermissions {
DrawableCompat.setTint(wrappedIconDrawable, theme == Preferences.Theme.light ? Color.BLACK : Color.WHITE);
return wrappedIconDrawable;
}
}
// PermissionInfo implements Parcelable but its Parcel constructor is private and thus cannot be extended.
@ -233,7 +232,6 @@ public class AppSecurityPermissions {
dialog.dismiss();
}
}
}
private AppSecurityPermissions(Context context) {

View File

@ -45,7 +45,6 @@ public class CameraCharacteristicsMinApiLevel21 extends CameraCharacteristicsChe
Log.e(TAG, e.getMessage(), e);
throw new FDroidDeviceException("Exception accessing the camera list", e);
}
}
@NonNull
@ -106,5 +105,4 @@ public class CameraCharacteristicsMinApiLevel21 extends CameraCharacteristicsChe
private boolean isAutofocus(final int mode) {
return mode != android.hardware.camera2.CameraMetadata.CONTROL_AF_MODE_OFF;
}
}

View File

@ -36,5 +36,4 @@ public class StartupReceiver extends BroadcastReceiver {
Utils.debugLog(TAG, "received unsupported Intent " + intent);
}
}
}

View File

@ -516,7 +516,6 @@ public class AppDetailsActivity extends AppCompatActivity
// Ignore.
break;
}
}
private final BroadcastReceiver appStatusReceiver = new BroadcastReceiver() {
@ -846,5 +845,4 @@ public class AppDetailsActivity extends AppCompatActivity
}
startUninstall();
}
}

View File

@ -96,7 +96,6 @@ public class AppDetailsRecyclerViewAdapter
void installCancel();
void launchApk();
}
private static final int VIEWTYPE_HEADER = 0;

View File

@ -131,7 +131,6 @@ public class AntiFeaturesListingView extends RecyclerView {
antiFeatureText = itemView.findViewById(R.id.anti_feature_text);
antiFeatureReason = itemView.findViewById(R.id.anti_feature_reason);
}
}
private static String getAntiFeatureDescriptionText(Context context, String antiFeatureName) {

View File

@ -137,5 +137,4 @@ public class AppListItemState {
this.checkBoxChecked = checked;
return this;
}
}

View File

@ -40,7 +40,7 @@ class AppPreviewAdapter extends RecyclerView.Adapter<AppCardController> {
void setAppCursor(List<AppOverviewItem> items) {
if (this.items == items) {
//don't notify when the cursor did not change
// don't notify when the cursor did not change
return;
}
this.items = items;

View File

@ -157,5 +157,4 @@ class CategoriesViewBinder implements Observer<List<Category>> {
});
return items;
}
}
}

View File

@ -108,7 +108,7 @@ public class LatestAdapter extends RecyclerView.Adapter<AppCardController> {
public void setApps(@Nullable List<AppOverviewItem> apps) {
if (this.apps == apps) {
//don't notify when the apps did not change
// don't notify when the apps did not change
return;
}
this.apps = apps;

View File

@ -401,5 +401,4 @@ public class MainActivity extends AppCompatActivity {
return false;
}
}
}

View File

@ -80,5 +80,4 @@ public class SettingsView extends FrameLayout {
currentTransaction = null;
activity.getSupportFragmentManager().executePendingTransactions();
}
}

View File

@ -66,5 +66,4 @@ public class UpdatesItemTouchCallback extends ItemTouchHelper.Callback {
public boolean isItemViewSwipeEnabled() {
return true;
}
}

View File

@ -57,5 +57,4 @@ public class AppStatus extends AppUpdateData {
((AppStatusListItemController) holder).bindModel(app.status.app, app.status.apk, app.status);
}
}
}

View File

@ -63,9 +63,7 @@ public class AppStatusListItemController extends AppListItemController {
final AppUpdateStatus appUpdateStatus = manager.get(status.getCanonicalUrl());
manager.removeApk(status.getCanonicalUrl());
switch (status.status) {
case Downloading:
cancelDownload();
Snackbar.make(itemView, R.string.app_list__dismiss_downloading_app, Snackbar.LENGTH_SHORT).show();
@ -89,5 +87,4 @@ public class AppStatusListItemController extends AppListItemController {
adapter.refreshItems();
}
}

View File

@ -62,5 +62,4 @@ public class KnownVulnApp extends AppUpdateData {
((KnownVulnAppListItemController) holder).bindModel(app.app, app.apk, null);
}
}
}

View File

@ -60,5 +60,4 @@ public class UpdateableApp extends AppUpdateData {
((UpdateableAppListItemController) holder).bindModel(app.app, app.apk, null);
}
}
}

View File

@ -118,5 +118,4 @@ public class UpdateableAppsHeader extends AppUpdateData {
}
}
}
}

View File

@ -43,7 +43,6 @@ public class SanitizedFileTest {
assertEquals("safe", safeSanitized.getName());
assertEquals("safe-and_bleh.boo", nonEvilSanitized.getName());
assertEquals("rm etcshadow", evilSanitized.getName());
}
@Test

View File

@ -138,5 +138,4 @@ public class SuggestedVersionTest {
AppPrefs appPrefs = new AppPrefs(app.packageName, 0, Collections.singletonList(releaseChannel));
assertEquals(hasUpdates, app.hasUpdates(apks, appPrefs));
}
}

View File

@ -21,5 +21,4 @@ public class MainActivityTest {
assertNotEquals(invalid, MainActivity.sanitizeSearchTerms(invalid));
}
}
}

View File

@ -34,13 +34,13 @@ import java.util.jar.JarOutputStream;
* This test the JAR signing functions of {@link ZipSigner}.
*/
@RunWith(RobolectricTestRunner.class)
@Config(sdk={23, 25, 32}) // minSdkVersion, targetSdkVersion, max SDK supported by Robolectric
@Config(sdk = {23, 25, 32}) // minSdkVersion, targetSdkVersion, max SDK supported by Robolectric
public class ZipSignerTest {
public static final String TAG = "ZipSignerTest";
private File unsigned;
private File signed;
@Before
public void setUp() {
ShadowLog.stream = System.out;
@ -58,7 +58,7 @@ public class ZipSignerTest {
fail();
}
}
@After
public void tearDown() {
if (unsigned != null) {
@ -72,7 +72,7 @@ public class ZipSignerTest {
@Test
public void testSignApk()
throws CertificateException, ClassNotFoundException, GeneralSecurityException, IllegalAccessException, InstantiationException, IOException, NoSuchAlgorithmException, OperatorCreationException {
System.out.println("wrote " + unsigned);
assertTrue(unsigned.exists());
assertTrue(unsigned.length() > 0);
@ -90,5 +90,5 @@ public class ZipSignerTest {
assertTrue(signed.exists());
assertTrue(signed.length() > unsigned.length());
}
}
}

View File

@ -19,7 +19,6 @@ import org.robolectric.shadows.ShadowLog;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* Test that this can start and stop the webserver.
*/