Skip to content

Commit

Permalink
Merge pull request #221 from kaczmarkiewiczp/dev
Browse files Browse the repository at this point in the history
Update Rclone and support Android 9
  • Loading branch information
patrykcoding authored Nov 5, 2018
2 parents c0a8690 + 3d11c2e commit cef6f35
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 104 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
28 changes: 14 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "ca.pkay.rcloneexplorer"
minSdkVersion 21
targetSdkVersion 27
versionCode 28
versionName "1.7.3-DEV"
targetSdkVersion 28
versionCode 29
versionName "1.7.4-DEV"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -27,22 +27,22 @@ repositories {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation "com.android.support:support-compat:27.1.1"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation "com.android.support:support-compat:28.0.0"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation "com.leinardi.android:speed-dial:1.0.2"
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation "com.leinardi.android:speed-dial:2.0.0"
implementation 'us.feras.mdv:markdownview:1.1.0'
implementation 'jp.wasabeef:recyclerview-animators:2.3.0'
implementation 'com.github.GrenderG:Toasty:1.3.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
android:allowBackup="true"
Expand Down
84 changes: 11 additions & 73 deletions app/src/main/assets/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### 1.7.4
* Update to Rclone v1.44
* **New:** Support for Android 9
* **New:** Serve feature
* Support FTP
* Remote access (off by default)
* Optional authentication
* **Fix:** Crash when external SD card isn't mounted

***

### 1.7.3
* **Fix:** FAB appearing when bottom bar is visible
* **New:** Get notified when beta releases are available
Expand Down Expand Up @@ -130,76 +141,3 @@
* **Fix:** Refreshing while in search mode
* **Fix:** Detect remote type of alias/crypt remotes to show/hide specific options
* **Update:** Hint and helper text for salt in crypt config

***

### 1.3.1
* **New:** Option to delete remotes
* **New:** Option to export rclone config file
* **New:** Option to empty trash for remotes that support it
* Encrypted remotes (crypt) are not supported
* **New:** Firebase Crashlytics
* Any app crashes will be reported to help fix them faster
* No identifiable information is sent, only line of code on which the crash occurred
* **New:** Push notifications when new app version is available on GitHub (can be disabled in settings)
* **Fix:** Recreate view after theme changes
* **Update:** Upload only one file at a time (fix any possible bottlenecks)
* **Update:** Download only one file at a time (fix any possible bottlenecks)
* **Update:** Move/delete operations - view is updated after each file is moved or deleted

***

### 1.3.0
* **New:** Remote creation - ability to create new remotes right from the app!
* Most of the rclone remotes are here
* Amazon S3, Google Cloud Storage, and Google Drive coming soon

***

### 1.2.6
* **New:** File picker
* **Fix:** Screen orientation change going back to main screen
* **Fix:** Sorting while in selection mode
* **Fix:** Other layout fixed and app crashes

***

### 1.2.5
* **New:** Run long running tasks in a Service
* **New:** File search
* **Fix:** Caching of directory content
* **Fix:** Bugs

***

### 1.2.4
* **Update:** App shortcut icons are now adaptive and with color

***

### 1.2.3
* **New:** Files can be shared with Rclone Explorer
* **New:** Tablet layout
* **Fix:** Wait for streaming service be available before streaming

***

### 1.2.2
* **Update:** Rclone to version 1.41
* **New:** App shortcuts
* **Fix:** Color picker not working on sdk 21
* **Fix:** Rclone not getting updated

***

### 1.2.1
* **New:** Dark theme!
* **Fix:** Crash when starting app for the first time

***

### 1.2.0
* **New:** Settings!
* **New:** Custom primary and accent colors
* **New:** Group notifications together
* **New:** "Open as" option in the menu
Binary file modified app/src/main/assets/rclone-arm32
Binary file not shown.
Binary file modified app/src/main/assets/rclone-arm64
Binary file not shown.
Binary file modified app/src/main/assets/rclone-x86_32
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
}

