Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to build without Google dependencies #582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CustomVnc-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
12 changes: 12 additions & 0 deletions Opaque-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

sourceSets.main {
java.srcDirs += 'src/main/java'
}
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ Welcome screen, browsing to the remote-desktop-clients directory and selecting i

- Build -> Make Project should now work.

### Opting-out of Google dependencies

To build without Google dependencies,

1. Open the project in Android Studio
2. In Android Studio menu, select Build -> Select Build Variant...
3. In the Build Variants window, select the `withoutGoogleDebug` or `withoutGoogleRelease` variant
for the module(s) you want to build.

## Custom Certificate Authority

You can add custom CAs for aSPICE and Opaque in remoteClientLib/certificate_authorities/. They will be merged with the
Expand Down
12 changes: 12 additions & 0 deletions aRDP-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
12 changes: 12 additions & 0 deletions aSPICE-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
12 changes: 12 additions & 0 deletions bVNC-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
16 changes: 13 additions & 3 deletions bVNC/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
}
withoutGoogle {
dimension "googleDependencies"
}
}

packagingOptions {
exclude 'lib/armeabi/libsqlcipher.so'
exclude 'lib/mips64/libsqlcipher.so'
Expand Down Expand Up @@ -52,10 +62,10 @@ dependencies {
implementation "androidx.core:core-ktx:1.7.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'com.google.android.play:review:2.0.1'
implementation 'com.google.android.play:review-ktx:2.0.1'
withGoogleImplementation 'com.google.android.play:review:2.0.1'
withGoogleImplementation 'com.google.android.play:review-ktx:2.0.1'
implementation project(path: ':common')
implementation 'com.google.android.gms:play-services-base:18.0.1'
withGoogleImplementation 'com.google.android.gms:play-services-base:18.0.1'
}
repositories {
mavenCentral()
Expand Down
25 changes: 0 additions & 25 deletions bVNC/src/main/java/com/iiordanov/bVNC/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@

import com.antlersoft.android.contentxml.SqliteElement;
import com.antlersoft.android.contentxml.SqliteElement.ReplaceStrategy;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.tasks.Task;
import com.google.android.play.core.review.ReviewInfo;
import com.google.android.play.core.review.ReviewManager;
import com.google.android.play.core.review.ReviewManagerFactory;
import com.undatech.opaque.AbstractDrawableData;
import com.undatech.opaque.ConnectionSetupActivity;
import com.undatech.remoteClientUi.R;
Expand Down Expand Up @@ -630,25 +624,6 @@ public static void startUriIntent(Context context, String url) {
}
}

public static void showRateAppDialog(Activity activity) {
ReviewManager manager = ReviewManagerFactory.create(activity);
Task<ReviewInfo> request = manager.requestReviewFlow();
request.addOnCompleteListener(task -> {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
if (apiAvailability.isGooglePlayServicesAvailable(activity) == ConnectionResult.SUCCESS) {
if (task.isSuccessful()) {
ReviewInfo reviewInfo = task.getResult();
Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo);
flow.addOnCompleteListener(completedTask -> {
Log.d(TAG, "rateApp: Completed: " + completedTask.getResult());
});
} else {
Log.d(TAG, "rateApp: task is not successful");
}
}
});
}

public static void setClipboard(Context context, String url) {
ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
cm.setText(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import com.iiordanov.bVNC.ConnectionBean;
import com.iiordanov.bVNC.Constants;
import com.iiordanov.bVNC.Database;
import com.iiordanov.bVNC.GoogleUtils;
import com.iiordanov.bVNC.RemoteCanvasActivity;
import com.iiordanov.bVNC.Utils;
import com.iiordanov.bVNC.dialogs.GetTextFragment;
Expand Down Expand Up @@ -591,7 +592,7 @@ public void reportBug(View item) {

public void rateApp(View item) {
Log.d(TAG, "rateApp: Showing rate app functionality");
Utils.showRateAppDialog(this);
GoogleUtils.showRateAppDialog(this);
}

public void shareApp(View item) {
Expand Down
34 changes: 34 additions & 0 deletions bVNC/src/withGoogle/java/com/iiordanov/bVNC/GoogleUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.iiordanov.bVNC;

import android.app.Activity;
import android.util.Log;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.tasks.Task;
import com.google.android.play.core.review.ReviewInfo;
import com.google.android.play.core.review.ReviewManager;
import com.google.android.play.core.review.ReviewManagerFactory;

public class GoogleUtils {
private final static String TAG = "GoogleUtils";

public static void showRateAppDialog(Activity activity) {
ReviewManager manager = ReviewManagerFactory.create(activity.getApplicationContext());
Task<ReviewInfo> request = manager.requestReviewFlow();
request.addOnCompleteListener(task -> {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
if (apiAvailability.isGooglePlayServicesAvailable(activity) == ConnectionResult.SUCCESS) {
if (task.isSuccessful()) {
ReviewInfo reviewInfo = task.getResult();
Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo);
flow.addOnCompleteListener(completedTask -> {
Log.d(TAG, "rateApp: Completed: " + completedTask.getResult());
});
} else {
Log.d(TAG, "rateApp: task is not successful");
}
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.iiordanov.bVNC;

import android.app.Activity;

public class GoogleUtils {
public static void showRateAppDialog(Activity activity) {

}
}
12 changes: 12 additions & 0 deletions freeaRDP-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
12 changes: 12 additions & 0 deletions freeaSPICE-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
12 changes: 12 additions & 0 deletions freebVNC-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ android {
}
}

flavorDimensions += "googleDependencies"
productFlavors {
withGoogle {
dimension "googleDependencies"
matchingFallbacks ["withGoogle"]
}
withoutGoogle {
dimension "googleDependencies"
matchingFallbacks ["withoutGoogle"]
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down