Skip to content

Integrate GoConsole in Android Application

Download the Library

Note : don't run Gradle synchro until we notice it

Download the last version from here Download

Unzip the file and copy goconsole-version.aar to your libs directory (Module folder for your app)

GoConsole Add lib file!

Optional : You can download Full Project With Included Library

You can download full Android Application preconfigured from here : Download, and update the goconsole.xml file with your application.

Migrate to AndroidX

Your project must be an AndroidX to use the Goconsole library without error.

Verify your gradle.properties file, and check if these two lines exist, otherwise, you must migrate your project to AndroidX (You can use the AndroidX Migration Tools from your Android Studio, if you find errors, try to solve them before going to the next step)

android.useAndroidX=true

android.enableJetifier=true

GoConsole Update the project gradle.properties!

Update the build.gradle for project

Please verfiy if all declarations are in your build.gradle project level or update it like the following example

GoConsole Update the  build.gradle for project!

    buildscript {
        repositories {
            mavenCentral()
            google()
            maven { url "https://maven.google.com" }
            maven { url 'https://developer.huawei.com/repo/' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:4.1.3'
        }
    }

    allprojects {
        repositories {
            mavenCentral()
            google()
            maven { url "https://maven.google.com" }
            maven { url "https://jitpack.io" }
            maven { url 'https://android-sdk.is.com/' }
            maven { url 'https://sdk.tapjoy.com/' }
            maven { url "https://android-sdk.tapdaq.com" }
            maven { url "https://imobile-maio.github.io/maven" }
            maven { url "https://artifact.bytedance.com/repository/pangle" }
            maven { url 'https://developer.huawei.com/repo/' }

            flatDir {
                dirs 'libs'
            }
        }
    }

    task clean(type: Delete) {
        delete rootProject.buildDir
    }

Update the build.gradle for module

Please verfiy if all declarations are in your build.gradle module level or update it like the following example.

Remove duplicated declaration.

Update the build.gradle for module!

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 32
        buildToolsVersion "30.0.3"

        defaultConfig {
            applicationId "com.goconsole.example"
            minSdkVersion 19
            targetSdkVersion 32
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }

        ndkVersion "21.3.6528147"

        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }

    dependencies {

        implementation fileTree(dir: 'libs', include: ['*.jar'])

        // ...
        // Your App dependencies
        //...

        //BEGIN_GO_DEPS
        api ('androidx.core:core:1.8.0') {
            force = true
        }
        api ('androidx.core:core-ktx:1.8.0') {
            force = true
        }
        api 'com.android.volley:volley:1.2.1'
        api 'org.greenrobot:eventbus:3.2.0'
        api 'com.google.android.gms:play-services-auth:20.2.0'
        api 'androidx.multidex:multidex:2.0.1'
        api 'com.facebook.android:facebook-login:4.42.0'
        api 'androidx.annotation:annotation:1.4.0'
        api 'com.startapp:inapp-sdk:4.8.11'
        api 'com.stripe:stripe-android:6.1.1'
        api 'androidx.ads:ads-identifier:1.0.0-alpha04'
        api 'com.google.guava:guava:28.0-android'
        api 'androidx.constraintlayout:constraintlayout:2.1.4'
        api 'com.google.android.ads.consent:consent-library:1.0.8'
        api 'com.google.android.gms:play-services-location:20.0.0'
        api 'com.google.android.play:core:1.10.3'
        api 'com.android.billingclient:billing:5.0.0'
        api 'com.google.android.gms:play-services-ads-identifier:18.0.1'
        api 'com.google.android.gms:play-services-basement:18.1.0'
        api 'com.ironsource.sdk:mediationsdk:7.2.3'
        api 'com.ironsource.adapters:adcolonyadapter:4.3.11'
        api 'com.adcolony:sdk:4.8.0'
        api 'com.google.android.gms:play-services-ads:21.0.0'
        api 'com.ironsource.adapters:admobadapter:4.3.27'
        api 'com.ironsource.adapters:applovinadapter:4.3.31'
        api 'com.ironsource.adapters:chartboostadapter:4.3.8'
        api 'com.chartboost:chartboost-sdk:8.4.3'
        api 'com.ironsource.adapters:facebookadapter:4.3.34'
        api 'com.facebook.android:audience-network-sdk:6.11.0'
        api 'com.ironsource.adapters:unityadsadapter:4.3.21'
        api 'com.unity3d.ads:unity-ads:4.2.1'
        api 'com.ironsource.adapters:vungleadapter:4.3.16'
        api 'com.vungle:publisher-sdk-android:6.11.0'
        api 'com.ironsource.adapters:tapjoyadapter:4.1.20'
        api 'com.tapjoy:tapjoy-android-sdk:12.10.0'
        api 'com.ironsource.adapters:amazonadapter:4.3.3'
        api 'com.ironsource.adapters:amazonsdk:6.0.0@jar'
        api 'com.huawei.hms:ads-prime:3.4.54.300'
        api 'com.yandex.android:mobileads:5.2.0'
        api 'com.applovin:applovin-sdk:+'
        api 'com.applovin.mediation:adcolony-adapter:+'
        api 'com.applovin.mediation:chartboost-adapter:+'
        api 'com.applovin.mediation:google-adapter:+'
        api 'com.applovin.mediation:ironsource-adapter:+'
        api 'com.applovin.mediation:facebook-adapter:+'
        api 'com.applovin.mediation:bytedance-adapter:+'
        api 'com.applovin.mediation:tapjoy-adapter:+'
        api 'com.applovin.mediation:unityads-adapter:+'
        api 'com.applovin.mediation:vungle-adapter:+'
        api 'com.applovin.mediation:yandex-adapter:+'
        //END_GO_DEPS

        api (name: 'goconsole-version', ext: 'aar')
    }

