19 Commits 2074cf0de2 ... 5610d23387

Author SHA1 Message Date
  Fynn Godau 5610d23387 Version 3.1 4 years ago
  Fynn Godau a21a4f2805 Do not crash on old DownloadManager if no notices or news are contained 4 years ago
  Fynn Godau 952d8f6e6f Add gradle wrapper properties file 4 years ago
  Fynn Godau a7123320e2 Bump libraries and gradle version 4 years ago
  Fynn Godau 0ec52ce6ba Fix crash on API 14 4 years ago
  fynngodau cd5dc9496a Merge branch 'mobileapi' of fynngodau/DSBDirect into master 4 years ago
  Fynn Godau 832f35b503 Use Conscrypt to support TLS 1.2 on old devices #17 #82 4 years ago
  Fynn Godau afe98d1ad5 Update privacy information 4 years ago
  Fynn Godau d2785a6d12 Fix runtime crash on API 14 4 years ago
  Fynn Godau dd1946e342 Fix crash when MainActivity is destroyed and options menu is not created 4 years ago
  Fynn Godau 7d7e70debc Store auth token 4 years ago
  Fynn Godau 0f35384090 Add preference to choose endpoint 4 years ago
  Fynn Godau b2a48fc490 Download content in old download manager if it is not loaded yet 4 years ago
  Fynn Godau 4b20921f2a Lazy load notice board 4 years ago
  Fynn Godau aee19f1720 Implement new DSB API 4 years ago
  Fynn Godau da9fe671ce Rename DsbDownloadManager to DsbAppDownloadManager 4 years ago
  Fynn Godau 1c2eebe475 Remove DownloadManagerFactory 4 years ago
  Fynn Godau ff02029fa2 Get DownloadManager from factory class 4 years ago
  Fynn Godau 0a5ac4727b Abstract DownloadManager 4 years ago

+ 2 - 1
.gitignore

@@ -6,7 +6,8 @@ local.properties
 
 # Gradle generated files
 .gradle/
-gradle/
+/gradle/
+/app/gradle/wrapper/gradle-wrapper.jar
 gradlew.bat
 gradlew
 

+ 4 - 18
PRIVACY.md

@@ -6,16 +6,9 @@ Der Entwickler selbst erhält keinerlei Informationen. DSBDirect ist lediglich e
 
 ### DSB-Server, für DSB-Zugriff
 
