diff --git a/app/build.gradle b/app/build.gradle
index 6a179f5..9e0f724 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager"
minSdk 23
targetSdk 33
- versionCode 50
- versionName "0.4.4"
+ versionCode 51
+ versionName "0.5.0"
setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -33,19 +33,19 @@ android {
dependencies {
- implementation 'androidx.appcompat:appcompat:1.3.0'
- implementation 'com.google.android.material:material:1.4.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
- def exoplayer_version = "2.18.1"
+ implementation 'androidx.appcompat:appcompat:1.5.1'
+ implementation 'com.google.android.material:material:1.7.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
+ def exoplayer_version = "2.18.2"
implementation "com.google.android.exoplayer:exoplayer:$exoplayer_version"
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
implementation 'androidx.recyclerview:recyclerview:1.2.1'
// BEGIN AWS DEPENDENCIES
- def aws_version = "2.58.0"
+ def aws_version = "2.60.0"
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
implementation ("com.amazonaws:aws-android-sdk-mobile-client:$aws_version") { transitive = true }
// END AWS DEPENDENCIES
testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.4'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}
\ No newline at end of file
diff --git a/app/src/main/assets/about.htm b/app/src/main/assets/about.htm
index 2b764cf..264087d 100644
--- a/app/src/main/assets/about.htm
+++ b/app/src/main/assets/about.htm
@@ -9,8 +9,8 @@
Created by Page Asgardius
Libraries used in this app
- - Amazon Web Services SDK 2.58.0
- - ExoPlayer 2.18.1
+ - Amazon Web Services SDK 2.60.0
+ - ExoPlayer 2.18.2
- Adwaita Icon Theme for GNOME 43
- pdf.js
diff --git a/app/src/main/java/asgardius/page/s3manager/Downloader.java b/app/src/main/java/asgardius/page/s3manager/Downloader.java
index e2d07ac..6ad6990 100644
--- a/app/src/main/java/asgardius/page/s3manager/Downloader.java
+++ b/app/src/main/java/asgardius/page/s3manager/Downloader.java
@@ -41,6 +41,7 @@ public class Downloader extends AppCompatActivity {
String username, password, endpoint, bucket, filename, prefix, location;
Uri fileuri, filepath;
Region region;
+ String[] folder;
S3ClientOptions s3ClientOptions;
AWSCredentials myCredentials;
AmazonS3 s3client;
@@ -128,7 +129,6 @@ public class Downloader extends AppCompatActivity {
//s3client.createBucket(bucket, location);
//System.out.println(fkey);
if (isfolder) {
- document = DocumentFile.fromTreeUri(getApplicationContext(), fileuri);
if (prefix == null) {
orequest = new ListObjectsRequest().withBucketName(bucket).withMaxKeys(1000);
} else {
@@ -161,8 +161,22 @@ public class Downloader extends AppCompatActivity {
}
for (String os : objectlist) {
+ document = DocumentFile.fromTreeUri(getApplicationContext(), fileuri);
object = s3client.getObject(bucket, os);
- filepath = document.createFile(null, os.replace(prefix, "")).getUri();
+ if (os.replace(prefix, "").contains("/")) {
+ folder = os.replace(prefix, "").split("/");
+ for (int i = 0; i < folder.length-1; i++) {
+ DocumentFile subfolder = document.findFile(folder[i].replace("/", ""));
+ if (subfolder != null) {
+ document = subfolder;
+ } else {
+ document = document.createDirectory(folder[i].replace("/", ""));
+ }
+ }
+ filepath = document.createFile(null, folder[folder.length-1]).getUri();
+ } else {
+ filepath = document.createFile(null, os.replace(prefix, "")).getUri();
+ }
writeContentToFile(filepath, object);
}
} else {
diff --git a/fastlane/metadata/android/en-US/changelogs/51.txt b/fastlane/metadata/android/en-US/changelogs/51.txt
new file mode 100644
index 0000000..97881ee
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/51.txt
@@ -0,0 +1 @@
+* Folder download function added
\ No newline at end of file