Update The module AndroidManifest File

Run Sync now

Run Sync now!

Ignore this error

If you are getting this error when building your project, just ignore it

Ignore this error!

Add GooConsole Application class to the Manifest

First Open your AndroidManifest file, go to <application and look if already has android:name with a class Name on it

If you have a previous android:name

With application class!

In case you have already a declaration on android:name , Please Go here Use Declaration with existing Application Class for further details, otherwise, just continue to the next step.

If you want to create your Application Class to use in the android:name you must extend the GoConsole Application Class

Redeclare your Main Activity

You will get this as your Main activity, that will allow the api to detect Enemy robots (like google, Admob ...)

GoConsole Login Activity!

From your current MainActivity Declaration, remove the tags

Delete this lines from your current MainActivity declaration :

<intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

GoConsole Adding predefined Login Activity!

And add this line with your MainActivty full package like this (you must use the full Class name with full package name of the class [not the app packagename in case it's different]) :

<meta-data android:name="mainActivity" android:value="package.name.full.MainActivity" />

If you want to use the Googl Auth Service you must declare your application on The Google Credential page Google Sign In

Optional : Add your own Activity to show to google

By default, you can use the Enemy activity (Generated content activity) that will be accessible by the Review Team or you can use your own, just create your own activity and declare it on the manifest, and add this line to your Manifest :

<meta-data android:name="replaceActivity" android:value="package.name.full.ReplaceActivity" />

Don't forget to activate it on the GoConsole Dashboard for your app ( Go to your application, Settings Tab and click on Enemy View, then check 'Use Replace activity instead if declared in the App' )

Update your MainActivity :

Go to your MainActivity Class, and open it

Look for the onCreate Methods

After setContentView(R.layout.activity_main); line, add this line :

GooConsole.initMainActivity(this);

GoConsole Adding predefined Login Activity!

Download goconsole.xml resource File

Go to your application listing and download the goconsole.xml resouce file

GoConsole Download goconsole.xml resource File!

This file will contain this data from your app :

  • goconsole_app_id : Your application id
  • goconsole_app_key : Your application key
  • goconsole_admob_app_id : Your Admob application id (find it on your Admob account)

Copy and paste the downloaded file to your res/values folder

GoConsole add goconsole resource file!

Update your proguard-rules.pro

If you want to obfuscate your application by using proguard, you must add the content in the proguard-rules.pro to your proguard-rules.pro module or use the following code (if this file does not exist in your project, create it) :

        -keepparameternames
        -keep public class goo.console.GooConsole {public *;}
        -keepclassmembernames class goo.console.GooConsole {
            public static <methods>;
        }

        -keep class goo.console.events.** {*;}
        -keep class goo.console.services.activities.ErrorActivity {*;}
        -keep class goo.console.services.activities.LoginAccountActivity {*;}
        -keepclassmembernames class goo.console.events.** {
            public static <methods>;
        }

        -keep interface goo.console.events.** {*;}
        -keepclassmembernames interface goo.console.events.**  {
            public static <methods>;
        }

        -keep class goo.console.gobj.** {*;}
        -keep class goo.sweet.** {*;}
        -keep class com.github.clans.fab.** {*;}
        -keep class com.formbuilder.** {*;}
        -keep class com.reflexmath.** {*;}
        -keep class com.easyandroidanimations.** {*;}
        -keep public class goo.console.services.models.**{ *; }
        -keep public class goo.console.services.notifs.**


        -ignorewarnings
        -dontwarn com.**
        -dontwarn org.**
        -dontwarn okhttp3.**
        -dontwarn okio.**
        -dontwarn com.paypal.**
        -dontwarn com.braintreepayments.**
        -dontwarn android.webkit.JavascriptInterface
        -dontwarn com.google.ar.core.**
        -keepattributes JavascriptInterface
        -keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile, LineNumberTable, *Annotation*, EnclosingMethod
        -keepclassmembers class ** {
            @com.squareup.otto.Subscribe public *;
            @com.squareup.otto.Produce public *;
        }
        -keep class com.jeremyfeinstein.**{*;}
        -keep class com.squareup.otto.**{*;}
        -keep class com.startapp.android.publish.**{*;}
        -keep class com.unirt3d.ads.**{*;}
        -keep class com.google.**{*;}
        -keep class okhttp3.**{*;}
        -keep class okio.**{*;}
        -keep class org.**{*;}
        -keep class com.facebook.**{*;}
        -keep class com.braintreepayments.** { *; }
        -keep interface com.braintreepayments.** { *; }
        -keep class com.paypal.** { *; }
        -keep interface com.paypal.** { *; }
        -keep class com.startapp.** {*;}
        -keep class com.stripe.android.** { *; }
        -keep class com.android.volley.** { *; }
        -keep class com.activeandroid.** { *; }
        -keep class android.webkit.JavascriptInterface {*;}
        -keep class com.unity3d.ads.** {*;}
        # Keep all classes in Unity Services package
        -keep class com.unity3d.services.** {
        *;
        }
        -keep public class com.google.android.gms.ads.**{public *;}
        -keep public class com.google.android.gms.** { public protected *; }
        -keep public class com.google.android.gms.wallet.**{*;}
        -keep public class com.google.ads.**{public *;}

        -keep class * extends java.util.ListResourceBundle {
        protected Object[][] getContents();
        }
        -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
        public static final *** NULL;
        }
        -keepnames @com.google.android.gms.common.annotation.KeepName class *
        -keepclassmembernames class * {
        @com.google.android.gms.common.annotation.KeepName *;
        }
        -keepnames class * implements android.os.Parcelable {
        public static final ** CREATOR;
        }

        -keep class com.michaelflisar.** {*;}

        -keepattributes *Annotation*
        -keepclassmembers class * {
            @org.greenrobot.eventbus.Subscribe <methods>;
        }
        -keep enum org.greenrobot.eventbus.ThreadMode { *; }

        # Only required if you use AsyncExecutor
        -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
            <init>(java.lang.Throwable);
        }

        -dontwarn com.pollfish.**
        -keep class com.pollfish.** { *; }

        -keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface {
            public *;
        }
        -keepclassmembers class * implements android.os.Parcelable {
            public static final android.os.Parcelable$Creator *;
        }
        -keep public class com.google.android.gms.ads.** {
        public *;
        }
        -keep class com.ironsource.adapters.** { *;
        }
        -dontwarn com.ironsource.mediationsdk.**
        -dontwarn com.ironsource.adapters.**
        -keepattributes JavascriptInterface
        -keepclassmembers class * {
            @android.webkit.JavascriptInterface <methods>;
        }

        # For communication with AdColony's WebView
        -keepclassmembers class * {
            @android.webkit.JavascriptInterface <methods>;
        }
        # Keep ADCNative class members unobfuscated
        -keepclassmembers class com.adcolony.sdk.ADCNative** {
            *;
        }

        -keepattributes Signature,InnerClasses,Exceptions,Annotation
        -keep public class com.applovin.sdk.AppLovinSdk{ *; }
        -keep public class com.applovin.sdk.AppLovin* { public protected *; }
        -keep public class com.applovin.nativeAds.AppLovin* { public protected *; }
        -keep public class com.applovin.adview.* { public protected *; }
        -keep public class com.applovin.mediation.* { public protected *; }
        -keep public class com.applovin.mediation.ads.* { public protected *; }
        -keep public class com.applovin.impl.*.AppLovin { public protected *; }
        -keep public class com.applovin.impl.**.*Impl { public protected *; }
        -keepclassmembers class com.applovin.sdk.AppLovinSdkSettings { private java.util.Map localSettings; }
        -keep class com.applovin.mediation.adapters.** { *; }
        -keep class com.applovin.mediation.adapter.**{ *; }

        -keep class com.chartboost.** { *; }

        # Vungle
        -keep class com.vungle.warren.** { *; }
        -dontwarn com.vungle.warren.error.VungleError$ErrorCode
        # Moat SDK
        -keep class com.moat.** { *; }
        -dontwarn com.moat.**
        # Okio
        -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
        # Retrofit
        -dontwarn okio.**
        -dontwarn retrofit2.Platform$Java8
        # Gson
        -keepattributes Signature
        -keepattributes *Annotation*
        -dontwarn sun.misc.**
        -keep class com.google.gson.examples.android.model.** { *; }
        -keep class * implements com.google.gson.TypeAdapterFactory
        -keep class * implements com.google.gson.JsonSerializer
        -keep class * implements com.google.gson.JsonDeserializer
        # Google Android Advertising ID
        -keep class com.google.android.gms.internal.** { *; }
        -dontwarn com.google.android.gms.ads.identifier.**
        #TapJoy
        -keep class com.tapjoy.** { *; }
        -keep class com.moat.** { *; }
        -keepattributes JavascriptInterface
        -keepattributes *Annotation*
        -keep class * extends java.util.ListResourceBundle {
        protected Object[][] getContents();
        }
        -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
        public static final *** NULL;
        }
        -keepnames @com.google.android.gms.common.annotation.KeepName class *
        -keepclassmembernames class * {
        @com.google.android.gms.common.annotation.KeepName *;
        }
        -keepnames class * implements android.os.Parcelable {
        public static final ** CREATOR;
        }
        -keep class com.google.android.gms.ads.identifier.** { *; }
        -dontwarn com.tapjoy.**

        -keep class com.tapdaq.sdk.** { *; }
        -keep class com.tapdaq.adapters.* { *; }
        -keep class com.tapdaq.unityplugin.* { *; }
        -keep class com.google.android.gms.ads.identifier.** { *; }

        # For communication with AdColony's WebView
        -keepclassmembers class * {
            @android.webkit.JavascriptInterface <methods>;
        }

        # For removing warnings due to lack of Multi-Window support
        -dontwarn android.app.Activity
        -dontwarn com.applovin.**
        -keep class com.applovin.** { *; }
        -keep class com.chartboost.** { *; }
        -keep class com.facebook.ads.** { *; }

        -keepattributes SourceFile,LineNumberTable,InnerClasses
        -keep class com.inmobi.** { *; }
        -dontwarn com.inmobi.**
        -keep class com.google.android.gms.common.api.GoogleApiClient { public *; }
        -keep class com.google.android.gms.common.api.GoogleApiClient$* {public *;}
        -keep class com.google.android.gms.location.LocationServices {public *;}
        -keep class com.google.android.gms.location.FusedLocationProviderApi {public *;}
        -keep class com.google.android.gms.location.ActivityRecognition {public *;}
        -keep class com.google.android.gms.location.ActivityRecognitionApi {public *;}
        -keep class com.google.android.gms.location.ActivityRecognitionResult {public *;}
        -keep class com.google.android.gms.location.DetectedActivity {public *;}
        -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
            public *;
        }
        -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
            public *;
        }
        -dontwarn com.google.android.gms.**
        # skip the Picasso library classes
        -keep class com.squareup.picasso.** {*;}
        -dontwarn com.squareup.picasso.**
        # skip Moat classes
        -keep class com.moat.** {*;}
        -dontwarn com.moat.**
        -keep interface jp.maio.sdk.android.**
        -keep class jp.maio.sdk.android.** {*;}
        -dontwarn jp.maio.sdk.android.**
        -keep class com.bytedance.sdk.** { *; }
        -keep class com.pgl.sys.ces.* {*;}
        -keep class com.tapjoy.** { *; }
        -keep class com.moat.** { *; }
        -keepattributes JavascriptInterface
        -keepattributes *Annotation*
        -keep class * extends java.util.ListResourceBundle {
        protected Object[][] getContents();
        }
        -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
        public static final *** NULL;
        }
        -keepnames @com.google.android.gms.common.annotation.KeepName class *
        -keepclassmembernames class * {
        @com.google.android.gms.common.annotation.KeepName *;
        }
        -keepnames class * implements android.os.Parcelable {
        public static final ** CREATOR;
        }
        -keep class com.google.android.gms.ads.identifier.** { *; }
        -dontwarn com.tapjoy.**

        -dontwarn com.vungle.**
        -dontnote com.vungle.**
        -keep class com.vungle.** { *; }
        -keep class javax.inject.*

        # GreenRobot
        -dontwarn de.greenrobot.event.util.**

        # RxJava
        -dontwarn rx.internal.util.unsafe.**
        -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
        long producerIndex;
        long consumerIndex;
        }
        -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
        rx.internal.util.atomic.LinkedQueueNode producerNode;
        }
        -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
        rx.internal.util.atomic.LinkedQueueNode consumerNode;
        }
        -keep class rx.schedulers.Schedulers { public static <methods>; }
        -keep class rx.schedulers.ImmediateScheduler { public <methods>; }
        -keep class rx.schedulers.TestScheduler { public <methods>; }
        -keep class rx.schedulers.Schedulers { public static ** test(); }

        # MOAT
        -dontwarn com.moat.**
        -keep class com.moat.** { public protected private *; }

        # Retrofit
        -dontwarn okio.**
        -dontwarn retrofit2.Platform$Java8

        -keep class com.huawei.openalliance.ad.** { *; }
        -keep class com.huawei.hms.ads.** { *; }

Next steps

Use Google Auth

Use Facebook Auth

Use Enemy Views (Enemy View, Calculator, Replacement)

Use Workflow

Config Ads