-Möglicherweise werden bei den DSB-Endpoints die gleichen Daten wie auf der Webseite digitales-schwarzes-brett.de gespeichert. Dort speichert heinekingmedia manche Daten, die nach einer Woche "gelöscht oder verfremdet" werden. Schau dir lieber [das ganze Ding](https://digitales-schwarzes-brett.de/datenschutz.html) anstatt nur diesen Ausschnitt an:
+Die DSBmobile-App beinhaltet eine [Datenschutzerklärung](https://notabug.org/fynngodau/dsbdirect-filedump/raw/master/dsbmobile/datenschutzerklaerung.pdf). Leider erklärt sie nicht, wie Daten verarbeitet werden, die von der Client an den DSB-Server gesendet werden. Auch die Speicherdauer ist nur sehr inkonkret definiert: Daten werden aufbewahrt, bis sie "nicht mehr erforderlich" (`I.8.`) sind.
 
->Folgende Daten werden erhoben:
->
-> 1.  Informationen über den Browsertyp und die verwendete Version
-> 2.  Das Betriebssystem des Nutzers
-> 3.  Den Internet-Service-Provider des Nutzers
-> 4.  Datum und Uhrzeit des Zugriffs
-> 5.  Die IP-Adresse des Nutzers (nur anonymisiert)
-> 6.  Websites, von denen das System des Nutzers auf unsere Internetseite gelangt
+So ist zum Beispiel unklar, ob IP-Adressen gespeichert werden, und wenn ja, ob in Kombination mit dem Zugang, der angefragt wurde.
 
 #### Hinweis
 
@@ -36,16 +29,9 @@ The developer does not receive any information by himself. DSBDirect is simply a
 
 ### DSB servers, for DSB access
 
-Maybe, the same data as on the website digitales-schwarzes-brett.de is collected at the DSB endpoints. On the website, heinekingmedia stores some data, and it is "deleted or alienated" after a week. Excerpt's translation by me. Better check [the full German thing](https://digitales-schwarzes-brett.de/datenschutz.html).
+The DSBmobile application contains a [German privacy policy](https://notabug.org/fynngodau/dsbdirect-filedump/raw/master/dsbmobile/datenschutzerklaerung.pdf). Unfortunately, it does not explain how the DSB server processes data sent by the client. Even the duration that data is stored is not defined concretely: data is stored until it is "no longer required" (translation by me, see `I.8.`).
 
->The following data is collected:
->
-> 1.  Information about browser type and used version
-> 2.  The user's operating system
-> 3.  The user's ISP
-> 4.  Access time and date
-> 5.  User's IP-Address (anonymized only)
-> 6.  Websites from which the user's system reaches our website
+For example, it is unclear whether IP addresses are stored, and if they are, whether they are combined with the board that is accessed.
 
 #### Notice
 

+ 8 - 8
app/build.gradle

@@ -33,7 +33,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.6.0-beta03'
+        classpath 'com.android.tools.build:gradle:3.6.3'
     }
 }
 
@@ -47,8 +47,8 @@ android {
         applicationId "godau.fynn.dsbdirect"
         minSdkVersion 14
         targetSdkVersion 28
-        versionCode 35
-        versionName "3.0.1"
+        versionCode 36
+        versionName "3.1"
         vectorDrawables.useSupportLibrary = true
     }
     buildTypes {
@@ -83,9 +83,9 @@ android {
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
     implementation 'androidx.appcompat:appcompat:1.1.0'
-    implementation 'com.google.android.material:material:1.0.0'
+    implementation 'com.google.android.material:material:1.1.0'
     implementation 'com.wefika:horizontal-picker:1.1.1'
-    implementation 'org.jsoup:jsoup:1.12.1'
+    implementation 'org.jsoup:jsoup:1.12.2'
     implementation 'com.github.mfornos:humanize-slim:1.2.2'
     implementation 'androidx.legacy:legacy-support-v4:1.0.0'
     implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
@@ -97,7 +97,7 @@ dependencies {
     implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     implementation 'com.squareup.picasso:picasso:2.71828'
-    implementation 'androidx.fragment:fragment:1.2.0'
-    implementation 'com.google.android.material:material:1.0.0'
-    implementation 'org.codeberg.fynngodau:librariesDirect:1.0'
+    implementation 'androidx.fragment:fragment:1.2.4'
+    implementation 'org.codeberg.fynngodau:librariesDirect:1.1.1'
+    implementation 'org.conscrypt:conscrypt-android:2.4.0'
 }

+ 6 - 0
app/gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Thu Sep 19 19:16:58 CEST 2019
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME

+ 15 - 0
app/src/main/java/godau/fynn/dsbdirect/AboutLibrariesConfig.java

@@ -37,6 +37,21 @@ public class AboutLibrariesConfig {
                         new Library("HtmlTextView", License.APACHE_20_LICENSE, null, "Dominik Schürmann", "https://github.com/sufficientlysecure/html-textview"),
                         new Library("ShiftColorPicker", License.MIT_LICENSE, "The MIT License (MIT)\n\nCopyright (c) 2015 Bogdasarov Bogdan", "Bogdasarov Bogdan", "https://github.com/DASAR/ShiftColorPicker"),
                         new Library("Picasso", License.APACHE_20_LICENSE, null, "Square, Inc.", "https://square.github.io/picasso/"),
+                        new Library("Conscrypt", License.APACHE_20_LICENSE, "This product contains a modified portion of `Netty`, a configurable network\n" +
+                                "stack in Java, which can be obtained at:\n" +
+                                "\n" +
+                                "  * LICENSE:\n" +
+                                "    * licenses/LICENSE.netty.txt (Apache License 2.0)\n" +
+                                "  * HOMEPAGE:\n" +
+                                "    * http://netty.io/\n" +
+                                "\n" +
+                                "This product contains a modified portion of `Apache Harmony`, modular Java runtime,\n" +
+                                "which can be obtained at:\n" +
+                                "\n" +
+                                "  * LICENSE:\n" +
+                                "    * licenses/LICENSE.harmony.txt (Apache License 2.0)\n" +
+                                "  * HOMEPAGE:\n" +
+                                "    * https://harmony.apache.org/", "The Android Open Source Project", "https://conscrypt.org/"),
                         new Library("librariesDirect", License.CC0_LICENSE, null, "Fynn Godau", "https://codeberg.org/fynngodau/librariesDirect"),
                 }
         );

+ 40 - 6
app/src/main/java/godau/fynn/dsbdirect/Login.java

@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
 public class Login {
 
     private String id, pass;
-    @Nullable private String displayName;
+    @Nullable private String displayName, token;
 
     public Login(String id, String pass) {
         this.id = id;
@@ -40,6 +40,14 @@ public class Login {
             throw new IllegalArgumentException("serialized string does not contain at least one \" / \" divider");
         }
 
+        String[] tokenSplit = split[split.length - 1].split(" \\(");
+
+        split[split.length - 1] = tokenSplit[0];
+
+        if (tokenSplit.length == 2) {
+            token = tokenSplit[1].split("\\)")[0];
+        }
+
         pass = "";
 
         for (String s :
@@ -78,6 +86,7 @@ public class Login {
 
     public void updatePass(Login login) {
         pass = login.pass;
+        token = login.token;
     }
 
     /**
@@ -97,16 +106,41 @@ public class Login {
 
     }
 
+    public String getPass() {
+        return pass;
+    }
+
+    @Nullable
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
     /**
      * Serialize this login to a String
      * @return The login serialized to the format {@code "displayName" id / pass} or {@code id / pass}
      */
     public String serialize() {
-        if (displayName == null) {
-            return id + " / " + pass;
-        } else {
-            return "\"" + displayName + "\" " + id + " / " + pass;
-        }
+
+        StringBuilder builder = new StringBuilder();
+
+        if (displayName != null)
+            builder.append("\"").append(displayName).append("\" ");
+
+        builder.append(id)
+                .append(" / ")
+                .append(pass);
+
+        if (token != null)
+            builder.append(" (")
+            .append(token)
+            .append(")");
+
+        return builder.toString();
+
     }
 
     /**

+ 3 - 3
app/src/main/java/godau/fynn/dsbdirect/NewsQuery.java

@@ -4,13 +4,13 @@ import android.app.Activity;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.SharedPreferences;
-import godau.fynn.dsbdirect.manager.DownloadManager;
+import godau.fynn.dsbdirect.manager.download.DownloadManager;
+import godau.fynn.dsbdirect.manager.download.exception.UnexpectedResponseException;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.io.IOException;
-import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Locale;
 import java.util.Set;
@@ -108,7 +108,7 @@ public class NewsQuery implements Runnable {
             // Show news
             popup(message);
 
-        } catch (JSONException | DownloadManager.UnexpectedResponseException ex) {
+        } catch (JSONException | UnexpectedResponseException ex) {
             popup(context.getString(R.string.news_network_invalid_response));
             ex.printStackTrace();
         } catch (IOException ex) {

+ 1 - 3
app/src/main/java/godau/fynn/dsbdirect/Utility.java

@@ -26,7 +26,6 @@ import android.app.AlertDialog;
 import android.app.job.JobInfo;
 import android.app.job.JobScheduler;
 import android.content.*;
-import android.graphics.Color;
 import android.net.Uri;
 import android.os.Build;
 import androidx.annotation.ColorInt;
@@ -38,13 +37,12 @@ import android.util.Log;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
-import godau.fynn.dsbdirect.manager.DownloadManager;
+import godau.fynn.dsbdirect.manager.download.DownloadManager;
 import godau.fynn.dsbdirect.table.PollingService;
 import godau.fynn.dsbdirect.table.reader.*;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.jsoup.nodes.Element;
-import org.jsoup.select.Elements;
 
 import java.io.IOException;
 import java.text.SimpleDateFormat;

+ 6 - 3
app/src/main/java/godau/fynn/dsbdirect/ZoomImage.java

@@ -47,6 +47,8 @@ public class ZoomImage {
 
     public boolean zoomed = false;
 
+    private View.OnClickListener onClickListener;
+
     public ZoomImage(View thumbView, TouchImageView expandedImageView, View container, String imageUrl) {
         this.thumbView = thumbView;
         this.expandedImageView = expandedImageView;
@@ -166,7 +168,7 @@ public class ZoomImage {
         // to the original bounds and show the thumbnail instead of
         // the expanded image.
         final float startScaleFinal = startScale;
-        expandedImageView.setOnClickListener(new View.OnClickListener() {
+        onClickListener = new View.OnClickListener() {
             @Override
             public void onClick(View view) {
 
@@ -215,12 +217,13 @@ public class ZoomImage {
 
                 zoomed = false;
             }
-        });
+        };
+        expandedImageView.setOnClickListener(onClickListener);
 
     }
 
     public void zoomOut() {
-        expandedImageView.callOnClick();
+        onClickListener.onClick(expandedImageView);
     }
 
 }

+ 0 - 0
app/src/main/java/godau/fynn/dsbdirect/activity/LoginActivity.java


Some files were not shown because too many files changed in this diff