Skip to content
This repository has been archived by the owner. It is now read-only.

Consolidated work on project bond #501

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -62,6 +62,9 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
/* Cliqz start */
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.5"
/* Cliqz end */
}
}

@@ -113,10 +116,12 @@ afterEvaluate {
"-Xlint:-serial",
// Classfile, because javac has a bug with MethodParameters attributes
// with Java 7. https://bugs.openjdk.java.net/browse/JDK-8190452
"-Xlint:-classfile",
"-Xlint:-classfile"]
/* cliqz start o/
// Turn all remaining warnings into errors,
// unless marked by @SuppressWarnings.
"-Werror"]
/o cliqz end*/
}
if (project.name == 'app') {
tasks.withType(JavaCompile) {
@@ -4,6 +4,7 @@ apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'findbugs'
apply plugin: 'com.google.protobuf'

apply from: "${topsrcdir}/mobile/android/gradle/product_flavors.gradle"

@@ -91,7 +92,7 @@ android {

def isDebuggable = (!mozconfig.substs.MOZILLA_OFFICIAL) || (mozconfig.substs.NIGHTLY_BUILD && mozconfig.substs.MOZ_DEBUG)
debug {
debuggable isDebuggable
debuggable isDebuggable
multiDexKeepProguard file("${topsrcdir}/mobile/android/config/proguard/debug-robocop-keeps.cfg")
}
release {
@@ -127,15 +128,15 @@ android {
/* Cliqz start */
//Photon is the only flavour, which doesnt make sense. But we cant remove it because it has a
//separate source set which is included by the build system. Merging main and photon source set
//will take some refactoring. For now we branch standard and premium from photon
//will take some refactoring. For now we branch standard and bond from photon
bond {
dimension "skin"
versionCode 5
}

standard {
dimension "skin"
versionCode 5 //version code can be same as premium because its a different app and package name is different
versionCode 5
}
/* Cliqz end */
}
@@ -234,28 +235,35 @@ android {
}

/* Cliqz start */
//photon should contain some implementation of CC. We take the implementation from standard version
photon {
java {
srcDir "${topsrcdir}/mobile/android/standard/java"
srcDir "${topsrcdir}/mobile/android/app/src/standard/java"
}
res {
srcDir "${topsrcdir}/mobile/android/app/src/standard/res"
}
}
bond {
java {
srcDir "${topsrcdir}/mobile/android/bond/java"
srcDir "${topsrcdir}/mobile/android/app/src/photon/java" //need to include the sources in the photon folder
srcDir "${topsrcdir}/mobile/android/app/src/bond/java"
srcDir "${topsrcdir}/mobile/android/app/src/photon/java"
}
res {
srcDir "${topsrcdir}/mobile/android/app/src/photon/res" //need to include the sources in the photon folder
srcDir "${topsrcdir}/mobile/android/app/src/bond/res"
srcDir "${topsrcdir}/mobile/android/app/src/photon/res"
}
proto {
srcDir "${topsrcdir}/mobile/android/app/src/bond/proto"
}
}
standard {
java {
srcDir "${topsrcdir}/mobile/android/standard/java"
srcDir "${topsrcdir}/mobile/android/app/src/photon/java" //need to include the sources in the photon folder
srcDir "${topsrcdir}/mobile/android/app/src/standard/java"
srcDir "${topsrcdir}/mobile/android/app/src/photon/java"
}
res {
srcDir "${topsrcdir}/mobile/android/app/src/photon/res" //need to include the sources in the photon folder
srcDir "${topsrcdir}/mobile/android/app/src/standard/res"
srcDir "${topsrcdir}/mobile/android/app/src/photon/res"
}
}
/* Cliqz end */
@@ -327,9 +335,35 @@ dependencies {
/*Cliqz Start*/
//Library for control center donut - chart
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
bondImplementation 'io.grpc:grpc-okhttp:1.15.0'
bondImplementation 'io.grpc:grpc-protobuf-lite:1.15.0'
bondImplementation 'io.grpc:grpc-stub:1.15.0'
bondImplementation 'javax.annotation:javax.annotation-api:1.3.1'
/*Cliqz End*/
}

/* Cliqz start*/
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.5.1-1' }
plugins {
javalite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" }
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.15.0' // CURRENT_GRPC_VERSION
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
javalite {}
grpc { // Options added to --grpc_out
option 'lite'
}
}

}
ofFlavor('bond')
}
}
/* Cliqz end */

// TODO: (bug 1261486): This impl is not robust -
// we just wanted to land something.
@@ -482,7 +516,6 @@ android.applicationVariants.all { variant ->
effort = "max" // Using more memory and time to find issues is acceptable in automation
reportLevel = "high" // For now we only care about high priority bugs. After we have fixed
// the issues with medium/low priority we can lower the report level here.

classes = files("$project.buildDir/intermediates/classes")
source = variant.javaCompile.source
classpath = variant.javaCompile.classpath
@@ -610,4 +643,4 @@ preBuild {
}
}
}
/* Cliqz end */
/* Cliqz end */
@@ -917,4 +917,6 @@ pref("general.useragent.override.google.de", "Mozilla/5.0 (Linux; Android 8.0.0;

/* Cliqz start */
pref("media.autoplay.enabled", false);
/* Cliqz end */
// Prevent mozaddonmanager on AMO
pref("privacy.resistFingerprinting.block_mozAddonManager", true);
/* Cliqz end */
@@ -0,0 +1,17 @@
package org.mozilla.gecko;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* Copyright © Cliqz 2018
*/
public class Utils {
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);

public static boolean validateEmail(String emailStr) {
Matcher matcher = VALID_EMAIL_ADDRESS_REGEX .matcher(emailStr);
return matcher.find();
}
}
ProTip! Use n and p to navigate between commits in a pull request.