Skip to content

Commit cb2cec7

Browse files
committed
Bump to 1311
1 parent 4fd5893 commit cb2cec7

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747
applicationId "com.cylonid.nativealpha"
4848
minSdkVersion 26
4949
targetSdkVersion 32
50-
versionCode 1310
50+
versionCode 1311
5151
versionName "1.3.1"
5252

5353
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

app/src/main/assets/news/latestUpdate_de.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<main>
2323
<article id="update">
2424
<h1>Aktuelle Neuerungen</h1>
25-
<h3>Version: v1.3.0</h3>
25+
<h3>Version: v1.3.1</h3>
2626
<ul>
2727
<li>Zurück-Verhalten auf div. Webseiten verbessert</li>
2828
<li>Unterstützung für Webseiten mit Google OAuth</li>

app/src/main/assets/news/latestUpdate_en.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<main>
2323
<article id="update">
2424
<h1>News</h1>
25-
<h3>Version: v1.3.0</h3>
25+
<h3>Version: v1.3.1</h3>
2626
<ul>
2727
<li>Resolved unusual going back behaviour on certain websites</li>
2828
<li>Added support for Google OAuth-enabled sites</li>

app/src/main/java/com/cylonid/nativealpha/model/DataManager.java

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.cylonid.nativealpha.R;
1212
import com.cylonid.nativealpha.util.App;
13+
import com.cylonid.nativealpha.util.Const;
1314
import com.cylonid.nativealpha.util.InvalidChecksumException;
1415
import com.cylonid.nativealpha.util.Utility;
1516
import com.google.gson.Gson;
@@ -101,14 +102,6 @@ public void saveWebAppData() {
101102
editor.apply();
102103
}
103104

104-
public void setDataFormat(int dataFormat) {
105-
getGeneralInfo().edit().putInt(DATA_FORMAT, dataFormat).apply();
106-
}
107-
108-
public int getDataFormat() {
109-
return getGeneralInfo().getInt(DATA_FORMAT, LEGACY_DATA_FORMAT);
110-
}
111-
112105
public boolean getEulaData() {
113106
return getGeneralInfo().getBoolean(EULA_ACCEPTED, false);
114107
}
@@ -181,6 +174,7 @@ public void loadAppData() {
181174
int oldDataFormat = DataVersionConverter.getDataFormat(json);
182175
String currentDataFormattedJson = this.checkDataFormat(oldDataFormat, json);
183176
settings = gson.fromJson(currentDataFormattedJson, new TypeToken<GlobalSettings>() {}.getType());
177+
assertGlobalWebappData();
184178
if(oldDataFormat != DataVersionConverter.getDataFormat(currentDataFormattedJson)) this.saveGlobalSettings();
185179
}
186180
}
@@ -336,7 +330,6 @@ private String checkDataFormat(int dataFormat, String jsonInput) {
336330
switch(dataFormat) {
337331
case LEGACY_DATA_FORMAT:
338332
String convertedInput = DataVersionConverter.convertToDataFormat(jsonInput, DataVersionConverter.getLegacyTo1300Map());
339-
this.setDataFormat(1300);
340333
return convertedInput;
341334
default:
342335
case 1300: // Current data format => corresponding to app release version
@@ -366,19 +359,16 @@ public WebApp getPredecessor(int i) {
366359
}
367360
while (!websites.get(neighbor).isActiveEntry());
368361
return websites.get(neighbor);
362+
}
369363

370-
// if (i != (websites.size() - 1)) {
371-
// return websites.get(i + 1);
372-
// }
373-
// else
374-
// return websites.get(0);
375-
376-
//
377-
// if (i != 0) {
378-
// return websites.get(i - 1);
379-
// }
380-
// else
381-
// return websites.get(websites.size() - 1);
364+
private void assertGlobalWebappData() {
365+
boolean override = settings.getGlobalWebApp().isOverrideGlobalSettings();
366+
int container = settings.getGlobalWebApp().getContainerId();
367+
if(!override || container != Const.NO_CONTAINER) {
368+
settings.getGlobalWebApp().setOverrideGlobalSettings(true);
369+
settings.getGlobalWebApp().setContainerId(Const.NO_CONTAINER);
370+
this.saveGlobalSettings();
371+
}
382372
}
383373

384374

app/src/main/java/com/cylonid/nativealpha/model/DataVersionConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static String convertToDataFormat(String input, Map<String, String> map)
1515
}
1616

1717
public static int getDataFormat(String input) {
18-
if(input.contains(DataVersionConverter.formatAsJsonKey("base_url"))) return 1000;
19-
if(input.contains(DataVersionConverter.formatAsJsonKey("baseUrl"))) return 1300;
18+
if(input.contains(DataVersionConverter.formatAsJsonKey("allow_js"))) return 1000;
19+
if(input.contains(DataVersionConverter.formatAsJsonKey("isAllowJs"))) return 1300;
2020

2121
return 0;
2222
}

0 commit comments

Comments
 (0)