Compare commits
73 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 | |||
b76890e320 | |||
4841fbcf5d | |||
81693d37db | |||
0fe7f7a79b | |||
16fca27422 | |||
960707d4e0 | |||
9ee818e47a | |||
95bba1f473 | |||
b3c1953a3b | |||
77f4a25a32 | |||
920c66f71d | |||
24c5d229d2 | |||
b167ea24d8 | |||
d033dfbb3b | |||
8f2a33514b | |||
46acbb13fb | |||
aa95967473 | |||
7566c924fd | |||
bfdf1b1527 | |||
1f52b6048b | |||
eddc353a82 | |||
19cc86b45e | |||
c30eb36854 | |||
cd4d17d497 | |||
13e6664569 | |||
6f6f9207cc | |||
6240ad14db | |||
f093972779 | |||
7223d9333f | |||
51b2f1f783 | |||
cd0b72a887 | |||
48fa899a97 | |||
c3cf489510 | |||
3c8d41e05e | |||
3e67badeb2 | |||
803297b2d6 | |||
52d5106ee3 |
74 changed files with 2346 additions and 520 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,15 +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="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="Android Studio default JDK" 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>
|
33
README.md
33
README.md
|
@ -1,13 +1,11 @@
|
||||||
# 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)
|
||||||
* Picture preview (jpg, jpeg, png, gif)
|
* Picture preview (jpg, jpeg, png, gif, webp)
|
||||||
* Plain text file preview (txt, md)
|
* Plain text file preview (txt, md)
|
||||||
* Webpage viewer (htm, html)
|
* Webpage viewer (htm, html)
|
||||||
* Multiple account support
|
* Multiple account support
|
||||||
|
@ -18,11 +16,15 @@ Current feature list
|
||||||
* Delete folders
|
* Delete folders
|
||||||
* File upload
|
* File upload
|
||||||
* File download
|
* File download
|
||||||
|
* Download folder content
|
||||||
|
* Upload folder content
|
||||||
* pdf file reader using user provided pdf.js server
|
* pdf file reader using user provided pdf.js server
|
||||||
* file sharing links
|
* file sharing links
|
||||||
* get object info
|
* get object info
|
||||||
* get bucket info
|
* get bucket info
|
||||||
* Set CORS policy
|
* Set CORS policy
|
||||||
|
* Set bucket as public or private
|
||||||
|
* Set object as public or private
|
||||||
|
|
||||||
Planned feature list
|
Planned feature list
|
||||||
|
|
||||||
|
@ -32,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)
|
||||||
|
|
||||||
|
@ -46,6 +44,8 @@ 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-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
|
||||||
|
|
||||||
* English
|
* English
|
||||||
|
@ -60,11 +60,16 @@ Knnown issues
|
||||||
Known supported providers
|
Known supported providers
|
||||||
|
|
||||||
* Amazon Web Services
|
* Amazon Web Services
|
||||||
* Scaleway Elements (partial)
|
* Scaleway Elements
|
||||||
* Oracle Cloud (partial)
|
* Wasabi Cloud (Provider broke access control intentionally since March 13 2023)
|
||||||
* Wasabi Cloud
|
* Backblaze B2
|
||||||
* MinIO
|
* Cloudflare R2 (partial)
|
||||||
|
* MinIO **
|
||||||
|
* Garage **
|
||||||
|
|
||||||
Known not supported providers
|
Known not supported providers
|
||||||
|
|
||||||
* Google Cloud
|
* Google Cloud (Not compatible with S3v4)
|
||||||
|
* Oracle Cloud (compatibility issues with S3v4)
|
||||||
|
|
||||||
|
** Extra steps required (read documentation)
|
||||||
|
|
|
@ -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 58
|
versionCode 2
|
||||||
versionName "0.6.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,23 +29,25 @@ android {
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
}
|
}
|
||||||
|
namespace 'asgardius.page.s3managermk2'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
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"
|
||||||
// BEGIN AWS DEPENDENCIES
|
// BEGIN AWS DEPENDENCIES
|
||||||
def aws_version = "2.60.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
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||||
}
|
}
|
|
@ -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,7 +18,14 @@
|
||||||
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
|
||||||
|
android:name=".BucketPolicy"
|
||||||
|
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"
|
||||||
|
@ -52,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"
|
||||||
|
@ -61,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:hardwareAccelerated="false"
|
|
||||||
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" />
|
||||||
<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"
|
||||||
|
@ -98,6 +109,7 @@
|
||||||
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"
|
||||||
|
|
|
@ -9,15 +9,16 @@
|
||||||
<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.60.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>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. 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 in some cases). 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. You can use https://office.asgardius.company/pdfjs or setup your own.
|
||||||
<br>
|
<br>
|
||||||
You can find technical support on official forum https://forum.asgardius.company/t/s3-manager</p>
|
You can find technical support on official forum https://forum.asgardius.company/t/s3-manager</p>
|
||||||
</Body>
|
</Body>
|
||||||
|
|
|
@ -1,152 +0,0 @@
|
||||||
package asgardius.page.s3manager;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
|
||||||
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;
|
|
||||||
import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest;
|
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class Share extends AppCompatActivity {
|
|
||||||
String username, password, endpoint, bucket, object, location, title;
|
|
||||||
boolean mediafile, style;
|
|
||||||
Region region;
|
|
||||||
S3ClientOptions s3ClientOptions;
|
|
||||||
AWSCredentials myCredentials;
|
|
||||||
AmazonS3 s3client;
|
|
||||||
Calendar mycal;
|
|
||||||
EditText datepick, hourpick, minutepick;
|
|
||||||
int date, hour, minute;
|
|
||||||
Button share;
|
|
||||||
GeneratePresignedUrlRequest request;
|
|
||||||
Date expiration;
|
|
||||||
URL objectURL;
|
|
||||||
int videotime;
|
|
||||||
|
|
||||||
public static String URLify(String str) {
|
|
||||||
str = str.trim();
|
|
||||||
int length = str.length();
|
|
||||||
int trueL = length;
|
|
||||||
if(str.contains(" ")) {
|
|
||||||
for(int i = 0; i < length; i++) {
|
|
||||||
if(str.charAt(i) == ' ') {
|
|
||||||
trueL = trueL + 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char[] oldArr = str.toCharArray();
|
|
||||||
char[] newArr = new char[trueL];
|
|
||||||
int x = 0;
|
|
||||||
for(int i = 0; i < length; i++) {
|
|
||||||
if(oldArr[i] == ' ') {
|
|
||||||
newArr[x] = '%';
|
|
||||||
newArr[x+1] = '2';
|
|
||||||
newArr[x+2] = '0';
|
|
||||||
x += 3;
|
|
||||||
} else {
|
|
||||||
newArr[x] = oldArr[i];
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
str = new String(newArr, 0, trueL);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_share);
|
|
||||||
mycal = Calendar.getInstance();
|
|
||||||
datepick = (EditText)findViewById(R.id.Date);
|
|
||||||
hourpick = (EditText)findViewById(R.id.Hour);
|
|
||||||
minutepick = (EditText)findViewById(R.id.Minute);
|
|
||||||
share = (Button)findViewById(R.id.share);
|
|
||||||
endpoint = getIntent().getStringExtra("endpoint");
|
|
||||||
username = getIntent().getStringExtra("username");
|
|
||||||
password = getIntent().getStringExtra("password");
|
|
||||||
bucket = getIntent().getStringExtra("bucket");
|
|
||||||
location = getIntent().getStringExtra("region");
|
|
||||||
style = getIntent().getBooleanExtra("style", false);
|
|
||||||
object = getIntent().getStringExtra("object");
|
|
||||||
mediafile = getIntent().getBooleanExtra("mediafile", false);
|
|
||||||
videotime = getIntent().getIntExtra("videotime", 1);
|
|
||||||
title = getIntent().getStringExtra("title");
|
|
||||||
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(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
s3client.setEndpoint(endpoint);
|
|
||||||
s3ClientOptions.setPathStyleAccess(style);
|
|
||||||
s3client.setS3ClientOptions(s3ClientOptions);
|
|
||||||
share.setOnClickListener(new View.OnClickListener(){
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
//buttonaction
|
|
||||||
try {
|
|
||||||
if (datepick.getText().toString().equals("")) {
|
|
||||||
date = 0;
|
|
||||||
} else {
|
|
||||||
date = Integer.parseInt(datepick.getText().toString());
|
|
||||||
}
|
|
||||||
if (hourpick.getText().toString().equals("")) {
|
|
||||||
hour = 0;
|
|
||||||
} else {
|
|
||||||
hour = Integer.parseInt(hourpick.getText().toString());
|
|
||||||
}
|
|
||||||
if (minutepick.getText().toString().equals("")) {
|
|
||||||
minute = 0;
|
|
||||||
} else {
|
|
||||||
minute = Integer.parseInt(minutepick.getText().toString());
|
|
||||||
}
|
|
||||||
expiration = new Date();
|
|
||||||
//System.out.println("today is " + mycal.getTime());
|
|
||||||
mycal.setTime(expiration);
|
|
||||||
if (date == 0 && hour == 0 && minute == 0) {
|
|
||||||
if (mediafile) {
|
|
||||||
mycal.add(Calendar.HOUR, videotime);
|
|
||||||
} else {
|
|
||||||
mycal.add(Calendar.MINUTE, 15);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mycal.add(Calendar.DATE, date);
|
|
||||||
mycal.add(Calendar.HOUR, hour);
|
|
||||||
mycal.add(Calendar.MINUTE, minute);
|
|
||||||
}
|
|
||||||
//System.out.println("Expiration date: " + mycal.getTime());
|
|
||||||
expiration = mycal.getTime();
|
|
||||||
//System.out.println(expiration);
|
|
||||||
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
|
||||||
objectURL = s3client.generatePresignedUrl(request);
|
|
||||||
//System.out.println(URLify(objectURL.toString()));
|
|
||||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
|
||||||
shareIntent.setType("text/plain");
|
|
||||||
shareIntent.putExtra(Intent.EXTRA_TEXT, URLify(objectURL.toString()));
|
|
||||||
startActivity(Intent.createChooser(shareIntent, "choose one"));
|
|
||||||
} catch (Exception e) {
|
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import static com.amazonaws.regions.Regions.US_EAST_1;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
@ -12,6 +8,8 @@ import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.amazonaws.auth.AWSCredentials;
|
import com.amazonaws.auth.AWSCredentials;
|
||||||
import com.amazonaws.auth.BasicAWSCredentials;
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
import com.amazonaws.regions.Region;
|
import com.amazonaws.regions.Region;
|
||||||
|
@ -21,7 +19,6 @@ import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
import com.amazonaws.services.s3.model.Bucket;
|
import com.amazonaws.services.s3.model.Bucket;
|
||||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AccountAdd extends AppCompatActivity {
|
public class AccountAdd extends AppCompatActivity {
|
||||||
|
@ -90,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();
|
||||||
|
@ -108,6 +100,9 @@ public class AccountAdd extends AppCompatActivity {
|
||||||
if (location.equals("")) {
|
if (location.equals("")) {
|
||||||
location = "us-east-1";
|
location = "us-east-1";
|
||||||
}
|
}
|
||||||
|
if(endpoint.endsWith("/")) {
|
||||||
|
endpoint = endpoint.substring(0, endpoint.length()-1);
|
||||||
|
}
|
||||||
if (edit) {
|
if (edit) {
|
||||||
db.execSQL("UPDATE account SET id=\""+alias+"\", endpoint=\""+endpoint+"\", username=\""+username+"\", password=\""+password+"\", region=\""+location+"\", pdfendpoint=\""+pdfendpoint+"\", style=\""+style+"\" WHERE id=\""+id+"\"");
|
db.execSQL("UPDATE account SET id=\""+alias+"\", endpoint=\""+endpoint+"\", username=\""+username+"\", password=\""+password+"\", region=\""+location+"\", pdfendpoint=\""+pdfendpoint+"\", style=\""+style+"\" WHERE id=\""+id+"\"");
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.accountsave_success), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.accountsave_success), 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://")) {
|
||||||
|
@ -150,10 +141,14 @@ public class AccountAdd extends AppCompatActivity {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
//Your code goes here
|
//Your code goes here
|
||||||
if (location.equals("")) {
|
if (endpoint.contains(getResources().getString(R.string.aws_endpoint)) || location.equals("")) {
|
||||||
location = "us-east-1";
|
|
||||||
}
|
|
||||||
region = Region.getRegion("us-east-1");
|
region = Region.getRegion("us-east-1");
|
||||||
|
} else {
|
||||||
|
region = Region.getRegion(location);
|
||||||
|
}
|
||||||
|
if(endpoint.endsWith("/")) {
|
||||||
|
endpoint = endpoint.substring(0, endpoint.length()-1);
|
||||||
|
}
|
||||||
S3ClientOptions s3ClientOptions = S3ClientOptions.builder().build();
|
S3ClientOptions s3ClientOptions = S3ClientOptions.builder().build();
|
||||||
s3ClientOptions.setPathStyleAccess(pathstyle.isChecked());
|
s3ClientOptions.setPathStyleAccess(pathstyle.isChecked());
|
||||||
myCredentials = new BasicAWSCredentials(username, password);
|
myCredentials = new BasicAWSCredentials(username, password);
|
|
@ -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;
|
||||||
|
@ -7,10 +7,11 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import asgardius.page.s3manager.BucketSelect;
|
|
||||||
|
|
||||||
public class Adapter extends RecyclerView.Adapter<Adapter.ViewHolder>{
|
public class Adapter extends RecyclerView.Adapter<Adapter.ViewHolder>{
|
||||||
ArrayList Img, Name;
|
ArrayList Img, Name;
|
192
app/src/main/java/asgardius/page/s3managermk2/BucketPolicy.java
Normal file
192
app/src/main/java/asgardius/page/s3managermk2/BucketPolicy.java
Normal file
|
@ -0,0 +1,192 @@
|
||||||
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
|
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 androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
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 BucketPolicy extends AppCompatActivity {
|
||||||
|
String username, password, endpoint, bucket, location;
|
||||||
|
Region region;
|
||||||
|
S3ClientOptions s3ClientOptions;
|
||||||
|
AWSCredentials myCredentials;
|
||||||
|
AmazonS3 s3client;
|
||||||
|
boolean style, publicbucket;
|
||||||
|
ProgressBar simpleProgressBar;
|
||||||
|
TextView permission;
|
||||||
|
Button setpublic, setprivate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_bucket_policy);
|
||||||
|
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
||||||
|
permission = (TextView) findViewById(R.id.permission);
|
||||||
|
endpoint = getIntent().getStringExtra("endpoint");
|
||||||
|
username = getIntent().getStringExtra("username");
|
||||||
|
password = getIntent().getStringExtra("password");
|
||||||
|
bucket = getIntent().getStringExtra("bucket");
|
||||||
|
style = getIntent().getBooleanExtra("style", false);
|
||||||
|
location = getIntent().getStringExtra("region");
|
||||||
|
getSupportActionBar().setTitle(bucket+"/");
|
||||||
|
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
|
||||||
|
String policy = s3client.getBucketPolicy(bucket).getPolicyText();
|
||||||
|
publicbucket = policy.contains("arn:aws:s3:::"+bucket+"/*") && policy.contains("s3:GetObject");
|
||||||
|
//System.out.println(policy);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
//Your code goes here
|
||||||
|
if(publicbucket){
|
||||||
|
permission.setText(getResources().getString(R.string.public_bucket));
|
||||||
|
} else {
|
||||||
|
permission.setText(getResources().getString(R.string.custom_policy));
|
||||||
|
setpublic.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
setprivate.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_bucket));
|
||||||
|
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
|
||||||
|
String policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:GetBucketLocation\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::"
|
||||||
|
+bucket+"\"]},{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"*\"]},\"Action\":[\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::"+bucket+"/*\"]}]}";
|
||||||
|
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
|
||||||
|
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,19 +1,16 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import static android.media.MediaExtractor.MetricsConstants.MIME_TYPE;
|
|
||||||
import static com.amazonaws.regions.Regions.US_EAST_1;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -29,7 +26,6 @@ import com.amazonaws.services.s3.AmazonS3;
|
||||||
import com.amazonaws.services.s3.AmazonS3Client;
|
import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
import com.amazonaws.services.s3.S3ClientOptions;
|
import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
import com.amazonaws.services.s3.model.Bucket;
|
import com.amazonaws.services.s3.model.Bucket;
|
||||||
import com.amazonaws.services.s3.model.DeleteObjectRequest;
|
|
||||||
import com.amazonaws.services.s3.model.DeleteObjectsRequest;
|
import com.amazonaws.services.s3.model.DeleteObjectsRequest;
|
||||||
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
||||||
import com.amazonaws.services.s3.model.ObjectListing;
|
import com.amazonaws.services.s3.model.ObjectListing;
|
||||||
|
@ -43,15 +39,14 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
ArrayList Name;
|
ArrayList Name;
|
||||||
ArrayList Img;
|
ArrayList Img;
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
String username, password, endpoint, prefix, location, file, pdfendpoint;
|
String username, password, endpoint, prefix, location, pdfendpoint;
|
||||||
boolean style;
|
boolean style, isplaylist;
|
||||||
int treelevel;
|
|
||||||
Region region;
|
Region region;
|
||||||
S3ClientOptions s3ClientOptions;
|
S3ClientOptions s3ClientOptions;
|
||||||
AWSCredentials myCredentials;
|
AWSCredentials myCredentials;
|
||||||
AmazonS3 s3client;
|
AmazonS3 s3client;
|
||||||
ProgressBar simpleProgressBar;
|
ProgressBar simpleProgressBar;
|
||||||
int videocache, videotime, buffersize;
|
int videocache, videotime, buffersize, treelevel, playlisttime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -64,10 +59,16 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
style = getIntent().getBooleanExtra("style", false);
|
style = getIntent().getBooleanExtra("style", false);
|
||||||
videocache = getIntent().getIntExtra("videocache", 40);
|
videocache = getIntent().getIntExtra("videocache", 40);
|
||||||
videotime = getIntent().getIntExtra("videotime", 1);
|
videotime = getIntent().getIntExtra("videotime", 1);
|
||||||
|
playlisttime = getIntent().getIntExtra("playlisttime", 1);
|
||||||
buffersize = getIntent().getIntExtra("buffersize", 2000);
|
buffersize = getIntent().getIntExtra("buffersize", 2000);
|
||||||
|
isplaylist = getIntent().getBooleanExtra("isplaylist", false);
|
||||||
prefix = "";
|
prefix = "";
|
||||||
setContentView(R.layout.activity_bucket_select);
|
setContentView(R.layout.activity_bucket_select);
|
||||||
|
if (endpoint.contains(getResources().getString(R.string.aws_endpoint))) {
|
||||||
region = Region.getRegion("us-east-1");
|
region = Region.getRegion("us-east-1");
|
||||||
|
} else {
|
||||||
|
region = Region.getRegion(location);
|
||||||
|
}
|
||||||
s3ClientOptions = S3ClientOptions.builder().build();
|
s3ClientOptions = S3ClientOptions.builder().build();
|
||||||
s3ClientOptions.setPathStyleAccess(style);
|
s3ClientOptions.setPathStyleAccess(style);
|
||||||
myCredentials = new BasicAWSCredentials(username, password);
|
myCredentials = new BasicAWSCredentials(username, password);
|
||||||
|
@ -170,6 +171,8 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
//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();
|
||||||
upload(Name.get(position).toString(), true);
|
upload(Name.get(position).toString(), true);
|
||||||
|
|
||||||
|
} else if (menuItem.getTitle() == getResources().getString(R.string.create_link)) {
|
||||||
|
share(Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.download_bucket)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.download_bucket)) {
|
||||||
//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();
|
||||||
download(Name.get(position).toString());
|
download(Name.get(position).toString());
|
||||||
|
@ -186,6 +189,8 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
copyName(Name.get(position).toString());
|
copyName(Name.get(position).toString());
|
||||||
} 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)) {
|
||||||
|
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());
|
||||||
|
@ -216,6 +221,25 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
intent.putExtra("videocache", videocache);
|
intent.putExtra("videocache", videocache);
|
||||||
intent.putExtra("videotime", videotime);
|
intent.putExtra("videotime", videotime);
|
||||||
intent.putExtra("buffersize", buffersize);
|
intent.putExtra("buffersize", buffersize);
|
||||||
|
intent.putExtra("playlisttime", playlisttime);
|
||||||
|
intent.putExtra("isplaylist", isplaylist);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void share(String bucket) {
|
||||||
|
|
||||||
|
Intent intent = new Intent(this, Share.class);
|
||||||
|
//treelevel ++;
|
||||||
|
intent.putExtra("endpoint", endpoint);
|
||||||
|
intent.putExtra("username", username);
|
||||||
|
intent.putExtra("password", password);
|
||||||
|
intent.putExtra("bucket", bucket);
|
||||||
|
intent.putExtra("title", bucket);
|
||||||
|
intent.putExtra("region", location);
|
||||||
|
intent.putExtra("videotime", videotime);
|
||||||
|
intent.putExtra("playlisttime", playlisttime);
|
||||||
|
intent.putExtra("style", style);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -281,7 +305,7 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -336,7 +360,8 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
intent.putExtra("password", password);
|
intent.putExtra("password", password);
|
||||||
intent.putExtra("region", location);
|
intent.putExtra("region", location);
|
||||||
intent.putExtra("style", style);
|
intent.putExtra("style", style);
|
||||||
startActivity(intent);
|
//startActivity(intent);
|
||||||
|
((Activity) this).startActivityForResult(intent, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void download(String bucket) {
|
private void download(String bucket) {
|
||||||
|
@ -365,12 +390,35 @@ public class BucketSelect extends AppCompatActivity {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void policyConfig(String bucket) {
|
||||||
|
Intent intent = new Intent(this, BucketPolicy.class);
|
||||||
|
intent.putExtra("endpoint", endpoint);
|
||||||
|
intent.putExtra("username", username);
|
||||||
|
intent.putExtra("password", password);
|
||||||
|
intent.putExtra("bucket", bucket);
|
||||||
|
intent.putExtra("region", location);
|
||||||
|
intent.putExtra("style", style);
|
||||||
|
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.newPlainText("name", name);
|
ClipData clip = ClipData.newPlainText("name", name);
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_name_ok), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, final Intent resultData) {
|
||||||
|
// The ACTION_OPEN_DOCUMENT intent was sent with the request code OPEN_DIRECTORY_REQUEST_CODE.
|
||||||
|
// If the request code seen here doesn't match, it's the response to some other intent,
|
||||||
|
// and the below code shouldn't run at all.
|
||||||
|
super.onActivityResult(requestCode, resultCode, resultData);
|
||||||
|
if(requestCode == 25 && resultCode == 25) {
|
||||||
|
recreate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,14 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.amazonaws.auth.AWSCredentials;
|
import com.amazonaws.auth.AWSCredentials;
|
||||||
import com.amazonaws.auth.BasicAWSCredentials;
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
import com.amazonaws.regions.Region;
|
import com.amazonaws.regions.Region;
|
||||||
|
@ -16,9 +17,6 @@ import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
import com.amazonaws.services.s3.S3ClientOptions;
|
import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
import com.amazonaws.services.s3.model.BucketCrossOriginConfiguration;
|
import com.amazonaws.services.s3.model.BucketCrossOriginConfiguration;
|
||||||
import com.amazonaws.services.s3.model.CORSRule;
|
import com.amazonaws.services.s3.model.CORSRule;
|
||||||
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
|
||||||
import com.amazonaws.services.s3.model.ObjectListing;
|
|
||||||
import com.amazonaws.services.s3.model.S3ObjectSummary;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
@ -26,12 +24,13 @@ 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;
|
||||||
AWSCredentials myCredentials;
|
AWSCredentials myCredentials;
|
||||||
AmazonS3 s3client;
|
AmazonS3 s3client;
|
||||||
|
ProgressBar simpleProgressBar;
|
||||||
BucketCrossOriginConfiguration bucketcors;
|
BucketCrossOriginConfiguration bucketcors;
|
||||||
boolean style;
|
boolean style;
|
||||||
boolean allorigins, pdfcompatible, found = false;
|
boolean allorigins, pdfcompatible, found = false;
|
||||||
|
@ -43,8 +42,8 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_cors_config);
|
setContentView(R.layout.activity_cors_config);
|
||||||
|
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");
|
||||||
|
@ -66,7 +65,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
try {
|
try {
|
||||||
s3client = new AmazonS3Client(myCredentials, region);
|
s3client = new AmazonS3Client(myCredentials, region);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
s3client.setEndpoint(endpoint);
|
s3client.setEndpoint(endpoint);
|
||||||
s3ClientOptions.setPathStyleAccess(style);
|
s3ClientOptions.setPathStyleAccess(style);
|
||||||
|
@ -98,6 +97,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
if (allorigins) {
|
if (allorigins) {
|
||||||
origins.setText(getResources().getString(R.string.cors_all));
|
origins.setText(getResources().getString(R.string.cors_all));
|
||||||
deletecors.setVisibility(View.VISIBLE);
|
deletecors.setVisibility(View.VISIBLE);
|
||||||
|
@ -124,7 +124,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -137,6 +137,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
//buttonaction
|
//buttonaction
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
setAllowall();
|
setAllowall();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -144,6 +145,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
//buttonaction
|
//buttonaction
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
setAllowpdf();
|
setAllowpdf();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -151,12 +153,13 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
//buttonaction
|
//buttonaction
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
setDeletecors();
|
setDeletecors();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowall() {
|
private void setAllowall() {
|
||||||
Thread addAll = new Thread(new Runnable() {
|
Thread addAll = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -175,7 +178,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.cors_ok), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_ok), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -186,7 +189,8 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.cors_error), Toast.LENGTH_SHORT).show();
|
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();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -196,7 +200,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
addAll.start();
|
addAll.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAllowpdf() {
|
private void setAllowpdf() {
|
||||||
Thread addPdf = new Thread(new Runnable() {
|
Thread addPdf = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -215,7 +219,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.cors_ok), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_ok), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -226,7 +230,8 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.cors_error), Toast.LENGTH_SHORT).show();
|
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();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -236,7 +241,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
addPdf.start();
|
addPdf.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDeletecors() {
|
private void setDeletecors() {
|
||||||
Thread delCors = new Thread(new Runnable() {
|
Thread delCors = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -249,7 +254,7 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.cors_ok), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.policy_ok), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -260,7 +265,8 @@ public class CorsConfig extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.cors_error), Toast.LENGTH_SHORT).show();
|
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();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
|
@ -1,9 +1,5 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
@ -11,19 +7,14 @@ import android.widget.EditText;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.amazonaws.auth.AWSCredentials;
|
import com.amazonaws.auth.AWSCredentials;
|
||||||
import com.amazonaws.auth.BasicAWSCredentials;
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
import com.amazonaws.regions.Region;
|
import com.amazonaws.regions.Region;
|
||||||
import com.amazonaws.services.s3.AmazonS3;
|
import com.amazonaws.services.s3.AmazonS3;
|
||||||
import com.amazonaws.services.s3.AmazonS3Client;
|
import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
import com.amazonaws.services.s3.S3ClientOptions;
|
import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
import com.amazonaws.services.s3.model.DeleteObjectsRequest;
|
|
||||||
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
|
||||||
import com.amazonaws.services.s3.model.ObjectListing;
|
|
||||||
import com.amazonaws.services.s3.model.S3ObjectSummary;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CreateBucket extends AppCompatActivity {
|
public class CreateBucket extends AppCompatActivity {
|
||||||
String username, password, endpoint, bucket, location;
|
String username, password, endpoint, bucket, location;
|
||||||
|
@ -75,8 +66,10 @@ public class CreateBucket extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// Sending reference and data to Adapter
|
// Sending reference and data to Adapter
|
||||||
|
setResult(25);
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.create_bucket_success), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.create_bucket_success), Toast.LENGTH_SHORT).show();
|
||||||
mainmenu();
|
finish();
|
||||||
|
//mainmenu();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -89,7 +82,7 @@ public class CreateBucket extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -106,12 +99,12 @@ public class CreateBucket 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);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}*/
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import static android.content.ContentValues.TAG;
|
import static android.content.ContentValues.TAG;
|
||||||
|
|
||||||
|
@ -288,6 +288,19 @@ public class Downloader extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
|
public void onDestroy() {
|
||||||
|
if (!mWifiLock.isHeld()) {
|
||||||
|
mWifiLock.acquire();
|
||||||
|
//System.out.println("WifiLock acquired");
|
||||||
|
}
|
||||||
|
if (!mWakeLock.isHeld()) {
|
||||||
|
mWakeLock.acquire();
|
||||||
|
//System.out.println("WakeLock acquired");
|
||||||
|
}
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, final Intent resultData) {
|
public void onActivityResult(int requestCode, int resultCode, final Intent resultData) {
|
||||||
// The ACTION_OPEN_DOCUMENT intent was sent with the request code OPEN_DIRECTORY_REQUEST_CODE.
|
// The ACTION_OPEN_DOCUMENT intent was sent with the request code OPEN_DIRECTORY_REQUEST_CODE.
|
||||||
// If the request code seen here doesn't match, it's the response to some other intent,
|
// If the request code seen here doesn't match, it's the response to some other intent,
|
|
@ -1,24 +1,28 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.view.WindowManager;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import java.io.InputStreamReader;
|
|
||||||
|
import com.otaliastudios.zoom.ZoomImageView;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class ImageViewer extends AppCompatActivity {
|
public class ImageViewer extends AppCompatActivity {
|
||||||
String videoURL, title;
|
String videoURL, title;
|
||||||
ImageView iv;
|
ZoomImageView iv;
|
||||||
boolean controls = false;
|
boolean controls = false;
|
||||||
|
float cursorx, cursory;
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -27,7 +31,7 @@ public class ImageViewer extends AppCompatActivity {
|
||||||
title = getIntent().getStringExtra("title");
|
title = getIntent().getStringExtra("title");
|
||||||
getSupportActionBar().setTitle(title);
|
getSupportActionBar().setTitle(title);
|
||||||
final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
||||||
iv = (ImageView) findViewById(R.id.imageViewer);
|
iv = (ZoomImageView) findViewById(R.id.imageViewer);
|
||||||
//System.out.println(videoURL);
|
//System.out.println(videoURL);
|
||||||
Thread imgread = new Thread(new Runnable() {
|
Thread imgread = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@ -65,7 +69,7 @@ public class ImageViewer extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -74,10 +78,19 @@ public class ImageViewer extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
imgread.start();
|
imgread.start();
|
||||||
iv.setOnClickListener(new View.OnClickListener(){
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
@Override
|
getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||||
public void onClick(View view) {
|
}
|
||||||
//buttonaction
|
iv.setOnTouchListener((v, event) -> {
|
||||||
|
|
||||||
|
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||||
|
cursorx = event.getX();
|
||||||
|
cursory = event.getY();
|
||||||
|
iv.performClick();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||||
|
if(Math.abs(event.getX() - cursorx) < 5 || Math.abs(event.getY() - cursory) < 5) {
|
||||||
if(controls) {
|
if(controls) {
|
||||||
controls = false;
|
controls = false;
|
||||||
hideSystemBars();
|
hideSystemBars();
|
||||||
|
@ -87,7 +100,9 @@ public class ImageViewer extends AppCompatActivity {
|
||||||
showSystemBars();
|
showSystemBars();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -20,14 +20,14 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
boolean style;
|
boolean style, isplaylist;
|
||||||
String alias, username, password, endpoint, location, pdfendpoint;
|
String alias, username, password, endpoint, location, pdfendpoint;
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
SQLiteDatabase db;
|
SQLiteDatabase db;
|
||||||
ArrayList Name;
|
ArrayList Name;
|
||||||
ArrayList Img;
|
ArrayList Img;
|
||||||
MyDbHelper dbHelper;
|
MyDbHelper dbHelper;
|
||||||
int videocache, videotime, buffersize;
|
int videocache, videotime, buffersize, playlisttime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -68,6 +68,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
db.execSQL("INSERT INTO preferences VALUES ('videocache', '300')");
|
db.execSQL("INSERT INTO preferences VALUES ('videocache', '300')");
|
||||||
db.execSQL("INSERT INTO preferences VALUES ('videotime', '3')");
|
db.execSQL("INSERT INTO preferences VALUES ('videotime', '3')");
|
||||||
db.execSQL("INSERT INTO preferences VALUES ('buffersize', '12000')");
|
db.execSQL("INSERT INTO preferences VALUES ('buffersize', '12000')");
|
||||||
|
db.execSQL("INSERT INTO preferences VALUES ('playlisttime', '5')");
|
||||||
|
db.execSQL("INSERT INTO preferences VALUES ('isplaylist', '0')");
|
||||||
videocache = 300;
|
videocache = 300;
|
||||||
//videotime = 3;
|
//videotime = 3;
|
||||||
db.close();
|
db.close();
|
||||||
|
@ -117,6 +119,74 @@ public class MainActivity extends AppCompatActivity {
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
db = dbHelper.getWritableDatabase();
|
||||||
|
String query = "SELECT value FROM preferences where setting='playlisttime'";
|
||||||
|
Cursor cursor = db.rawQuery(query,null);
|
||||||
|
while (cursor.moveToNext()){
|
||||||
|
playlisttime = (Integer.parseInt(cursor.getString(0)));
|
||||||
|
}
|
||||||
|
db.close();
|
||||||
|
if (playlisttime == 0) {
|
||||||
|
try {
|
||||||
|
db = dbHelper.getWritableDatabase();
|
||||||
|
db.execSQL("INSERT INTO preferences VALUES ('playlisttime', '5')");
|
||||||
|
playlisttime = 5;
|
||||||
|
db.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
db = dbHelper.getWritableDatabase();
|
||||||
|
db.execSQL("CREATE TABLE IF NOT EXISTS preferences(setting text UNIQUE, value text)");
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.broken_database), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
db = dbHelper.getWritableDatabase();
|
||||||
|
String query = "SELECT value FROM preferences where setting='isplaylist'";
|
||||||
|
Cursor cursor = db.rawQuery(query,null);
|
||||||
|
String update = null;
|
||||||
|
while (cursor.moveToNext()){
|
||||||
|
isplaylist = cursor.getString(0).equals("1");
|
||||||
|
if(!isplaylist) {
|
||||||
|
update = cursor.getString(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
db.close();
|
||||||
|
if (!isplaylist && update == null) {
|
||||||
|
try {
|
||||||
|
db = dbHelper.getWritableDatabase();
|
||||||
|
db.execSQL("INSERT INTO preferences VALUES ('isplaylist', '0')");
|
||||||
|
isplaylist = false;
|
||||||
|
db.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
db = dbHelper.getWritableDatabase();
|
||||||
|
db.execSQL("CREATE TABLE IF NOT EXISTS preferences(setting text UNIQUE, value text)");
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.broken_database), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
db = dbHelper.getWritableDatabase();
|
db = dbHelper.getWritableDatabase();
|
||||||
String query = "SELECT value FROM preferences where setting='buffersize'";
|
String query = "SELECT value FROM preferences where setting='buffersize'";
|
||||||
|
@ -379,6 +449,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
intent.putExtra("videocache", videocache);
|
intent.putExtra("videocache", videocache);
|
||||||
intent.putExtra("videotime", videotime);
|
intent.putExtra("videotime", videotime);
|
||||||
intent.putExtra("buffersize", buffersize);
|
intent.putExtra("buffersize", buffersize);
|
||||||
|
intent.putExtra("playlisttime", playlisttime);
|
||||||
|
intent.putExtra("isplaylist", isplaylist);
|
||||||
startActivity(intent);
|
startActivity(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;
|
||||||
|
@ -10,6 +10,8 @@ public class MyDbHelper extends SQLiteOpenHelper {
|
||||||
private static final String setvideocache = "INSERT INTO preferences VALUES ('videocache', '300')";
|
private static final String setvideocache = "INSERT INTO preferences VALUES ('videocache', '300')";
|
||||||
private static final String setvideotime = "INSERT INTO preferences VALUES ('videotime', '3')";
|
private static final String setvideotime = "INSERT INTO preferences VALUES ('videotime', '3')";
|
||||||
private static final String setbuffersize = "INSERT INTO preferences VALUES ('buffersize', '12000')";
|
private static final String setbuffersize = "INSERT INTO preferences VALUES ('buffersize', '12000')";
|
||||||
|
private static final String setplaylisttime = "INSERT INTO preferences VALUES ('playlisttime', '5')";
|
||||||
|
private static final String setisplaylist = "INSERT INTO preferences VALUES ('isplaylist', '0')";
|
||||||
//private static final String upgrade = "ALTER TABLE account add column pdfendpoint text";
|
//private static final String upgrade = "ALTER TABLE account add column pdfendpoint text";
|
||||||
private static final int DATABASE_VERSION = 1;
|
private static final int DATABASE_VERSION = 1;
|
||||||
private static final String dbname = "accounts.sqlite3";
|
private static final String dbname = "accounts.sqlite3";
|
||||||
|
@ -24,6 +26,8 @@ public class MyDbHelper extends SQLiteOpenHelper {
|
||||||
db.execSQL(setvideocache);
|
db.execSQL(setvideocache);
|
||||||
db.execSQL(setvideotime);
|
db.execSQL(setvideotime);
|
||||||
db.execSQL(setbuffersize);
|
db.execSQL(setbuffersize);
|
||||||
|
db.execSQL(setplaylisttime);
|
||||||
|
db.execSQL(setisplaylist);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
|
@ -1,26 +1,23 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.amazonaws.auth.AWSCredentials;
|
import com.amazonaws.auth.AWSCredentials;
|
||||||
import com.amazonaws.auth.BasicAWSCredentials;
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
import com.amazonaws.regions.Region;
|
import com.amazonaws.regions.Region;
|
||||||
import com.amazonaws.services.s3.AmazonS3;
|
import com.amazonaws.services.s3.AmazonS3;
|
||||||
import com.amazonaws.services.s3.AmazonS3Client;
|
import com.amazonaws.services.s3.AmazonS3Client;
|
||||||
import com.amazonaws.services.s3.S3ClientOptions;
|
import com.amazonaws.services.s3.S3ClientOptions;
|
||||||
import com.amazonaws.services.s3.model.Bucket;
|
|
||||||
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
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.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ObjectInfo extends AppCompatActivity {
|
public class ObjectInfo extends AppCompatActivity {
|
||||||
|
@ -67,7 +64,7 @@ public class ObjectInfo extends AppCompatActivity {
|
||||||
try {
|
try {
|
||||||
s3client = new AmazonS3Client(myCredentials, region);
|
s3client = new AmazonS3Client(myCredentials, region);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
s3client.setEndpoint(endpoint);
|
s3client.setEndpoint(endpoint);
|
||||||
s3ClientOptions.setPathStyleAccess(style);
|
s3ClientOptions.setPathStyleAccess(style);
|
||||||
|
@ -140,7 +137,7 @@ public class ObjectInfo extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
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,18 +1,14 @@
|
||||||
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;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.app.AppOpsManager;
|
|
||||||
import android.app.PictureInPictureParams;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -34,12 +30,13 @@ 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;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
@ -49,17 +46,15 @@ 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;
|
boolean style, isplaylist;
|
||||||
int treelevel;
|
|
||||||
String[] filename;
|
String[] filename;
|
||||||
Region region;
|
Region region;
|
||||||
S3ClientOptions s3ClientOptions;
|
S3ClientOptions s3ClientOptions;
|
||||||
AWSCredentials myCredentials;
|
AWSCredentials myCredentials;
|
||||||
AmazonS3 s3client;
|
AmazonS3 s3client;
|
||||||
ProgressBar simpleProgressBar;
|
ProgressBar simpleProgressBar;
|
||||||
int videocache, videotime, buffersize;
|
int videocache, videotime, buffersize, treelevel, playlisttime;
|
||||||
AppOpsManager appOpsManager;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -75,8 +70,9 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
treelevel = getIntent().getIntExtra("treelevel", 0);
|
treelevel = getIntent().getIntExtra("treelevel", 0);
|
||||||
videocache = getIntent().getIntExtra("videocache", 40);
|
videocache = getIntent().getIntExtra("videocache", 40);
|
||||||
videotime = getIntent().getIntExtra("videotime", 1);
|
videotime = getIntent().getIntExtra("videotime", 1);
|
||||||
|
playlisttime = getIntent().getIntExtra("playlisttime", 1);
|
||||||
buffersize = getIntent().getIntExtra("buffersize", 2000);
|
buffersize = getIntent().getIntExtra("buffersize", 2000);
|
||||||
appOpsManager = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE);
|
isplaylist = getIntent().getBooleanExtra("isplaylist", false);
|
||||||
setContentView(R.layout.activity_object_select);
|
setContentView(R.layout.activity_object_select);
|
||||||
getSupportActionBar().setTitle(bucket+"/"+prefix);
|
getSupportActionBar().setTitle(bucket+"/"+prefix);
|
||||||
region = Region.getRegion(location);
|
region = Region.getRegion(location);
|
||||||
|
@ -85,7 +81,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
try {
|
try {
|
||||||
s3client = new AmazonS3Client(myCredentials, region);
|
s3client = new AmazonS3Client(myCredentials, region);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
s3client.setEndpoint(endpoint);
|
s3client.setEndpoint(endpoint);
|
||||||
s3ClientOptions.setPathStyleAccess(style);
|
s3ClientOptions.setPathStyleAccess(style);
|
||||||
|
@ -131,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) {
|
||||||
|
@ -157,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("/");
|
||||||
|
@ -198,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")
|
||||||
|
@ -238,7 +236,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,7 +257,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
URL objectURL = s3client.generatePresignedUrl(request);
|
||||||
imageViewer(objectURL.toString(), Name.get(position).toString());
|
imageViewer(objectURL.toString(), Name.get(position).toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} /*else if (Img.get(position).equals(R.drawable.textfile)) {
|
} /*else if (Img.get(position).equals(R.drawable.textfile)) {
|
||||||
//load media file
|
//load media file
|
||||||
|
@ -268,7 +266,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
URL objectURL = s3client.generatePresignedUrl(request);
|
||||||
textViewer(objectURL.toString());
|
textViewer(objectURL.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}*/ else if (Img.get(position).equals(R.drawable.webpage) || Img.get(position).equals(R.drawable.ptextfile)) {
|
}*/ else if (Img.get(position).equals(R.drawable.webpage) || Img.get(position).equals(R.drawable.ptextfile)) {
|
||||||
//load media file
|
//load media file
|
||||||
|
@ -277,7 +275,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
URL objectURL = s3client.generatePresignedUrl(request);
|
URL objectURL = s3client.generatePresignedUrl(request);
|
||||||
webBrowser(objectURL.toString(), Name.get(position).toString());
|
webBrowser(objectURL.toString(), Name.get(position).toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
} else if (Img.get(position).equals(R.drawable.pdffile)) {
|
} else if (Img.get(position).equals(R.drawable.pdffile)) {
|
||||||
//load media file
|
//load media file
|
||||||
|
@ -313,10 +311,10 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -327,6 +325,10 @@ 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)) {
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
if (isplaylist && !Name.get(position).toString().toLowerCase(Locale.ROOT).endsWith(".m3u")) {
|
||||||
|
videoPlayer(null, Name.get(position).toString());
|
||||||
|
} else {
|
||||||
Thread mediaread = new Thread(new Runnable() {
|
Thread mediaread = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -340,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(), Name.get(position).toString().endsWith(".m3u8"));
|
videoPlayer(objectURL, Name.get(position).toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//System.out.println("tree "+treelevel);
|
//System.out.println("tree "+treelevel);
|
||||||
|
@ -360,15 +368,16 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mediaread.start();
|
mediaread.start();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.unsupported_file), Toast.LENGTH_SHORT).show();
|
Toast.makeText(ObjectSelect.this, getResources().getString(R.string.unsupported_file), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
@ -398,6 +407,10 @@ 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)) {
|
||||||
|
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)) {
|
||||||
objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString());
|
objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
|
||||||
|
@ -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);
|
||||||
|
@ -435,7 +450,7 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
//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(true);
|
upload(true);
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.create_link)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.create_link)) {
|
||||||
share(prefix + Name.get(position).toString(), 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)) {
|
||||||
objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString());
|
objectInfo(prefix + Name.get(position).toString(), Name.get(position).toString());
|
||||||
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
|
} else if (menuItem.getTitle() == getResources().getString(R.string.copy_name)) {
|
||||||
|
@ -459,17 +474,119 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void videoPlayer(String url, String title, boolean hls) {
|
private void videoPlayer(String url, String title) {
|
||||||
|
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() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//load media file
|
||||||
|
ArrayList<String> medialist = new ArrayList<String>();
|
||||||
|
for (int i = 0; i < Name.size(); i++) {
|
||||||
|
if (Img.get(i).equals(R.drawable.audiofile) || Img.get(i).equals(R.drawable.videofile)) {
|
||||||
|
medialist.add(Name.get(i).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ArrayList<String> links = getLinks(medialist);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if(links != null) {
|
||||||
|
// 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", isplaylist);
|
||||||
|
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 {
|
||||||
Intent intent = new Intent(this, VideoPlayer.class);
|
Intent intent = new Intent(this, VideoPlayer.class);
|
||||||
intent.putExtra("video_url", url);
|
intent.putExtra("video_url", url);
|
||||||
intent.putExtra("title", title);
|
intent.putExtra("title", title);
|
||||||
intent.putExtra("videocache", videocache);
|
intent.putExtra("videocache", videocache);
|
||||||
intent.putExtra("buffersize", buffersize);
|
intent.putExtra("buffersize", buffersize);
|
||||||
intent.putExtra("hls", hls);
|
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);
|
||||||
|
@ -512,11 +629,13 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
intent.putExtra("videocache", videocache);
|
intent.putExtra("videocache", videocache);
|
||||||
intent.putExtra("videotime", videotime);
|
intent.putExtra("videotime", videotime);
|
||||||
intent.putExtra("buffersize", buffersize);
|
intent.putExtra("buffersize", buffersize);
|
||||||
|
intent.putExtra("playlisttime", playlisttime);
|
||||||
|
intent.putExtra("isplaylist", isplaylist);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void share(String object, String title, boolean mediafile) {
|
private void share(String object, boolean mediafile) {
|
||||||
|
|
||||||
Intent intent = new Intent(this, Share.class);
|
Intent intent = new Intent(this, Share.class);
|
||||||
//treelevel ++;
|
//treelevel ++;
|
||||||
|
@ -524,11 +643,12 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
intent.putExtra("username", username);
|
intent.putExtra("username", username);
|
||||||
intent.putExtra("password", password);
|
intent.putExtra("password", password);
|
||||||
intent.putExtra("bucket", bucket);
|
intent.putExtra("bucket", bucket);
|
||||||
intent.putExtra("object", object);
|
intent.putExtra("object", prefix+object);
|
||||||
intent.putExtra("title", title);
|
intent.putExtra("title", object);
|
||||||
intent.putExtra("region", location);
|
intent.putExtra("region", location);
|
||||||
intent.putExtra("mediafile", mediafile);
|
intent.putExtra("mediafile", mediafile);
|
||||||
intent.putExtra("videotime", videotime);
|
intent.putExtra("videotime", videotime);
|
||||||
|
intent.putExtra("playlisttime", playlisttime);
|
||||||
intent.putExtra("style", style);
|
intent.putExtra("style", style);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
|
@ -627,10 +747,10 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -680,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;
|
||||||
|
@ -690,7 +824,46 @@ public class ObjectSelect extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_name_ok), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getLinks (ArrayList<String> medialist) throws InterruptedException {
|
||||||
|
ArrayList<String> links = new ArrayList<String>();
|
||||||
|
Date expiration = new Date();
|
||||||
|
Calendar mycal = Calendar.getInstance();
|
||||||
|
mycal.setTime(expiration);
|
||||||
|
//System.out.println("today is " + mycal.getTime());
|
||||||
|
mycal.add(Calendar.HOUR, playlisttime);
|
||||||
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
|
expiration = mycal.getTime();
|
||||||
|
for (int i = 0; i < medialist.size(); i++) {
|
||||||
|
//GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, prefix+medialist.get(i)).withExpiration(expiration);;
|
||||||
|
//links.add(s3client.generatePresignedUrl(request).toString());
|
||||||
|
links.add(PolicyCheck.getFileKey(s3client, bucket, prefix+medialist.get(i), expiration, policy));
|
||||||
|
}
|
||||||
|
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,27 +13,36 @@ import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import asgardius.page.s3manager.databinding.ActivitySettingsBinding;
|
import com.google.android.exoplayer2.database.StandaloneDatabaseProvider;
|
||||||
|
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||||
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import asgardius.page.s3managermk2.databinding.ActivitySettingsBinding;
|
||||||
|
|
||||||
public class Settings extends AppCompatActivity {
|
public class Settings extends AppCompatActivity {
|
||||||
|
|
||||||
private ActivitySettingsBinding binding;
|
private ActivitySettingsBinding binding;
|
||||||
MyDbHelper dbHelper;
|
MyDbHelper dbHelper;
|
||||||
SQLiteDatabase db;
|
SQLiteDatabase db;
|
||||||
String videocache, videotime, buffersize;
|
String videocache, videotime, buffersize, playlisttime;
|
||||||
EditText vcachepick, vtimepick, bsizepick;
|
EditText vcachepick, vtimepick, bsizepick, ptimepick;
|
||||||
Button saveprefs, about;
|
Button saveprefs, about, clearcache;
|
||||||
|
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);
|
||||||
vtimepick = (EditText)findViewById(R.id.videotime);
|
vtimepick = (EditText)findViewById(R.id.videotime);
|
||||||
bsizepick = (EditText)findViewById(R.id.buffersize);
|
bsizepick = (EditText)findViewById(R.id.buffersize);
|
||||||
|
ptimepick = (EditText)findViewById(R.id.playlisttime);
|
||||||
dbHelper = new MyDbHelper(this);
|
dbHelper = new MyDbHelper(this);
|
||||||
|
isplaylist = (SwitchMaterial) findViewById(R.id.isplaylist);
|
||||||
Thread getprefs = new Thread(new Runnable() {
|
Thread getprefs = new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,7 +66,18 @@ public class Settings extends AppCompatActivity {
|
||||||
while (cursor.moveToNext()){
|
while (cursor.moveToNext()){
|
||||||
buffersize = (cursor.getString(0));
|
buffersize = (cursor.getString(0));
|
||||||
}
|
}
|
||||||
|
query = "SELECT value FROM preferences where setting='isplaylist'";
|
||||||
|
cursor = db.rawQuery(query,null);
|
||||||
|
while (cursor.moveToNext()){
|
||||||
|
isplaylist.setChecked(cursor.getString(0).equals("1"));
|
||||||
|
}
|
||||||
|
query = "SELECT value FROM preferences where setting='playlisttime'";
|
||||||
|
cursor = db.rawQuery(query,null);
|
||||||
|
while (cursor.moveToNext()){
|
||||||
|
playlisttime = (cursor.getString(0));
|
||||||
|
}
|
||||||
db.close();
|
db.close();
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
|
@ -66,6 +86,7 @@ public class Settings extends AppCompatActivity {
|
||||||
vcachepick.setText(videocache);
|
vcachepick.setText(videocache);
|
||||||
vtimepick.setText(videotime);
|
vtimepick.setText(videotime);
|
||||||
bsizepick.setText(buffersize);
|
bsizepick.setText(buffersize);
|
||||||
|
ptimepick.setText(playlisttime);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -84,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(){
|
||||||
|
@ -94,19 +135,26 @@ public class Settings extends AppCompatActivity {
|
||||||
videocache = vcachepick.getText().toString();
|
videocache = vcachepick.getText().toString();
|
||||||
videotime = vtimepick.getText().toString();
|
videotime = vtimepick.getText().toString();
|
||||||
buffersize = bsizepick.getText().toString();
|
buffersize = bsizepick.getText().toString();
|
||||||
|
playlisttime = ptimepick.getText().toString();
|
||||||
if (videocache.equals("") || videotime.equals("") || buffersize.equals("")) {
|
if (videocache.equals("") || videotime.equals("") || buffersize.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 (videocache.equals("0") || videotime.equals("0")) {
|
} else if (videocache.equals("0") || videotime.equals("0") || playlisttime.equals("0")) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.not_zero), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.not_zero), Toast.LENGTH_SHORT).show();
|
||||||
} else if (Integer.parseInt(buffersize) <= 2000) {
|
} else if (Integer.parseInt(buffersize) <= 2000) {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.buffersize_error), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.buffersize_error), Toast.LENGTH_SHORT).show();
|
||||||
} else if (Integer.parseInt(videotime) > 168) {
|
} else if (Integer.parseInt(videotime) > 168 || Integer.parseInt(playlisttime) > 168) {
|
||||||
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();
|
||||||
} else {
|
} else {
|
||||||
db = dbHelper.getWritableDatabase();
|
db = dbHelper.getWritableDatabase();
|
||||||
db.execSQL("UPDATE preferences SET value='" + videocache + "' where setting='videocache'");
|
db.execSQL("UPDATE preferences SET value='" + videocache + "' where setting='videocache'");
|
||||||
db.execSQL("UPDATE preferences SET value='" + videotime + "' where setting='videotime'");
|
db.execSQL("UPDATE preferences SET value='" + videotime + "' where setting='videotime'");
|
||||||
db.execSQL("UPDATE preferences SET value='" + buffersize + "' where setting='buffersize'");
|
db.execSQL("UPDATE preferences SET value='" + buffersize + "' where setting='buffersize'");
|
||||||
|
db.execSQL("UPDATE preferences SET value='" + playlisttime + "' where setting='playlisttime'");
|
||||||
|
if(isplaylist.isChecked()) {
|
||||||
|
db.execSQL("UPDATE preferences SET value='1' where setting='isplaylist'");
|
||||||
|
} else {
|
||||||
|
db.execSQL("UPDATE preferences SET value='0' where setting='isplaylist'");
|
||||||
|
}
|
||||||
db.close();
|
db.close();
|
||||||
mainmenu();
|
mainmenu();
|
||||||
}
|
}
|
||||||
|
@ -130,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);
|
||||||
|
@ -140,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);
|
467
app/src/main/java/asgardius/page/s3managermk2/Share.java
Normal file
467
app/src/main/java/asgardius/page/s3managermk2/Share.java
Normal file
|
@ -0,0 +1,467 @@
|
||||||
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
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;
|
||||||
|
import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest;
|
||||||
|
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
||||||
|
import com.amazonaws.services.s3.model.ObjectListing;
|
||||||
|
import com.amazonaws.services.s3.model.S3ObjectSummary;
|
||||||
|
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Share extends AppCompatActivity {
|
||||||
|
String username, password, endpoint, bucket, object, location, title, objectlist, policy;
|
||||||
|
boolean mediafile, style, publicobject;
|
||||||
|
TextView expirationtext;
|
||||||
|
ProgressBar simpleProgressBar;
|
||||||
|
Region region;
|
||||||
|
S3ClientOptions s3ClientOptions;
|
||||||
|
AWSCredentials myCredentials;
|
||||||
|
AmazonS3 s3client;
|
||||||
|
ListObjectsRequest orequest;
|
||||||
|
Calendar mycal;
|
||||||
|
EditText datepick, hourpick, minutepick;
|
||||||
|
int date, hour, minute;
|
||||||
|
Button share, copylinks, savelinks;
|
||||||
|
GeneratePresignedUrlRequest request;
|
||||||
|
Date expiration;
|
||||||
|
URL objectURL;
|
||||||
|
Uri fileuri;
|
||||||
|
Intent intent;
|
||||||
|
int videotime, playlisttime;
|
||||||
|
|
||||||
|
public static String URLify(String str) {
|
||||||
|
str = str.trim();
|
||||||
|
int length = str.length();
|
||||||
|
int trueL = length;
|
||||||
|
if(str.contains(" ")) {
|
||||||
|
for(int i = 0; i < length; i++) {
|
||||||
|
if(str.charAt(i) == ' ') {
|
||||||
|
trueL = trueL + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
char[] oldArr = str.toCharArray();
|
||||||
|
char[] newArr = new char[trueL];
|
||||||
|
int x = 0;
|
||||||
|
for(int i = 0; i < length; i++) {
|
||||||
|
if(oldArr[i] == ' ') {
|
||||||
|
newArr[x] = '%';
|
||||||
|
newArr[x+1] = '2';
|
||||||
|
newArr[x+2] = '0';
|
||||||
|
x += 3;
|
||||||
|
} else {
|
||||||
|
newArr[x] = oldArr[i];
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str = new String(newArr, 0, trueL);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_share);
|
||||||
|
simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
|
||||||
|
expirationtext = (TextView) findViewById(R.id.expirationtext);
|
||||||
|
mycal = Calendar.getInstance();
|
||||||
|
datepick = (EditText)findViewById(R.id.Date);
|
||||||
|
hourpick = (EditText)findViewById(R.id.Hour);
|
||||||
|
minutepick = (EditText)findViewById(R.id.Minute);
|
||||||
|
share = (Button)findViewById(R.id.share);
|
||||||
|
copylinks = (Button)findViewById(R.id.copy_links);
|
||||||
|
savelinks = (Button)findViewById(R.id.save_links);
|
||||||
|
endpoint = getIntent().getStringExtra("endpoint");
|
||||||
|
username = getIntent().getStringExtra("username");
|
||||||
|
password = getIntent().getStringExtra("password");
|
||||||
|
bucket = getIntent().getStringExtra("bucket");
|
||||||
|
location = getIntent().getStringExtra("region");
|
||||||
|
style = getIntent().getBooleanExtra("style", false);
|
||||||
|
object = getIntent().getStringExtra("object");
|
||||||
|
mediafile = getIntent().getBooleanExtra("mediafile", false);
|
||||||
|
videotime = getIntent().getIntExtra("videotime", 1);
|
||||||
|
playlisttime = getIntent().getIntExtra("playlisttime", 1);
|
||||||
|
title = getIntent().getStringExtra("title");
|
||||||
|
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);
|
||||||
|
Thread getPolicy = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//Your code goes here
|
||||||
|
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);
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
//Your code goes here
|
||||||
|
if(publicobject){
|
||||||
|
expirationtext.setText(getResources().getString(R.string.expiration_not_required));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
datepick.setEnabled(true);
|
||||||
|
hourpick.setEnabled(true);
|
||||||
|
minutepick.setEnabled(true);
|
||||||
|
expirationtext.setText(getResources().getString(R.string.expiration_time));
|
||||||
|
}
|
||||||
|
if(object == null || object.endsWith("/")) {
|
||||||
|
copylinks.setVisibility(View.VISIBLE);
|
||||||
|
savelinks.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
share.setVisibility(View.VISIBLE);
|
||||||
|
copylinks.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
publicobject = false;
|
||||||
|
datepick.setEnabled(true);
|
||||||
|
hourpick.setEnabled(true);
|
||||||
|
minutepick.setEnabled(true);
|
||||||
|
expirationtext.setText(getResources().getString(R.string.expiration_time));
|
||||||
|
if(object == null || object.endsWith("/")) {
|
||||||
|
copylinks.setVisibility(View.VISIBLE);
|
||||||
|
savelinks.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
share.setVisibility(View.VISIBLE);
|
||||||
|
copylinks.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getPolicy.start();
|
||||||
|
share.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//buttonaction
|
||||||
|
try {
|
||||||
|
sharefile();
|
||||||
|
//System.out.println(URLify(objectURL.toString()));
|
||||||
|
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||||
|
shareIntent.setType("text/plain");
|
||||||
|
shareIntent.putExtra(Intent.EXTRA_TEXT, URLify(objectURL.toString()));
|
||||||
|
startActivity(Intent.createChooser(shareIntent, "choose one"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
copylinks.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//buttonaction
|
||||||
|
if(object == null || object.endsWith("/")) {
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
Thread copyLinks = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//load media file
|
||||||
|
if(object == null || object.endsWith("/")) {
|
||||||
|
getLinks();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Sending reference and data to Adapter
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
ClipData clip;
|
||||||
|
clip = ClipData.newPlainText("name", objectlist);
|
||||||
|
clipboard.setPrimaryClip(clip);
|
||||||
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sharefile();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Sending reference and data to Adapter
|
||||||
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
ClipData clip;
|
||||||
|
clip = ClipData.newPlainText("name", URLify(objectURL.toString()));
|
||||||
|
clipboard.setPrimaryClip(clip);
|
||||||
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.copy_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//System.out.println("tree "+treelevel);
|
||||||
|
//System.out.println("prefix "+prefix);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
copyLinks.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
savelinks.setOnClickListener(new View.OnClickListener(){
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
//buttonaction
|
||||||
|
performFileSearch("Select download location");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void performFileSearch(String messageTitle) {
|
||||||
|
//uri = Uri.parse("content://com.android.externalstorage.documents/document/home");
|
||||||
|
intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_CREATE_DOCUMENT);
|
||||||
|
//intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
|
//intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
|
||||||
|
//intent.putExtra("android.provider.extra.INITIAL_URI", uri);
|
||||||
|
intent.putExtra(Intent.EXTRA_TITLE, "links.txt");
|
||||||
|
intent.setType("*/*");
|
||||||
|
((Activity) this).startActivityForResult(intent, 70);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, final Intent resultData) {
|
||||||
|
// The ACTION_OPEN_DOCUMENT intent was sent with the request code OPEN_DIRECTORY_REQUEST_CODE.
|
||||||
|
// If the request code seen here doesn't match, it's the response to some other intent,
|
||||||
|
// and the below code shouldn't run at all.
|
||||||
|
super.onActivityResult(requestCode, resultCode, resultData);
|
||||||
|
if (requestCode == 70) {
|
||||||
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
|
// The document selected by the user won't be returned in the intent.
|
||||||
|
// Instead, a URI to that document will be contained in the return intent
|
||||||
|
// provided to this method as a parameter. Pull that uri using "resultData.getData()"
|
||||||
|
if (resultData != null && resultData.getData() != null) {
|
||||||
|
fileuri = resultData.getData();
|
||||||
|
System.out.println(fileuri.toString());
|
||||||
|
savelinks();
|
||||||
|
//System.out.println("File selected successfully");
|
||||||
|
//System.out.println("content://com.android.externalstorage.documents"+file.getPath());
|
||||||
|
} else {
|
||||||
|
Toast.makeText(Share.this, getResources().getString(R.string.file_path_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//System.out.println("User cancelled file browsing {}");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getLinks() {
|
||||||
|
if (datepick.getText().toString().equals("")) {
|
||||||
|
date = 0;
|
||||||
|
} else {
|
||||||
|
date = Integer.parseInt(datepick.getText().toString());
|
||||||
|
}
|
||||||
|
if (hourpick.getText().toString().equals("")) {
|
||||||
|
hour = 0;
|
||||||
|
} else {
|
||||||
|
hour = Integer.parseInt(hourpick.getText().toString());
|
||||||
|
}
|
||||||
|
if (minutepick.getText().toString().equals("")) {
|
||||||
|
minute = 0;
|
||||||
|
} else {
|
||||||
|
minute = Integer.parseInt(minutepick.getText().toString());
|
||||||
|
}
|
||||||
|
expiration = new Date();
|
||||||
|
//System.out.println("today is " + mycal.getTime());
|
||||||
|
mycal.setTime(expiration);
|
||||||
|
if (date == 0 && hour == 0 && minute == 0) {
|
||||||
|
mycal.add(Calendar.HOUR, playlisttime);
|
||||||
|
} else {
|
||||||
|
mycal.add(Calendar.DATE, date);
|
||||||
|
mycal.add(Calendar.HOUR, hour);
|
||||||
|
mycal.add(Calendar.MINUTE, minute);
|
||||||
|
}
|
||||||
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
|
expiration = mycal.getTime();
|
||||||
|
//System.out.println(expiration);
|
||||||
|
if (object == null) {
|
||||||
|
orequest = new ListObjectsRequest().withBucketName(bucket).withMaxKeys(1000);
|
||||||
|
} else {
|
||||||
|
orequest = new ListObjectsRequest().withBucketName(bucket).withPrefix(object).withMaxKeys(1000);
|
||||||
|
}
|
||||||
|
ObjectListing result = s3client.listObjects(orequest);
|
||||||
|
objectlist = "";
|
||||||
|
List<S3ObjectSummary> objects = result.getObjectSummaries();
|
||||||
|
for (S3ObjectSummary os : objects) {
|
||||||
|
objectlist = objectlist+PolicyCheck.getFileKey(s3client, bucket, os.getKey(), expiration, policy)+"\n";
|
||||||
|
}
|
||||||
|
while (result.isTruncated()) {
|
||||||
|
result = s3client.listNextBatchOfObjects (result);
|
||||||
|
objects = result.getObjectSummaries();
|
||||||
|
for (S3ObjectSummary os : objects) {
|
||||||
|
objectlist = objectlist+PolicyCheck.getFileKey(s3client, bucket, os.getKey(), expiration, policy)+"\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sharefile() {
|
||||||
|
if(publicobject) {
|
||||||
|
objectURL = s3client.getUrl(bucket, object);
|
||||||
|
} else {
|
||||||
|
if (datepick.getText().toString().equals("")) {
|
||||||
|
date = 0;
|
||||||
|
} else {
|
||||||
|
date = Integer.parseInt(datepick.getText().toString());
|
||||||
|
}
|
||||||
|
if (hourpick.getText().toString().equals("")) {
|
||||||
|
hour = 0;
|
||||||
|
} else {
|
||||||
|
hour = Integer.parseInt(hourpick.getText().toString());
|
||||||
|
}
|
||||||
|
if (minutepick.getText().toString().equals("")) {
|
||||||
|
minute = 0;
|
||||||
|
} else {
|
||||||
|
minute = Integer.parseInt(minutepick.getText().toString());
|
||||||
|
}
|
||||||
|
expiration = new Date();
|
||||||
|
//System.out.println("today is " + mycal.getTime());
|
||||||
|
mycal.setTime(expiration);
|
||||||
|
if (date == 0 && hour == 0 && minute == 0) {
|
||||||
|
if (mediafile) {
|
||||||
|
mycal.add(Calendar.HOUR, videotime);
|
||||||
|
} else {
|
||||||
|
mycal.add(Calendar.MINUTE, 15);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mycal.add(Calendar.DATE, date);
|
||||||
|
mycal.add(Calendar.HOUR, hour);
|
||||||
|
mycal.add(Calendar.MINUTE, minute);
|
||||||
|
}
|
||||||
|
//System.out.println("Expiration date: " + mycal.getTime());
|
||||||
|
expiration = mycal.getTime();
|
||||||
|
//System.out.println(expiration);
|
||||||
|
request = new GeneratePresignedUrlRequest(bucket, object).withExpiration(expiration);
|
||||||
|
objectURL = s3client.generatePresignedUrl(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void savelinks() {
|
||||||
|
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||||
|
Thread saveLinks = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
getLinks();
|
||||||
|
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(getContentResolver().openOutputStream(fileuri));
|
||||||
|
outputStreamWriter.write(objectlist);
|
||||||
|
outputStreamWriter.close();
|
||||||
|
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// Sending reference and data to Adapter
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.save_ok), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//System.out.println("tree "+treelevel);
|
||||||
|
//System.out.println("prefix "+prefix);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
simpleProgressBar.setVisibility(View.INVISIBLE);
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.invalid_expiration_date), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
saveLinks.start();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -9,18 +7,11 @@ import android.widget.EditText;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.amazonaws.services.s3.model.ListObjectsRequest;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import com.amazonaws.services.s3.model.ObjectListing;
|
|
||||||
import com.amazonaws.services.s3.model.S3ObjectSummary;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class TextViewer extends AppCompatActivity {
|
public class TextViewer extends AppCompatActivity {
|
||||||
|
@ -66,11 +57,11 @@ public class TextViewer extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getApplicationContext(),e.toString(), Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package asgardius.page.s3manager;
|
package asgardius.page.s3managermk2;
|
||||||
|
|
||||||
import static android.content.ContentValues.TAG;
|
import static android.content.ContentValues.TAG;
|
||||||
|
|
||||||
|
@ -351,6 +351,19 @@ public class Uploader extends AppCompatActivity {
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
|
public void onDestroy() {
|
||||||
|
if (!mWifiLock.isHeld()) {
|
||||||
|
mWifiLock.acquire();
|
||||||
|
//System.out.println("WifiLock acquired");
|
||||||
|
}
|
||||||
|
if (!mWakeLock.isHeld()) {
|
||||||
|
mWakeLock.acquire();
|
||||||
|
//System.out.println("WakeLock acquired");
|
||||||
|
}
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, final Intent resultData) {
|
public void onActivityResult(int requestCode, int resultCode, final Intent resultData) {
|
||||||
// The ACTION_OPEN_DOCUMENT intent was sent with the request code OPEN_DIRECTORY_REQUEST_CODE.
|
// The ACTION_OPEN_DOCUMENT intent was sent with the request code OPEN_DIRECTORY_REQUEST_CODE.
|
||||||
// If the request code seen here doesn't match, it's the response to some other intent,
|
// If the request code seen here doesn't match, it's the response to some other intent,
|
|
@ -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;
|
||||||
|
@ -17,6 +17,7 @@ import android.support.v4.media.session.MediaSessionCompat;
|
||||||
import android.util.Rational;
|
import android.util.Rational;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
@ -28,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;
|
||||||
|
@ -35,12 +37,12 @@ import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
||||||
import com.google.android.exoplayer2.ui.PlayerNotificationManager;
|
import com.google.android.exoplayer2.ui.PlayerNotificationManager;
|
||||||
import com.google.android.exoplayer2.ui.StyledPlayerView;
|
import com.google.android.exoplayer2.ui.StyledPlayerView;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
|
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.HttpDataSource;
|
|
||||||
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
|
||||||
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
|
import com.google.android.exoplayer2.upstream.cache.LeastRecentlyUsedCacheEvictor;
|
||||||
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,6 +57,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
private PowerManager.WakeLock mWakeLock;
|
private PowerManager.WakeLock mWakeLock;
|
||||||
private PowerManager powerManager;
|
private PowerManager powerManager;
|
||||||
private long maxCacheSize;
|
private long maxCacheSize;
|
||||||
|
ArrayList<String> queue, names;
|
||||||
LeastRecentlyUsedCacheEvictor evictor;
|
LeastRecentlyUsedCacheEvictor evictor;
|
||||||
StandaloneDatabaseProvider standaloneDatabaseProvider;
|
StandaloneDatabaseProvider standaloneDatabaseProvider;
|
||||||
SimpleCache simpleCache;
|
SimpleCache simpleCache;
|
||||||
|
@ -70,7 +73,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
AppOpsManager appOpsManager;
|
AppOpsManager appOpsManager;
|
||||||
private PlayerNotificationManager playerNotificationManager;
|
private PlayerNotificationManager playerNotificationManager;
|
||||||
private int notificationId = 1234;
|
private int notificationId = 1234;
|
||||||
boolean hls;
|
boolean isplaylist;
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
String videoURL, title;
|
String videoURL, title;
|
||||||
Rational ratio;
|
Rational ratio;
|
||||||
|
@ -79,6 +82,9 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_video_player);
|
setContentView(R.layout.activity_video_player);
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
|
getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
|
||||||
|
}
|
||||||
if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){
|
if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){
|
||||||
|
|
||||||
NotificationChannel channel= new NotificationChannel("playback","Video Playback", NotificationManager.IMPORTANCE_DEFAULT);
|
NotificationChannel channel= new NotificationChannel("playback","Video Playback", NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
|
@ -103,7 +109,9 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
title = getIntent().getStringExtra("title");
|
title = getIntent().getStringExtra("title");
|
||||||
videocache = getIntent().getIntExtra("videocache", 40);
|
videocache = getIntent().getIntExtra("videocache", 40);
|
||||||
buffersize = getIntent().getIntExtra("buffersize", 2000);
|
buffersize = getIntent().getIntExtra("buffersize", 2000);
|
||||||
hls = getIntent().getBooleanExtra("hls", false);
|
isplaylist = getIntent().getBooleanExtra("isplaylist", false);
|
||||||
|
queue = getIntent().getStringArrayListExtra("queue");
|
||||||
|
names = getIntent().getStringArrayListExtra("names");
|
||||||
getSupportActionBar().setTitle(title);
|
getSupportActionBar().setTitle(title);
|
||||||
loadControl = new DefaultLoadControl.Builder().setBufferDurationsMs(2000, buffersize, 1500, 2000).build();
|
loadControl = new DefaultLoadControl.Builder().setBufferDurationsMs(2000, buffersize, 1500, 2000).build();
|
||||||
|
|
||||||
|
@ -119,17 +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);
|
||||||
|
if(SdcardCheck.isInstalledOnSdCard(this)) {
|
||||||
simpleCache = new SimpleCache(
|
simpleCache = new SimpleCache(
|
||||||
new File(this.getCacheDir(), "media"),
|
new File(this.getExternalFilesDirs(null)[this.getExternalFilesDirs(null).length-1], "media"),
|
||||||
evictor,
|
evictor,
|
||||||
standaloneDatabaseProvider);
|
standaloneDatabaseProvider);
|
||||||
mediaSource = new ProgressiveMediaSource.Factory(
|
} else {
|
||||||
new CacheDataSource.Factory()
|
simpleCache = new SimpleCache(
|
||||||
.setCache(simpleCache)
|
new File(this.getFilesDir(), "media"),
|
||||||
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
evictor,
|
||||||
.setUserAgent("S3 Manager"))
|
standaloneDatabaseProvider);
|
||||||
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
}
|
||||||
).createMediaSource(MediaItem.fromUri(Uri.parse(videoURL)));
|
|
||||||
playerView.setPlayer(player);
|
playerView.setPlayer(player);
|
||||||
control = new StyledPlayerView.ControllerVisibilityListener() {
|
control = new StyledPlayerView.ControllerVisibilityListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -149,15 +157,27 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
// Prepare the player.
|
// Prepare the player.
|
||||||
player.setPlayWhenReady(true);
|
player.setPlayWhenReady(true);
|
||||||
playerNotificationManager = new PlayerNotificationManager.Builder(this, notificationId, "playback").build();
|
playerNotificationManager = new PlayerNotificationManager.Builder(this, notificationId, "playback").build();
|
||||||
|
playerNotificationManager.setUseNextActionInCompactView(true);
|
||||||
|
playerNotificationManager.setUsePreviousActionInCompactView(true);
|
||||||
playerNotificationManager.setMediaSessionToken(mediaSession.getSessionToken());
|
playerNotificationManager.setMediaSessionToken(mediaSession.getSessionToken());
|
||||||
playerNotificationManager.setPlayer(player);
|
playerNotificationManager.setPlayer(player);
|
||||||
if (hls) {
|
if (isplaylist) {
|
||||||
MediaItem mediaItem = MediaItem.fromUri(videoURL);
|
for (int i = 0; i < queue.size(); i++) {
|
||||||
player.setMediaItem(mediaItem);
|
MediaItem mediaItem = MediaItem.fromUri(Share.URLify(queue.get(i)));
|
||||||
} else {
|
player.addMediaItem(mediaItem);
|
||||||
player.setMediaSource(mediaSource);
|
|
||||||
}
|
}
|
||||||
|
getSupportActionBar().setTitle(names.get(player.getCurrentMediaItemIndex()));
|
||||||
player.prepare();
|
player.prepare();
|
||||||
|
try {
|
||||||
|
player.seekTo(names.indexOf(title), 0);
|
||||||
|
}catch (Exception e) {
|
||||||
|
System.out.println("Playing m3u file");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MediaItem mediaItem = MediaItem.fromUri(Share.URLify(videoURL));
|
||||||
|
player.setMediaItem(mediaItem);
|
||||||
|
player.prepare();
|
||||||
|
}
|
||||||
// Start the playback.
|
// Start the playback.
|
||||||
player.play();
|
player.play();
|
||||||
|
|
||||||
|
@ -169,20 +189,22 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
if(success) {
|
if(success) {
|
||||||
player.pause();
|
player.pause();
|
||||||
} else {
|
} else {
|
||||||
if (cause instanceof HttpDataSource.HttpDataSourceException) {
|
|
||||||
// An HTTP error occurred.
|
// An HTTP error occurred.
|
||||||
//System.out.println("Playback error F");
|
//System.out.println("Playback error F");
|
||||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.media_conn_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), Objects.requireNonNull(error.getCause()).toString(), Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
|
||||||
// An HTTP error occurred.
|
|
||||||
//System.out.println("Playback error F");
|
|
||||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.media_wrong_type), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
player.release();
|
player.release();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTracksChanged(Tracks tracks) {
|
||||||
|
if(isplaylist) {
|
||||||
|
getSupportActionBar().setTitle(names.get(player.getCurrentMediaItemIndex()));
|
||||||
|
}
|
||||||
|
Player.Listener.super.onTracksChanged(tracks);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -236,6 +258,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
// Set the IMMERSIVE flag.
|
// Set the IMMERSIVE flag.
|
||||||
// Set the content to appear under the system bars so that the content
|
// Set the content to appear under the system bars so that the content
|
||||||
// doesn't resize when the system bars hide and show.
|
// doesn't resize when the system bars hide and show.
|
||||||
|
Objects.requireNonNull(getSupportActionBar()).hide();
|
||||||
View decorView = getWindow().getDecorView();
|
View decorView = getWindow().getDecorView();
|
||||||
decorView.setSystemUiVisibility(
|
decorView.setSystemUiVisibility(
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
@ -250,6 +273,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
View decorView = getWindow().getDecorView();
|
View decorView = getWindow().getDecorView();
|
||||||
decorView.setSystemUiVisibility(
|
decorView.setSystemUiVisibility(
|
||||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||||
|
Objects.requireNonNull(getSupportActionBar()).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -298,12 +322,22 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
if (mWifiLock.isHeld()) {
|
||||||
|
mWifiLock.release();
|
||||||
|
//System.out.println("WifiLock acquired");
|
||||||
|
}
|
||||||
|
if (mWakeLock.isHeld()) {
|
||||||
|
mWakeLock.release();
|
||||||
|
//System.out.println("WakeLock acquired");
|
||||||
|
}
|
||||||
mediaSessionConnector.setPlayer(null);
|
mediaSessionConnector.setPlayer(null);
|
||||||
|
//deleteCache(this, standaloneDatabaseProvider);
|
||||||
mediaSession.setActive(false);
|
mediaSession.setActive(false);
|
||||||
playerNotificationManager.setPlayer(null);
|
playerNotificationManager.setPlayer(null);
|
||||||
player.release();
|
player.release();
|
||||||
playerView.setPlayer(null);
|
playerView.setPlayer(null);
|
||||||
simpleCache.release();
|
simpleCache.release();
|
||||||
|
standaloneDatabaseProvider.close();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,6 +347,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
if (!playerView.getUseController()) {
|
if (!playerView.getUseController()) {
|
||||||
playerView.setUseController(true);
|
playerView.setUseController(true);
|
||||||
}
|
}
|
||||||
|
hideSystemBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserLeaveHint() {
|
public void onUserLeaveHint() {
|
||||||
|
@ -325,22 +360,23 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
title = intent.getStringExtra("title");
|
title = intent.getStringExtra("title");
|
||||||
videocache = intent.getIntExtra("videocache", 40);
|
videocache = intent.getIntExtra("videocache", 40);
|
||||||
buffersize = intent.getIntExtra("buffersize", 2000);
|
buffersize = intent.getIntExtra("buffersize", 2000);
|
||||||
hls = intent.getBooleanExtra("hls", false);
|
isplaylist = intent.getBooleanExtra("isplaylist", false);
|
||||||
|
queue = intent.getStringArrayListExtra("queue");
|
||||||
|
names = intent.getStringArrayListExtra("names");
|
||||||
getSupportActionBar().setTitle(title);
|
getSupportActionBar().setTitle(title);
|
||||||
mediaSource = new ProgressiveMediaSource.Factory(
|
if (isplaylist) {
|
||||||
new CacheDataSource.Factory()
|
player.clearMediaItems();
|
||||||
.setCache(simpleCache)
|
for (int i = 0; i < queue.size(); i++) {
|
||||||
.setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
|
MediaItem mediaItem = MediaItem.fromUri(queue.get(i));
|
||||||
.setUserAgent("ExoplayerDemo"))
|
player.addMediaItem(mediaItem);
|
||||||
.setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
|
|
||||||
).createMediaSource(MediaItem.fromUri(Uri.parse(videoURL)));
|
|
||||||
if (hls) {
|
|
||||||
MediaItem mediaItem = MediaItem.fromUri(videoURL);
|
|
||||||
player.setMediaItem(mediaItem);
|
|
||||||
} else {
|
|
||||||
player.setMediaSource(mediaSource);
|
|
||||||
}
|
}
|
||||||
player.prepare();
|
player.prepare();
|
||||||
|
player.seekTo(names.indexOf(title), 0);
|
||||||
|
} else {
|
||||||
|
MediaItem mediaItem = MediaItem.fromUri(videoURL);
|
||||||
|
player.setMediaItem(mediaItem);
|
||||||
|
player.prepare();
|
||||||
|
}
|
||||||
// Start the playback.
|
// Start the playback.
|
||||||
player.play();
|
player.play();
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
|
@ -364,6 +400,10 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static void deleteCache(Context context, StandaloneDatabaseProvider database) {
|
||||||
|
SimpleCache.delete(new File(context.getCacheDir(), "media"), database);
|
||||||
|
}*/
|
||||||
|
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
try {
|
try {
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
|
|
@ -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;
|
||||||
|
|
53
app/src/main/res/layout/activity_bucket_policy.xml
Normal file
53
app/src/main/res/layout/activity_bucket_policy.xml
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".BucketPolicy">
|
||||||
|
|
||||||
|
<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>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/activity_main"
|
android:id="@+id/activity_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="MissingConstraints">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -47,4 +48,14 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
<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>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/activity_main"
|
android:id="@+id/activity_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -53,6 +53,9 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/simpleProgressBar"
|
android:id="@+id/simpleProgressBar"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
@ -64,7 +67,4 @@
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
tools:ignore="MissingConstraints" />
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -4,9 +4,10 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/black"
|
||||||
tools:context=".ImageViewer">
|
tools:context=".ImageViewer">
|
||||||
|
|
||||||
<ImageView
|
<com.otaliastudios.zoom.ZoomImageView
|
||||||
android:id="@+id/imageViewer"
|
android:id="@+id/imageViewer"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
@ -14,7 +15,9 @@
|
||||||
app:srcCompat="@drawable/empty"
|
app:srcCompat="@drawable/empty"
|
||||||
tools:ignore="MissingConstraints"
|
tools:ignore="MissingConstraints"
|
||||||
tools:layout_editor_absoluteX="0dp"
|
tools:layout_editor_absoluteX="0dp"
|
||||||
tools:layout_editor_absoluteY="82dp" />
|
tools:layout_editor_absoluteY="82dp"
|
||||||
|
app:minZoom="1.0"
|
||||||
|
app:maxZoom="25.5" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/simpleProgressBar"
|
android:id="@+id/simpleProgressBar"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/activity_main"
|
android:id="@+id/activity_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -7,6 +7,12 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".ObjectInfo">
|
tools:context=".ObjectInfo">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingConstraints">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/size_info"
|
android:id="@+id/size_info"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -28,6 +34,8 @@
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="25sp" />
|
android:textSize="25sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/simpleProgressBar"
|
android:id="@+id/simpleProgressBar"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
|
@ -38,4 +46,4 @@
|
||||||
tools:ignore="MissingConstraints"
|
tools:ignore="MissingConstraints"
|
||||||
android:indeterminate="true" />
|
android:indeterminate="true" />
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
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"
|
||||||
|
@ -65,6 +74,30 @@
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:textColorHint="?attr/colorOnSecondary"/>
|
android:textColorHint="?attr/colorOnSecondary"/>
|
||||||
|
|
||||||
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
|
android:id="@+id/isplaylist"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:text="@string/playlist_playback"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/playlisttime"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="25sp"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/playlisttime"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:focusable="true"
|
||||||
|
android:hint="@string/playlisttime"
|
||||||
|
android:inputType="number"
|
||||||
|
android:textColorHint="?attr/colorOnSecondary"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/saveprefs"
|
android:id="@+id/saveprefs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/activity_main"
|
android:id="@+id/activity_main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="MissingConstraints">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -17,9 +18,9 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/expirationtext"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/expiration_time"
|
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="25sp" />
|
android:textSize="25sp" />
|
||||||
|
|
||||||
|
@ -38,6 +39,7 @@
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:enabled="false"
|
||||||
android:hint="@string/share_date"
|
android:hint="@string/share_date"
|
||||||
android:maxLength="1"
|
android:maxLength="1"
|
||||||
android:inputType="date"
|
android:inputType="date"
|
||||||
|
@ -50,6 +52,7 @@
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:enabled="false"
|
||||||
android:hint="@string/share_hour"
|
android:hint="@string/share_hour"
|
||||||
android:maxLength="2"
|
android:maxLength="2"
|
||||||
android:inputType="date"
|
android:inputType="date"
|
||||||
|
@ -62,6 +65,7 @@
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:enabled="false"
|
||||||
android:hint="@string/share_minute"
|
android:hint="@string/share_minute"
|
||||||
android:maxLength="2"
|
android:maxLength="2"
|
||||||
android:inputType="date"
|
android:inputType="date"
|
||||||
|
@ -75,9 +79,36 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:text="@string/file_share"
|
android:text="@string/file_share"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/copy_links"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:text="@string/copy_links"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/save_links"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:text="@string/save_links"
|
||||||
|
android:visibility="gone"
|
||||||
tools:ignore="MissingConstraints" />
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
<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>
|
|
@ -13,6 +13,10 @@
|
||||||
android:id="@+id/download_bucket"
|
android:id="@+id/download_bucket"
|
||||||
android:title="@string/download_bucket" />
|
android:title="@string/download_bucket" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/sharefile"
|
||||||
|
android:title="@string/create_link" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/newbucket"
|
android:id="@+id/newbucket"
|
||||||
android:title="@string/create_bucket" />
|
android:title="@string/create_bucket" />
|
||||||
|
@ -29,6 +33,10 @@
|
||||||
android:id="@+id/cors_config"
|
android:id="@+id/cors_config"
|
||||||
android:title="@string/cors_config" />
|
android:title="@string/cors_config" />
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
android:id="@+id/download_folder"
|
android:id="@+id/download_folder"
|
||||||
android:title="@string/download_folder" />
|
android:title="@string/download_folder" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/sharefile"
|
||||||
|
android:title="@string/create_link" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/info"
|
android:id="@+id/info"
|
||||||
android:title="@string/object_info" />
|
android:title="@string/object_info" />
|
||||||
|
@ -21,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" />
|
||||||
|
|
|
@ -62,15 +62,8 @@
|
||||||
<string name="accountsave_success">Cuenta editada exitosamente</string>
|
<string name="accountsave_success">Cuenta editada exitosamente</string>
|
||||||
<string name="nosslwarning">No se permiten las conexiones sin SSL</string>
|
<string name="nosslwarning">No se permiten las conexiones sin SSL</string>
|
||||||
<string name="invalid_url">La URL del endpoint debe iniciar con https://</string>
|
<string name="invalid_url">La URL del endpoint debe iniciar con https://</string>
|
||||||
<string name="explorer_test_button">Probar explorador de archivos</string>
|
|
||||||
<string name="unsupported_file">Tipo de archivo no soportado</string>
|
<string name="unsupported_file">Tipo de archivo no soportado</string>
|
||||||
<string name="test_server_button">Conectar al servidor de pruebas</string>
|
|
||||||
<string name="media_conn_fail">No se pudo obtener el archivo remoto</string>
|
|
||||||
<string name="media_wrong_type">Archivo multimedia inválido</string>
|
|
||||||
<string name="media_list_fail">No se pudo conectar al servidor</string>
|
|
||||||
<string name="about_button">Acerca de esta app</string>
|
<string name="about_button">Acerca de esta app</string>
|
||||||
<string name="dummy_button">Botón de prueba</string>
|
|
||||||
<string name="dummy_content">Contenido de prueba</string>
|
|
||||||
<string name="accountadd_pdfendpoint">servidor pdfjs</string>
|
<string name="accountadd_pdfendpoint">servidor pdfjs</string>
|
||||||
<string name="pdf_reader_notready">Necesita configurar un servidor pdf.js</string>
|
<string name="pdf_reader_notready">Necesita configurar un servidor pdf.js</string>
|
||||||
<string name="share_date">D</string>
|
<string name="share_date">D</string>
|
||||||
|
@ -78,7 +71,7 @@
|
||||||
<string name="share_minute">MM</string>
|
<string name="share_minute">MM</string>
|
||||||
<string name="expiration_date">Fecha de expiración</string>
|
<string name="expiration_date">Fecha de expiración</string>
|
||||||
<string name="expiration_time">Expira dentro de</string>
|
<string name="expiration_time">Expira dentro de</string>
|
||||||
<string name="create_link">Crear enlace al archivo</string>
|
<string name="create_link">Crear enlace</string>
|
||||||
<string name="invalid_expiration_date">La fecha de caducidad debe ser inferior a 7 días</string>
|
<string name="invalid_expiration_date">La fecha de caducidad debe ser inferior a 7 días</string>
|
||||||
<string name="file_size">Tamaño del archivo</string>
|
<string name="file_size">Tamaño del archivo</string>
|
||||||
<string name="object_info">Propiedades</string>
|
<string name="object_info">Propiedades</string>
|
||||||
|
@ -93,6 +86,8 @@
|
||||||
<string name="save_settings">Guardar ajustes</string>
|
<string name="save_settings">Guardar ajustes</string>
|
||||||
<string name="videocache">Tamaño máximo de cache multimedia (en MiB)</string>
|
<string name="videocache">Tamaño máximo de cache multimedia (en MiB)</string>
|
||||||
<string name="videotime">Tiempo de expiración para visor multimedia (en horas)</string>
|
<string name="videotime">Tiempo de expiración para visor multimedia (en horas)</string>
|
||||||
|
<string name="playlist_playback">Habilitar listas de reproducción</string>
|
||||||
|
<string name="playlisttime">Tiempo de expiración para listas de reproducción (en horas)</string>
|
||||||
<string name="buffersize">Tamaño del buffer del reproductor multimedia (en milisegundos)</string>
|
<string name="buffersize">Tamaño del buffer del reproductor multimedia (en milisegundos)</string>
|
||||||
<string name="buffersize_error">El tamaño del búfer debe ser de al menos 2001 milisegundos</string>
|
<string name="buffersize_error">El tamaño del búfer debe ser de al menos 2001 milisegundos</string>
|
||||||
<string name="mediaplayer_multierror">Solo se puede reproducir un archivo multimedia a la vez</string>
|
<string name="mediaplayer_multierror">Solo se puede reproducir un archivo multimedia a la vez</string>
|
||||||
|
@ -108,13 +103,28 @@
|
||||||
<string name="allow_all">Permitir todo</string>
|
<string name="allow_all">Permitir todo</string>
|
||||||
<string name="allow_pdf">Permitir pdf</string>
|
<string name="allow_pdf">Permitir pdf</string>
|
||||||
<string name="delete_cors">Eliminar CORS</string>
|
<string name="delete_cors">Eliminar CORS</string>
|
||||||
<string name="cors_error">No se pudo cambiar la política CORS</string>
|
<string name="policy_error">No se pudo cambiar la política</string>
|
||||||
<string name="cors_ok">Política CORS cambiada exitosamente</string>
|
<string name="policy_ok">Política cambiada exitosamente</string>
|
||||||
<string name="download_bucket">Descargar contenido del bucket</string>
|
<string name="download_bucket">Descargar contenido del bucket</string>
|
||||||
<string name="download_folder">Descargar contenido de la carpeta</string>
|
<string name="download_folder">Descargar contenido de la carpeta</string>
|
||||||
<string name="batch_download_success">Archivos descargados exitosamente</string>
|
<string name="batch_download_success">Archivos descargados exitosamente</string>
|
||||||
<string name="copy_name">Copiar nombre al portapapeles</string>
|
<string name="copy_name">Copiar nombre al portapapeles</string>
|
||||||
<string name="copy_name_ok">Nombre copiado al portapapeles</string>
|
<string name="copy_ok">Copiado al portapapeles</string>
|
||||||
<string name="upload_calculate">Calculando tamaño de la carpeta</string>
|
<string name="upload_calculate">Calculando tamaño de la carpeta</string>
|
||||||
<string name="picture_too_big">Imagen demasiado grande</string>
|
<string name="picture_too_big">Imagen demasiado grande</string>
|
||||||
|
<string name="save_links">Guardar enlaces en archivo</string>
|
||||||
|
<string name="copy_links">Copiar enlaces al potapapeles</string>
|
||||||
|
<string name="save_ok">Archivo guardado exitosamente</string>
|
||||||
|
<string name="bucket_policy">Permisos de acceso</string>
|
||||||
|
<string name="public_bucket">Bucket público</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="set_public">Establecer como público</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="clearcache">Limpiar Cache de Video</string>
|
||||||
|
<string name="clearcache_ok">Cache limpiada exitosamente</string>
|
||||||
</resources>
|
</resources>
|
|
@ -1,9 +1,8 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">S3 Manager</string>
|
<string name="app_name" translatable="false">S3 Manager</string>
|
||||||
<string name="endpoint_url" translatable="false">https://s3.asgardius.company</string>
|
<string name="aws_endpoint" translatable="false">.amazonaws.com</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>
|
||||||
|
@ -13,7 +12,7 @@
|
||||||
<string name="share_hour">HH</string>
|
<string name="share_hour">HH</string>
|
||||||
<string name="share_minute">MM</string>
|
<string name="share_minute">MM</string>
|
||||||
<string name="share_date">D</string>
|
<string name="share_date">D</string>
|
||||||
<string name="create_link">Create file link</string>
|
<string name="create_link">Create link</string>
|
||||||
<string name="invalid_expiration_date">Expiration date must be at most 7 days</string>
|
<string name="invalid_expiration_date">Expiration date must be at most 7 days</string>
|
||||||
<string name="null_expiration_date">You must set an expiration date to share files</string>
|
<string name="null_expiration_date">You must set an expiration date to share files</string>
|
||||||
<string name="broken_database">Local database is corrupted. Please reinstall this app</string>
|
<string name="broken_database">Local database is corrupted. Please reinstall this app</string>
|
||||||
|
@ -86,21 +85,16 @@
|
||||||
<string name="accountsave_success">Account edited successfully</string>
|
<string name="accountsave_success">Account edited successfully</string>
|
||||||
<string name="nosslwarning">Connections without SSL are not allowed</string>
|
<string name="nosslwarning">Connections without SSL are not allowed</string>
|
||||||
<string name="invalid_url">Endpoint URL must start with https://</string>
|
<string name="invalid_url">Endpoint URL must start with https://</string>
|
||||||
<string name="explorer_test_button">File Explorer Test</string>
|
|
||||||
<string name="unsupported_file">Unsupported file type</string>
|
<string name="unsupported_file">Unsupported file type</string>
|
||||||
<string name="test_server_button">Connect to test server</string>
|
|
||||||
<string name="media_conn_fail">Cannot retrieve remote file</string>
|
|
||||||
<string name="media_wrong_type">Invalid media file</string>
|
|
||||||
<string name="media_list_fail">Cannot connect to server</string>
|
|
||||||
<string name="about_button">About this app</string>
|
<string name="about_button">About this app</string>
|
||||||
<string name="dummy_button">Dummy Button</string>
|
|
||||||
<string name="dummy_content">DUMMY\nCONTENT</string>
|
|
||||||
<string name="settings">Settings</string>
|
<string name="settings">Settings</string>
|
||||||
<string name="save_settings">Save settings</string>
|
<string name="save_settings">Save settings</string>
|
||||||
<string name="videocache">Max media cache size (in MiB)</string>
|
<string name="videocache">Max media cache size (in MiB)</string>
|
||||||
<string name="videotime">Expiration time for media viewer (in hours)</string>
|
<string name="videotime">Expiration time for media viewer (in hours)</string>
|
||||||
<string name="buffersize">Media player buffer size (in milliseconds)</string>
|
<string name="buffersize">Media player buffer size (in milliseconds)</string>
|
||||||
<string name="buffersize_error">Buffer size must be at least 2001 milliseconds</string>
|
<string name="buffersize_error">Buffer size must be at least 2001 milliseconds</string>
|
||||||
|
<string name="playlist_playback">Enable playlists</string>
|
||||||
|
<string name="playlisttime">Expiration time for media playlists (in hours)</string>
|
||||||
<string name="mediaplayer_multierror">Only one media file can be played at once</string>
|
<string name="mediaplayer_multierror">Only one media file can be played at once</string>
|
||||||
<string name="playback_channel_name">Video Playback</string>
|
<string name="playback_channel_name">Video Playback</string>
|
||||||
<string name="not_zero">This value cannot be zero</string>
|
<string name="not_zero">This value cannot be zero</string>
|
||||||
|
@ -114,10 +108,25 @@
|
||||||
<string name="allow_all">Allow all</string>
|
<string name="allow_all">Allow all</string>
|
||||||
<string name="allow_pdf">Allow pdf</string>
|
<string name="allow_pdf">Allow pdf</string>
|
||||||
<string name="delete_cors">Delete CORS</string>
|
<string name="delete_cors">Delete CORS</string>
|
||||||
<string name="cors_error">Cannot change CORS policy</string>
|
<string name="policy_error">Cannot change policy</string>
|
||||||
<string name="cors_ok">CORS policy changed successfully</string>
|
<string name="policy_ok">Policy changed successfully</string>
|
||||||
<string name="copy_name">Copy name to clipboard</string>
|
<string name="copy_name">Copy name to clipboard</string>
|
||||||
<string name="copy_name_ok">Name copied to clipboard</string>
|
<string name="copy_ok">Copied to clipboard</string>
|
||||||
<string name="upload_calculate">Calculating folder size</string>
|
<string name="upload_calculate">Calculating folder size</string>
|
||||||
<string name="picture_too_big">Picture too big</string>
|
<string name="picture_too_big">Picture too big</string>
|
||||||
|
<string name="save_links">Save links to file</string>
|
||||||
|
<string name="save_ok">File saved successfully</string>
|
||||||
|
<string name="copy_links">Copy links to clipboard</string>
|
||||||
|
<string name="bucket_policy">Access permissions</string>
|
||||||
|
<string name="public_bucket">Public 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="set_public">Set as public</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="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.3.1' apply false
|
id 'com.android.application' version '8.5.2' apply false
|
||||||
id 'com.android.library' version '7.3.1' 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/59.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/59.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Enhanced picture viewer
|
2
fastlane/metadata/android/en-US/changelogs/61.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/61.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
* Add option to play all media items on current folder
|
||||||
|
* Add option to share entire folders and save on clipboard or txt file
|
1
fastlane/metadata/android/en-US/changelogs/62.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/62.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Delete cached media when is not longer needed
|
1
fastlane/metadata/android/en-US/changelogs/63.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/63.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Fix app setting validation
|
1
fastlane/metadata/android/en-US/changelogs/64.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/64.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* UI fixes
|
1
fastlane/metadata/android/en-US/changelogs/65.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/65.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* UI fixes
|
1
fastlane/metadata/android/en-US/changelogs/66.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/66.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* UI fixes
|
1
fastlane/metadata/android/en-US/changelogs/68.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/68.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* UI fixes
|
2
fastlane/metadata/android/en-US/changelogs/69.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/69.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
* UI fixes
|
||||||
|
* Better support for notched devices
|
1
fastlane/metadata/android/en-US/changelogs/71.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/71.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Set bucket as public or private
|
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
|
|
@ -14,11 +14,15 @@ Current feature list
|
||||||
<li>Delete folders</li>
|
<li>Delete folders</li>
|
||||||
<li>File upload</li>
|
<li>File upload</li>
|
||||||
<li>File download</li>
|
<li>File download</li>
|
||||||
|
<li>Download folder content</li>
|
||||||
|
<li>Upload folder content</li>
|
||||||
<li>pdf file reader using user provided pdf.js server</li>
|
<li>pdf file reader using user provided pdf.js server</li>
|
||||||
<li>file sharing links</li>
|
<li>file sharing links</li>
|
||||||
<li>get object info</li>
|
<li>get object info</li>
|
||||||
<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 object as public or private</li>
|
||||||
|
|
||||||
Planned feature list
|
Planned feature list
|
||||||
|
|
||||||
|
@ -41,17 +45,22 @@ Knnown issues
|
||||||
Known supported providers
|
Known supported providers
|
||||||
|
|
||||||
<li>Amazon Web Services</li>
|
<li>Amazon Web Services</li>
|
||||||
<li>Scaleway Elements (partial)</li>
|
<li>Scaleway Elements</li>
|
||||||
<li>Oracle Cloud (partial)</li>
|
<li>Wasabi Cloud (Provider broke access control intentionally since March 13 2023)</li>
|
||||||
<li>Wasabi Cloud</li>
|
<li>Backblaze B2</li>
|
||||||
<li>MinIO</li>
|
<li>Cloudflare R2 (partial)</li>
|
||||||
|
<li>MinIO **</li>
|
||||||
|
<li>Garage **</li>
|
||||||
|
|
||||||
Known not supported providers
|
Known not supported providers
|
||||||
|
|
||||||
<li>Google Cloud</li>
|
<li>Google Cloud (Not compatible with S3v4)</li>
|
||||||
|
<li>Oracle Cloud (compatibility issues with S3v4)</li>
|
||||||
|
|
||||||
|
** 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-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 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.4-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