Skip to content

Commit

Permalink
Bump to 1311
Browse files Browse the repository at this point in the history
  • Loading branch information
cylonid committed Nov 23, 2022
1 parent 4fd5893 commit cb2cec7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
applicationId "com.cylonid.nativealpha"
minSdkVersion 26
targetSdkVersion 32
versionCode 1310
versionCode 1311
versionName "1.3.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/news/latestUpdate_de.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<main>
<article id="update">
<h1>Aktuelle Neuerungen</h1>
<h3>Version: v1.3.0</h3>
<h3>Version: v1.3.1</h3>
<ul>
<li>Zurück-Verhalten auf div. Webseiten verbessert</li>
<li>Unterstützung für Webseiten mit Google OAuth</li>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/news/latestUpdate_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<main>
<article id="update">
<h1>News</h1>
<h3>Version: v1.3.0</h3>
<h3>Version: v1.3.1</h3>
<ul>
<li>Resolved unusual going back behaviour on certain websites</li>
<li>Added support for Google OAuth-enabled sites</li>
Expand Down
32 changes: 11 additions & 21 deletions app/src/main/java/com/cylonid/nativealpha/model/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.cylonid.nativealpha.R;
import com.cylonid.nativealpha.util.App;
import com.cylonid.nativealpha.util.Const;
import com.cylonid.nativealpha.util.InvalidChecksumException;
import com.cylonid.nativealpha.util.Utility;
import com.google.gson.Gson;
Expand Down Expand Up @@ -101,14 +102,6 @@ public void saveWebAppData() {
editor.apply();
}

public void setDataFormat(int dataFormat) {
getGeneralInfo().edit().putInt(DATA_FORMAT, dataFormat).apply();
}

public int getDataFormat() {
return getGeneralInfo().getInt(DATA_FORMAT, LEGACY_DATA_FORMAT);
}

public boolean getEulaData() {
return getGeneralInfo().getBoolean(EULA_ACCEPTED, false);
}
Expand Down Expand Up @@ -181,6 +174,7 @@ public void loadAppData() {
int oldDataFormat = DataVersionConverter.getDataFormat(json);
String currentDataFormattedJson = this.checkDataFormat(oldDataFormat, json);
settings = gson.fromJson(currentDataFormattedJson, new TypeToken<GlobalSettings>() {}.getType());
assertGlobalWebappData();
if(oldDataFormat != DataVersionConverter.getDataFormat(currentDataFormattedJson)) this.saveGlobalSettings();
}
}
Expand Down Expand Up @@ -336,7 +330,6 @@ private String checkDataFormat(int dataFormat, String jsonInput) {
switch(dataFormat) {
case LEGACY_DATA_FORMAT:
String convertedInput = DataVersionConverter.convertToDataFormat(jsonInput, DataVersionConverter.getLegacyTo1300Map());
this.setDataFormat(1300);
return convertedInput;
default:
case 1300: // Current data format => corresponding to app release version
Expand Down Expand Up @@ -366,19 +359,16 @@ public WebApp getPredecessor(int i) {
}
while (!websites.get(neighbor).isActiveEntry());
return websites.get(neighbor);
}

// if (i != (websites.size() - 1)) {
// return websites.get(i + 1);
// }
// else
// return websites.get(0);

//
// if (i != 0) {
// return websites.get(i - 1);
// }
// else
// return websites.get(websites.size() - 1);
private void assertGlobalWebappData() {
boolean override = settings.getGlobalWebApp().isOverrideGlobalSettings();
int container = settings.getGlobalWebApp().getContainerId();
if(!override || container != Const.NO_CONTAINER) {
settings.getGlobalWebApp().setOverrideGlobalSettings(true);
settings.getGlobalWebApp().setContainerId(Const.NO_CONTAINER);
this.saveGlobalSettings();
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static String convertToDataFormat(String input, Map<String, String> map)
}

public static int getDataFormat(String input) {
if(input.contains(DataVersionConverter.formatAsJsonKey("base_url"))) return 1000;
if(input.contains(DataVersionConverter.formatAsJsonKey("baseUrl"))) return 1300;
if(input.contains(DataVersionConverter.formatAsJsonKey("allow_js"))) return 1000;
if(input.contains(DataVersionConverter.formatAsJsonKey("isAllowJs"))) return 1300;

return 0;
}
Expand Down

0 comments on commit cb2cec7

Please sign in to comment.