Skip to content

Commit

Permalink
Merge branch 'release/3.6' into bugfix/2189
Browse files Browse the repository at this point in the history
  • Loading branch information
TranceLove committed Mar 15, 2021
2 parents 09fcee5 + 112c98c commit 8639957
Show file tree
Hide file tree
Showing 105 changed files with 2,841 additions and 2,640 deletions.
1 change: 0 additions & 1 deletion .github/workflows/android-debug-artifact-ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- name: Get PR informations
id: pr_data
run: |
echo "::set-output name=branch::${{ fromJson(steps.request.outputs.data).head.ref }}"
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
echo "::set-output name=repo_clone_url::${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}"
echo "::set-output name=repo_ssh_url::${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}"
Expand Down
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

testOptions {
unitTests {
includeAndroidResources = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import com.amaze.filemanager.adapters.holders.EmptyViewHolder;
import com.amaze.filemanager.adapters.holders.ItemViewHolder;
import com.amaze.filemanager.adapters.holders.SpecialViewHolder;
import com.amaze.filemanager.application.AppConfig;
import com.amaze.filemanager.filesystem.files.CryptUtil;
import com.amaze.filemanager.ui.ItemPopupMenu;
import com.amaze.filemanager.ui.activities.superclasses.PreferenceActivity;
Expand Down Expand Up @@ -176,6 +177,11 @@ public RecyclerAdapter(
* @param imageView the check {@link CircleGradientDrawable} that is to be animated
*/
public void toggleChecked(int position, ImageView imageView) {
if (itemsDigested.size() <= position || position < 0) {
AppConfig.toast(context, R.string.operation_not_supported);
return;
}

if (itemsDigested.get(position).getChecked() == ListItem.UNCHECKABLE) {
throw new IllegalArgumentException("You have checked a header");
}
Expand Down Expand Up @@ -1061,6 +1067,7 @@ private void showPopup(View v, final LayoutElementParcelable rowItem) {
if (description.endsWith(fileExtensionZip)
|| description.endsWith(fileExtensionJar)
|| description.endsWith(fileExtensionApk)
|| description.endsWith(fileExtensionApks)
|| description.endsWith(fileExtensionRar)
|| description.endsWith(fileExtensionTar)
|| description.endsWith(fileExtensionGzipTarLong)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ protected void addFirstDatapoint(String name, int amountOfFiles, long totalBytes
throw new IllegalStateException("This is not the first datapoint!");
}

DatapointParcelable intent1 = new DatapointParcelable(name, amountOfFiles, totalBytes, move);
DatapointParcelable intent1 =
DatapointParcelable.Companion.buildDatapointParcelable(
name, amountOfFiles, totalBytes, move);
putDataPackage(intent1);
}

Expand All @@ -256,7 +258,7 @@ protected void addDatapoint(DatapointParcelable datapoint) {
putDataPackage(datapoint);
if (getProgressListener() != null) {
getProgressListener().onUpdate(datapoint);
if (datapoint.completed) getProgressListener().refresh();
if (datapoint.getCompleted()) getProgressListener().refresh();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ public boolean isCancelled() {
|| e.getCause() != null
&& ZipException.class.isAssignableFrom(e.getCause().getClass())) {
Log.d(TAG, "Archive is password protected.", e);
if (ArchivePasswordCache.getInstance().containsKey(compressedPath)) {
ArchivePasswordCache.getInstance().remove(compressedPath);
AppConfig.toast(
extractService,
extractService.getString(R.string.error_archive_password_incorrect));
}
passwordProtected = true;
paused = true;
publishProgress(e);
Expand Down Expand Up @@ -378,6 +384,7 @@ protected void onProgressUpdate(IOException... values) {

@Override
public void onPostExecute(Boolean hasInvalidEntries) {
ArchivePasswordCache.getInstance().remove(compressedPath);
final ExtractService extractService = this.extractService.get();
if (extractService == null) return;

Expand All @@ -393,6 +400,12 @@ public void onPostExecute(Boolean hasInvalidEntries) {
AppConfig.toast(extractService, getString(R.string.multiple_invalid_archive_entries));
}

@Override
protected void onCancelled() {
super.onCancelled();
ArchivePasswordCache.getInstance().remove(compressedPath);
}

private void toastOnParseError(IOException result) {
Toast.makeText(
AppConfig.getInstance().getMainActivityContext(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

package com.amaze.filemanager.database;

import static com.amaze.filemanager.BuildConfig.DEBUG;

import java.io.File;
import java.io.IOException;
import java.security.GeneralSecurityException;
Expand Down Expand Up @@ -326,7 +328,9 @@ public String getSshHostKey(String uri) {
.blockingGet();
} catch (Exception e) {
// catch error to handle Single#onError for blockingGet
Log.e(getClass().getSimpleName(), e.getMessage());
if (DEBUG) {
Log.e(getClass().getSimpleName(), "Error getting public key for URI [" + uri + "]", e);
}
return null;
}
} else {
Expand Down Expand Up @@ -357,7 +361,10 @@ public String getSshAuthPrivateKey(String uri) {
.blockingGet();
} catch (Exception e) {
// catch error to handle Single#onError for blockingGet
Log.e(getClass().getSimpleName(), e.getMessage());
if (DEBUG) {
Log.e(
getClass().getSimpleName(), "Error getting auth private key for URI [" + uri + "]", e);
}
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public abstract class CompressedHelper {

public static final String fileExtensionZip = "zip",
fileExtensionJar = "jar",
fileExtensionApk = "apk";
fileExtensionApk = "apk",
fileExtensionApks = "apks";
public static final String fileExtensionTar = "tar";
public static final String fileExtensionGzipTarLong = "tar.gz", fileExtensionGzipTarShort = "tgz";
public static final String fileExtensionBzip2TarLong = "tar.bz2",
Expand Down Expand Up @@ -173,7 +174,8 @@ public static final boolean isEntryPathValid(String entryPath) {
private static boolean isZip(String type) {
return type.endsWith(fileExtensionZip)
|| type.endsWith(fileExtensionJar)
|| type.endsWith(fileExtensionApk);
|| type.endsWith(fileExtensionApk)
|| type.endsWith(fileExtensionApks);
}

private static boolean isTar(String type) {
Expand Down

This file was deleted.

Loading

0 comments on commit 8639957

Please sign in to comment.