Apply a few android studio fixes
This commit is contained in:
parent
869662152a
commit
bc98fd69b1
@ -5,16 +5,16 @@ import android.os.Build;
|
||||
public abstract class Compatibility {
|
||||
|
||||
// like minSdkVersion
|
||||
protected static final boolean hasApi(int apiLevel) {
|
||||
protected static boolean hasApi(int apiLevel) {
|
||||
return getApi() >= apiLevel;
|
||||
}
|
||||
|
||||
// like maxSdkVersion
|
||||
protected static final boolean upToApi(int apiLevel) {
|
||||
protected static boolean upToApi(int apiLevel) {
|
||||
return (apiLevel < 1 || getApi() <= apiLevel);
|
||||
}
|
||||
|
||||
protected static final int getApi() {
|
||||
protected static int getApi() {
|
||||
return Build.VERSION.SDK_INT;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.fdroid.fdroid.compat;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
|
||||
public class SupportedArchitectures extends Compatibility {
|
||||
@ -8,6 +7,7 @@ public class SupportedArchitectures extends Compatibility {
|
||||
/**
|
||||
* The most preferred ABI is the first element in the list.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@SuppressWarnings("deprecation")
|
||||
public static String[] getAbis() {
|
||||
if (hasApi(21)) {
|
||||
|
@ -21,10 +21,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
|
@ -47,13 +47,11 @@ public class RootInstaller extends Installer {
|
||||
}
|
||||
|
||||
private Shell.Builder createShellBuilder() {
|
||||
Shell.Builder shellBuilder = new Shell.Builder()
|
||||
return new Shell.Builder()
|
||||
.useSU()
|
||||
.setWantSTDERR(true)
|
||||
.setWatchdogTimeout(30)
|
||||
.setMinimalLogging(false);
|
||||
|
||||
return shellBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -272,8 +272,7 @@ public class LocalRepoKeyStore {
|
||||
private KeyPair generateRandomKeypair() throws NoSuchAlgorithmException {
|
||||
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(DEFAULT_KEY_ALGO);
|
||||
keyPairGenerator.initialize(DEFAULT_KEY_BITS);
|
||||
KeyPair keyPair = keyPairGenerator.generateKeyPair();
|
||||
return keyPair;
|
||||
return keyPairGenerator.generateKeyPair();
|
||||
}
|
||||
|
||||
private Certificate generateSelfSignedCertChain(KeyPair kp, X500Name subject)
|
||||
|
@ -119,12 +119,12 @@ public class SignedRepoUpdater extends RepoUpdater {
|
||||
@Override
|
||||
protected File getIndexFromFile(File downloadedFile) throws
|
||||
UpdateException {
|
||||
Date updateTime = new Date(System.currentTimeMillis());
|
||||
final Date updateTime = new Date(System.currentTimeMillis());
|
||||
Log.d(TAG, "Getting signed index from " + repo.address + " at " +
|
||||
Utils.formatLogDate(updateTime));
|
||||
|
||||
File indexJar = downloadedFile;
|
||||
File indexXml = null;
|
||||
final File indexJar = downloadedFile;
|
||||
File indexXml = null;
|
||||
|
||||
// Don't worry about checking the status code for 200. If it was a
|
||||
// successful download, then we will have a file ready to use:
|
||||
|
@ -141,14 +141,13 @@ public class SelectLocalAppsFragment extends ListFragment
|
||||
} else {
|
||||
baseUri = InstalledAppProvider.getSearchUri(mCurrentFilterString);
|
||||
}
|
||||
CursorLoader loader = new CursorLoader(
|
||||
return new CursorLoader(
|
||||
this.getActivity(),
|
||||
baseUri,
|
||||
InstalledAppProvider.DataColumns.ALL,
|
||||
null,
|
||||
null,
|
||||
InstalledAppProvider.DataColumns.APPLICATION_LABEL);
|
||||
return loader;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -88,7 +88,6 @@ public class ConfirmReceiveSwapFragment extends Fragment implements ProgressList
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private Repo ensureRepoExists() {
|
||||
if (!newRepoConfig.isValidRepo()) {
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user