Browse Source

Version 1.7.1

master v1.7.1
Ezerous 6 years ago
parent
commit
ff98ad774b
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 8
      app/build.gradle
  2. 18
      app/src/main/java/gr/thmmy/mthmmy/utils/CrashReporter.java
  3. 16
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseHelpers.java
  4. 2
      build.gradle

8
app/build.gradle

@ -13,8 +13,8 @@ android {
applicationId "gr.thmmy.mthmmy" applicationId "gr.thmmy.mthmmy"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 28
versionCode 18 versionCode 19
versionName "1.7.0" versionName "1.7.1"
archivesBaseName = "mTHMMY-v$versionName" archivesBaseName = "mTHMMY-v$versionName"
buildConfigField "String", "CURRENT_BRANCH", "\"" + getCurrentBranch() + "\"" buildConfigField "String", "CURRENT_BRANCH", "\"" + getCurrentBranch() + "\""
buildConfigField "String", "COMMIT_HASH", "\"" + getCommitHash() + "\"" buildConfigField "String", "COMMIT_HASH", "\"" + getCommitHash() + "\""
@ -75,7 +75,7 @@ dependencies {
implementation 'com.google.firebase:firebase-messaging:19.0.1' implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.snatik:storage:2.1.0' implementation 'com.snatik:storage:2.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.14.2' implementation 'com.squareup.okhttp3:okhttp:3.12.0' //TODO: Warning: okhttp has dropped support for Android v.19 since okhttp 3.13!
implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'org.jsoup:jsoup:1.10.3' //TODO: Warning: upgrading from 1.10.3 will break stuff! implementation 'org.jsoup:jsoup:1.10.3' //TODO: Warning: upgrading from 1.10.3 will break stuff!
@ -90,7 +90,7 @@ dependencies {
implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'ru.noties:markwon:2.0.2' implementation 'ru.noties:markwon:2.0.2'
implementation 'net.gotev:uploadservice:3.5.2' implementation 'net.gotev:uploadservice:3.5.2'
implementation 'net.gotev:uploadservice-okhttp:3.5.2' implementation 'net.gotev:uploadservice-okhttp:3.4.2' //TODO: Warning: v.3.5 depends on okhttp 3.13!
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.5' implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.5'
//Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler //Plugin: https://plugins.jetbrains.com/plugin/11249-okhttp-profiler
} }

18
app/src/main/java/gr/thmmy/mthmmy/utils/CrashReporter.java

@ -17,8 +17,8 @@ public class CrashReporter {
public static void reportForumInfo(Document document) { public static void reportForumInfo(Document document) {
ParseHelpers.Theme theme = ParseHelpers.parseTheme(document); ParseHelpers.Theme theme = ParseHelpers.parseTheme(document);
ParseHelpers.Language language = ParseHelpers.Language.getLanguage(document); ParseHelpers.Language language = ParseHelpers.Language.getLanguage(document);
String themeKey = "forum theme", themeValue = null; String themeKey = "forum theme", themeValue;
String languageKey = "forum language", languageValue = null; String languageKey = "forum language", languageValue;
switch (theme) { switch (theme) {
case SCRIBBLES2: case SCRIBBLES2:
themeValue = "Scribbles2"; themeValue = "Scribbles2";
@ -32,18 +32,16 @@ public class CrashReporter {
case HELIOS_MULTI: case HELIOS_MULTI:
themeValue = "Helios_Multi"; themeValue = "Helios_Multi";
break; break;
case THEME_UNKNOWN: default:
themeValue = "Unknown theme"; themeValue = "Unknown theme";
break;
} }
switch (language) {
case GREEK: if (language == ParseHelpers.Language.GREEK)
languageValue = "Greek"; languageValue = "Greek";
break; else if (language == ParseHelpers.Language.ENGLISH)
case ENGLISH:
languageValue = "English"; languageValue = "English";
break; else
} languageValue = "Unknown";
Crashlytics.setString(themeKey, themeValue); Crashlytics.setString(themeKey, themeValue);
Crashlytics.setString(languageKey, languageValue); Crashlytics.setString(languageKey, languageValue);

16
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseHelpers.java

@ -23,7 +23,7 @@ public class ParseHelpers {
/** /**
* An enum describing a forum page's language by defining the types:<ul> * An enum describing a forum page's language by defining the types:<ul>
* <li>{@link #PAGE_INCOMPLETE}</li> * <li>{@link #PAGE_INCOMPLETE}</li>
* <li>{@link #UNDEFINED_LANGUAGE}</li> * <li>{@link #UNKNOWN_LANGUAGE}</li>
* <li>{@link #ENGLISH}</li> * <li>{@link #ENGLISH}</li>
* <li>{@link #GREEK}</li> * <li>{@link #GREEK}</li>
* </ul> * </ul>
@ -42,9 +42,9 @@ public class ParseHelpers {
*/ */
PAGE_INCOMPLETE, PAGE_INCOMPLETE,
/** /**
* Page language is not (yet) supported. * Page language could not be determined/ not (yet) supported.
*/ */
UNDEFINED_LANGUAGE; UNKNOWN_LANGUAGE;
/** /**
* Returns one of the supported forum languages. * Returns one of the supported forum languages.
@ -57,13 +57,12 @@ public class ParseHelpers {
Element welcoming = page.select("h3").first(); Element welcoming = page.select("h3").first();
if (welcoming == null) { if (welcoming == null) {
Element welcomingGuest = page.select("div[id=myuser]").first(); Element welcomingGuest = page.select("div[id=myuser]").first();
if (welcomingGuest != null) { if (welcomingGuest != null && welcomingGuest.text().contains("Welcome"))
if (welcomingGuest.text().contains("Welcome")) return ENGLISH; return ENGLISH;
}
return PAGE_INCOMPLETE; return PAGE_INCOMPLETE;
} else if (welcoming.text().contains("Καλώς ορίσατε")) return GREEK; } else if (welcoming.text().contains("Καλώς ορίσατε")) return GREEK;
else if (welcoming.text().contains("Hey")) return ENGLISH; else if (welcoming.text().contains("Hey")) return ENGLISH;
else return UNDEFINED_LANGUAGE; else return UNKNOWN_LANGUAGE;
} }
} }
@ -77,6 +76,7 @@ public class ParseHelpers {
public static Theme parseTheme(Document page) { public static Theme parseTheme(Document page) {
Element stylesheet = page.select("link[rel=stylesheet]").first(); Element stylesheet = page.select("link[rel=stylesheet]").first();
if(stylesheet!=null){
if (stylesheet.attr("href").contains("scribbles2")) if (stylesheet.attr("href").contains("scribbles2"))
return Theme.SCRIBBLES2; return Theme.SCRIBBLES2;
else if (stylesheet.attr("href").contains("helios_multi")) else if (stylesheet.attr("href").contains("helios_multi"))
@ -85,7 +85,7 @@ public class ParseHelpers {
return Theme.SMFONE_BLUE; return Theme.SMFONE_BLUE;
else if (stylesheet.attr("href").contains("default")) else if (stylesheet.attr("href").contains("default"))
return Theme.SMF_DEFAULT; return Theme.SMF_DEFAULT;
else }
return Theme.THEME_UNKNOWN; return Theme.THEME_UNKNOWN;
} }

2
build.gradle

@ -10,7 +10,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0' classpath 'com.google.gms:google-services:4.3.0'
classpath 'io.fabric.tools:gradle:1.29.0' classpath 'io.fabric.tools:gradle:1.29.0'
classpath 'org.ajoberstar.grgit:grgit-core:3.1.1' // Also change in app/gradle/grgit.gradle classpath 'org.ajoberstar.grgit:grgit-core:3.1.1' // Also change in app/gradle/grgit.gradle
classpath "com.github.ben-manes:gradle-versions-plugin:0.21.0" classpath "com.github.ben-manes:gradle-versions-plugin:0.21.0"

Loading…
Cancel
Save