~xdavidwu/saf-sftp

d3f7db3e5c68b555be059c8dc3125eef48d79577 — xdavidwu 2 years ago f53c3a8
fix various lints
M build.gradle => build.gradle +5 -5
@@ 4,18 4,18 @@ buildscript {
		mavenCentral()
	}
	dependencies {
		classpath 'com.android.tools.build:gradle:7.0.1'
		classpath 'com.android.tools.build:gradle:7.2.1'
	}
}
apply plugin: 'com.android.application'

android {
	compileSdkVersion 'android-31'
	buildToolsVersion '31'
	compileSdkVersion 'android-32'
	buildToolsVersion '32'

	defaultConfig {
		minSdkVersion 26
		targetSdkVersion 28
		targetSdkVersion 32
	}

	buildTypes {


@@ 33,6 33,6 @@ dependencies {
allprojects {
	repositories {
		google()
		jcenter()
		mavenCentral()
	}
}

M src/main/AndroidManifest.xml => src/main/AndroidManifest.xml +2 -2
@@ 10,8 10,8 @@
		  android:icon="@mipmap/sym_def_app_icon"
		  android:allowBackup="false">
		<activity android:name="MainActivity"
			android:label="@string/app_name"
			android:theme="@android:style/Theme.DeviceDefault">
			android:theme="@android:style/Theme.DeviceDefault"
			android:exported="true">
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />

M src/main/java/org/safsftp/SFTPDocumentsProvider.java => src/main/java/org/safsftp/SFTPDocumentsProvider.java +9 -5
@@ 27,6 27,7 @@ import com.trilead.ssh2.SFTPv3FileAttributes;
import com.trilead.ssh2.SFTPv3FileHandle;

import java.io.IOException;
import java.util.Locale;
import java.util.Vector;

public class SFTPDocumentsProvider extends DocumentsProvider {


@@ 53,12 54,15 @@ public class SFTPDocumentsProvider extends DocumentsProvider {
	};

	private static String getMime(String filename) {
		int idx=filename.lastIndexOf(".");
		if(idx>0){
			String mime=MimeTypeMap.getSingleton()
		int idx = filename.lastIndexOf(".");
		if(idx > 0){
			String mime = MimeTypeMap.getSingleton()
				.getMimeTypeFromExtension(filename
				.substring(idx+1).toLowerCase());
			if(mime!=null)return mime;
					.substring(idx + 1)
					.toLowerCase(Locale.ROOT));
			if (mime != null) {
				return mime;
			}
		}
		return "application/octet-stream";
	}