From 9d3113d31c1b6662156cdcb222dc5d8f34d7a1f9 Mon Sep 17 00:00:00 2001 From: Daktak Date: Sun, 22 Oct 2017 03:24:48 +1100 Subject: [PATCH 01/10] Update md5 --- .gitignore | 1 + .idea/.name | 1 - .idea/gradle.xml | 7 +------ .idea/misc.xml | 2 +- .idea/modules.xml | 3 +-- .travis.yml | 2 +- app/build.gradle | 12 ++++++------ app/src/main/java/org/afhdownloader/Download.java | 7 ++++++- .../main/java/org/afhdownloader/PrefsFragment.java | 1 - .../org/afhdownloader/SetPreferenceActivity.java | 1 - .../SwipeDismissListViewTouchListener.java | 1 - .../org/afhdownloader/SwipeDismissTouchListener.java | 2 -- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 14 files changed, 20 insertions(+), 26 deletions(-) delete mode 100644 .idea/.name diff --git a/.gitignore b/.gitignore index c6cbe56..aeebdfb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /local.properties /.idea/workspace.xml /.idea/libraries +/.idea .DS_Store /build /captures diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 317ee41..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -BasketBuild Downloader \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 58992cc..cfe4315 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,12 +12,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 1a3eaff..3d21ecd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/.idea/modules.xml b/.idea/modules.xml index 8f0d555..c3d5942 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,9 +2,8 @@ - + - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 612dd00..82887bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ android: - platform-tools - tools - build-tools-23.0.2 - - android-24 + - android-25 script: - ./gradlew build check diff --git a/app/build.gradle b/app/build.gradle index f303d18..05d6012 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 24 - buildToolsVersion '23.0.2' + compileSdkVersion 25 + buildToolsVersion '25.0.2' defaultConfig { applicationId "org.afhdownloader" minSdkVersion 16 - targetSdkVersion 24 + targetSdkVersion 25 versionCode 10 versionName "0.4.5" } @@ -22,14 +22,14 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:24.0.0' - compile 'com.android.support:design:24.0.0' + compile 'com.android.support:appcompat-v7:25.3.1' + compile 'com.android.support:design:25.3.1' compile 'org.jsoup:jsoup:1.9.1' } android { lintOptions { - disable 'TrustAllX509TrustManager','UnusedResources','GoogleAppIndexingWarning','IconDipSize','IconLocation','IconMissingDensityFolder' + disable 'TrustAllX509TrustManager','UnusedResources','GoogleAppIndexingWarning','IconDipSize','IconLocation','IconMissingDensityFolder','ObsoleteSdkInt' checkReleaseBuilds false } } diff --git a/app/src/main/java/org/afhdownloader/Download.java b/app/src/main/java/org/afhdownloader/Download.java index bb1c026..aeb1d99 100644 --- a/app/src/main/java/org/afhdownloader/Download.java +++ b/app/src/main/java/org/afhdownloader/Download.java @@ -27,6 +27,7 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; +import java.net.URLDecoder; /** @@ -212,9 +213,13 @@ private class dlMd5 extends AsyncTask { protected String doInBackground(String... strings) { try { String aUrl = strings[0]; + String md5_ext = getString(R.string.md5_ext); int slash = aUrl.lastIndexOf("/"); - String filename = aUrl.substring(slash+1)+".md5"; + String filename = aUrl.substring(slash+1); + filename = URLDecoder.decode(filename) + md5_ext; + Log.d(LOGTAG,"Saving File: "+filename); String body = getMD5(getBaseUrl()+"/?"+strings[1]); + Log.d(LOGTAG,"Found MD5: "+body); FileOutputStream fileout=openFileOutput(filename, MODE_PRIVATE); OutputStreamWriter outputWriter=new OutputStreamWriter(fileout); outputWriter.write(body); diff --git a/app/src/main/java/org/afhdownloader/PrefsFragment.java b/app/src/main/java/org/afhdownloader/PrefsFragment.java index d5dc384..42cf986 100644 --- a/app/src/main/java/org/afhdownloader/PrefsFragment.java +++ b/app/src/main/java/org/afhdownloader/PrefsFragment.java @@ -13,7 +13,6 @@ public class PrefsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub super.onCreate(savedInstanceState); // Load the preferences from an XML resource addPreferencesFromResource(R.xml.settings); diff --git a/app/src/main/java/org/afhdownloader/SetPreferenceActivity.java b/app/src/main/java/org/afhdownloader/SetPreferenceActivity.java index 35ff67e..7f47d9f 100644 --- a/app/src/main/java/org/afhdownloader/SetPreferenceActivity.java +++ b/app/src/main/java/org/afhdownloader/SetPreferenceActivity.java @@ -11,7 +11,6 @@ public class SetPreferenceActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); diff --git a/app/src/main/java/org/afhdownloader/SwipeDismissListViewTouchListener.java b/app/src/main/java/org/afhdownloader/SwipeDismissListViewTouchListener.java index 1fad7b9..c9c5c0d 100644 --- a/app/src/main/java/org/afhdownloader/SwipeDismissListViewTouchListener.java +++ b/app/src/main/java/org/afhdownloader/SwipeDismissListViewTouchListener.java @@ -182,7 +182,6 @@ public boolean onTouch(View view, MotionEvent motionEvent) { return false; } - // TODO: ensure this is a finger, and set a flag // Find the child view that was touched (perform a hit test) Rect rect = new Rect(); diff --git a/app/src/main/java/org/afhdownloader/SwipeDismissTouchListener.java b/app/src/main/java/org/afhdownloader/SwipeDismissTouchListener.java index c1edfbc..11ac5ac 100644 --- a/app/src/main/java/org/afhdownloader/SwipeDismissTouchListener.java +++ b/app/src/main/java/org/afhdownloader/SwipeDismissTouchListener.java @@ -131,7 +131,6 @@ public boolean onTouch(View view, MotionEvent motionEvent) { switch (motionEvent.getActionMasked()) { case MotionEvent.ACTION_DOWN: { - // TODO: ensure this is a finger, and set a flag mDownX = motionEvent.getRawX(); mDownY = motionEvent.getRawY(); if (mCallbacks.canDismiss(mToken)) { @@ -244,7 +243,6 @@ public void onAnimationEnd(Animator animation) { if (mSwiping) { mTranslationX = deltaX; mView.setTranslationX(deltaX - mSwipingSlop); - // TODO: use an ease-out interpolator or such mView.setAlpha(Math.max(0f, Math.min(1f, 1f - 2f * Math.abs(deltaX) / mViewWidth))); view.performClick(); diff --git a/build.gradle b/build.gradle index aff4f41..c2eea8e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.android.tools.build:gradle:2.3.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 122a0dc..efa239f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Dec 28 10:00:20 PST 2015 +#Sat Oct 21 22:43:10 AEDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip From 164348229e0c593230e947f00db02cdc0526ff97 Mon Sep 17 00:00:00 2001 From: Daktak Date: Sun, 22 Oct 2017 06:07:43 +1100 Subject: [PATCH 02/10] md5 update --- app/src/main/java/org/afhdownloader/Download.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/org/afhdownloader/Download.java b/app/src/main/java/org/afhdownloader/Download.java index aeb1d99..d089572 100644 --- a/app/src/main/java/org/afhdownloader/Download.java +++ b/app/src/main/java/org/afhdownloader/Download.java @@ -138,11 +138,7 @@ public String getMD5(String url) { Log.d(LOGTAG, "md5 url: "+url); String userAgent = getString(R.string.user_agent); Document doc = Jsoup.connect(url).timeout(10 * 1000).followRedirects(true).userAgent(userAgent).get(); - /* - SharedPreferences mySharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); - String select_md5 = mySharedPreferences.getString("prefSelector",getString(R.string.md5_sel_val)).trim(); - */ - String select_md5 = "span:has(span:containsOwn(md5))"; + String select_md5 = getString(R.string.md5_sel_val); Log.d(LOGTAG, "md5 selector: "+select_md5); Elements md5s = doc.select(select_md5); for (Element md5 : md5s) { From 1fbd256557bf4dcb1d6a2b90a4aae2a6f5a07630 Mon Sep 17 00:00:00 2001 From: Daktak Date: Sun, 22 Oct 2017 06:55:53 +1100 Subject: [PATCH 03/10] travis --- .travis.yml | 2 +- app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82887bf..5486f0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ android: - tools - platform-tools - tools - - build-tools-23.0.2 + - build-tools-23.0.3 - android-25 script: - ./gradlew build check diff --git a/app/build.gradle b/app/build.gradle index 05d6012..e048020 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion '25.0.2' + buildToolsVersion '25.0.3' defaultConfig { applicationId "org.afhdownloader" From 8a9d6517592977a8b842a3163a612a7515a91f79 Mon Sep 17 00:00:00 2001 From: Daktak Date: Sun, 22 Oct 2017 07:02:52 +1100 Subject: [PATCH 04/10] gradle ver --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index e048020..4c61739 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion '25.0.3' + buildToolsVersion '23.0.3' defaultConfig { applicationId "org.afhdownloader" From ea912c9865cb4294091810e5b93fb79b5d31a0e1 Mon Sep 17 00:00:00 2001 From: Daktak Date: Sun, 22 Oct 2017 07:12:22 +1100 Subject: [PATCH 05/10] travis --- .travis.yml | 2 +- app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5486f0c..3d98fa5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ android: - tools - platform-tools - tools - - build-tools-23.0.3 + - build-tools-25.0.2 - android-25 script: - ./gradlew build check diff --git a/app/build.gradle b/app/build.gradle index 4c61739..05d6012 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion '23.0.3' + buildToolsVersion '25.0.2' defaultConfig { applicationId "org.afhdownloader" From c10b9e46492815c04a52dae5156808871c69f0b2 Mon Sep 17 00:00:00 2001 From: daktak Date: Sat, 28 Apr 2018 09:17:53 +1000 Subject: [PATCH 06/10] Add refresh --- app/build.gradle | 4 ++-- app/src/main/java/org/afhdownloader/MainActivity.java | 3 +++ app/src/main/res/menu/menu_main.xml | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 05d6012..cb8ddb9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "org.afhdownloader" minSdkVersion 16 targetSdkVersion 25 - versionCode 10 - versionName "0.4.5" + versionCode 11 + versionName "0.4.6" } buildTypes { release { diff --git a/app/src/main/java/org/afhdownloader/MainActivity.java b/app/src/main/java/org/afhdownloader/MainActivity.java index 9729ae1..21ed99c 100644 --- a/app/src/main/java/org/afhdownloader/MainActivity.java +++ b/app/src/main/java/org/afhdownloader/MainActivity.java @@ -210,6 +210,9 @@ public boolean onOptionsItemSelected(MenuItem item) { setAlarm(this); return true; } + if (id == R.id.action_refresh) { + run(this); + } if (id == R.id.action_reboot) { ExecuteAsRootBase e = new ExecuteAsRootBase() { @Override diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index a271153..a59ae9a 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -7,9 +7,14 @@ android:orderInCategory="100" android:title="@string/action_settings" app:showAsAction="never" /> + From 227dd4cb73a6243456958683bb942d55e2f45a7d Mon Sep 17 00:00:00 2001 From: daktak Date: Sat, 28 Apr 2018 09:23:20 +1000 Subject: [PATCH 07/10] [#21] remove www from base url --- app/src/main/res/values/donottranslate.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 2cd0e00..bf5d159 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -5,7 +5,7 @@ submit=submit&action=getdownloadmirrors& div[class=file-name] > h3 > a[href^=/?fid=] span:has(span:containsOwn(md5)) - https://www.androidfilehost.com + https://androidfilehost.com 39788 3 0 From 03c64ea42ed31fe82046d60f39a44b672cf01a8b Mon Sep 17 00:00:00 2001 From: daktak Date: Sat, 28 Apr 2018 09:29:16 +1000 Subject: [PATCH 08/10] Refresh string --- app/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ca216db..e233571 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -38,5 +38,6 @@ Yes No Delete + Refresh From 751b3331359690511961752906847fd50fcb70ee Mon Sep 17 00:00:00 2001 From: Daktak Date: Sat, 28 Apr 2018 09:47:00 +1000 Subject: [PATCH 09/10] gradle fix --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cb8ddb9..8d276f7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion '25.0.2' + buildToolsVersion '25.0.3' defaultConfig { applicationId "org.afhdownloader" @@ -29,7 +29,7 @@ dependencies { android { lintOptions { - disable 'TrustAllX509TrustManager','UnusedResources','GoogleAppIndexingWarning','IconDipSize','IconLocation','IconMissingDensityFolder','ObsoleteSdkInt' + disable 'TrustAllX509TrustManager','UnusedResources','GoogleAppIndexingWarning','IconDipSize','IconLocation','IconMissingDensityFolder','ObsoleteSdkInt','MissingTranslation' checkReleaseBuilds false } } From bbcf728963835766e4c5298cdf842ec50ce43f36 Mon Sep 17 00:00:00 2001 From: Daktak Date: Sat, 28 Apr 2018 09:52:35 +1000 Subject: [PATCH 10/10] travis update --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d98fa5..692185c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ android: - tools - platform-tools - tools - - build-tools-25.0.2 + - build-tools-25.0.3 - android-25 script: - ./gradlew build check