diff --git a/.travis.yml b/.travis.yml index 90b45be166..a47b6699da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,11 @@ jdk: oraclejdk8 sudo: required +env: + global: +# - ANDROID_TARGET=android-24 +# - ANDROID_ABI=arm64-v8a + 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 @@ -34,17 +39,26 @@ android: - build-tools-28.0.3 - android-27 - extra-android-m2repository +# - $ANDROID_TARGET +# - sys-img-${ANDROID_ABI}-${ANDROID_TARGET} licenses: - ".+" script: - - ./gradlew lintKiwixDebug jacocoTestKiwixDebugUnitTestReport assembleKiwixRelease - - if [$TRAVIS_PULL_REQUEST == “false” ] && [ $TRAVIS_BRANCH == “release” ]; then - ./gradlew publishKiwixRelease; + - ./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 + - if [ $TRAVIS_TAG ] && [$TRAVIS_PULL_REQUEST == “false” ] && [ $TRAVIS_BRANCH == “release” ]; then + ./gradlew publish; fi - - if [$TRAVIS_TAG != “” ] && [$TRAVIS_PULL_REQUEST == “false” ] && [ $TRAVIS_BRANCH == “master” ]; then - ./gradlew publishKiwixRelease; + - if [ $TRAVIS_TAG ] && [$TRAVIS_PULL_REQUEST == “false” ] && [ $TRAVIS_BRANCH == “master” ]; then + ./gradlew publish; fi after_success: diff --git a/app/build.gradle b/app/build.gradle index 0a8f0c658e..966976a604 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -124,9 +124,19 @@ dependencies { androidTestImplementation "org.mockito:mockito-android:2.24.5" // Leak canary - debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3' - androidTestImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3' - releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3' + implementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3' + // Only enable leak canary in debug builds + configurations.all { config -> + if (config.name.contains('debug') || config.name.contains("Debug")) { + config.resolutionStrategy.eachDependency { details -> + if (details.requested.group == 'com.squareup.leakcanary' && + details.requested.name == 'leakcanary-android-no-op') { + details.useTarget(group: details.requested.group, name: 'leakcanary-android', + version: details.requested.version) + } + } + } + } implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.android.support.constraint:constraint-layout:1.1.3' @@ -231,9 +241,9 @@ android { signingConfigs { release { storeFile file("../kiwix-android.keystore") - storePassword System.getenv("KEY_STORE_PASSWORD") - keyAlias System.getenv("KEY_ALIAS") - keyPassword System.getenv("KEY_PASSWORD") + storePassword System.getenv("KEY_STORE_PASSWORD") ?: "000000" + keyAlias System.getenv("KEY_ALIAS") ?: "keystore" + keyPassword System.getenv("KEY_PASSWORD") ?: "000000" } } diff --git a/google.json b/google.json new file mode 100644 index 0000000000..de8174e081 --- /dev/null +++ b/google.json @@ -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" +} \ No newline at end of file diff --git a/kiwix-android.keystore b/kiwix-android.keystore new file mode 100644 index 0000000000..0e06aad396 Binary files /dev/null and b/kiwix-android.keystore differ