mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -04:00
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:
commit
5431afa1f7
@ -189,15 +189,28 @@ def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER') ?: "dev"
|
|||||||
ext {
|
ext {
|
||||||
versionMajor = 2
|
versionMajor = 2
|
||||||
versionMinor = 5
|
versionMinor = 5
|
||||||
versionPatch = 0
|
versionPatch = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateVersionName() {
|
private String generateVersionName() {
|
||||||
"${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
"${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() {
|
private Integer generateVersionCode() {
|
||||||
200000 + (ext.versionMajor * 10000) + (ext.versionMinor * 100) + (ext.versionPatch)
|
20 * 10000 +
|
||||||
|
(ext.versionMajor * 10000) +
|
||||||
|
(ext.versionMinor * 100) +
|
||||||
|
(ext.versionPatch)
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@ -263,9 +276,8 @@ android {
|
|||||||
|
|
||||||
// Main build type for debugging
|
// Main build type for debugging
|
||||||
debug {
|
debug {
|
||||||
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
|
||||||
// Needed for instrumentation tests on Pre 5.0
|
|
||||||
multiDexKeepProguard file("multidex-instrumentation-config.pro")
|
multiDexKeepProguard file("multidex-instrumentation-config.pro")
|
||||||
|
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://mirror.download.kiwix.org/\""
|
||||||
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "false"
|
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "false"
|
||||||
testCoverageEnabled true
|
testCoverageEnabled true
|
||||||
}
|
}
|
||||||
@ -285,7 +297,8 @@ android {
|
|||||||
// Release Type
|
// Release Type
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.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
|
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 {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
enable true
|
enable true
|
||||||
reset()
|
reset()
|
||||||
include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a"
|
include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a"
|
||||||
universalApk false
|
universalApk buildNumber == "dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".splash.SplashActivity"
|
android:name=".splash.SplashActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
@ -25,29 +25,29 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.logging.HttpLoggingInterceptor;
|
import okhttp3.logging.HttpLoggingInterceptor;
|
||||||
|
import okhttp3.logging.HttpLoggingInterceptor.Level;
|
||||||
import org.kiwix.kiwixmobile.BuildConfig;
|
import org.kiwix.kiwixmobile.BuildConfig;
|
||||||
import org.kiwix.kiwixmobile.data.remote.KiwixService;
|
import org.kiwix.kiwixmobile.data.remote.KiwixService;
|
||||||
import org.kiwix.kiwixmobile.data.remote.UserAgentInterceptor;
|
import org.kiwix.kiwixmobile.data.remote.UserAgentInterceptor;
|
||||||
|
|
||||||
@Module public class NetworkModule {
|
@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;
|
private final static String userAgent = "kiwix-android-version:" + BuildConfig.VERSION_CODE;
|
||||||
|
|
||||||
@Provides @Singleton OkHttpClient provideOkHttpClient() {
|
@Provides @Singleton OkHttpClient provideOkHttpClient() {
|
||||||
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
|
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)
|
return new OkHttpClient().newBuilder().followRedirects(true).followSslRedirects(true)
|
||||||
.connectTimeout(10, TimeUnit.SECONDS)
|
.connectTimeout(10, TimeUnit.SECONDS)
|
||||||
.readTimeout(10, TimeUnit.SECONDS)
|
.readTimeout(20, TimeUnit.SECONDS)
|
||||||
.addNetworkInterceptor(logging)
|
.addNetworkInterceptor(logging)
|
||||||
.addNetworkInterceptor(new UserAgentInterceptor(userAgent)).build();
|
.addNetworkInterceptor(new UserAgentInterceptor(userAgent)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides @Singleton KiwixService provideKiwixService(OkHttpClient okHttpClient) {
|
@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
|
@Provides @Singleton
|
||||||
|
Loading…
x
Reference in New Issue
Block a user