Skip to content

Commit 9a262de

Browse files
committed
Signing debug builds
1 parent 157d170 commit 9a262de

9 files changed

Lines changed: 64 additions & 7 deletions

File tree

app/.signing/app-debug.prop

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RELEASE_STORE_FILE=.signing/openvk-debug.jks
2+
RELEASE_STORE_PASSWORD=ovk_debug
3+
RELEASE_KEY_ALIAS=ovk_refresh
4+
RELEASE_KEY_PASSWORD=ovk_debug

app/.signing/app-example.prop

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// APK signing config file example
2+
3+
RELEASE_STORE_FILE=openvk.jks
4+
RELEASE_STORE_PASSWORD=[YOUR_STORE_PASSWORD_HERE]
5+
RELEASE_KEY_ALIAS=[YOUR_ALIAS_HERE]
6+
RELEASE_KEY_PASSWORD=[YOUR_KEY_PASSWORD_HERE]

app/.signing/openvk-debug.jks

2.53 KB
Binary file not shown.

app/build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,39 @@ android {
5050
buildConfigField "String", "GITHUB_COMMIT", "\"${getGitHubCommit()}\""
5151
}
5252
}
53+
54+
signingConfigs {
55+
if (file('.signing/app.prop').exists()) {
56+
release {
57+
Properties props = new Properties();
58+
props.load(new FileInputStream(file(".signing/app.prop")))
59+
storeFile file(props['RELEASE_STORE_FILE'])
60+
storePassword props['RELEASE_STORE_PASSWORD']
61+
keyAlias props['RELEASE_KEY_ALIAS']
62+
keyPassword props['RELEASE_KEY_PASSWORD']
63+
}
64+
}
65+
debug {
66+
if (file('.signing/app-debug.prop').exists()) {
67+
Properties props = new Properties();
68+
props.load(new FileInputStream(file(".signing/app-debug.prop")))
69+
storeFile file(props['RELEASE_STORE_FILE'])
70+
storePassword props['RELEASE_STORE_PASSWORD']
71+
keyAlias props['RELEASE_KEY_ALIAS']
72+
keyPassword props['RELEASE_KEY_PASSWORD']
73+
}
74+
}
75+
}
76+
splits {
77+
abi {
78+
enable true
79+
reset()
80+
universalApk true
81+
}
82+
}
83+
lintOptions {
84+
checkReleaseBuilds false
85+
}
5386
compileOptions {
5487
sourceCompatibility JavaVersion.VERSION_1_8
5588
targetCompatibility JavaVersion.VERSION_1_8

app/src/main/java/uk/openvk/android/refresh/api/wrappers/OvkAPIWrapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,8 @@ public void run() {
12191219
} else if(response_code == 301) {
12201220
sendMessage(HandlerMessages.OVKAPI_OVK_CHECK_HTTPS, response_body);
12211221
}
1222+
httpClient = new OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS)
1223+
.writeTimeout(15, TimeUnit.SECONDS).readTimeout(30, TimeUnit.SECONDS).build();
12221224
} catch (SocketTimeoutException e) {
12231225
if(logging_enabled) Log.e("OpenVK API", String.format("Connection error: %s",
12241226
e.getMessage()));

app/src/main/java/uk/openvk/android/refresh/ui/core/activities/AppActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import uk.openvk.android.refresh.api.Likes;
7575
import uk.openvk.android.refresh.api.Messages;
7676
import uk.openvk.android.refresh.api.Newsfeed;
77+
import uk.openvk.android.refresh.api.Ovk;
7778
import uk.openvk.android.refresh.api.Users;
7879
import uk.openvk.android.refresh.api.Wall;
7980
import uk.openvk.android.refresh.api.enumerations.HandlerMessages;
@@ -834,6 +835,9 @@ private void receiveState(int message, Bundle data) {
834835
mainSettingsFragment.getInstanceInfo("stats", data.getString("response"));
835836
} else if (message == HandlerMessages.OVKAPI_OVK_CHECK_HTTP || message == HandlerMessages.OVKAPI_OVK_CHECK_HTTPS) {
836837
mainSettingsFragment.getInstanceInfo("checkHTTP", data.getString("response"));
838+
Ovk ovk = new Ovk();
839+
ovk.getVersion(ovk_api);
840+
ovk.aboutInstance(ovk_api);
837841
} else if (message == HandlerMessages.OVKAPI_OVK_VERSION) {
838842
mainSettingsFragment.getInstanceInfo("instanceVersion", data.getString("response"));
839843
} else if(message == HandlerMessages.DLM_CONVERSATIONS_AVATARS) {

app/src/main/java/uk/openvk/android/refresh/ui/core/activities/MainSettingsActivity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
6363
super.onCreate(savedInstanceState);
6464
global_prefs = PreferenceManager.getDefaultSharedPreferences(this);
6565
isDarkTheme = global_prefs.getBoolean("dark_theme", false);
66-
Global.setColorTheme(this, global_prefs.getString("theme_color", "blue"), getWindow());
66+
Global.setColorTheme(this, global_prefs.getString("theme_color", "blue"),
67+
getWindow());
6768
Global.setInterfaceFont(this);
6869
instance_prefs = getSharedPreferences("instance", 0);
6970
setContentView(R.layout.intent_view);
@@ -148,7 +149,8 @@ public void switchFragment(String tag) {
148149
ft.hide(Objects.requireNonNull(fm.findFragmentByTag("settings")));
149150
ft.hide(Objects.requireNonNull(fm.findFragmentByTag("personalization")));
150151
ft.hide(Objects.requireNonNull(fm.findFragmentByTag("about_app")));
151-
if(selectedFragment == null) selectedFragment = getSupportFragmentManager().findFragmentByTag("settings");
152+
if(selectedFragment == null) selectedFragment = getSupportFragmentManager()
153+
.findFragmentByTag("settings");
152154
switch (tag) {
153155
case "settings":
154156
ft.hide(selectedFragment);

app/src/main/java/uk/openvk/android/refresh/ui/core/fragments/app/settings/MainSettingsFragment.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ private void showAboutInstanceDialog() {
211211
.setOnClickListener(new View.OnClickListener() {
212212
@Override
213213
public void onClick(View v) {
214-
openWebAddress(String.format("http://%s/about",
214+
openWebAddress(String.format("http://%s/terms",
215215
instance_prefs.getString("server", "")));
216216
}
217217
});
@@ -239,8 +239,6 @@ public void onClick(View v) {
239239
if(requireActivity().getClass().getSimpleName().equals("AppActivity")) {
240240
OvkAPIWrapper ovk_api = ((AppActivity) requireActivity()).ovk_api;
241241
ovk_api.checkHTTPS();
242-
ovk.getVersion(ovk_api);
243-
ovk.aboutInstance(ovk_api);
244242
}
245243
}
246244

app/src/main/res/values/strings.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@
9090
<string name="version_subtitle"><![CDATA[
9191
Version: %s<br>Commit: %s
9292
]]></string>
93-
<string name="app_license_text">This program is free software: you may redistribute and/or modify it under the terms GNU (Affero) General Public License v3.0 (https://www.gnu.org/licenses/agpl.txt) or a later version published by the Free Software Foundation.\n\nWITHOUT ANY WARRANTY, NOT EVEN FOR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.</string>
93+
<string name="app_license_text">This program is free software: you may redistribute and/or
94+
modify it under the terms GNU (Affero) General Public License v3.0
95+
(https://www.gnu.org/licenses/agpl.txt)
96+
or a later version published by the Free Software Foundation.
97+
\n\nWITHOUT ANY WARRANTY, NOT EVEN FOR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
98+
</string>
9499
<string name="source_code_btn">Source code</string>
95100
<string name="enter_msg">Messenger</string>
96101

@@ -150,7 +155,10 @@
150155
<string name="send_msg_btn">Message</string>
151156
<string name="profile_status">Status</string>
152157
<string name="ovk_warning_title">Warning</string>
153-
<string name="ovk_warning"><![CDATA[You have launched a OpenVK Refresh FOSS client that ONLY works with <a href="https://github.com/openvk/openvk">OpenVK</a> instances, an open source network that is not compatible with VKontakte / VK.<br><br>Please log in ONLY to the registered OpenVK account in one of the existing instances.]]></string>
158+
<string name="ovk_warning"><![CDATA[You have launched a OpenVK Refresh FOSS client that
159+
ONLY works with <a href="https://github.com/openvk/openvk">OpenVK</a> instances,
160+
an open source network that is not compatible with VKontakte / VK.<br><br>
161+
Please log in ONLY to the registered OpenVK account in one of the existing instances.]]></string>
154162
<string name="dont_show_warn">Don\'t show again</string>
155163
<string name="photo_title">Photo</string>
156164
<string name="save">Save</string>

0 commit comments

Comments
 (0)