Compare commits
36 commits
Author | SHA1 | Date | |
---|---|---|---|
3dcc9912d3 | |||
2434b38117 | |||
ed11ab882b | |||
5742255b5b | |||
e668cd4b46 | |||
732f230ee6 | |||
dbfcb1e9f1 | |||
abaa65516e | |||
ac1184b164 | |||
0e1391e89d | |||
f84b96cfc6 | |||
532b05dde2 | |||
5eb44e6bc1 | |||
319019cd46 | |||
fc3c1c98b0 | |||
7f627b5e4c | |||
98cd78a1ec | |||
684c1e36cc | |||
13004d2bd3 | |||
448dfc3ab7 | |||
175462a344 | |||
0083f34a82 | |||
791c747832 | |||
7df9789241 | |||
b3e65a8fcf | |||
55b5113fd3 | |||
7aa05c783a | |||
ce28a53de7 | |||
6c83a96491 | |||
4196c2f6e8 | |||
7be7d93b50 | |||
303f0469d7 | |||
31537846da | |||
1b1dc39482 | |||
ec78f304ee | |||
8a3a2d62db |
57 changed files with 1044 additions and 226 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="11" />
|
<bytecodeTargetLevel target="17" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
10
.idea/deploymentTargetSelector.xml
Normal file
10
.idea/deploymentTargetSelector.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetSelector">
|
||||||
|
<selectionStates>
|
||||||
|
<SelectionState runConfigName="app">
|
||||||
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
</SelectionState>
|
||||||
|
</selectionStates>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -4,16 +4,26 @@
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="testRunner" value="GRADLE" />
|
<option name="externalProjectPath" value="/data/2/asgardius/StudioProjects/s3manager" />
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
||||||
<option name="gradleJvm" value="Embedded JDK" />
|
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="/data/2/asgardius/StudioProjects/s3manager" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="/data/2/asgardius/StudioProjects/s3manager/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="resolveExternalAnnotations" value="false" />
|
||||||
|
</GradleProjectSettings>
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="/data/2/asgardius/StudioProjects/s3manager" />
|
||||||
|
<option value="/data/2/asgardius/StudioProjects/s3manager/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="resolveExternalAnnotations" value="false" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
11
.idea/migrations.xml
Normal file
11
.idea/migrations.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectMigrations">
|
||||||
|
<option name="MigrateToGradleLocalJavaHome">
|
||||||
|
<set>
|
||||||
|
<option value="/data/2/asgardius/StudioProjects/s3manager" />
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DesignSurface">
|
<component name="DesignSurface">
|
||||||
<option name="filePathToZoomLevelMap">
|
<option name="filePathToZoomLevelMap">
|
||||||
|
@ -28,7 +27,8 @@
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
252
.idea/other.xml
Normal file
252
.idea/other.xml
Normal file
|
@ -0,0 +1,252 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="direct_access_persist.xml">
|
||||||
|
<option name="deviceSelectionList">
|
||||||
|
<list>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="27" />
|
||||||
|
<option name="brand" value="DOCOMO" />
|
||||||
|
<option name="codename" value="F01L" />
|
||||||
|
<option name="id" value="F01L" />
|
||||||
|
<option name="manufacturer" value="FUJITSU" />
|
||||||
|
<option name="name" value="F-01L" />
|
||||||
|
<option name="screenDensity" value="360" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1280" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="28" />
|
||||||
|
<option name="brand" value="DOCOMO" />
|
||||||
|
<option name="codename" value="SH-01L" />
|
||||||
|
<option name="id" value="SH-01L" />
|
||||||
|
<option name="manufacturer" value="SHARP" />
|
||||||
|
<option name="name" value="AQUOS sense2 SH-01L" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2160" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="31" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="a51" />
|
||||||
|
<option name="id" value="a51" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy A51" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="akita" />
|
||||||
|
<option name="id" value="akita" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="b0q" />
|
||||||
|
<option name="id" value="b0q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S22 Ultra" />
|
||||||
|
<option name="screenDensity" value="600" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3088" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="32" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="bluejay" />
|
||||||
|
<option name="id" value="bluejay" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 6a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="29" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="crownqlteue" />
|
||||||
|
<option name="id" value="crownqlteue" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Note9" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2220" />
|
||||||
|
<option name="screenY" value="1080" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="dm3q" />
|
||||||
|
<option name="id" value="dm3q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S23 Ultra" />
|
||||||
|
<option name="screenDensity" value="600" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3088" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="felix" />
|
||||||
|
<option name="id" value="felix" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Fold" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2208" />
|
||||||
|
<option name="screenY" value="1840" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="felix_camera" />
|
||||||
|
<option name="id" value="felix_camera" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Fold (Camera-enabled)" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2208" />
|
||||||
|
<option name="screenY" value="1840" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="gts8uwifi" />
|
||||||
|
<option name="id" value="gts8uwifi" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Tab S8 Ultra" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="1848" />
|
||||||
|
<option name="screenY" value="2960" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="husky" />
|
||||||
|
<option name="id" value="husky" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8 Pro" />
|
||||||
|
<option name="screenDensity" value="390" />
|
||||||
|
<option name="screenX" value="1008" />
|
||||||
|
<option name="screenY" value="2244" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="30" />
|
||||||
|
<option name="brand" value="motorola" />
|
||||||
|
<option name="codename" value="java" />
|
||||||
|
<option name="id" value="java" />
|
||||||
|
<option name="manufacturer" value="Motorola" />
|
||||||
|
<option name="name" value="G20" />
|
||||||
|
<option name="screenDensity" value="280" />
|
||||||
|
<option name="screenX" value="720" />
|
||||||
|
<option name="screenY" value="1600" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="lynx" />
|
||||||
|
<option name="id" value="lynx" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 7a" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="31" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="oriole" />
|
||||||
|
<option name="id" value="oriole" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 6" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="panther" />
|
||||||
|
<option name="id" value="panther" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 7" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="q5q" />
|
||||||
|
<option name="id" value="q5q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy Z Fold5" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1812" />
|
||||||
|
<option name="screenY" value="2176" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="30" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="r11" />
|
||||||
|
<option name="id" value="r11" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Watch" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="384" />
|
||||||
|
<option name="screenY" value="384" />
|
||||||
|
<option name="type" value="WEAR_OS" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="30" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="redfin" />
|
||||||
|
<option name="id" value="redfin" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 5" />
|
||||||
|
<option name="screenDensity" value="440" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="shiba" />
|
||||||
|
<option name="id" value="shiba" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel 8" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2400" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="33" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="tangorpro" />
|
||||||
|
<option name="id" value="tangorpro" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Tablet" />
|
||||||
|
<option name="screenDensity" value="320" />
|
||||||
|
<option name="screenX" value="1600" />
|
||||||
|
<option name="screenY" value="2560" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="29" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="x1q" />
|
||||||
|
<option name="id" value="x1q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S20" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1440" />
|
||||||
|
<option name="screenY" value="3200" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
7
.idea/vcs.xml
Normal file
7
.idea/vcs.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
<mapping directory="/data/2/asgardius/StudioProjects/s3manager" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
15
README.md
15
README.md
|
@ -1,9 +1,7 @@
|
||||||
# s3manager
|
# Asgardius S3 Manager
|
||||||
|
|
||||||
File Explorer to manage servers compatible with S3 Object Storage Protocol
|
File Explorer to manage servers compatible with S3 Object Storage Protocol
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Current feature list
|
Current feature list
|
||||||
|
|
||||||
* Audio and Video playback (opus, ogg, oga, mp3, m4a, flac, mka, mkv, mp4, m4v, webm)
|
* Audio and Video playback (opus, ogg, oga, mp3, m4a, flac, mka, mkv, mp4, m4v, webm)
|
||||||
|
@ -26,6 +24,7 @@ Current feature list
|
||||||
* get bucket info
|
* get bucket info
|
||||||
* Set CORS policy
|
* Set CORS policy
|
||||||
* Set bucket as public or private
|
* Set bucket as public or private
|
||||||
|
* Set object as public or private
|
||||||
|
|
||||||
Planned feature list
|
Planned feature list
|
||||||
|
|
||||||
|
@ -35,13 +34,9 @@ This app is a work in progress, so it have some bugs that need to be fixed
|
||||||
|
|
||||||
You need to setup a pdf.js server to use pdf viewer. Just download latest version from official website and upload to any web server with ssl on same root domain than S3 server (can be same subdomain or a different one). Then set url to pdfjs root folder like https://example.com/pdfjs-dist
|
You need to setup a pdf.js server to use pdf viewer. Just download latest version from official website and upload to any web server with ssl on same root domain than S3 server (can be same subdomain or a different one). Then set url to pdfjs root folder like https://example.com/pdfjs-dist
|
||||||
|
|
||||||
[<img src="app-store-badges/fdroid.png"
|
|
||||||
alt="Get it on F-Droid"
|
|
||||||
height="80">](https://f-droid.org/packages/asgardius.page.s3manager/)
|
|
||||||
|
|
||||||
[<img src="app-store-badges/play-store.png"
|
[<img src="app-store-badges/play-store.png"
|
||||||
alt="Get it on Google Play"
|
alt="Get it on Google Play"
|
||||||
height="80">](https://play.google.com/store/apps/details?id=asgardius.page.s3manager)
|
height="80">](https://play.google.com/store/apps/details?id=asgardius.page.s3managermk2)
|
||||||
|
|
||||||
F-droid release may take a few days to get updated [More info here](https://www.f-droid.org/en/docs/FAQ_-_App_Developers/#ive-published-a-new-release-why-is-it-not-in-the-repository)
|
F-droid release may take a few days to get updated [More info here](https://www.f-droid.org/en/docs/FAQ_-_App_Developers/#ive-published-a-new-release-why-is-it-not-in-the-repository)
|
||||||
|
|
||||||
|
@ -49,7 +44,7 @@ F-droid release may take a few days to get updated [More info here](https://www.
|
||||||
|
|
||||||
You can get help at https://forum.asgardius.company/t/s3-manager
|
You can get help at https://forum.asgardius.company/t/s3-manager
|
||||||
|
|
||||||
You can find app documentation at https://wiki.asgardius.company/shelves/asgardius-s3-manager-english (english) or https://wiki.asgardius.company/shelves/asgardius-s3-manager-espanol (spanish)
|
You can find app documentation at https://wiki-en.asgardius.company/index.php?title=Asgardius_S3_Manager_Documentation (english) or https://wiki-es.asgardius.company/index.php?title=Documentacion_Asgardius_S3_Manager (spanish)
|
||||||
|
|
||||||
Supported languages
|
Supported languages
|
||||||
|
|
||||||
|
@ -66,7 +61,7 @@ Known supported providers
|
||||||
|
|
||||||
* Amazon Web Services
|
* Amazon Web Services
|
||||||
* Scaleway Elements
|
* Scaleway Elements
|
||||||
* Wasabi Cloud
|
* Wasabi Cloud (Provider broke access control intentionally since March 13 2023)
|
||||||
* Backblaze B2
|
* Backblaze B2
|
||||||
* Cloudflare R2 (partial)
|
* Cloudflare R2 (partial)
|
||||||
* MinIO **
|
* MinIO **
|
||||||
|
|
|
@ -6,11 +6,11 @@ android {
|
||||||
compileSdk 33
|
compileSdk 33
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "asgardius.page.s3manager"
|
applicationId "asgardius.page.s3managermk2"
|
||||||
minSdk 23
|
minSdk 21
|
||||||
targetSdk 33
|
targetSdk 34
|
||||||
versionCode 71
|
versionCode 2
|
||||||
versionName "0.8.0"
|
versionName "0.11.1"
|
||||||
setProperty("archivesBaseName", "s3-manager-$versionName")
|
setProperty("archivesBaseName", "s3-manager-$versionName")
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
@ -29,20 +29,21 @@ android {
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
}
|
}
|
||||||
|
namespace 'asgardius.page.s3managermk2'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
implementation 'com.google.android.material:material:1.7.0'
|
implementation 'com.google.android.material:material:1.8.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
def exoplayer_version = "2.18.2"
|
def exoplayer_version = "2.19.1"
|
||||||
implementation "com.google.android.exoplayer:exoplayer:$exoplayer_version"
|
implementation "com.google.android.exoplayer:exoplayer:$exoplayer_version"
|
||||||
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
|
implementation "com.google.android.exoplayer:extension-mediasession:$exoplayer_version"
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation"com.otaliastudios:zoomlayout:1.9.0"
|
implementation"com.otaliastudios:zoomlayout:1.9.0"
|
||||||
// BEGIN AWS DEPENDENCIES
|
// BEGIN AWS DEPENDENCIES
|
||||||
def aws_version = "2.62.0"
|
def aws_version = "2.76.1"
|
||||||
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
|
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
|
||||||
implementation ("com.amazonaws:aws-android-sdk-mobile-client:$aws_version") { transitive = true }
|
implementation ("com.amazonaws:aws-android-sdk-mobile-client:$aws_version") { transitive = true }
|
||||||
// END AWS DEPENDENCIES
|
// END AWS DEPENDENCIES
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
android:installLocation="auto"
|
||||||
package="asgardius.page.s3manager">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.READ_PHONE_STATE"
|
android:name="android.permission.READ_PHONE_STATE"
|
||||||
tools:node="remove" />
|
tools:node="remove" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
@ -19,14 +18,18 @@
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.AsgardiusS3Manager"
|
android:theme="@style/Theme.AsgardiusS3Manager"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31"
|
||||||
|
android:usesCleartextTraffic="true" >
|
||||||
|
<activity
|
||||||
|
android:name=".ObjectPolicy"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".BucketPolicy"
|
android:name=".BucketPolicy"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".CorsConfig"
|
android:name=".CorsConfig"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
android:exported="false">
|
android:exported="false" >
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.app.lib_name"
|
android:name="android.app.lib_name"
|
||||||
android:value="" />
|
android:value="" />
|
||||||
|
@ -35,7 +38,7 @@
|
||||||
android:name=".Settings"
|
android:name=".Settings"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/settings">
|
android:label="@string/settings" >
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.app.lib_name"
|
android:name="android.app.lib_name"
|
||||||
android:value="" />
|
android:value="" />
|
||||||
|
@ -43,7 +46,7 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".ObjectInfo"
|
android:name=".ObjectInfo"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
android:exported="false">
|
android:exported="false" >
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.app.lib_name"
|
android:name="android.app.lib_name"
|
||||||
android:value="" />
|
android:value="" />
|
||||||
|
@ -55,6 +58,7 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".Downloader"
|
android:name=".Downloader"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
|
android:documentLaunchMode="always"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".CreateBucket"
|
android:name=".CreateBucket"
|
||||||
|
@ -64,19 +68,23 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".Uploader"
|
android:name=".Uploader"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
|
android:documentLaunchMode="always"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ImageViewer"
|
android:name=".ImageViewer"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
|
android:documentLaunchMode="always"
|
||||||
android:hardwareAccelerated="false" />
|
android:hardwareAccelerated="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".TextViewer"
|
android:name=".TextViewer"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
|
android:documentLaunchMode="always"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".WebBrowser"
|
android:name=".WebBrowser"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
|
android:documentLaunchMode="always"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".AccountAdd"
|
android:name=".AccountAdd"
|
||||||
|
@ -101,11 +109,12 @@
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
|
android:documentLaunchMode="always"
|
||||||
android:supportsPictureInPicture="true" />
|
android:supportsPictureInPicture="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|uiMode|keyboardHidden"
|
||||||
android:exported="true">
|
android:exported="true" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
<H3>Created by Page Asgardius</H3>
|
<H3>Created by Page Asgardius</H3>
|
||||||
<H3>Libraries used in this app</H3>
|
<H3>Libraries used in this app</H3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Amazon Web Services SDK 2.62.0</li>
|
<li>Amazon Web Services SDK 2.76.1</li>
|
||||||
<li>ExoPlayer 2.18.2</li>
|
<li>ExoPlayer 2.19.1</li>
|
||||||
<li>ZoomLayout 1.9.0</li>
|
<li>ZoomLayout 1.9.0</li>
|
||||||
<li>Adwaita Icon Theme for GNOME 43</li>
|
<li>Adwaita Icon Theme for GNOME 43</li>
|
||||||
<li>pdf.js</li>
|
<li>pdf.js</li>
|
||||||
</ul>
|
</ul>
|
||||||
<H3>This software released under GNU General Public License 3</H3>
|
<H3>This software released under GNU General Public License 3</H3>
|
||||||
<p>You can find source code at https://patrice.asgardius.company/gitea/asgardius/s3manager
|
<p>You can find source code at https://git.asgardius.company/asgardius/s3manager
|
||||||
<br>
|
<br>
|
||||||
You need to setup a pdf.js server to use pdf viewer. You can use https://office.asgardius.company/pdfjs or setup your own.
|
You need to setup a pdf.js server to use pdf viewer. You can use https://office.asgardius.company/pdfjs or setup your own.
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
@ -87,11 +87,6 @@ public class AccountAdd extends AppCompatActivity {
|
||||||
style = "0";
|
style = "0";
|
||||||
}
|
}
|
||||||
MyDbHelper dbHelper = new MyDbHelper(AccountAdd.this);
|
MyDbHelper dbHelper = new MyDbHelper(AccountAdd.this);
|
||||||
if (alias.equals("") && endpoint.equals("") && username.equals(getResources().getString(R.string.access_key))) {
|
|
||||||
endpoint = getResources().getString(R.string.endpoint_url);
|
|
||||||
alias = "Google Test";
|
|
||||||
pdfendpoint = getResources().getString(R.string.pdf_reader);
|
|
||||||
}
|
|
||||||
SQLiteDatabase db = dbHelper.getWritableDatabase();
|
SQLiteDatabase db = dbHelper.getWritableDatabase();
|
||||||
if (alias.equals("") || endpoint.equals("") || username.equals("") || password.equals("")) {
|
if (alias.equals("") || endpoint.equals("") || username.equals("") || password.equals("")) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.accountadd_null), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.accountadd_null), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -133,10 +128,6 @@ public class AccountAdd extends AppCompatActivity {
|
||||||
username = aupick.getText().toString();
|
username = aupick.getText().toString();
|
||||||
password = appick.getText().toString();
|
password = appick.getText().toString();
|
||||||
location = arpick.getText().toString();
|
location = arpick.getText().toString();
|
||||||
if (alias.equals("") && endpoint.equals("") && username.equals(getResources().getString(R.string.access_key))) {
|
|
||||||
endpoint = getResources().getString(R.string.endpoint_url);
|
|
||||||
alias = "Google Test";
|
|
||||||
}
|
|
||||||
if (alias.equals("") || endpoint.equals("") || username.equals("") || password.equals("")) {
|
if (alias.equals("") || endpoint.equals("") || username.equals("") || password.equals("")) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.accountadd_null), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.accountadd_null), Toast.LENGTH_SHORT).show();
|
||||||
} else if (endpoint.startsWith("http://")) {
|
} else if (endpoint.startsWith("http://")) {
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -17,12 +17,12 @@ import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
import com.amazonaws.services.s3.S3ClientOptions;
|
import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
|
|
||||||
public class BucketPolicy extends AppCompatActivity {
|
public class BucketPolicy extends AppCompatActivity {
|
||||||
String username, password, endpoint, bucket, location, title;
|
String username, password, endpoint, bucket, location;
|
||||||
Region region;
|
Region region;
|
||||||
S3ClientOptions s3ClientOptions;
|
S3ClientOptions s3ClientOptions;
|
||||||
AWSCredentials myCredentials;
|
AWSCredentials myCredentials;
|
||||||
AmazonS3 s3client;
|
AmazonS3 s3client;
|
||||||
boolean style;
|
boolean style, publicbucket;
|
||||||
ProgressBar simpleProgressBar;
|
ProgressBar simpleProgressBar;
|
||||||
TextView permission;
|
TextView permission;
|
||||||
Button setpublic, setprivate;
|
Button setpublic, setprivate;
|
||||||
|
@ -34,7 +34,6 @@ public class BucketPolicy extends AppCompatActivity {
|
||||||
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
||||||
permission = (TextView) findViewById(R.id.permission);
|
permission = (TextView) findViewById(R.id.permission);
|
||||||
endpoint = getIntent().getStringExtra("endpoint");
|
endpoint = getIntent().getStringExtra("endpoint");
|
||||||
title = getIntent().getStringExtra("title");
|
|
||||||
username = getIntent().getStringExtra("username");
|
username = getIntent().getStringExtra("username");
|
||||||
password = getIntent().getStringExtra("password");
|
password = getIntent().getStringExtra("password");
|
||||||
bucket = getIntent().getStringExtra("bucket");
|
bucket = getIntent().getStringExtra("bucket");
|
||||||
|
@ -61,6 +60,7 @@ public class BucketPolicy extends AppCompatActivity {
|
||||||
try {
|
try {
|
||||||
//Your code goes here
|
//Your code goes here
|
||||||
String policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
String policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
||||||
|
publicbucket = policy.contains("arn:aws:s3:::"+bucket+"/*") && policy.contains("s3:GetObject");
|
||||||
//System.out.println(policy);
|
//System.out.println(policy);
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
@ -68,7 +68,7 @@ public class BucketPolicy extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//Your code goes here
|
//Your code goes here
|
||||||
if(policy.contains("\"Resource\":[\"arn:aws:s3:::"+bucket+"/*") || policy.contains("\"Resource\":\"arn:aws:s3:::"+bucket+"/*")){
|
if(publicbucket){
|
||||||
permission.setText(getResources().getString(R.string.public_bucket));
|
permission.setText(getResources().getString(R.string.public_bucket));
|
||||||
} else {
|
} else {
|
||||||
permission.setText(getResources().getString(R.string.custom_policy));
|
permission.setText(getResources().getString(R.string.custom_policy));
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
@ -190,7 +190,7 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.cors_config)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.cors_config)) {
|
||||||
corsConfig(Name.get(position).toString());
|
corsConfig(Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.bucket_policy)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.bucket_policy)) {
|
||||||
aclConfig(Name.get(position).toString());
|
policyConfig(Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.file_del)) {
|
||||||
//Toast.makeText(BucketSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(BucketSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
||||||
delete(prefix + Name.get(position).toString());
|
delete(prefix + Name.get(position).toString());
|
||||||
|
@ -390,7 +390,7 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void aclConfig(String bucket) {
|
private void policyConfig(String bucket) {
|
||||||
Intent intent = new Intent(this, BucketPolicy.class);
|
Intent intent = new Intent(this, BucketPolicy.class);
|
||||||
intent.putExtra("endpoint", endpoint);
|
intent.putExtra("endpoint", endpoint);
|
||||||
intent.putExtra("username", username);
|
intent.putExtra("username", username);
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -24,7 +24,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CorsConfig extends AppCompatActivity {
|
public class CorsConfig extends AppCompatActivity {
|
||||||
String username, password, endpoint, bucket, location, title;
|
String username, password, endpoint, bucket, location;
|
||||||
URI pdfendpoint;
|
URI pdfendpoint;
|
||||||
Region region;
|
Region region;
|
||||||
S3ClientOptions s3ClientOptions;
|
S3ClientOptions s3ClientOptions;
|
||||||
|
@ -44,7 +44,6 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
setContentView(R.layout.activity_cors_config);
|
setContentView(R.layout.activity_cors_config);
|
||||||
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
||||||
endpoint = getIntent().getStringExtra("endpoint");
|
endpoint = getIntent().getStringExtra("endpoint");
|
||||||
title = getIntent().getStringExtra("title");
|
|
||||||
username = getIntent().getStringExtra("username");
|
username = getIntent().getStringExtra("username");
|
||||||
password = getIntent().getStringExtra("password");
|
password = getIntent().getStringExtra("password");
|
||||||
bucket = getIntent().getStringExtra("bucket");
|
bucket = getIntent().getStringExtra("bucket");
|
|
@ -1,6 +1,5 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import static android.content.ContentValues.TAG;
|
import static android.content.ContentValues.TAG;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
260
app/src/main/java/asgardius/page/s3managermk2/ObjectPolicy.java
Normal file
260
app/src/main/java/asgardius/page/s3managermk2/ObjectPolicy.java
Normal file
|
@ -0,0 +1,260 @@
|
||||||
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.amazonaws.auth.AWSCredentials;
|
||||||
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
|
import com.amazonaws.regions.Region;
|
||||||
|
import com.amazonaws.services.s3.AmazonS3;
|
||||||
|
import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
|
import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
|
|
||||||
|
public class ObjectPolicy extends AppCompatActivity {
|
||||||
|
String username, password, endpoint, bucket, location, filename, title, policy;
|
||||||
|
Region region;
|
||||||
|
S3ClientOptions s3ClientOptions;
|
||||||
|
AWSCredentials myCredentials;
|
||||||
|
AmazonS3 s3client;
|
||||||
|
boolean style, publicbucket, publicobject, parent;
|
||||||
|
ProgressBar simpleProgressBar;
|
||||||
|
TextView permission;
|
||||||
|
Button setpublic, setprivate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_object_policy);
|
||||||
|
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
||||||
|
permission = (TextView) findViewById(R.id.permission);
|
||||||
|
endpoint = getIntent().getStringExtra("endpoint");
|
||||||
|
filename = getIntent().getStringExtra("filename");
|
||||||
|
username = getIntent().getStringExtra("username");
|
||||||
|
password = getIntent().getStringExtra("password");
|
||||||
|
bucket = getIntent().getStringExtra("bucket");
|
||||||
|
title = getIntent().getStringExtra("title");
|
||||||
|
style = getIntent().getBooleanExtra("style", false);
|
||||||
|
location = getIntent().getStringExtra("region");
|
||||||
|
getSupportActionBar().setTitle(title);
|
||||||
|
region = Region.getRegion(location);
|
||||||
|
s3ClientOptions = S3ClientOptions.builder().build();
|
||||||
|
myCredentials = new BasicAWSCredentials(username, password);
|
||||||
|
try {
|
||||||
|
s3client = new AmazonS3Client(myCredentials, region);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
s3client.setEndpoint(endpoint);
|
||||||
|
s3ClientOptions.setPathStyleAccess(style);
|
||||||
|
s3client.setS3ClientOptions(s3ClientOptions);
|
||||||
|
setprivate = (Button)findViewById(R.id.set_private);
|
||||||
|
setpublic = (Button)findViewById(R.id.set_public);
|
||||||
|
Thread getPolicy = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//Your code goes here
|
||||||
|
policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
||||||
|
publicbucket = policy.contains("arn:aws:s3:::"+bucket+"/*") && policy.contains("s3:GetObject");
|
||||||
|
publicobject = false;
|
||||||
|
parent = true;
|
||||||
|
if(!publicbucket && policy.contains("s3:GetObject")) {
|
||||||
|
if((policy.contains("\"arn:aws:s3:::"+bucket+"/"+filename+"\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+filename+"*\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+filename+"**\"")) && policy.contains("s3:GetObject")) {
|
||||||
|
publicobject = true;
|
||||||
|
parent = false;
|
||||||
|
} else {
|
||||||
|
String[] path = filename.split("/");
|
||||||
|
String filepath = "";
|
||||||
|
for (int i = 0; i < path.length-1; i++) {
|
||||||
|
filepath = filepath+path[i]+"/";
|
||||||
|
//System.out.println(filepath);
|
||||||
|
if(policy.contains("\"arn:aws:s3:::"+bucket+"/"+filepath+"*\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+filepath+"**\"")) {
|
||||||
|
publicobject = true;
|
||||||
|
i = path.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//System.out.println(policy);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
//Your code goes here
|
||||||
|
if(publicbucket){
|
||||||
|
permission.setText(getResources().getString(R.string.public_object));
|
||||||
|
setprivate.setEnabled(false);
|
||||||
|
setprivate.setText(getResources().getString(R.string.parent_policy));
|
||||||
|
setprivate.setVisibility(View.VISIBLE);
|
||||||
|
}else if(publicobject) {
|
||||||
|
permission.setText(getResources().getString(R.string.public_object));
|
||||||
|
if(parent) {
|
||||||
|
setprivate.setEnabled(false);
|
||||||
|
setprivate.setText(getResources().getString(R.string.parent_policy));
|
||||||
|
}
|
||||||
|
setprivate.setVisibility(View.VISIBLE);
|
||||||
|
}else {
|
||||||
|
permission.setText(getResources().getString(R.string.private_object));
|
||||||
|
setpublic.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if(e.toString().contains("NoSuchBucketPolicy")) {
|
||||||
|
permission.setText(getResources().getString(R.string.private_object));
|
||||||
|
setpublic.setVisibility(View.VISIBLE);
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getPolicy.start();
|
||||||
|
setpublic.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//buttonaction
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
setPublic();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setprivate.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//buttonaction
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
setPrivate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setPublic() {
|
||||||
|
Thread setPublic = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//Your code goes here
|
||||||
|
if(policy == null) {
|
||||||
|
if(filename.endsWith("/")) {
|
||||||
|
policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::"+bucket+"/"+filename+"*\"]}]}";
|
||||||
|
} else {
|
||||||
|
policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::"+bucket+"/"+filename+"\"]}]}";
|
||||||
|
}
|
||||||
|
} else if(policy.endsWith("]}]}")) {
|
||||||
|
if(filename.endsWith("/")) {
|
||||||
|
policy = policy.substring(0, policy.length()-4)+",\"arn:aws:s3:::"+bucket+"/"+filename+"*\"]}]}";
|
||||||
|
} else {
|
||||||
|
policy = policy.substring(0, policy.length()-4)+",\"arn:aws:s3:::"+bucket+"/"+filename+"\"]}]}";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(filename.endsWith("/")) {
|
||||||
|
policy = policy.substring(0, policy.length()-3)+",\"arn:aws:s3:::"+bucket+"/"+filename+"*\"}]}";
|
||||||
|
} else {
|
||||||
|
policy = policy.substring(0, policy.length()-3)+",\"arn:aws:s3:::"+bucket+"/"+filename+"\"}]}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s3client.setBucketPolicy(bucket, policy);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_error), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setPublic.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setPrivate() {
|
||||||
|
Thread setPrivate = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//Your code goes here
|
||||||
|
String newpolicy = null;
|
||||||
|
if(policy.contains(",\"arn:aws:s3:::"+bucket+"/"+filename+"*\"")) {
|
||||||
|
newpolicy = policy.replace(",\"arn:aws:s3:::"+bucket+"/"+filename+"*\"", "");
|
||||||
|
s3client.setBucketPolicy(bucket, newpolicy);
|
||||||
|
} else if(policy.contains(",\"arn:aws:s3:::"+bucket+"/"+filename+"**\"")) {
|
||||||
|
newpolicy = policy.replace(",\"arn:aws:s3:::"+bucket+"/"+filename+"**\"", "");
|
||||||
|
s3client.setBucketPolicy(bucket, newpolicy);
|
||||||
|
} else if(policy.contains(",\"arn:aws:s3:::"+bucket+"/"+filename+"\"")) {
|
||||||
|
newpolicy = policy.replace(",\"arn:aws:s3:::"+bucket+"/"+filename+"\"", "");
|
||||||
|
s3client.setBucketPolicy(bucket, newpolicy);
|
||||||
|
} else if(policy.contains("\"arn:aws:s3:::"+bucket+"/"+filename+"*\",")) {
|
||||||
|
newpolicy = policy.replace("\"arn:aws:s3:::"+bucket+"/"+filename+"*\",", "");
|
||||||
|
s3client.setBucketPolicy(bucket, newpolicy);
|
||||||
|
} else if(policy.contains("\"arn:aws:s3:::"+bucket+"/"+filename+"**\",")) {
|
||||||
|
newpolicy = policy.replace("\"arn:aws:s3:::"+bucket+"/"+filename+"**\",", "");
|
||||||
|
s3client.setBucketPolicy(bucket, newpolicy);
|
||||||
|
} else if(policy.contains("\"arn:aws:s3:::"+bucket+"/"+filename+"\",")) {
|
||||||
|
newpolicy = policy.replace("\"arn:aws:s3:::"+bucket+"/"+filename+"\",", "");
|
||||||
|
s3client.setBucketPolicy(bucket, newpolicy);
|
||||||
|
} else {
|
||||||
|
s3client.deleteBucketPolicy(bucket);
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_error), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setPrivate.start();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
@ -30,6 +30,8 @@ import com.amazonaws.services.s3.model.ListObjectsRequest;
|
||||||
import com.amazonaws.services.s3.model.ObjectListing;
|
import com.amazonaws.services.s3.model.ObjectListing;
|
||||||
import com.amazonaws.services.s3.model.S3ObjectSummary;
|
import com.amazonaws.services.s3.model.S3ObjectSummary;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -44,7 +46,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
ArrayList Img;
|
ArrayList Img;
|
||||||
//ArrayList object;
|
//ArrayList object;
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
String username, password, endpoint, bucket, prefix, location, pdfendpoint, query;
|
String username, password, endpoint, bucket, prefix, location, pdfendpoint, query, policy;
|
||||||
boolean style, isplaylist;
|
boolean style, isplaylist;
|
||||||
String[] filename;
|
String[] filename;
|
||||||
Region region;
|
Region region;
|
||||||
|
@ -125,19 +127,6 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
//i++;
|
//i++;
|
||||||
}
|
}
|
||||||
while (result.isTruncated()) {
|
|
||||||
result = s3client.listNextBatchOfObjects (result);
|
|
||||||
od = result.getCommonPrefixes();
|
|
||||||
for (String os : od) {
|
|
||||||
filename = os.split("/");
|
|
||||||
if (filename.length == treelevel+1) {
|
|
||||||
object.add(filename[treelevel]+"/");
|
|
||||||
}
|
|
||||||
|
|
||||||
//i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//This get file list
|
//This get file list
|
||||||
List<S3ObjectSummary> ob = result.getObjectSummaries();
|
List<S3ObjectSummary> ob = result.getObjectSummaries();
|
||||||
for (S3ObjectSummary os : ob) {
|
for (S3ObjectSummary os : ob) {
|
||||||
|
@ -151,8 +140,23 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
//i++;
|
//i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Get next batch
|
||||||
while (result.isTruncated()) {
|
while (result.isTruncated()) {
|
||||||
result = s3client.listNextBatchOfObjects (result);
|
result = s3client.listNextBatchOfObjects (result);
|
||||||
|
|
||||||
|
//This get folder list
|
||||||
|
od = result.getCommonPrefixes();
|
||||||
|
for (String os : od) {
|
||||||
|
filename = os.split("/");
|
||||||
|
if (filename.length == treelevel+1) {
|
||||||
|
object.add(filename[treelevel]+"/");
|
||||||
|
}
|
||||||
|
|
||||||
|
//i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//This get file list
|
||||||
ob = result.getObjectSummaries();
|
ob = result.getObjectSummaries();
|
||||||
for (S3ObjectSummary os : ob) {
|
for (S3ObjectSummary os : ob) {
|
||||||
filename = os.getKey().split("/");
|
filename = os.getKey().split("/");
|
||||||
|
@ -192,7 +196,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".opus") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".ogg")
|
else if (Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".opus") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".ogg")
|
||||||
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".oga") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mp3")
|
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".oga") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mp3")
|
||||||
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".m4a") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".flac")
|
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".m4a") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".flac")
|
||||||
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mka")) {
|
|| Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mka") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".m3u")) {
|
||||||
Img.add(R.drawable.audiofile);
|
Img.add(R.drawable.audiofile);
|
||||||
}
|
}
|
||||||
else if(Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mp4") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mkv")
|
else if(Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mp4") || Name.get(i).toString().toLowerCase(Locale.ROOT).endsWith(".mkv")
|
||||||
|
@ -321,7 +325,8 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
pdfread.start();
|
pdfread.start();
|
||||||
}
|
}
|
||||||
} else if (Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile)) {
|
} else if (Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile)) {
|
||||||
if (isplaylist) {
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
if (isplaylist && !Name.get(position).toString().toLowerCase(Locale.ROOT).endsWith(".m3u")) {
|
||||||
videoPlayer(null, Name.get(position).toString());
|
videoPlayer(null, Name.get(position).toString());
|
||||||
} else {
|
} else {
|
||||||
Thread mediaread = new Thread(new Runnable() {
|
Thread mediaread = new Thread(new Runnable() {
|
||||||
|
@ -337,15 +342,21 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
mycal.add(Calendar.HOUR, videotime);
|
mycal.add(Calendar.HOUR, videotime);
|
||||||
//System.out.println("Expiration date: " + mycal.getTime());
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
expiration = mycal.getTime();
|
expiration = mycal.getTime();
|
||||||
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()).withExpiration(expiration);;
|
try {
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
||||||
|
} catch (Exception e) {
|
||||||
|
policy = null;
|
||||||
|
}
|
||||||
|
String objectURL = PolicyCheck.getFileKey(s3client, bucket, prefix + Name.get(position).toString(), expiration, policy);
|
||||||
|
/*GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix + Name.get(position).toString()).withExpiration(expiration);;
|
||||||
|
URL objectURL = s3client.generatePresignedUrl(request);*/
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// Sending reference and data to Adapter
|
// Sending reference and data to Adapter
|
||||||
videoPlayer(objectURL.toString(), Name.get(position).toString());
|
videoPlayer(objectURL, Name.get(position).toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//System.out.println("tree "+treelevel);
|
//System.out.println("tree "+treelevel);
|
||||||
|
@ -396,6 +407,8 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.download_folder)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.download_folder)) {
|
||||||
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
||||||
download(Name.get(position).toString(), true);
|
download(Name.get(position).toString(), true);
|
||||||
|
} else if (menuItem.getTitle() == getResources().getString(R.string.bucket_policy)) {
|
||||||
|
policyConfig(prefix + Name.get(position).toString(), Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.create_link)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.create_link)) {
|
||||||
share( Name.get(position).toString(), Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile));
|
share( Name.get(position).toString(), Img.get(position).equals(R.drawable.audiofile) || Img.get(position).equals(R.drawable.videofile));
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.object_info)) {
|
||||||
|
@ -428,6 +441,8 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
if (menuItem.getTitle() == getResources().getString(R.string.download_file)) {
|
if (menuItem.getTitle() == getResources().getString(R.string.download_file)) {
|
||||||
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
||||||
download(Name.get(position).toString(), false);
|
download(Name.get(position).toString(), false);
|
||||||
|
} else if (menuItem.getTitle() == getResources().getString(R.string.bucket_policy)) {
|
||||||
|
policyConfig(prefix + Name.get(position).toString(), Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.upload_file_here)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.upload_file_here)) {
|
||||||
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(ObjectSelect.this, getResources().getString(R.string.pending_feature), Toast.LENGTH_SHORT).show();
|
||||||
upload(false);
|
upload(false);
|
||||||
|
@ -460,7 +475,55 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void videoPlayer(String url, String title) {
|
private void videoPlayer(String url, String title) {
|
||||||
if (isplaylist) {
|
if (title.toLowerCase(Locale.ROOT).endsWith(".m3u")) {
|
||||||
|
Thread mediaread = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//load media file
|
||||||
|
ArrayList<String> links = getPlaylist(url);
|
||||||
|
ArrayList<String> medialist = new ArrayList<String>();
|
||||||
|
for (int i = 0; i < links.size(); i++) {
|
||||||
|
medialist.add(links.get(i).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Sending reference and data to Adapter
|
||||||
|
//videoPlayer(objectURL.toString(), Name.get(position).toString());
|
||||||
|
Intent intent = new Intent(getApplicationContext(), VideoPlayer.class);
|
||||||
|
intent.putExtra("video_url", url);
|
||||||
|
intent.putExtra("title", title);
|
||||||
|
intent.putExtra("videocache", videocache);
|
||||||
|
intent.putExtra("buffersize", buffersize);
|
||||||
|
intent.putExtra("isplaylist", true);
|
||||||
|
intent.putExtra("queue", links);
|
||||||
|
intent.putExtra("names", medialist);
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//System.out.println("tree "+treelevel);
|
||||||
|
//System.out.println("prefix "+prefix);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mediaread.start();
|
||||||
|
}
|
||||||
|
else if (isplaylist) {
|
||||||
Thread mediaread = new Thread(new Runnable() {
|
Thread mediaread = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -479,17 +542,20 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// Sending reference and data to Adapter
|
if(links != null) {
|
||||||
//videoPlayer(objectURL.toString(), Name.get(position).toString());
|
// Sending reference and data to Adapter
|
||||||
Intent intent = new Intent(getApplicationContext(), VideoPlayer.class);
|
//videoPlayer(objectURL.toString(), Name.get(position).toString());
|
||||||
intent.putExtra("video_url", url);
|
Intent intent = new Intent(getApplicationContext(), VideoPlayer.class);
|
||||||
intent.putExtra("title", title);
|
intent.putExtra("video_url", url);
|
||||||
intent.putExtra("videocache", videocache);
|
intent.putExtra("title", title);
|
||||||
intent.putExtra("buffersize", buffersize);
|
intent.putExtra("videocache", videocache);
|
||||||
intent.putExtra("isplaylist", isplaylist);
|
intent.putExtra("buffersize", buffersize);
|
||||||
intent.putExtra("queue", links);
|
intent.putExtra("isplaylist", isplaylist);
|
||||||
intent.putExtra("names", medialist);
|
intent.putExtra("queue", links);
|
||||||
startActivity(intent);
|
intent.putExtra("names", medialist);
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//System.out.println("tree "+treelevel);
|
//System.out.println("tree "+treelevel);
|
||||||
|
@ -515,10 +581,12 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
intent.putExtra("videocache", videocache);
|
intent.putExtra("videocache", videocache);
|
||||||
intent.putExtra("buffersize", buffersize);
|
intent.putExtra("buffersize", buffersize);
|
||||||
intent.putExtra("isplaylist", isplaylist);
|
intent.putExtra("isplaylist", isplaylist);
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textViewer(String url) {
|
private void textViewer(String url) {
|
||||||
|
|
||||||
Intent intent = new Intent(this, TextViewer.class);
|
Intent intent = new Intent(this, TextViewer.class);
|
||||||
|
@ -732,6 +800,20 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void policyConfig(String filename, String title) {
|
||||||
|
Intent intent = new Intent(this, ObjectPolicy.class);
|
||||||
|
intent.putExtra("endpoint", endpoint);
|
||||||
|
intent.putExtra("username", username);
|
||||||
|
intent.putExtra("password", password);
|
||||||
|
intent.putExtra("bucket", bucket);
|
||||||
|
intent.putExtra("filename", filename);
|
||||||
|
intent.putExtra("region", location);
|
||||||
|
intent.putExtra("style", style);
|
||||||
|
intent.putExtra("title", title);
|
||||||
|
intent.putExtra("pdfendpoint", pdfendpoint);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
public void copyName (String name) {
|
public void copyName (String name) {
|
||||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
ClipData clip;
|
ClipData clip;
|
||||||
|
@ -756,9 +838,32 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
//System.out.println("Expiration date: " + mycal.getTime());
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
expiration = mycal.getTime();
|
expiration = mycal.getTime();
|
||||||
for (int i = 0; i < medialist.size(); i++) {
|
for (int i = 0; i < medialist.size(); i++) {
|
||||||
GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix+medialist.get(i)).withExpiration(expiration);;
|
//GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix+medialist.get(i)).withExpiration(expiration);;
|
||||||
links.add(s3client.generatePresignedUrl(request).toString());
|
//links.add(s3client.generatePresignedUrl(request).toString());
|
||||||
|
links.add(PolicyCheck.getFileKey(s3client, bucket, prefix+medialist.get(i), expiration, policy));
|
||||||
}
|
}
|
||||||
return links;
|
return links;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getPlaylist(String playlist) {
|
||||||
|
ArrayList<String> links = new ArrayList<String>();
|
||||||
|
try {
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader((new URL(playlist).openStream())));
|
||||||
|
String strLine;
|
||||||
|
|
||||||
|
//Read File Line By Line
|
||||||
|
while ((strLine = br.readLine()) != null) {
|
||||||
|
// Print the content on the console - do what you want to do
|
||||||
|
if(!strLine.startsWith("#")) {
|
||||||
|
links.add(strLine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Close the input stream
|
||||||
|
return links;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
|
import com.amazonaws.services.s3.AmazonS3;
|
||||||
|
import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class PolicyCheck {
|
||||||
|
public static String getFileKey(AmazonS3 s3client, String bucket, String object, Date expiration, String policy) {
|
||||||
|
try {
|
||||||
|
Boolean publicobject;
|
||||||
|
String fileKey = null;
|
||||||
|
publicobject = false;
|
||||||
|
if(policy.contains("arn:aws:s3:::"+bucket+"/*") && policy.contains("s3:GetObject")) {
|
||||||
|
publicobject = true;
|
||||||
|
} else if(policy.contains("s3:GetObject")) {
|
||||||
|
if((policy.contains("\"arn:aws:s3:::"+bucket+"/"+object+"\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+object+"*\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+object+"**\"")) && policy.contains("s3:GetObject")) {
|
||||||
|
publicobject = true;
|
||||||
|
} else {
|
||||||
|
String[] path = object.split("/");
|
||||||
|
String filepath = "";
|
||||||
|
for (int i = 0; i < path.length-1; i++) {
|
||||||
|
filepath = filepath+path[i]+"/";
|
||||||
|
//System.out.println(filepath);
|
||||||
|
if(policy.contains("\"arn:aws:s3:::"+bucket+"/"+filepath+"*\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+filepath+"**\"")) {
|
||||||
|
publicobject = true;
|
||||||
|
i = path.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(publicobject) {
|
||||||
|
fileKey = s3client.getUrl(bucket, object).toString();
|
||||||
|
} else {
|
||||||
|
GeneratePresignedUrlRequest request;
|
||||||
|
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
||||||
|
fileKey = s3client.generatePresignedUrl(request).toString();
|
||||||
|
}
|
||||||
|
return fileKey;
|
||||||
|
} catch (Exception e) {
|
||||||
|
GeneratePresignedUrlRequest request;
|
||||||
|
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
||||||
|
return s3client.generatePresignedUrl(request).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.GestureDetector;
|
import android.view.GestureDetector;
|
|
@ -0,0 +1,21 @@
|
||||||
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
|
||||||
|
public class SdcardCheck {
|
||||||
|
public static boolean isInstalledOnSdCard(Context context) {
|
||||||
|
|
||||||
|
PackageManager pm = context.getPackageManager();
|
||||||
|
try {
|
||||||
|
PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
|
||||||
|
ApplicationInfo ai = pi.applicationInfo;
|
||||||
|
return (ai.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == ApplicationInfo.FLAG_EXTERNAL_STORAGE;
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -13,9 +13,13 @@ import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.android.exoplayer2.database.StandaloneDatabaseProvider;
|
||||||
|
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
import asgardius.page.s3manager.databinding.ActivitySettingsBinding;
|
import java.io.File;
|
||||||
|
|
||||||
|
import asgardius.page.s3managermk2.databinding.ActivitySettingsBinding;
|
||||||
|
|
||||||
public class Settings extends AppCompatActivity {
|
public class Settings extends AppCompatActivity {
|
||||||
|
|
||||||
|
@ -24,13 +28,13 @@ public class Settings extends AppCompatActivity {
|
||||||
SQLiteDatabase db;
|
SQLiteDatabase db;
|
||||||
String videocache, videotime, buffersize, playlisttime;
|
String videocache, videotime, buffersize, playlisttime;
|
||||||
EditText vcachepick, vtimepick, bsizepick, ptimepick;
|
EditText vcachepick, vtimepick, bsizepick, ptimepick;
|
||||||
Button saveprefs, about;
|
Button saveprefs, about, clearcache;
|
||||||
SwitchMaterial isplaylist;
|
SwitchMaterial isplaylist;
|
||||||
|
StandaloneDatabaseProvider standaloneDatabaseProvider;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
binding = ActivitySettingsBinding.inflate(getLayoutInflater());
|
binding = ActivitySettingsBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
vcachepick = (EditText)findViewById(R.id.videocache);
|
vcachepick = (EditText)findViewById(R.id.videocache);
|
||||||
|
@ -73,6 +77,7 @@ public class Settings extends AppCompatActivity {
|
||||||
playlisttime = (cursor.getString(0));
|
playlisttime = (cursor.getString(0));
|
||||||
}
|
}
|
||||||
db.close();
|
db.close();
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
|
@ -100,6 +105,26 @@ public class Settings extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
getprefs.start();
|
getprefs.start();
|
||||||
|
|
||||||
|
clearcache = (Button)findViewById(R.id.clearcache);
|
||||||
|
clearcache.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//buttonaction
|
||||||
|
try {
|
||||||
|
standaloneDatabaseProvider = new StandaloneDatabaseProvider(getApplicationContext());
|
||||||
|
SimpleCache.delete(new File(getApplicationContext().getFilesDir(), "media"), standaloneDatabaseProvider);
|
||||||
|
SimpleCache.delete(new File(getApplicationContext().getExternalFilesDirs(null)[getApplicationContext().getExternalFilesDirs(null).length-1], "media"), standaloneDatabaseProvider);
|
||||||
|
standaloneDatabaseProvider.close();
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.clearcache_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.broken_database), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
//This launch account add screen
|
||||||
|
//addaccount(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//This is to add new user account
|
//This is to add new user account
|
||||||
saveprefs = (Button)findViewById(R.id.saveprefs);
|
saveprefs = (Button)findViewById(R.id.saveprefs);
|
||||||
saveprefs.setOnClickListener(new View.OnClickListener(){
|
saveprefs.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@ -153,6 +178,12 @@ public class Settings extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
private void aboutPage () {
|
private void aboutPage () {
|
||||||
|
|
||||||
Intent intent = new Intent(this, WebBrowser.class);
|
Intent intent = new Intent(this, WebBrowser.class);
|
||||||
|
@ -163,7 +194,6 @@ public class Settings extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mainmenu() {
|
private void mainmenu() {
|
||||||
|
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
intent.putExtra("EXIT", true);
|
intent.putExtra("EXIT", true);
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Share extends AppCompatActivity {
|
public class Share extends AppCompatActivity {
|
||||||
String username, password, endpoint, bucket, object, location, title, objectlist;
|
String username, password, endpoint, bucket, object, location, title, objectlist, policy;
|
||||||
boolean mediafile, style, publicbucket;
|
boolean mediafile, style, publicobject;
|
||||||
TextView expirationtext;
|
TextView expirationtext;
|
||||||
ProgressBar simpleProgressBar;
|
ProgressBar simpleProgressBar;
|
||||||
Region region;
|
Region region;
|
||||||
|
@ -126,7 +126,26 @@ public class Share extends AppCompatActivity {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
//Your code goes here
|
//Your code goes here
|
||||||
String policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
||||||
|
publicobject = false;
|
||||||
|
if(policy.contains("arn:aws:s3:::"+bucket+"/*") && policy.contains("s3:GetObject")) {
|
||||||
|
publicobject = true;
|
||||||
|
} else if(policy.contains("s3:GetObject")) {
|
||||||
|
if((policy.contains("\"arn:aws:s3:::"+bucket+"/"+object+"\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+object+"*\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+object+"**\"")) && policy.contains("s3:GetObject")) {
|
||||||
|
publicobject = true;
|
||||||
|
} else {
|
||||||
|
String[] path = object.split("/");
|
||||||
|
String filepath = "";
|
||||||
|
for (int i = 0; i < path.length-1; i++) {
|
||||||
|
filepath = filepath+path[i]+"/";
|
||||||
|
//System.out.println(filepath);
|
||||||
|
if(policy.contains("\"arn:aws:s3:::"+bucket+"/"+filepath+"*\"") || policy.contains("\"arn:aws:s3:::"+bucket+"/"+filepath+"**\"")) {
|
||||||
|
publicobject = true;
|
||||||
|
i = path.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//System.out.println(policy);
|
//System.out.println(policy);
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
@ -134,12 +153,10 @@ public class Share extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
//Your code goes here
|
//Your code goes here
|
||||||
if(policy.contains("\"Resource\":[\"arn:aws:s3:::"+bucket+"/*") || policy.contains("\"Resource\":\"arn:aws:s3:::"+bucket+"/*")){
|
if(publicobject){
|
||||||
publicbucket = true;
|
|
||||||
expirationtext.setText(getResources().getString(R.string.expiration_not_required));
|
expirationtext.setText(getResources().getString(R.string.expiration_not_required));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
publicbucket = false;
|
|
||||||
datepick.setEnabled(true);
|
datepick.setEnabled(true);
|
||||||
hourpick.setEnabled(true);
|
hourpick.setEnabled(true);
|
||||||
minutepick.setEnabled(true);
|
minutepick.setEnabled(true);
|
||||||
|
@ -162,7 +179,7 @@ public class Share extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
publicbucket = false;
|
publicobject = false;
|
||||||
datepick.setEnabled(true);
|
datepick.setEnabled(true);
|
||||||
hourpick.setEnabled(true);
|
hourpick.setEnabled(true);
|
||||||
minutepick.setEnabled(true);
|
minutepick.setEnabled(true);
|
||||||
|
@ -256,6 +273,7 @@ public class Share extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -354,30 +372,20 @@ public class Share extends AppCompatActivity {
|
||||||
objectlist = "";
|
objectlist = "";
|
||||||
List<S3ObjectSummary> objects = result.getObjectSummaries();
|
List<S3ObjectSummary> objects = result.getObjectSummaries();
|
||||||
for (S3ObjectSummary os : objects) {
|
for (S3ObjectSummary os : objects) {
|
||||||
if(publicbucket) {
|
objectlist = objectlist+PolicyCheck.getFileKey(s3client, bucket, os.getKey(), expiration, policy)+"\n";
|
||||||
objectlist = objectlist+s3client.getUrl(bucket, os.getKey()).toString()+"\n";
|
|
||||||
} else {
|
|
||||||
request = new GeneratePresignedUrlRequest(bucket, os.getKey()).withExpiration(expiration);
|
|
||||||
objectlist = objectlist+s3client.generatePresignedUrl(request).toString()+"\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
while (result.isTruncated()) {
|
while (result.isTruncated()) {
|
||||||
result = s3client.listNextBatchOfObjects (result);
|
result = s3client.listNextBatchOfObjects (result);
|
||||||
objects = result.getObjectSummaries();
|
objects = result.getObjectSummaries();
|
||||||
for (S3ObjectSummary os : objects) {
|
for (S3ObjectSummary os : objects) {
|
||||||
if(publicbucket) {
|
objectlist = objectlist+PolicyCheck.getFileKey(s3client, bucket, os.getKey(), expiration, policy)+"\n";
|
||||||
objectlist = objectlist+s3client.getUrl(bucket, os.getKey()).toString()+"\n";
|
|
||||||
} else {
|
|
||||||
request = new GeneratePresignedUrlRequest(bucket, os.getKey()).withExpiration(expiration);
|
|
||||||
objectlist = objectlist+s3client.generatePresignedUrl(request).toString()+"\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sharefile() {
|
private void sharefile() {
|
||||||
if(publicbucket) {
|
if(publicobject) {
|
||||||
objectURL = s3client.getUrl(bucket, object);
|
objectURL = s3client.getUrl(bucket, object);
|
||||||
} else {
|
} else {
|
||||||
if (datepick.getText().toString().equals("")) {
|
if (datepick.getText().toString().equals("")) {
|
||||||
|
@ -447,6 +455,7 @@ public class Share extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import static android.content.ContentValues.TAG;
|
import static android.content.ContentValues.TAG;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import android.app.AppOpsManager;
|
import android.app.AppOpsManager;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
|
@ -29,6 +29,7 @@ import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.PlaybackException;
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
|
import com.google.android.exoplayer2.Tracks;
|
||||||
import com.google.android.exoplayer2.audio.AudioAttributes;
|
import com.google.android.exoplayer2.audio.AudioAttributes;
|
||||||
import com.google.android.exoplayer2.database.StandaloneDatabaseProvider;
|
import com.google.android.exoplayer2.database.StandaloneDatabaseProvider;
|
||||||
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector;
|
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector;
|
||||||
|
@ -126,10 +127,17 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
mediaSessionConnector.setPlayer(player);
|
mediaSessionConnector.setPlayer(player);
|
||||||
mediaSession.setActive(true);
|
mediaSession.setActive(true);
|
||||||
evictor = new LeastRecentlyUsedCacheEvictor(maxCacheSize);
|
evictor = new LeastRecentlyUsedCacheEvictor(maxCacheSize);
|
||||||
simpleCache = new SimpleCache(
|
if(SdcardCheck.isInstalledOnSdCard(this)) {
|
||||||
new File(this.getCacheDir(), "media"),
|
simpleCache = new SimpleCache(
|
||||||
evictor,
|
new File(this.getExternalFilesDirs(null)[this.getExternalFilesDirs(null).length-1], "media"),
|
||||||
standaloneDatabaseProvider);
|
evictor,
|
||||||
|
standaloneDatabaseProvider);
|
||||||
|
} else {
|
||||||
|
simpleCache = new SimpleCache(
|
||||||
|
new File(this.getFilesDir(), "media"),
|
||||||
|
evictor,
|
||||||
|
standaloneDatabaseProvider);
|
||||||
|
}
|
||||||
playerView.setPlayer(player);
|
playerView.setPlayer(player);
|
||||||
control = new StyledPlayerView.ControllerVisibilityListener() {
|
control = new StyledPlayerView.ControllerVisibilityListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -155,36 +163,19 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
playerNotificationManager.setPlayer(player);
|
playerNotificationManager.setPlayer(player);
|
||||||
if (isplaylist) {
|
if (isplaylist) {
|
||||||
for (int i = 0; i < queue.size(); i++) {
|
for (int i = 0; i < queue.size(); i++) {
|
||||||
if (names.get(i).endsWith(".m3u8")) {
|
MediaItem mediaItem = MediaItem.fromUri(Share.URLify(queue.get(i)));
|
||||||
MediaItem mediaItem = MediaItem.fromUri(Share.URLify(queue.get(i)));
|
player.addMediaItem(mediaItem);
|
||||||
player.addMediaItem(mediaItem);
|
|
||||||
} else {
|
|
||||||
mediaSource = new ProgressiveMediaSource.Factory(
|
|
||||||
new CacheDataSource.Factory()
|
|
||||||
.setCache(simpleCache)
|
|
||||||
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
|
||||||
.setUserAgent("S3 Manager"))
|
|
||||||
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
|
||||||
).createMediaSource(MediaItem.fromUri(Share.URLify(queue.get(i))));
|
|
||||||
player.addMediaSource(mediaSource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
getSupportActionBar().setTitle(names.get(player.getCurrentMediaItemIndex()));
|
||||||
player.prepare();
|
player.prepare();
|
||||||
player.seekTo(names.indexOf(title), 0);
|
try {
|
||||||
} else {
|
player.seekTo(names.indexOf(title), 0);
|
||||||
if (title.endsWith(".m3u8")) {
|
}catch (Exception e) {
|
||||||
MediaItem mediaItem = MediaItem.fromUri(Share.URLify(videoURL));
|
System.out.println("Playing m3u file");
|
||||||
player.setMediaItem(mediaItem);
|
|
||||||
} else {
|
|
||||||
mediaSource = new ProgressiveMediaSource.Factory(
|
|
||||||
new CacheDataSource.Factory()
|
|
||||||
.setCache(simpleCache)
|
|
||||||
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
|
||||||
.setUserAgent("S3 Manager"))
|
|
||||||
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
|
||||||
).createMediaSource(MediaItem.fromUri(Share.URLify(videoURL)));
|
|
||||||
player.setMediaSource(mediaSource);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
MediaItem mediaItem = MediaItem.fromUri(Share.URLify(videoURL));
|
||||||
|
player.setMediaItem(mediaItem);
|
||||||
player.prepare();
|
player.prepare();
|
||||||
}
|
}
|
||||||
// Start the playback.
|
// Start the playback.
|
||||||
|
@ -206,6 +197,14 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTracksChanged(Tracks tracks) {
|
||||||
|
if(isplaylist) {
|
||||||
|
getSupportActionBar().setTitle(names.get(player.getCurrentMediaItemIndex()));
|
||||||
|
}
|
||||||
|
Player.Listener.super.onTracksChanged(tracks);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -224,9 +223,6 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
mWakeLock.acquire();
|
mWakeLock.acquire();
|
||||||
//System.out.println("WakeLock acquired");
|
//System.out.println("WakeLock acquired");
|
||||||
}
|
}
|
||||||
if(isplaylist) {
|
|
||||||
getSupportActionBar().setTitle(names.get(player.getCurrentMediaItemIndex()));
|
|
||||||
}
|
|
||||||
} else if (state == 2) {
|
} else if (state == 2) {
|
||||||
// Buffering.
|
// Buffering.
|
||||||
//Acquiring WakeLock and WifiLock if not held
|
//Acquiring WakeLock and WifiLock if not held
|
||||||
|
@ -238,9 +234,6 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
mWakeLock.acquire();
|
mWakeLock.acquire();
|
||||||
//System.out.println("WakeLock acquired");
|
//System.out.println("WakeLock acquired");
|
||||||
}
|
}
|
||||||
if(isplaylist) {
|
|
||||||
getSupportActionBar().setTitle(names.get(player.getCurrentMediaItemIndex()));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//Player inactive
|
//Player inactive
|
||||||
//Releasing WifiLock and WakeLock if held
|
//Releasing WifiLock and WakeLock if held
|
||||||
|
@ -329,16 +322,16 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if (!mWifiLock.isHeld()) {
|
if (mWifiLock.isHeld()) {
|
||||||
mWifiLock.acquire();
|
mWifiLock.release();
|
||||||
//System.out.println("WifiLock acquired");
|
//System.out.println("WifiLock acquired");
|
||||||
}
|
}
|
||||||
if (!mWakeLock.isHeld()) {
|
if (mWakeLock.isHeld()) {
|
||||||
mWakeLock.acquire();
|
mWakeLock.release();
|
||||||
//System.out.println("WakeLock acquired");
|
//System.out.println("WakeLock acquired");
|
||||||
}
|
}
|
||||||
mediaSessionConnector.setPlayer(null);
|
mediaSessionConnector.setPlayer(null);
|
||||||
deleteCache(this, standaloneDatabaseProvider);
|
//deleteCache(this, standaloneDatabaseProvider);
|
||||||
mediaSession.setActive(false);
|
mediaSession.setActive(false);
|
||||||
playerNotificationManager.setPlayer(null);
|
playerNotificationManager.setPlayer(null);
|
||||||
player.release();
|
player.release();
|
||||||
|
@ -374,36 +367,14 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
if (isplaylist) {
|
if (isplaylist) {
|
||||||
player.clearMediaItems();
|
player.clearMediaItems();
|
||||||
for (int i = 0; i < queue.size(); i++) {
|
for (int i = 0; i < queue.size(); i++) {
|
||||||
if (names.get(i).endsWith(".m3u8")) {
|
MediaItem mediaItem = MediaItem.fromUri(queue.get(i));
|
||||||
MediaItem mediaItem = MediaItem.fromUri(queue.get(i));
|
player.addMediaItem(mediaItem);
|
||||||
player.addMediaItem(mediaItem);
|
|
||||||
} else {
|
|
||||||
mediaSource = new ProgressiveMediaSource.Factory(
|
|
||||||
new CacheDataSource.Factory()
|
|
||||||
.setCache(simpleCache)
|
|
||||||
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
|
||||||
.setUserAgent("S3 Manager"))
|
|
||||||
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
|
||||||
).createMediaSource(MediaItem.fromUri(Uri.parse(queue.get(i))));
|
|
||||||
player.addMediaSource(mediaSource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
player.prepare();
|
player.prepare();
|
||||||
player.seekTo(names.indexOf(title), 0);
|
player.seekTo(names.indexOf(title), 0);
|
||||||
} else {
|
} else {
|
||||||
if (title.endsWith(".m3u8")) {
|
MediaItem mediaItem = MediaItem.fromUri(videoURL);
|
||||||
MediaItem mediaItem = MediaItem.fromUri(videoURL);
|
player.setMediaItem(mediaItem);
|
||||||
player.setMediaItem(mediaItem);
|
|
||||||
} else {
|
|
||||||
mediaSource = new ProgressiveMediaSource.Factory(
|
|
||||||
new CacheDataSource.Factory()
|
|
||||||
.setCache(simpleCache)
|
|
||||||
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
|
||||||
.setUserAgent("S3 Manager"))
|
|
||||||
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
|
||||||
).createMediaSource(MediaItem.fromUri(Uri.parse(videoURL)));
|
|
||||||
player.setMediaSource(mediaSource);
|
|
||||||
}
|
|
||||||
player.prepare();
|
player.prepare();
|
||||||
}
|
}
|
||||||
// Start the playback.
|
// Start the playback.
|
||||||
|
@ -429,9 +400,9 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deleteCache(Context context, StandaloneDatabaseProvider database) {
|
/*static void deleteCache(Context context, StandaloneDatabaseProvider database) {
|
||||||
SimpleCache.delete(new File(context.getCacheDir(), "media"), database);
|
SimpleCache.delete(new File(context.getCacheDir(), "media"), database);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
try {
|
try {
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
|
@ -27,14 +27,14 @@
|
||||||
android:id="@+id/set_public"
|
android:id="@+id/set_public"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:text="@string/set_public_bucket"
|
android:text="@string/set_public"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/set_private"
|
android:id="@+id/set_private"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:text="@string/set_private_bucket"
|
android:text="@string/set_private"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
54
app/src/main/res/layout/activity_object_policy.xml
Normal file
54
app/src/main/res/layout/activity_object_policy.xml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".ObjectPolicy">
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="MissingConstraints">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/permission"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="25sp"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/set_public"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:text="@string/set_public"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/set_private"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:text="@string/set_private"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/simpleProgressBar"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:max="100"
|
||||||
|
android:progress="50"
|
||||||
|
android:padding="20dp"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
android:indeterminate="true" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -20,7 +20,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/videocache"
|
android:text="@string/videocache"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="25sp"/>
|
android:textSize="25sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/videocache"
|
android:id="@+id/videocache"
|
||||||
|
@ -29,7 +30,15 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:hint="@string/videocache"
|
android:hint="@string/videocache"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:textColorHint="?attr/colorOnSecondary"/>
|
android:textColorHint="?attr/colorOnSecondary"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/clearcache"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:text="@string/clearcache"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
android:id="@+id/copy_name"
|
android:id="@+id/copy_name"
|
||||||
android:title="@string/copy_name" />
|
android:title="@string/copy_name" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/acl_config"
|
||||||
|
android:title="@string/bucket_policy" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/deletefolder"
|
android:id="@+id/deletefolder"
|
||||||
android:title="@string/file_del" />
|
android:title="@string/file_del" />
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
android:id="@+id/copy_name"
|
android:id="@+id/copy_name"
|
||||||
android:title="@string/copy_name" />
|
android:title="@string/copy_name" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/acl_config"
|
||||||
|
android:title="@string/bucket_policy" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/deletefile"
|
android:id="@+id/deletefile"
|
||||||
android:title="@string/file_del" />
|
android:title="@string/file_del" />
|
||||||
|
|
|
@ -118,8 +118,13 @@
|
||||||
<string name="bucket_policy">Permisos de acceso</string>
|
<string name="bucket_policy">Permisos de acceso</string>
|
||||||
<string name="public_bucket">Bucket público</string>
|
<string name="public_bucket">Bucket público</string>
|
||||||
<string name="private_bucket">Bucket privado</string>
|
<string name="private_bucket">Bucket privado</string>
|
||||||
|
<string name="public_object">Objeto público</string>
|
||||||
|
<string name="private_object">Objeto privado</string>
|
||||||
<string name="custom_policy">Política personalizada</string>
|
<string name="custom_policy">Política personalizada</string>
|
||||||
<string name="set_public_bucket">Establecer bucket como público</string>
|
<string name="set_public">Establecer como público</string>
|
||||||
<string name="set_private_bucket">Establecer bucket como privado</string>
|
<string name="set_private">Establecer como privado</string>
|
||||||
|
<string name="parent_policy">Política establecida por carpeta padre</string>
|
||||||
<string name="expiration_not_required">Fecha de expiración no requerida</string>
|
<string name="expiration_not_required">Fecha de expiración no requerida</string>
|
||||||
|
<string name="clearcache">Limpiar Cache de Video</string>
|
||||||
|
<string name="clearcache_ok">Cache limpiada exitosamente</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,10 +1,8 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">S3 Manager</string>
|
<string name="app_name" translatable="false">S3 Manager</string>
|
||||||
<string name="aws_endpoint" translatable="false">.amazonaws.com</string>
|
<string name="aws_endpoint" translatable="false">.amazonaws.com</string>
|
||||||
<string name="endpoint_url" translatable="false">https://s3.asgardius.company</string>
|
|
||||||
<string name="pdf_reader" translatable="false">https://office.asgardius.company/pdfjs</string>
|
<string name="pdf_reader" translatable="false">https://office.asgardius.company/pdfjs</string>
|
||||||
<string name="pdf_reader_notready">You need to setup a pdf.js server</string>
|
<string name="pdf_reader_notready">You need to setup a pdf.js server</string>
|
||||||
<string name="access_key" translatable="false">google</string>
|
|
||||||
<string name="account_list">Account list</string>
|
<string name="account_list">Account list</string>
|
||||||
<string name="bucket_list">Bucket list</string>
|
<string name="bucket_list">Bucket list</string>
|
||||||
<string name="object_list">Object list</string>
|
<string name="object_list">Object list</string>
|
||||||
|
@ -122,8 +120,13 @@
|
||||||
<string name="bucket_policy">Access permissions</string>
|
<string name="bucket_policy">Access permissions</string>
|
||||||
<string name="public_bucket">Public bucket</string>
|
<string name="public_bucket">Public bucket</string>
|
||||||
<string name="private_bucket">Private bucket</string>
|
<string name="private_bucket">Private bucket</string>
|
||||||
|
<string name="public_object">Public object</string>
|
||||||
|
<string name="private_object">Private object</string>
|
||||||
<string name="custom_policy">Custom policy</string>
|
<string name="custom_policy">Custom policy</string>
|
||||||
<string name="set_public_bucket">Set bucket as public</string>
|
<string name="set_public">Set as public</string>
|
||||||
<string name="set_private_bucket">Set bucket as private</string>
|
<string name="set_private">Set as private</string>
|
||||||
|
<string name="parent_policy">Policy set by parent folder</string>
|
||||||
<string name="expiration_not_required">Expiration date not required</string>
|
<string name="expiration_not_required">Expiration date not required</string>
|
||||||
|
<string name="clearcache">Clear Video Cache</string>
|
||||||
|
<string name="clearcache_ok">Cache clean successfully</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application' version '7.4.0' apply false
|
id 'com.android.application' version '8.5.2' apply false
|
||||||
id 'com.android.library' version '7.4.0' apply false
|
id 'com.android.library' version '8.5.2' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
|
1
fastlane/metadata/android/en-US/changelogs/74.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/74.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Set object as public or private
|
3
fastlane/metadata/android/en-US/changelogs/76.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/76.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
* Check policy per object at creating share links
|
||||||
|
* Cache reuse for public media files
|
||||||
|
* Button to remove media cache inside ths app
|
1
fastlane/metadata/android/en-US/changelogs/77.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/77.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Fix wakelock not being released at closing video player
|
1
fastlane/metadata/android/en-US/changelogs/78.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/78.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* M3U Playlist support
|
1
fastlane/metadata/android/en-US/changelogs/79.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/79.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Fix UI issue at media player screen
|
1
fastlane/metadata/android/en-US/changelogs/80.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/80.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Libraries updated
|
1
fastlane/metadata/android/en-US/changelogs/83.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/83.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Upgrade libraries
|
1
fastlane/metadata/android/en-US/changelogs/85.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/85.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Allow move app to SD Card
|
2
fastlane/metadata/android/en-US/changelogs/86.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/86.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
* Dependencies upgraded
|
||||||
|
* Fixed large file list being truncate
|
|
@ -22,6 +22,7 @@ Current feature list
|
||||||
<li>get bucket info</li>
|
<li>get bucket info</li>
|
||||||
<li>Set CORS policy</li>
|
<li>Set CORS policy</li>
|
||||||
<li>Set bucket as public or private</li>
|
<li>Set bucket as public or private</li>
|
||||||
|
<li>Set object as public or private</li>
|
||||||
|
|
||||||
Planned feature list
|
Planned feature list
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ Known supported providers
|
||||||
|
|
||||||
<li>Amazon Web Services</li>
|
<li>Amazon Web Services</li>
|
||||||
<li>Scaleway Elements</li>
|
<li>Scaleway Elements</li>
|
||||||
<li>Wasabi Cloud</li>
|
<li>Wasabi Cloud (Provider broke access control intentionally since March 13 2023)</li>
|
||||||
<li>Backblaze B2</li>
|
<li>Backblaze B2</li>
|
||||||
<li>Cloudflare R2 (partial)</li>
|
<li>Cloudflare R2 (partial)</li>
|
||||||
<li>MinIO **</li>
|
<li>MinIO **</li>
|
||||||
|
@ -59,9 +60,7 @@ Known not supported providers
|
||||||
** Extra steps required (read documentation)
|
** Extra steps required (read documentation)
|
||||||
|
|
||||||
Please report all issues at https://forum.asgardius.company/t/s3-manager
|
Please report all issues at https://forum.asgardius.company/t/s3-manager
|
||||||
|
https://wiki-es.asgardius.company/index.php?title=Documentacion_Asgardius_S3_Manager
|
||||||
You can find app documentation at https://wiki.asgardius.company/shelves/asgardius-s3-manager-english (english) or https://wiki.asgardius.company/shelves/asgardius-s3-manager-espanol (spanish)
|
You can find app documentation at https://wiki-en.asgardius.company/index.php?title=Asgardius_S3_Manager_Documentation (english) or https://wiki-es.asgardius.company/index.php?title=Documentacion_Asgardius_S3_Manager (spanish)
|
||||||
|
|
||||||
This app has nonfreenet antifeature because its compatibility list.
|
|
||||||
|
|
||||||
You can use MinIO or Garage to have a FOSS selfhosted server to use with this app
|
You can use MinIO or Garage to have a FOSS selfhosted server to use with this app
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
@ -19,3 +19,5 @@ android.useAndroidX=true
|
||||||
# resources declared in the library itself and none from the library's dependencies,
|
# resources declared in the library itself and none from the library's dependencies,
|
||||||
# thereby reducing the size of the R class for that library
|
# thereby reducing the size of the R class for that library
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
|
android.nonFinalResIds=false
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
#Sat Aug 27 12:12:23 MST 2022
|
#Sat Aug 27 12:12:23 MST 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
Loading…
Reference in a new issue