From 26d2ce972fc3be8d6e7b3bfe3402dd0690714be1 Mon Sep 17 00:00:00 2001 From: hyb1996 <946994919@qq.com> Date: Sun, 7 Jan 2018 14:04:19 +0800 Subject: [PATCH] fix: download script failed when dir does not exist --- app/build.gradle | 11 ++- .../network/download/DownloadManager.java | 2 + app/src/main/res/raw/licenses.xml | 86 ++++++++----------- app/src/main/res/xml/preferences.xml | 5 -- 4 files changed, 45 insertions(+), 59 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ef054745..2bbbc670 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -92,12 +92,19 @@ dependencies { exclude group: 'com.afollestad.material-dialogs' exclude group: 'com.android.support' }) + //MultiLevelListView compile 'com.github.hyb1996:android-multi-level-listview:1.1' + //Licenses Dialog compile 'de.psdev.licensesdialog:licensesdialog:1.8.1' + //Expandable RecyclerView compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1' + //FlexibleDivider compile 'com.yqritc:recyclerview-flexibledivider:1.4.0' + //??? compile 'com.wang.avi:library:2.1.3' + //Commons-lang compile 'org.apache.commons:commons-lang3:3.6' + //Expandable RecyclerView compile 'com.thoughtbot:expandablerecyclerview:1.3' compile('com.github.hyb1996:FloatingCircularActionMenu:0.0.4') compile 'com.github.hyb1996:Auto.js-ApkBuilder:1.0.1' @@ -123,12 +130,12 @@ dependencies { compile 'joda-time:joda-time:2.9.9' // Tasker Plugin compile 'com.twofortyfouram:android-plugin-client-sdk-for-locale:4.0.3' + // Flurry compile 'com.flurry.android:analytics:7.0.0@aar' + // MaterialDialogCommon compile('com.afollestad.material-dialogs:commons:0.9.2.3', { exclude group: 'com.android.support' }) - compile 'com.rengwuxian.materialedittext:library:2.0.3' - compile 'org.msgpack:msgpack-core:0.8.11' compile project(':automator') compile project(':common') compile project(':autojs') diff --git a/app/src/main/java/com/stardust/scriptdroid/network/download/DownloadManager.java b/app/src/main/java/com/stardust/scriptdroid/network/download/DownloadManager.java index 6bfaf4bb..1fa20120 100644 --- a/app/src/main/java/com/stardust/scriptdroid/network/download/DownloadManager.java +++ b/app/src/main/java/com/stardust/scriptdroid/network/download/DownloadManager.java @@ -2,6 +2,7 @@ package com.stardust.scriptdroid.network.download; import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.stardust.concurrent.VolatileBox; +import com.stardust.pio.PFiles; import com.stardust.scriptdroid.network.NodeBB; import com.stardust.scriptdroid.network.api.DownloadApi; @@ -132,6 +133,7 @@ public class DownloadManager { public void start(ResponseBody body) { try { + PFiles.ensureDir(mPath); startImpl(body); } catch (Exception e) { mProgress.onError(e); diff --git a/app/src/main/res/raw/licenses.xml b/app/src/main/res/raw/licenses.xml index 92388c83..204eed0a 100644 --- a/app/src/main/res/raw/licenses.xml +++ b/app/src/main/res/raw/licenses.xml @@ -1,122 +1,104 @@ - + Rhino: JavaScript in Java https://github.com/mozilla/rhino Mozilla Public License 2.0 - - - 920 Text Editor - https://github.com/jecelyin/920-text-editor-v2 - - Apache Software License 2.0 - - + + LeakCanary Copyright 2015 Square, Inc. https://github.com/square/leakcanary Apache Software License 2.0 - - + + StorIO https://github.com/pushtorefresh/storio Apache Software License 2.0 - - + + Material Dialogs https://github.com/afollestad/material-dialogs Copyright (c) 2014-2016 Aidan Michael Follestad MIT License - - + + Gson https://github.com/google/gson Copyright 2008 Google Inc. Apache Software License 2.0 - - + + commonmark-java https://github.com/atlassian/commonmark-java Copyright (c) 2015-2016 Atlassian and others. BSD 2-Clause License - - + + Alipay ZeroSdk Copyright 2016 Fung Go (fython) https://github.com/fython/AlipayZeroSdk Apache Software License 2.0 - - - Console - Copyright 2015 Josef Raska - https://github.com/jraska/Console - Apache Software License 2.0 - - + + android-issue-reporter https://github.com/HeinrichReimer/android-issue-reporter Apache Software License 2.0 - - + + SortableTableView Copyright 2015 Ingo Schwarz https://github.com/ISchwarz23/SortableTableView Apache Software License 2.0 - - + + MultiLevelListView 2016 (C) Copyright Open-RnD Sp. z o.o. https://github.com/open-rnd/android-multi-level-listview Apache Software License 2.0 - - - hover - 2016 (C) Copyright Open-RnD Sp. z o.o. - https://github.com/google/hover - Apache Software License 2.0 - - + + event-bus 2016 (C) Copyright Open-RnD Sp. z o.o. https://github.com/greenrobot/EventBus Apache Software License 2.0 - - + + Expandable RecyclerView Copyright (c) 2015 Big Nerd Ranch https://github.com/bignerdranch/expandable-recycler-view MIT License - - + + Android Terminal Emulator https://github.com/jackpal/Android-Terminal-Emulator Apache Software License 2.0 - - + + RecyclerView-FlexibleDivider Copyright 2016 yqritc https://github.com/yqritc/RecyclerView-FlexibleDivider Apache Software License 2.0 - - + + Volley https://github.com/google/volley Apache Software License 2.0 - - + + Settings Compat Copyright 2016 czy1121 https://github.com/czy1121/settingscompat Apache Software License 2.0 - - + + Zip4j http://www.lingala.net/zip4j/ Apache Software License 2.0 - + \ No newline at end of file diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 08e076c7..7b7f5867 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -129,11 +129,6 @@ android:title="@string/text_check_for_updates" /> - -