Merge branch 'macgills/2.5-kotlin' into macgills/2.5-mergeable-to-dev
# Conflicts: # .travis.yml # app/build.gradle # app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/di/components/TestComponent.java # app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/di/modules/TestJNIModule.java # app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/tests/DownloadTest.java # app/src/androidTestKiwix/java/org/kiwix/kiwixmobile/tests/NetworkTest.java # app/src/main/AndroidManifest.xml # build.gradle
77
.travis.yml
@ -4,19 +4,90 @@ jdk: oraclejdk8
|
|||||||
|
|
||||||
sudo: required
|
sudo: required
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- ANDROID_TARGET=android-22
|
||||||
|
- ANDROID_ABI=armeabi-v7a
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- openssl aes-256-cbc -K $encrypted_82adfa9c3806_key -iv $encrypted_82adfa9c3806_iv -in secrets.tar.enc -out secrets.tar -d
|
||||||
|
- tar xvf secrets.tar
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install --user 'requests[security]'
|
- pip install --user 'requests[security]'
|
||||||
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true
|
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- lynx
|
||||||
|
|
||||||
|
before_cache:
|
||||||
|
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||||
|
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "$HOME/.gradle/caches/"
|
||||||
|
- "$HOME/.gradle/wrapper/"
|
||||||
|
- "$HOME/.android/build-cache"
|
||||||
|
|
||||||
android:
|
android:
|
||||||
components:
|
components:
|
||||||
- tools
|
- tools
|
||||||
- platform-tools
|
- platform-tools
|
||||||
- tools
|
|
||||||
- build-tools-28.0.3
|
- build-tools-28.0.3
|
||||||
- android-28
|
- android-28
|
||||||
|
- extra-android-m2repository
|
||||||
|
- $ANDROID_TARGET
|
||||||
|
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
|
||||||
|
|
||||||
licenses:
|
licenses:
|
||||||
- '.+'
|
- ".+"
|
||||||
|
|
||||||
script: ./gradlew assembleKiwixRelease kiwixtestUploadKiwix && ./testdroid.py
|
script:
|
||||||
|
- ./gradlew lintKiwixDebug jacocoTestKiwixDebugUnitTestReport
|
||||||
|
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
|
||||||
|
- emulator -avd test -no-window &
|
||||||
|
- android-wait-for-emulator
|
||||||
|
- adb shell setprop dalvik.vm.dexopt-flags v=n,o=v
|
||||||
|
- adb shell input keyevent 82 & # unlock screen by pressing menu button
|
||||||
|
- adb -e logcat *:D > logcat.log &
|
||||||
|
- ./gradlew createKiwixDebugCoverageReport
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
- ./gradlew kiwixtestUploadKiwix
|
||||||
|
|
||||||
|
after_failure:
|
||||||
|
- export LOG_DIR = ${TRAVIS_HOME}/build/kiwix/kiwix-android/app/build/outputs/reports/androidTests/connected/flavors/KIWIX/
|
||||||
|
- lynx --dump ${LOG_DIR}com.android.builder.testing.ConnectedDevice.html
|
||||||
|
- lynx --dump ${LOG_DIR}com.android.builder.testing.html
|
||||||
|
- lynx --dump ${LOG_DIR}org.kiwix.kiwixmobile.tests.BasicTest.html;
|
||||||
|
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb
|
||||||
|
|
||||||
|
before_deploy:
|
||||||
|
- export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt)
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
|
||||||
|
#publish on github releases
|
||||||
|
- provider: releases
|
||||||
|
api_key: "$GITHUB_TOKEN"
|
||||||
|
file: app/build/outputs/apk/kiwix/release/*
|
||||||
|
file_glob: true
|
||||||
|
skip_cleanup: true
|
||||||
|
overwrite: true
|
||||||
|
body: "$APP_CHANGELOG"
|
||||||
|
draft: true
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
condition: $TRAVIS_BRANCH =~ ^release|master
|
||||||
|
|
||||||
|
#publish on play store
|
||||||
|
- provider: script
|
||||||
|
skip_cleanup: true
|
||||||
|
script: ./gradlew publishKiwixRelease
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
condition: $TRAVIS_BRANCH =~ ^release|master
|
||||||
|
@ -9,6 +9,7 @@ Kiwix is an offline reader for Web content. One of its main purposes is to make
|
|||||||
|
|
||||||
[](https://travis-ci.org/kiwix/kiwix-android)
|
[](https://travis-ci.org/kiwix/kiwix-android)
|
||||||
[](http://chat.kiwix.org)
|
[](http://chat.kiwix.org)
|
||||||
|
[](https://codecov.io/gh/kiwix/kiwix-android)
|
||||||
---
|
---
|
||||||
|
|
||||||
## Build Instructions
|
## Build Instructions
|
||||||
|
111
app/build.gradle
@ -1,4 +1,5 @@
|
|||||||
import com.android.annotations.NonNull
|
import com.android.annotations.NonNull
|
||||||
|
import com.android.build.OutputFile
|
||||||
import com.android.builder.testing.api.TestServer
|
import com.android.builder.testing.api.TestServer
|
||||||
import com.testdroid.api.APIClient
|
import com.testdroid.api.APIClient
|
||||||
import com.testdroid.api.APIKeyClient
|
import com.testdroid.api.APIKeyClient
|
||||||
@ -25,11 +26,13 @@ buildscript {
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("checkstyle")
|
id("checkstyle")
|
||||||
|
id("com.github.triplet.play") version("2.2.1")
|
||||||
}
|
}
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
apply plugin: 'io.objectbox'
|
apply plugin: 'io.objectbox'
|
||||||
|
apply plugin: 'jacoco-android'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
@ -40,14 +43,14 @@ repositories {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] archs = ["arm64-v8a", "armeabi", "mips", "mips64", "x86", "x86_64"]
|
String[] archs = ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// use jdk8 java.time backport, as long app < Build.VERSION_CODES.O
|
// use jdk8 java.time backport, as long app < Build.VERSION_CODES.O
|
||||||
implementation("com.jakewharton.threetenabp:threetenabp:1.1.1")
|
implementation("com.jakewharton.threetenabp:threetenabp:1.1.1")
|
||||||
// Get kiwixlib online if it is not populated locally
|
// Get kiwixlib online if it is not populated locally
|
||||||
if (file("../kiwixlib/src/main").list().length == 1) {
|
if (file("../kiwixlib/src/main").list().length == 1) {
|
||||||
implementation "org.kiwix.kiwixlib:kiwixlib:1.0.11"
|
implementation 'org.kiwix.kiwixlib:kiwixlib:1.0.12'
|
||||||
} else {
|
} else {
|
||||||
implementation project(":kiwixlib")
|
implementation project(":kiwixlib")
|
||||||
archs = file("../kiwixlib/src/main/jniLibs").list()
|
archs = file("../kiwixlib/src/main/jniLibs").list()
|
||||||
@ -167,14 +170,43 @@ if (custom.listFiles()) {
|
|||||||
custom.eachFile() { file ->
|
custom.eachFile() { file ->
|
||||||
|
|
||||||
def fileName = file.getName()
|
def fileName = file.getName()
|
||||||
if (fileName.startsWith(".") || fileName.contains("test") ||
|
if (fileName.startsWith(".") ||
|
||||||
fileName == "main" || fileName.contains("Test")) {
|
fileName.contains("test") ||
|
||||||
|
fileName == "main" ||
|
||||||
|
fileName.contains("Test")) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
map.put(fileName, file.getAbsolutePath())
|
map.put(fileName, file.getAbsolutePath())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jacoco {
|
||||||
|
toolVersion = "0.8.3"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(Test) {
|
||||||
|
jacoco.includeNoLocationClasses = true
|
||||||
|
}
|
||||||
|
|
||||||
|
def branchName = System.getenv('TRAVIS_PULL_REQUEST') ?: "false" == "false"
|
||||||
|
? System.getenv('TRAVIS_BRANCH') ?: "local"
|
||||||
|
: System.getenv('TRAVIS_PULL_REQUEST_BRANCH')
|
||||||
|
def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER') ?: "dev"
|
||||||
|
|
||||||
|
ext {
|
||||||
|
versionMajor = 2
|
||||||
|
versionMinor = 5
|
||||||
|
versionPatch = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
private String generateVersionName() {
|
||||||
|
"${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
||||||
|
}
|
||||||
|
|
||||||
|
private Integer generateVersionCode() {
|
||||||
|
200000 + (ext.versionMajor * 10000) + (ext.versionMinor * 100) + (ext.versionPatch)
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
testServer new TestDroidUpload()
|
testServer new TestDroidUpload()
|
||||||
@ -187,6 +219,7 @@ android {
|
|||||||
testInstrumentationRunnerArguments.notClass = "com.android.dex.DexIndexOverflowException"
|
testInstrumentationRunnerArguments.notClass = "com.android.dex.DexIndexOverflowException"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
archivesBaseName = "${branchName.replace('/', '-')}-$buildNumber"
|
||||||
}
|
}
|
||||||
|
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
@ -210,18 +243,38 @@ android {
|
|||||||
warning "InvalidPackage"
|
warning "InvalidPackage"
|
||||||
warning "StringFormatInvalid"
|
warning "StringFormatInvalid"
|
||||||
}
|
}
|
||||||
|
testOptions {
|
||||||
|
unitTests.returnDefaultValues = true
|
||||||
|
unitTests.all {
|
||||||
|
useJUnitPlatform()
|
||||||
|
testLogging {
|
||||||
|
events "passed", "skipped", "failed", "standardOut", "standardError"
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
showStandardStreams = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile file("../kiwix-android.keystore")
|
||||||
|
storePassword System.getenv("KEY_STORE_PASSWORD") ?: "000000"
|
||||||
|
keyAlias System.getenv("KEY_ALIAS") ?: "keystore"
|
||||||
|
keyPassword System.getenv("KEY_PASSWORD") ?: "000000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
||||||
// Main build type for debugging
|
// Main build type for debugging
|
||||||
debug {
|
debug {
|
||||||
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
||||||
// True breaks local variables being shown in breakpoints
|
|
||||||
testCoverageEnabled false
|
|
||||||
// Needed for instrumentation tests on Pre 5.0
|
// Needed for instrumentation tests on Pre 5.0
|
||||||
multiDexKeepProguard file("multidex-instrumentation-config.pro")
|
multiDexKeepProguard file("multidex-instrumentation-config.pro")
|
||||||
|
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "false"
|
||||||
|
testCoverageEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
mock_network {
|
mock_network {
|
||||||
@ -236,15 +289,9 @@ android {
|
|||||||
matchingFallbacks = ["debug", "release"]
|
matchingFallbacks = ["debug", "release"]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used to assess code coverage
|
|
||||||
coverage {
|
|
||||||
initWith debug
|
|
||||||
testCoverageEnabled true
|
|
||||||
matchingFallbacks = ["debug", "release"]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release Type
|
// Release Type
|
||||||
release {
|
release {
|
||||||
|
signingConfig signingConfigs.release
|
||||||
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,18 +313,22 @@ android {
|
|||||||
def version_code = project.property("version_code")
|
def version_code = project.property("version_code")
|
||||||
versionCode version_code.toInteger()
|
versionCode version_code.toInteger()
|
||||||
} else {
|
} else {
|
||||||
versionCode 56
|
versionCode generateVersionCode()
|
||||||
}
|
}
|
||||||
if (project.hasProperty("version_name")) {
|
if (project.hasProperty("version_name")) {
|
||||||
versionName project.property("version_name")
|
versionName project.property("version_name")
|
||||||
} else {
|
} else {
|
||||||
versionName "2.5"
|
versionName generateVersionName()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom apps built from a json file, zim file and icon set
|
// Custom apps built from a json file, zim file and icon set
|
||||||
map.each { name, directory ->
|
map.each { name, directory ->
|
||||||
"$name" {
|
"$name" {
|
||||||
println "Configuring $name"
|
println "Configuring $name"
|
||||||
|
if (name == "kiwix") {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (file(directory + "/build.gradle").exists()) {
|
if (file(directory + "/build.gradle").exists()) {
|
||||||
apply from: directory + "/build.gradle"
|
apply from: directory + "/build.gradle"
|
||||||
}
|
}
|
||||||
@ -339,8 +390,8 @@ android {
|
|||||||
buildConfigField "int", "CONTENT_VERSION_CODE", "$content_version_code"
|
buildConfigField "int", "CONTENT_VERSION_CODE", "$content_version_code"
|
||||||
} else if (parsedJson.content_version_code != null) {
|
} else if (parsedJson.content_version_code != null) {
|
||||||
buildConfigField "int", "CONTENT_VERSION_CODE", "$parsedJson.content_version_code"
|
buildConfigField "int", "CONTENT_VERSION_CODE", "$parsedJson.content_version_code"
|
||||||
} else if (project.hasProperty("version_code")) {
|
} else if (project.hasProperty('version_code')) {
|
||||||
def version_code = project.property("version_code")
|
def version_code = project.property('version_code')
|
||||||
buildConfigField "int", "CONTENT_VERSION_CODE", "$version_code"
|
buildConfigField "int", "CONTENT_VERSION_CODE", "$version_code"
|
||||||
} else if (parsedJson.version_code != null) {
|
} else if (parsedJson.version_code != null) {
|
||||||
buildConfigField "int", "CONTENT_VERSION_CODE", "$parsedJson.version_code"
|
buildConfigField "int", "CONTENT_VERSION_CODE", "$parsedJson.version_code"
|
||||||
@ -385,9 +436,31 @@ android {
|
|||||||
androidExtensions {
|
androidExtensions {
|
||||||
experimental = true
|
experimental = true
|
||||||
}
|
}
|
||||||
testOptions {
|
|
||||||
unitTests.returnDefaultValues = true
|
def abiCodes = ['arm64-v8a': 1, 'x86': 2, 'x86_64': 3, 'armeabi-v7a': 4]
|
||||||
|
splits {
|
||||||
|
abi {
|
||||||
|
enable true
|
||||||
|
reset()
|
||||||
|
include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a"
|
||||||
|
universalApk true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def baseAbiVersionCode = abiCodes.get(output.getFilter(OutputFile.ABI))
|
||||||
|
if (baseAbiVersionCode != null) {
|
||||||
|
output.versionCodeOverride = baseAbiVersionCode * 1000000 + variant.versionCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
play {
|
||||||
|
enabled = branchName == "master" || branchName == "release"
|
||||||
|
serviceAccountCredentials = file("../google.json")
|
||||||
|
track = "alpha"
|
||||||
|
resolutionStrategy = "fail"
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestDroidUpload extends TestServer {
|
class TestDroidUpload extends TestServer {
|
||||||
|
@ -57,6 +57,7 @@ import static org.kiwix.kiwixmobile.testutils.TestUtils.getResourceString;
|
|||||||
import static org.kiwix.kiwixmobile.testutils.TestUtils.withContent;
|
import static org.kiwix.kiwixmobile.testutils.TestUtils.withContent;
|
||||||
import static org.kiwix.kiwixmobile.utils.StandardActions.deleteZimIfExists;
|
import static org.kiwix.kiwixmobile.utils.StandardActions.deleteZimIfExists;
|
||||||
|
|
||||||
|
|
||||||
@LargeTest
|
@LargeTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class DownloadTest {
|
public class DownloadTest {
|
||||||
@ -84,6 +85,7 @@ public class DownloadTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore("Broken in 2.5")//TODO: Fix in 3.0
|
||||||
public void downloadTest() {
|
public void downloadTest() {
|
||||||
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
|
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
|
||||||
BaristaMenuClickInteractions.clickMenu(getResourceString(R.string.menu_zim_manager));
|
BaristaMenuClickInteractions.clickMenu(getResourceString(R.string.menu_zim_manager));
|
||||||
|
@ -28,6 +28,10 @@ import com.schibsted.spain.barista.interaction.BaristaMenuClickInteractions;
|
|||||||
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
|
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import okhttp3.mockwebserver.MockResponse;
|
import okhttp3.mockwebserver.MockResponse;
|
||||||
@ -36,6 +40,7 @@ import okio.Buffer;
|
|||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.kiwix.kiwixmobile.KiwixApplication;
|
import org.kiwix.kiwixmobile.KiwixApplication;
|
||||||
@ -45,6 +50,7 @@ import org.kiwix.kiwixmobile.di.components.DaggerTestComponent;
|
|||||||
import org.kiwix.kiwixmobile.di.components.TestComponent;
|
import org.kiwix.kiwixmobile.di.components.TestComponent;
|
||||||
import org.kiwix.kiwixmobile.main.MainActivity;
|
import org.kiwix.kiwixmobile.main.MainActivity;
|
||||||
import org.kiwix.kiwixmobile.testutils.TestUtils;
|
import org.kiwix.kiwixmobile.testutils.TestUtils;
|
||||||
|
import org.kiwix.kiwixmobile.utils.IOUtils;
|
||||||
import org.kiwix.kiwixmobile.utils.KiwixIdlingResource;
|
import org.kiwix.kiwixmobile.utils.KiwixIdlingResource;
|
||||||
|
|
||||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||||
@ -90,9 +96,8 @@ public class NetworkTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
|
||||||
TestComponent component = DaggerTestComponent.builder()
|
TestComponent component = DaggerTestComponent.builder().context(
|
||||||
.context(getInstrumentation().getTargetContext().getApplicationContext())
|
getInstrumentation().getTargetContext().getApplicationContext()).build();
|
||||||
.build();
|
|
||||||
|
|
||||||
KiwixApplication.setApplicationComponent(component);
|
KiwixApplication.setApplicationComponent(component);
|
||||||
|
|
||||||
@ -118,6 +123,7 @@ public class NetworkTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore("Broken in 2.5")//TODO: Fix in 3.0
|
||||||
public void networkTest() {
|
public void networkTest() {
|
||||||
|
|
||||||
mActivityTestRule.launchActivity(null);
|
mActivityTestRule.launchActivity(null);
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
package org.kiwix.kiwixmobile.utils;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Kiwix Android
|
||||||
|
* Copyright (C) 2018 Kiwix <android.kiwix.org>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
public class IOUtils {
|
||||||
|
private IOUtils() {
|
||||||
|
//utility class
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
|
||||||
|
private static final int EOF = -1;
|
||||||
|
|
||||||
|
public static byte[] toByteArray(final InputStream input) throws IOException {
|
||||||
|
try (final ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
||||||
|
copy(input, output);
|
||||||
|
return output.toByteArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static int copy(final InputStream input, final OutputStream output) throws IOException {
|
||||||
|
final long count = copyLarge(input, output);
|
||||||
|
if (count > Integer.MAX_VALUE) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return (int) count;
|
||||||
|
|
||||||
|
}
|
||||||
|
private static long copyLarge(final InputStream input, final OutputStream output) throws IOException {
|
||||||
|
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
|
||||||
|
long count = 0;
|
||||||
|
int n;
|
||||||
|
while (EOF != (n = input.read(buffer))) {
|
||||||
|
output.write(buffer, 0, n);
|
||||||
|
count += n;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
}
|
1
app/src/kiwix/play/contact-email.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
contact+android@kiwix.org
|
1
app/src/kiwix/play/contact-website.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
http://www.kiwix.org
|
1
app/src/kiwix/play/default-language.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
en-US
|
9
app/src/kiwix/play/listings/de-DE/full-description.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Die ganze Wikipedia auf deinem Mobilgerät!
|
||||||
|
|
||||||
|
Kiwix ist eine Programm, daß das Lesen der Wikipedia und anderer Inhalte (Ubuntu Dokumentation, WikiLeaks, WikiVoyage, WikiSource, etc) ohne Internetverbindung erlaubt.
|
||||||
|
|
||||||
|
Sobald du die Inhaltsdateien heruntergeladen hast, die sehr groß sein können, benötigst du keine Internetverbindung um sie zu verwenden.
|
||||||
|
|
||||||
|
Siehe die Hilfe in der App und unsere Webseite für Informationen über verfügbare Inhalte.
|
||||||
|
|
||||||
|
Anmerkung: Kiwix existiert auch für PCs (Windows, Mac, Linux) verfügbar..
|
1
app/src/kiwix/play/listings/de-DE/short-description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Die Wikipedia immer dabei; ohne Internetverbindung!
|
1
app/src/kiwix/play/listings/de-DE/title.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Kiwix, Wikipedia offline
|
7
app/src/kiwix/play/listings/en-US/full-description.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
The whole of Wikipedia on your device!
|
||||||
|
|
||||||
|
The app is a lightweight piece of software reading bigger files stored on your device or SD card: once it is installed, you can select which additional content you would like to download (Wikipedia, Wiktionary, TED talks, etc.) and be ready for when your internet connexion is bad (or need to be in airplane mode)!
|
||||||
|
|
||||||
|
Please read the instructions inside the App or on the website (www.kiwix.org) to learn about the various contents that are available for download.
|
||||||
|
|
||||||
|
Note: Kiwix is also available on regular computers (Windows, Mac, Linux).
|
After Width: | Height: | Size: 253 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 522 KiB |
After Width: | Height: | Size: 491 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 212 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 491 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 145 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 323 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 491 KiB |
After Width: | Height: | Size: 522 KiB |
After Width: | Height: | Size: 68 KiB |
1
app/src/kiwix/play/listings/en-US/short-description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Wikipedia (and a lot more) at hand everywhere. No internet required!
|
1
app/src/kiwix/play/listings/en-US/title.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Kiwix, Wikipedia offline
|
11
app/src/kiwix/play/listings/fr-FR/full-description.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Tout Wikipédia dans votre mobile !
|
||||||
|
|
||||||
|
Kiwix est un lecteur de contenus hors-ligne qui peut être utilisé pour Wikipédia ainsi que d'autres contenus (Documentation Ubuntu, WikiLeaks, WikiVoyage, WikiSource, etc).
|
||||||
|
|
||||||
|
Une fois que vous avez téléchargé le fichier de contenu (potentiellement très gros), vous n'avez plus du tout besoin de connexion pour l'utiliser.
|
||||||
|
|
||||||
|
Kiwix est une application légère utilisant des fichiers ZIM que vous aurez préalablement téléchargé et stocké sur la mémoire externe (carte SD).
|
||||||
|
|
||||||
|
Merci de consulter les instructions d'utilisations dans l'application ainsi que sur le site web pour en savoir plus sur les contenus disponibles.
|
||||||
|
|
||||||
|
Note: Kiwix est aussi disponible sur ordinateur (Windows, Mac, Linux).
|
1
app/src/kiwix/play/listings/fr-FR/short-description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Emportez la Wikipédia partout avec vous ; sans connexion !
|
1
app/src/kiwix/play/listings/fr-FR/title.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Kiwix, Wikipédia sans Internet
|
11
app/src/kiwix/play/listings/it-IT/full-description.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
L'intera Wikipedia sempre con te!
|
||||||
|
|
||||||
|
Kiwix è un lettore non in linea di contenuti e siti di ogni genere, Wikipedia ma non solo (documentazione di Ubuntu, WikiLeaks, Wikisource, Wikivoyage ecc.).
|
||||||
|
|
||||||
|
Una volta scaricato l'archivio ZIM contenente il tutto (potenzialmente molto grande), non serve alcuna connessione a internet per navigarlo.
|
||||||
|
|
||||||
|
Kiwix è leggero e gli archivi ZIM si possono scaricare e conservare nel tuo apparecchio android o memoria esterna (scheda SD).
|
||||||
|
|
||||||
|
Controlla le istruzioni nell'applicazione e nel sito per sapere di più sui contenuti disponibili.
|
||||||
|
|
||||||
|
Nota, Kiwix è disponibile anche per computer normali (Windows, Mac e Linux).
|
1
app/src/kiwix/play/listings/it-IT/short-description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Wikipedia sempre con te!
|
1
app/src/kiwix/play/listings/it-IT/title.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Kiwix
|
5
app/src/kiwix/play/listings/tr-TR/full-description.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Vikipedi'nin tamamı cihazınızda!
|
||||||
|
|
||||||
|
Uygulama, cihazınızda veya SD kartta depolanan büyük dosyalar okuyan hafif bir yazılım parçasıdır: yükledikten sonra, hangi ek içerikler indirmek istediğinizi seçebilirsiniz (Vikipedi, Vikisözlük, TED Konferansları, v.b.) ve ne zaman internet bağlantınız kötü olsa, hazır olabilirsiniz (veya uçak modunda olmanız gerekiyorsa) !
|
||||||
|
|
||||||
|
Indirmek için hazır olan çeşitli içerikler hakkında bilgi edinmek için, lütfen uygulama içindeki veya web sitemizindeki talimatları okuyun (www.kiwix.org)
|
After Width: | Height: | Size: 379 KiB |
After Width: | Height: | Size: 809 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 502 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 670 KiB |
1
app/src/kiwix/play/listings/tr-TR/short-description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Kiwix ile, Vikipedi tamamıyla telefonunuza veya tabletinize indirin
|
1
app/src/kiwix/play/listings/tr-TR/title.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Kiwix - offline Vikipedi
|
3
app/src/kiwix/play/release-notes/en-US/default.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
NEW: Downloads are now using the DownloadManager
|
||||||
|
NEW: Downloads/Device/Library completely rewritten
|
||||||
|
+ Lots More
|
@ -179,8 +179,6 @@
|
|||||||
android:resource="@xml/kiwix_widget_provider_info"/>
|
android:resource="@xml/kiwix_widget_provider_info"/>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<service android:name=".downloader.DownloadService"/>
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".error.ErrorActivity"
|
android:name=".error.ErrorActivity"
|
||||||
android:process=":error_activity"/>
|
android:process=":error_activity"/>
|
||||||
|
@ -5,7 +5,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:3.4.1")
|
classpath("com.android.tools.build:gradle:3.4.1")
|
||||||
|
classpath("com.dicedmelon.gradle:jacoco-android:0.1.4")
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
|
174
google.json
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "529266483286",
|
||||||
|
"firebase_url": "https://dummy-robot-scouter-for-travis.firebaseio.com",
|
||||||
|
"project_id": "dummy-robot-scouter-for-travis",
|
||||||
|
"storage_bucket": "dummy-robot-scouter-for-travis.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:529266483286:android:3fe88d30d9c76f79",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.supercilex.robotscouter.debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"analytics_service": {
|
||||||
|
"status": 1
|
||||||
|
},
|
||||||
|
"appinvite_service": {
|
||||||
|
"status": 1,
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
},
|
||||||
|
"ads_service": {
|
||||||
|
"status": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:529266483286:android:fa7f0f2977f5f001",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.supercilex.robotscouter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-6vo1cbbrsvdl80mqdomk3i3m425mv07b.apps.googleusercontent.com",
|
||||||
|
"client_type": 1,
|
||||||
|
"android_info": {
|
||||||
|
"package_name": "com.supercilex.robotscouter",
|
||||||
|
"certificate_hash": "0c7b6732a540434aca7e4bdea13aa3ed3209242f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"analytics_service": {
|
||||||
|
"status": 1
|
||||||
|
},
|
||||||
|
"appinvite_service": {
|
||||||
|
"status": 2,
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ads_service": {
|
||||||
|
"status": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:529266483286:android:91eecf4730fc920b",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.firebase.uidemo"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-qid6ms49u1kq7q3e0guv8fuvsqhthi4r.apps.googleusercontent.com",
|
||||||
|
"client_type": 1,
|
||||||
|
"android_info": {
|
||||||
|
"package_name": "com.firebase.uidemo",
|
||||||
|
"certificate_hash": "0c7b6732a540434aca7e4bdea13aa3ed3209242f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"analytics_service": {
|
||||||
|
"status": 1
|
||||||
|
},
|
||||||
|
"appinvite_service": {
|
||||||
|
"status": 2,
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ads_service": {
|
||||||
|
"status": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:529266483286:android:31fef6725a92125b",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.supercilex.test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-tmk00dnjnsbqo0j6ha30rmul2u3aqppf.apps.googleusercontent.com",
|
||||||
|
"client_type": 1,
|
||||||
|
"android_info": {
|
||||||
|
"package_name": "com.supercilex.test",
|
||||||
|
"certificate_hash": "0c7b6732a540434aca7e4bdea13aa3ed3209242f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"analytics_service": {
|
||||||
|
"status": 1
|
||||||
|
},
|
||||||
|
"appinvite_service": {
|
||||||
|
"status": 2,
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ads_service": {
|
||||||
|
"status": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|