[app] Bump minSdkVersion to 23

This is done, because index v2 is signed with apksigner --min-sdk-version 23 by fdroidserver. So to ensure that the client will always be able to verify a v2 index, we force clients to run SDK 23 at least. If they were running 22 and apksigner ever upgrades to incompatible signing algorithms, those clients would get locked out.
This commit is contained in:
Torsten Grote
2022-09-12 14:04:58 -03:00
committed by Hans-Christoph Steiner
parent 82ecf7c0ab
commit 03b536779f
31 changed files with 15 additions and 106 deletions

View File

@@ -130,7 +130,7 @@ final public class WifiApControl {
// the actual class when first called.
public static WifiApControl getInstance(Context context) {
if (instance == null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.System.canWrite(context)) {
if (!Settings.System.canWrite(context)) {
Log.e(TAG, "6.0 or later, but haven't been granted WRITE_SETTINGS!");
return null;
}
@@ -139,36 +139,8 @@ final public class WifiApControl {
return instance;
}
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
private static String getDeviceName(WifiManager wifiManager) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Log.w(TAG, "6.0 or later, unaccessible MAC - falling back to the default device name: " + FALLBACK_DEVICE);
return FALLBACK_DEVICE;
}
@SuppressLint("HardwareIds")
String macString = wifiManager.getConnectionInfo().getMacAddress();
if (macString == null) {
Log.w(TAG, "MAC Address not found - Wi-Fi disabled? Falling back to the default device name: " + FALLBACK_DEVICE);
return FALLBACK_DEVICE;
}
byte[] macBytes = macAddressToByteArray(macString);
try {
Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();
while (ifaces.hasMoreElements()) {
NetworkInterface iface = ifaces.nextElement();
byte[] hardwareAddress = iface.getHardwareAddress();
if (hardwareAddress != null && Arrays.equals(macBytes, hardwareAddress)) {
return iface.getName();
}
}
} catch (IOException e) {
Log.e(TAG, "", e);
}
Log.w(TAG, "None found - falling back to the default device name: " + FALLBACK_DEVICE);
Log.w(TAG, "6.0 or later, unaccessible MAC - falling back to the default device name: " + FALLBACK_DEVICE);
return FALLBACK_DEVICE;
}