This commit is contained in:
laoyuyu
2019-07-23 20:52:30 +08:00
parent 062f124cae
commit a5fc5d0bcf
4 changed files with 12 additions and 10 deletions

View File

@@ -161,13 +161,11 @@ import org.xml.sax.SAXException;
* 初始化数据库
*/
private void initDb(Context context) {
// 这个地方错误了获取数据库路径见https://www.jianshu.com/p/815c9efc5449
String oldDbName = "AriaLyyDb";
String oldDbPath = context.getDatabasePath(oldDbName).getPath();
File db = new File(oldDbPath);
File dbConfig = new File(String.format("%s/%s", db.getParent(), "AriaLyyDb-journal"));
if (db.exists()) {
db.renameTo(new File(String.format("%s/%s", db.getParent(), "AndroidAria.db")));
File oldDbFile = context.getDatabasePath(oldDbName);
if (oldDbFile != null && oldDbFile.exists()) {
File dbConfig = new File(String.format("%s/%s", oldDbFile.getParent(), "AriaLyyDb-journal"));
oldDbFile.renameTo(new File(String.format("%s/%s", oldDbFile.getParent(), "AndroidAria.db")));
// 如果数据库是在/data/data/{packagename}/databases/下面journal文件因权限问题将无法删除和重命名
if (dbConfig.exists()) {
dbConfig.delete();

View File

@@ -16,6 +16,7 @@
package com.arialyy.aria.core.download.downloader;
import android.net.TrafficStats;
import android.net.Uri;
import android.os.Process;
import android.text.TextUtils;
import com.arialyy.aria.core.AriaManager;
@@ -284,13 +285,17 @@ public class HttpFileInfoThread implements Runnable {
*/
private void handleUrlReTurn(HttpURLConnection conn, String newUrl) throws IOException {
ALog.d(TAG, "30x跳转新url为【" + newUrl + "");
if (TextUtils.isEmpty(newUrl) || newUrl.equalsIgnoreCase("null") || !newUrl.startsWith(
"http")) {
if (TextUtils.isEmpty(newUrl) || newUrl.equalsIgnoreCase("null")) {
if (onFileInfoCallback != null) {
onFileInfoCallback.onFail(mEntity, new TaskException(TAG, "获取重定向链接失败"), false);
}
return;
}
if (newUrl.startsWith("/")) {
Uri uri = Uri.parse(mEntity.getUrl());
newUrl = uri.getHost() + newUrl;
}
if (!CheckUtil.checkUrlNotThrow(newUrl)) {
failDownload(new TaskException(TAG, "下载失败重定向url错误"), false);
return;

View File

@@ -158,7 +158,6 @@ protected void onCreate(Bundle savedInstanceState) {
## 其他
有任何问题,可以在[issues](https://github.com/AriaLyy/Aria/issues)给我留言反馈。</br>
在提交问题前,希望你已经查看过[wiki](https://aria.laoyuyu.me/aria_doc/)或搜索过[issues](https://github.com/AriaLyy/Aria/issues)。</br>
交流群524329160
***

View File

@@ -43,7 +43,7 @@ task clean(type: Delete) {
ext {
userOrg = 'arialyy'
groupId = 'com.arialyy.aria'
publishVersion = '3.6.5'
publishVersion = '3.6.6_beta_1'
// publishVersion = '1.0.4' //FTP插件
repoName='maven'
desc = 'android 下载框架'