Merge branch 'release' into macgills/2.5-mergeable-to-dev

# Conflicts:
#	app/build.gradle
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/org/kiwix/kiwixmobile/di/modules/NetworkModule.java
#	app/src/main/res/xml/network_security_config.xml
This commit is contained in:
Sean Mac Gillicuddy 2019-06-19 11:55:07 +01:00
commit 5431afa1f7
3 changed files with 26 additions and 12 deletions

View File

@ -189,15 +189,28 @@ def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER') ?: "dev"
ext {
versionMajor = 2
versionMinor = 5
versionPatch = 0
versionPatch = 1
}
private String generateVersionName() {
"${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
}
/*
* max version code: 210-0-00-00-00
* our template : UUU-A-ZZ-YY-XX
* where:
* X = patch version
* Y = minor version
* Z = major version (+ 20 to distinguish from previous, non semantic, versions of the app)
* A = number representing ABI split
* U = unused
*/
private Integer generateVersionCode() {
200000 + (ext.versionMajor * 10000) + (ext.versionMinor * 100) + (ext.versionPatch)
20 * 10000 +
(ext.versionMajor * 10000) +
(ext.versionMinor * 100) +
(ext.versionPatch)
}
android {
@ -263,9 +276,8 @@ android {
// Main build type for debugging
debug {
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
// Needed for instrumentation tests on Pre 5.0
multiDexKeepProguard file("multidex-instrumentation-config.pro")
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://mirror.download.kiwix.org/\""
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "false"
testCoverageEnabled true
}
@ -285,7 +297,8 @@ android {
// Release Type
release {
signingConfig signingConfigs.release
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://mirror.download.kiwix.org/\""
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "true"
}
}
@ -430,13 +443,13 @@ android {
experimental = true
}
def abiCodes = ['arm64-v8a': 5, 'x86': 2, 'x86_64': 3, 'armeabi-v7a': 4]
def abiCodes = ['arm64-v8a': 6, 'x86': 3, 'x86_64': 4, 'armeabi-v7a': 5]
splits {
abi {
enable true
reset()
include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a"
universalApk false
universalApk buildNumber == "dev"
}
}
applicationVariants.all { variant ->

View File

@ -24,6 +24,7 @@
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".splash.SplashActivity"
android:label="@string/app_name"

View File

@ -25,29 +25,29 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Singleton;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import okhttp3.logging.HttpLoggingInterceptor.Level;
import org.kiwix.kiwixmobile.BuildConfig;
import org.kiwix.kiwixmobile.data.remote.KiwixService;
import org.kiwix.kiwixmobile.data.remote.UserAgentInterceptor;
@Module public class NetworkModule {
private static final String KIWIX_DOWNLOAD_URL = BuildConfig.KIWIX_DOWNLOAD_URL;
//"http://download.kiwix.org/";
private final static String userAgent = "kiwix-android-version:" + BuildConfig.VERSION_CODE;
@Provides @Singleton OkHttpClient provideOkHttpClient() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BASIC);
logging.setLevel(BuildConfig.DEBUG ? Level.BODY : Level.BASIC);
return new OkHttpClient().newBuilder().followRedirects(true).followSslRedirects(true)
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.readTimeout(20, TimeUnit.SECONDS)
.addNetworkInterceptor(logging)
.addNetworkInterceptor(new UserAgentInterceptor(userAgent)).build();
}
@Provides @Singleton KiwixService provideKiwixService(OkHttpClient okHttpClient) {
return KiwixService.ServiceCreator.newHacklistService(okHttpClient, KIWIX_DOWNLOAD_URL);
return KiwixService.ServiceCreator.newHacklistService(okHttpClient,
BuildConfig.KIWIX_DOWNLOAD_URL);
}
@Provides @Singleton