int savedProtocol = savedInstanceState.getInt("protocol", -1);
if (savedProtocol == R.id.radio_http || savedProtocol == R.id.radio_webdav) {
if (savedProtocol == R.id.radio_http || savedProtocol == R.id.radio_webdav || savedProtocol == R.id.radio_ftp) {
protocol.check(savedProtocol);
}
}
Expand All @@ -134,6 +134,9 @@ private void sendCallback() {
int selectedProtocolId = protocol.getCheckedRadioButtonId();
int selectedProtocol;
switch (selectedProtocolId) {
case R.id.radio_ftp:
selectedProtocol = Rclone.SERVE_PROTOCOL_FTP;
break;
case R.id.radio_webdav:
selectedProtocol = Rclone.SERVE_PROTOCOL_WEBDAV;
break;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ca/pkay/rcloneexplorer/FilePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
filePickerAdapter = new FilePickerAdapter(this, fileList, destinationPickerType, findViewById(R.id.empty_folder_view));
recyclerView.setAdapter(filePickerAdapter);

speedDialView = findViewById(R.id.fab);
speedDialView = findViewById(R.id.fab_activity_file_picker);
if (!destinationPickerType) {
speedDialView.setVisibility(View.INVISIBLE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
}
}

fab = view.findViewById(R.id.fab);
fab = view.findViewById(R.id.fab_fragment_file_explorer_list);
fab.setOverlayLayout((SpeedDialOverlayLayout)view.findViewById(R.id.fab_overlay));
fab.setOnActionSelectedListener(new SpeedDialView.OnActionSelectedListener() {
@Override
Expand Down Expand Up @@ -646,6 +646,9 @@ public void onServeOptionsSelected(int protocol, boolean allowRemoteAccess, Stri
case Rclone.SERVE_PROTOCOL_HTTP: // HTTP
intent.putExtra(StreamingService.SERVE_PROTOCOL, StreamingService.SERVE_HTTP);
break;
case Rclone.SERVE_PROTOCOL_FTP: // FTP
intent.putExtra(StreamingService.SERVE_PROTOCOL, StreamingService.SERVE_FTP);
break;
case Rclone.SERVE_PROTOCOL_WEBDAV: // Webdav
intent.putExtra(StreamingService.SERVE_PROTOCOL, StreamingService.SERVE_WEBDAV);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void onClick(View view) {
}
});

SpeedDialView speedDialView = view.findViewById(R.id.fab);
SpeedDialView speedDialView = view.findViewById(R.id.fab_empty_config);
speedDialView.setOnChangeListener(new SpeedDialView.OnChangeListener() {
@Override
public boolean onMainActionSelected() {
Expand Down Expand Up @@ -146,7 +146,7 @@ public void onToggleChanged(boolean isOpen) {
recyclerViewAdapter = new RemotesRecyclerViewAdapter(remotes, remoteClickListener, this);
recyclerView.setAdapter(recyclerViewAdapter);

SpeedDialView speedDialView = view.findViewById(R.id.fab);
SpeedDialView speedDialView = view.findViewById(R.id.fab_fragment_remote_list);
speedDialView.setOnChangeListener(new SpeedDialView.OnChangeListener() {
@Override
public boolean onMainActionSelected() {
Expand Down
16 changes: 14 additions & 2 deletions app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class Rclone {
public static final int SYNC_DIRECTION_REMOTE_TO_LOCAL = 2;
public static final int SERVE_PROTOCOL_HTTP = 1;
public static final int SERVE_PROTOCOL_WEBDAV = 2;
public static final int SERVE_PROTOCOL_FTP = 3;
private Context context;
private String rclone;
private String rcloneConf;
Expand Down Expand Up @@ -359,9 +360,20 @@ public Process serve(int protocol, int port, boolean allowRemoteAccess, String u
String remoteName = remote.getName();
String localRemotePath = (remote.isRemoteType(RemoteItem.LOCAL)) ? Environment.getExternalStorageDirectory().getAbsolutePath() + "/" : "";
String path = (servePath.compareTo("//" + remoteName) == 0) ? remoteName + ":" + localRemotePath : remoteName + ":" + localRemotePath + servePath;

String commandProtocol = protocol == SERVE_PROTOCOL_HTTP ? "http" : "webdav";
String address;
String commandProtocol;

switch (protocol) {
case SERVE_PROTOCOL_HTTP:
commandProtocol = "http";
break;
case SERVE_PROTOCOL_FTP:
commandProtocol = "ftp";
break;
default:
commandProtocol = "webdav";
}

if (allowRemoteAccess) {
address = ":" + String.valueOf(port);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class StreamingService extends IntentService {
public static final String AUTHENTICATION_PASSWORD = "ca.pkay.rcexplorer.password";
public static final int SERVE_HTTP = 11;
public static final int SERVE_WEBDAV = 12;
public static final int SERVE_FTP = 13;
private final String CHANNEL_ID = "ca.pkay.rcexplorer.streaming_channel";
private final String CHANNEL_NAME = "Streaming service";
private final int PERSISTENT_NOTIFICATION_ID = 179;
Expand Down Expand Up @@ -86,6 +87,9 @@ protected void onHandleIntent(@Nullable Intent intent) {
startForeground(PERSISTENT_NOTIFICATION_ID, builder.build());

switch (protocol) {
case SERVE_FTP:
runningProcess = rclone.serve(Rclone.SERVE_PROTOCOL_FTP, 8080, allowRemoteAccess, authenticationUsername, authenticationPassword, remote, servePath);
break;
case SERVE_WEBDAV:
runningProcess = rclone.serve(Rclone.SERVE_PROTOCOL_WEBDAV, 8080, allowRemoteAccess, authenticationUsername, authenticationPassword, remote, servePath);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
app:clickable_overlay="true"/>

<com.leinardi.android.speeddial.SpeedDialView
android:id="@+id/fab"
android:id="@+id/fab_fragment_file_explorer_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_file_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<include layout="@layout/file_picker_list" />

<com.leinardi.android.speeddial.SpeedDialView
android:id="@+id/fab"
android:id="@+id/fab_activity_file_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/res/layout/dialog_serve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:textColor="?attr/textColorPrimary"
android:text="@string/provider_http"
android:checked="true" />
android:checked="true"
android:text="@string/provider_http" />

<RadioButton
android:id="@+id/radio_ftp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:textColor="?attr/textColorPrimary"
android:text="@string/provider_ftp"/>

<RadioButton
android:id="@+id/radio_webdav"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/empty_state_config_file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</RelativeLayout>

<com.leinardi.android.speeddial.SpeedDialView
android:id="@+id/fab"
android:id="@+id/fab_empty_config"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_file_explorer_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
app:clickable_overlay="true"/>

<com.leinardi.android.speeddial.SpeedDialView
android:id="@+id/fab"
android:id="@+id/fab_fragment_file_explorer_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_remotes_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
tools:listitem="@layout/fragment_remotes_item" />

<com.leinardi.android.speeddial.SpeedDialView
android:id="@+id/fab"
android:id="@+id/fab_fragment_remote_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
classpath 'io.fabric.tools:gradle:1.25.4'

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Mar 31 12:01:16 MDT 2018
#Sun Nov 04 19:58:22 MST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

0 comments on commit cef6f35

Please sign in to comment.