Hi @wwen , I saw inside of my apk in release mode and in the root directory I also have got a folder called com, and inside of it there is practically the same content that you show me before (red and yellow rectangles): But also I have (in the root directory) a .dex file in my case called classes2.dex (green rectangle). Inside of it there are some files and folders. One of these folders is com, and it contains the sas folder with the SDK dependencies. In this folder I couldn't find the SASCollector class that allows the app initialize the apk. In the path com/sas/mkt/mobile/sdk there is no SASCollector module, so I think (I'm not sure) that when the MainApplication.java run this import: import com.sas.mkt.mobile.sdk.SASCollector; it isn't able to processing it correctly. In the debug apk the SASCollector class is inside of the path described above. When the apk in debug mode starts the app logs are: I/SASCollector::SASCOLLECTOR_API: initialize: [ com.services.movistar.ar.MainApplication@9de060e]
D/SASCollector::SASCollector: SASCollector initializing (com.services.movistar.ar.MainApplication@9de060e)
D/SASCollector::AppEnvironment: AppEnvironment initialized. Internet=true Location=false PlayServices=true SDKIntentService=true
I/SASCollector::SASCollector: Loading configuration from assets/SASCollector.properties
I/SASCollector::SASCollector: Properties (3):
I/SASCollector::SASCollector: application.id=Test.AppMobile.Desa
I/SASCollector::SASCollector: tenant.id=a8a352b2d200011483d50aec
I/SASCollector::SASCollector: tag.server=https://execution-ci360.nop.movistar.com.ar/t/mobile
D/SASCollector::SASCollector: DeviceID from SharedPreferences: 10ac7910-69b2-4077-bcc4-e31d21464843
D/SASCollector::SASCollector: DeviceID seed is 1043
D/SASCollector::OfflineEventManager: Event Manager is running.
D/SASCollector::SASCollector: SASCollector initialized.
D/SASCollector::SASCollectorExecutor: Executing com.sas.mkt.mobile.sdk.tasks.CleanRemoteImagesTask
D/SASCollector::CleanRemoteImagesTask: Begin remote image cleanup...
D/SASCollector::CleanRemoteImagesTask: Remote image dir does not exist: /data/user/0/com.services.movistar.ar.integration/cache/sas/remote_files
D/SASCollector::CleanRemoteImagesTask: Cleanup completed. Deleted 0
D/SASCollector::MidtierServices: Using base server URL: https://execution-ci360.nop.movistar.com.ar/t/mobile
D/SASCollector::MidtierServices: Resolving host execution-ci360.nop.movistar.com.ar
I/SASCollector::SASCOLLECTOR_API: setPushNotificationChannelId: [ ReactNativePushChannel2]
D/SASCollector::ActivityLifecycleListener: Activity created: com.zoontek.rnbootsplash.RNBootSplashActivity
D/SASCollector::MidtierServices: Resolved to 3.160.119.101
D/SASCollector::OfflineEventManager: Server is available.
D/SASCollector::OfflineEventManager: Buffer was empty.
D/SASCollector::EventsDataSource: Events data source is open with 1 connections.
D/SASCollector::EventsDataSource: Retrieved 0 recent events.
D/SASCollector::ActivityLifecycleListener: Activity created: com.services.movistar.ar.MainActivity
D/SASCollector::EventsDataSource: All events are deleted.
D/SASCollector::EventsDataSource: Events data source is closed.
D/SASCollector::OfflineEventManager: Pulled 0 from DB
I/SASCollector::SASCOLLECTOR_API: setMobileMessagingDelegate2: [ com.services.movistar.ar.MainActivity$1@be5e863]
D/SASCollector::ActivityLifecycleListener: Activity started: com.services.movistar.ar.MainActivity
D/SASCollector::SASCollectorExecutor: Executing com.sas.mkt.mobile.sdk.tasks.QueueEventTask
D/SASCollector::ActivityLifecycleListener: Foreground counter : 1
D/SASCollector::QueueEventTask: Queuing event: focus
D/SASCollector::OfflineEventManager: Session timed out.
D/SASCollector::OfflineEventManager: Session indicator is NONE
D/SASCollector::OfflineEventManager: Starting new session. 1681838104797 1681838104797 120000 600000 null 10ac7910-69b2-4077-bcc4-e31d21464843
I/SASCollector::DeviceAndApplicationInfoHelper: SDK Version: 1.79.0
D/SASCollector::ActivityLifecycleListener: Activity resumed: com.services.movistar.ar.MainActivity
D/SASCollector::OfflineEventManager: Adding event (focus) to buffer.
I/SASCollector::SASCOLLECTOR_API: registerForMobileMessages: [ cHQg-UXURzuV2F6M1Rekv7:APA91bG_RY3-BTYAJwyjwJXgkk3wU45Ld1LEw1vADw-n1Z47jRGYrfnLM5osqGuX-dPuSErdp3zfxW9H5W-DWVm2qqY6tGXDd_euNW83LMfcIBaFEto57vIZxmrkOOZQUWs8mYozbS-x]
D/SASCollector::SASCollectorExecutor: Executing com.sas.mkt.mobile.sdk.tasks.UpdateToken
D/SASCollector::UpdateToken: Sending token cHQg-UXURzuV2F6M1Rekv7:APA91bG_RY3-BTYAJwyjwJXgkk3wU45Ld1LEw1vADw-n1Z47jRGYrfnLM5osqGuX-dPuSErdp3zfxW9H5W-DWVm2qqY6tGXDd_euNW83LMfcIBaFEto57vIZxmrkOOZQUWs8mYozbS-x for device 10ac7910-69b2-4077-bcc4-e31d21464843
D/SASCollector::MidtierServices: Outbound request: PUT https://execution-ci360.nop.movistar.com.ar/t/mobile/tokens/a8a352b2d200011483d50aec/10ac7910-69b2-4077-bcc4-e31d21464843
D/SASCollector::MidtierServices: JSON data for com.sas.mkt.mobile.sdk.domain.TokenData : {"appId":"Test.AppMobile.Desa","deviceId":"10ac7910-69b2-4077-bcc4-e31d21464843","token":"Android-cHQg-UXURzuV2F6M1Rekv7:APA91bG_RY3-BTYAJwyjwJXgkk3wU45Ld1LEw1vADw-n1Z47jRGYrfnLM5osqGuX-dPuSErdp3zfxW9H5W-DWVm2qqY6tGXDd_euNW83LMfcIBaFEto57vIZxmrkOOZQUWs8mYozbS-x"}
D/SASCollector::MidtierServices: Content-Length: 263
D/SASCollector::ActivityLifecycleListener: Activity destroyed: com.zoontek.rnbootsplash.RNBootSplashActivity
D/SASCollector::MidtierServices: Using base server URL: https://execution-ci360.nop.movistar.com.ar/t/mobile
D/SASCollector::MidtierServices: Resolving host execution-ci360.nop.movistar.com.ar
D/SASCollector::MidtierServices: Resolved to 3.160.119.101
D/SASCollector::OfflineEventManager: Server is available.
D/SASCollector::OfflineEventManager: Flushing 1 buffered events.
D/SASCollector::PostEventsTask: PostEventsTask created.
D/SASCollector::SASCollectorExecutor: Executing com.sas.mkt.mobile.sdk.tasks.PostEventsTask
D/SASCollector::OfflineEventManager: DB is clean.
D/SASCollector::MidtierServices: Response Code: 200
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/tokens/a8a352b2d200011483d50aec/10ac7910-69b2-4077-bcc4-e31d21464843 AWSALB=1vctTBA00OZyjzL/VMZpdmbKK6G//Fz6Nqa+UGIgAk90n1n0s1ZbkUnQEpvOAxA/BqzqXZB7k2FUyP8+l9c/hcpjLXbmvJGbm18DLYxW8glk3wgIalM95CuMYFlXOuQnfPoqu/RtnJVNS4tWF1qrZXEEb1Ds75Lr0wp6w0MIWZxstyXempEas4JMFoMD0w==; Expires=Tue, 25 Apr 2023 17:15:05 GMT; Path=/
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/tokens/a8a352b2d200011483d50aec/10ac7910-69b2-4077-bcc4-e31d21464843 AWSALBCORS=1vctTBA00OZyjzL/VMZpdmbKK6G//Fz6Nqa+UGIgAk90n1n0s1ZbkUnQEpvOAxA/BqzqXZB7k2FUyP8+l9c/hcpjLXbmvJGbm18DLYxW8glk3wgIalM95CuMYFlXOuQnfPoqu/RtnJVNS4tWF1qrZXEEb1Ds75Lr0wp6w0MIWZxstyXempEas4JMFoMD0w==; Expires=Tue, 25 Apr 2023 17:15:05 GMT; Path=/; SameSite=None; Secure
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/tokens/a8a352b2d200011483d50aec/10ac7910-69b2-4077-bcc4-e31d21464843 _SI_M_DID.a8a352b2d200011483d50aec=f67c9ea7-ae5f-3422-9653-7ddb686bd5a2; Path=/t/mobile; Secure; HttpOnly; SameSite=None
D/SASCollector::PostEventsTask: Execute PostEventsTask.
D/SASCollector::PostEventsTask: Posting 1 events for CSI: 1681838104798
D/SASCollector::MidtierServices: Outbound request: POST https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec
D/SASCollector::MidtierServices: JSON data for com.sas.mkt.mobile.sdk.domain.EventList : [{"appId":"Test.AppMobile.Desa","csi":1681838104798,"deviceId":"10ac7910-69b2-4077-bcc4-e31d21464843","eventAttributes":{"mobile_device_model":"Android SDK built for arm64","mobile_device_language":"en","mobile_sdk_version":"1.79.0","mobile_screen_height":"2872","mobile_platform":"Android","mobile_carrier_name":"Android","flags":"ns|nl","mobile_country_code":"310","uri":"Test.AppMobile.Desa/","visitor_state":"returning","mobile_platform_version":"10","mobile_device_type":"phone","mobile_screen_width":"1440","mobile_app_version":"412110700","mobile_device_mfg":"Google","mobile_network_code":"260","mobile_app_language":"en"},"eventDateTime":"2023-04-18T17:15:04.797Z","eventType":"focus","loadId":"b24e0324441043661a7c40a9"}]
D/SASCollector::MidtierServices: Content-Length: 731
D/SASCollector::MidtierServices: Response Code: 200
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec AWSALB=bcrfQ7EJraIc96DfxRBVe9K9P33AeLHKa71LK6uhcjioIga2+O2LnVJyud5ANzLbNxtTJMAdlrRglt4viwGm6cTcsbbyKHFFNojEvpYNmnOV3utgktBw9nCST0rLQ2Vk7QzvWQB2CW6kNte+u8tcNCHrVR7FK3bPfV5ilink6fXA3IH8XH+KiLWF9OIJ1Q==; Expires=Tue, 25 Apr 2023 17:15:05 GMT; Path=/
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec AWSALBCORS=bcrfQ7EJraIc96DfxRBVe9K9P33AeLHKa71LK6uhcjioIga2+O2LnVJyud5ANzLbNxtTJMAdlrRglt4viwGm6cTcsbbyKHFFNojEvpYNmnOV3utgktBw9nCST0rLQ2Vk7QzvWQB2CW6kNte+u8tcNCHrVR7FK3bPfV5ilink6fXA3IH8XH+KiLWF9OIJ1Q==; Expires=Tue, 25 Apr 2023 17:15:05 GMT; Path=/; SameSite=None; Secure
D/SASCollector::MidtierServices: Part _SI_M_SID=69a9dd7a6dfb2a5fb0b9c805.30.720 2
D/SASCollector::MidtierServices: Subpart 69a9dd7a6dfb2a5fb0b9c805.30.720 3
D/SASCollector::MidtierServices: Timeout update session: 1800000 max: 43200000
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec _SI_M_SID=69a9dd7a6dfb2a5fb0b9c805.30.720; Max-Age=1800; Expires=Tue, 18 Apr 2023 17:45:05 GMT; Path=/; Secure; HttpOnly
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec _SI_M_VID=10ac791069b24077bcc4e31d21464843; Max-Age=1800; Expires=Tue, 18 Apr 2023 17:45:05 GMT; Path=/; Secure; HttpOnly
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec _SI_M_DLT=893; Max-Age=1800; Expires=Tue, 18 Apr 2023 17:45:05 GMT; Path=/; Secure; HttpOnly
D/SASCollector::MidtierServices: Setting cookie https://execution-ci360.nop.movistar.com.ar/t/mobile/e/a8a352b2d200011483d50aec _SI_M_DID.a8a352b2d200011483d50aec=f67c9ea7-ae5f-3422-9653-7ddb686bd5a2; Path=/t/mobile; Secure; HttpOnly
D/SASCollector::OfflineEventManager: 1 Events successfully posted.
D/SASCollector::OfflineEventManager: No more events to send, entering deep sleep.
D/SASCollector::ActivityLifecycleListener: Activity paused: com.services.movistar.ar.MainActivity
D/SASCollector::ActivityLifecycleListener: Activity resumed: com.services.movistar.ar.MainActivity We are using React Native, and inside of the path android/app/libs we've got the SASCollector.jar, and inside of the path android/app/src/main/assets we've got the SASCollector.properties. In our build.gradle file we've got: apply plugin: "com.android.application"
// project.ext.envConfigFiles = [
// production: ".env.production",
// certification: ".env.certification",
// integration: ".env.integration",
// local: ".env.local",
// ]
// apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
// apply plugin: 'com.google.gms.google-services'
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = true
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
def keystorePropertiesFile = rootProject.file("keystore.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
def keysPropertiesFile = rootProject.file("keys.properties")
def keysProperties = new Properties()
keysProperties.load(new FileInputStream(keysPropertiesFile))
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.services.movistar.ar"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled true
versionCode 412110700
versionName "12.0.23"
vectorDrawables.useSupportLibrary = true
resValue "string", "build_config_package", "com.services.movistar.ar"
setProperty("archivesBaseName", "MiMovistar-$versionName")
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if(keystorePropertiesFile.exists()){
storeFile file(keystoreProperties['MYAPP_UPLOAD_STORE_FILE'])
storePassword keystoreProperties['MYAPP_UPLOAD_STORE_PASSWORD']
keyAlias keystoreProperties['MYAPP_UPLOAD_KEY_ALIAS']
keyPassword keystoreProperties['MYAPP_UPLOAD_KEY_PASSWORD']
enableV3Signing = true
// v1SigningEnabled false
}
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
debuggable true
matchingFallbacks = ['debug', 'release']
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
debuggable false
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
shrinkResources enableProguardInReleaseBuilds
zipAlignEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
flavorDimensions "default"
productFlavors {
production {
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID'])
buildConfigField "boolean", "IS_DEBUGGABLE", "false"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
f5 {
applicationIdSuffix '.f5'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.services.movistar.ar"
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID'])
buildConfigField "boolean", "IS_DEBUGGABLE", "false"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
certification {
applicationIdSuffix '.certification'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.services.movistar.ar"
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY_CERT'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID_CERT'])
buildConfigField "boolean", "IS_DEBUGGABLE", "false"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID_CERT'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY_CERT'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID_CERT'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET_CERT'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID_CERT'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
hotfix {
applicationIdSuffix '.hotfix'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.services.movistar.ar"
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY_CERT'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID_CERT'])
buildConfigField "boolean", "IS_DEBUGGABLE", "true"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID_CERT'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY_CERT'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID_CERT'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET_CERT'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID_CERT'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
bugfix {
applicationIdSuffix '.bugfix'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.services.movistar.ar"
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY_CERT'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID_CERT'])
buildConfigField "boolean", "IS_DEBUGGABLE", "true"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID_CERT'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY_CERT'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID_CERT'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET_CERT'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID_CERT'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
integration {
applicationIdSuffix '.integration'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.services.movistar.ar"
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY_CERT'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID_CERT'])
buildConfigField "boolean", "IS_DEBUGGABLE", "true"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID_CERT'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY_CERT'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID_CERT'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET_CERT'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID_CERT'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
local {
applicationIdSuffix '.local'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "build_config_package", "com.services.movistar.ar"
buildConfigField("String", "SWRVE_API_KEY", keysProperties['SWRVE_API_KEY_CERT'])
buildConfigField("int", "SWRVE_APP_ID", keysProperties['SWRVE_APP_ID_CERT'])
buildConfigField "boolean", "IS_DEBUGGABLE", "false"
buildConfigField("String", "FIREBASE_APP_ID", keysProperties['FIREBASE_APP_ID_CERT'])
buildConfigField("String", "FIREBASE_API_KEY", keysProperties['FIREBASE_API_KEY_CERT'])
buildConfigField("String", "FIREBASE_SENDER_ID", keysProperties['FIREBASE_SENDER_ID_CERT'])
buildConfigField("String", "FIREBASE_STORAGE_BUCKET", keysProperties['FIREBASE_STORAGE_BUCKET_CERT'])
buildConfigField("String", "FIREBASE_PROJECT_ID", keysProperties['FIREBASE_PROJECT_ID_CERT'])
buildConfigField("String", "AES_SECRET_KEY", keysProperties['AES_SECRET_KEY'])
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", keysProperties['IS_NEW_ARCHITECTURE_ENABLED'])
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation 'com.swrve.sdk.android:swrve-firebase:10.8.0'
implementation platform('com.google.firebase:firebase-bom:28.0.1')
implementation("com.google.firebase:firebase-iid")
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation project(':react-native-splash-screen')
implementation 'com.google.android.gms:play-services-tagmanager:17.0.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
// Add the following if you are using the Adjust SDK inside web views on your app
implementation 'com.adjust.sdk:adjust-android-webbridge:4.28.2'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'
// Libreria para IVR
//implementation(name: 'DialMyAppLib-release', ext: 'aar')
implementation files('libs/DialMyAppLib-release.aar')
implementation 'com.googlecode.libphonenumber:libphonenumber:8.10.6'
implementation 'org.apache.cordova:framework:8.1.0'
implementation 'com.google.guava:guava:27.0.1-android'
implementation 'commons-io:commons-io:2.6'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'androidx.work:work-runtime:2.5.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.4.0'
//CI360 implementation files('libs/SASCollector.jar')
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.code.gson:gson:2.8.9'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) MainApplication.java: package com.services.movistar.ar;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.sas.mkt.mobile.sdk.util.SLog;
import com.swrve.reactnative.SwrvePlugin;
import com.swrve.sdk.SwrveNotificationConfig;
import com.swrve.sdk.config.SwrveConfig;
import com.swrve.sdk.config.SwrveStack;
import android.app.Application;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import android.content.res.Configuration;
import android.graphics.Color;
import android.webkit.WebView;
import android.util.Log;
import androidx.annotation.RequiresApi;
import com.sas.mkt.mobile.sdk.SASCollector;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
Log.v("Swrve", "swrve_api_key=" + BuildConfig.SWRVE_API_KEY);
Log.v("Swrve", "swrve_app_id=" + BuildConfig.SWRVE_APP_ID);
Log.v("Mi Movistar", "IS_DEBUGGABLE=" + BuildConfig.IS_DEBUGGABLE);
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for
// example:
// packages.add(new MyReactNativePackage());
packages.add(new MyAppPackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SLog.setLevel(SLog.VERBOSE);
SASCollector.getInstance().initialize(this);
initializeFirebase(this);
org.mbte.dialmyapp.app.InjectingRef.defineApplication(this, org.mbte.dialmyapp.app.DialMyAppComponent.class);
SwrveConfig swrveConfig = new SwrveConfig();
// To use the EU stack, include this in your config
swrveConfig.setSelectedStack(SwrveStack.EU);
NotificationChannel channel = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
channel = new NotificationChannel("123", "Devapp swrve default channel",
NotificationManager.IMPORTANCE_DEFAULT);
channel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
if (getSystemService(Context.NOTIFICATION_SERVICE) != null) {
NotificationManager notificationManager = (NotificationManager) getSystemService(
Context.NOTIFICATION_SERVICE);
notificationManager.createNotificationChannel(channel);
}
}
SwrveNotificationConfig.Builder notificationConfig = new SwrveNotificationConfig.Builder(
R.mipmap.ic_launcher_round, R.mipmap.ic_launcher_round, channel)
.activityClass(MainActivity.class)
.largeIconDrawableId(R.mipmap.ic_launcher_round)
.accentColorHex("#00a9e0");
swrveConfig.setNotificationConfig(notificationConfig.build());
SwrvePlugin.createInstance(this, BuildConfig.SWRVE_APP_ID, BuildConfig.SWRVE_API_KEY, swrveConfig);
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
//WebView.setWebContentsDebuggingEnabled(true); // WEBVIEW DEBUG
WebView.setWebContentsDebuggingEnabled(false); // WEBVIEW RELEASE
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
setPushChannel();
}
}
@Override
public void onConfigurationChanged(Configuration newConfiguration) {
super.onConfigurationChanged(newConfiguration);
SASCollector.getInstance().onConfigurationChanged(newConfiguration);
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method
* with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
* We use reflection here to pick up the class that initializes Flipper,
* since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.services.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
public void initializeFirebase(Context context) {
Log.v("Firebase", "Inicializando SDK: " + BuildConfig.FIREBASE_PROJECT_ID);
// .setApiKey(Utils.decryptKey(BuildConfig.FIREBASE_API_KEY,
// BuildConfig.AES_SECRET_KEY))
if (FirebaseApp.getApps(context).isEmpty()) {
FirebaseOptions firebaseOptions = new FirebaseOptions.Builder()
.setApplicationId(BuildConfig.FIREBASE_APP_ID)
.setApiKey(BuildConfig.FIREBASE_API_KEY)
.setGcmSenderId(BuildConfig.FIREBASE_SENDER_ID)
.setStorageBucket(BuildConfig.FIREBASE_STORAGE_BUCKET)
.setProjectId(BuildConfig.FIREBASE_PROJECT_ID)
.build();
FirebaseApp.initializeApp(context, firebaseOptions);
}
}
@RequiresApi(api = android.os.Build.VERSION_CODES.O)
private void setPushChannel() {
NotificationManager notificationManager =
(NotificationManager) this.getSystemService(this.NOTIFICATION_SERVICE);
String customAndroidChannel = "ReactNativePushChannel2";
CharSequence channelName = "React Native Channel2";
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel notificationChannel = new NotificationChannel(customAndroidChannel, channelName, importance);
notificationChannel.enableLights(true);
notificationChannel.setLightColor(Color.RED);
notificationChannel.enableVibration(true);
notificationChannel.setShowBadge(true);
notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
notificationManager.createNotificationChannel(notificationChannel);
SASCollector.getInstance().setPushNotificationChannelId(customAndroidChannel);
}
} Our native module is called CI360AndroidModule.java: package com.services.movistar.ar;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.sas.mkt.mobile.sdk.SASCollector;
import java.util.HashMap;
import java.util.Map;
public class CI360AndroidModule extends ReactContextBaseJavaModule {
public static final String NAME = "CI360AndroidModule";
CI360AndroidModule(ReactApplicationContext context) {
super(context);
if(!SASCollector.getInstance().isInitialized()) {
SASCollector.getInstance().initialize(context.getApplicationContext());
}
}
@Override
@NonNull
public String getName() {
return NAME;
}
@ReactMethod
public void newPage(String uri) {
SASCollector.getInstance().newPage(uri);
}
@ReactMethod
public void addAppEvent(String eventKey, ReadableMap data) {
if (data == null) {
SASCollector.getInstance().addAppEvent(eventKey, null);
return;
}
HashMap<String, Object> rawData = data.toHashMap();
HashMap<String, String> convertedData = new HashMap<>();
for (Map.Entry<String, Object> entry : rawData.entrySet()) {
if(entry.getValue() instanceof String) {
convertedData.put(entry.getKey(), (String)entry.getValue());
}
}
SASCollector.getInstance().addAppEvent(eventKey, convertedData);
}
@ReactMethod
public void sendCI360EventAndroid(String eventId, String keyEventName, String eventValue) {
Map <String, String> myEventAttributeMap = new HashMap<>();
myEventAttributeMap.put("Start_Button", "Botón Comenzar fué presionado");
SASCollector.getInstance().addAppEvent("Button_Pressed", myEventAttributeMap);
Log.d("EventID", eventId);
Log.d("KeyEventName", keyEventName);
Log.d("EventValue", eventValue);
}
@ReactMethod
public void sendCI360EventAndroidInApp() {
Map <String, String> myEventAttributeMap = new HashMap<>();
SASCollector.getInstance().addAppEvent("test_event_for_in_app", null);
Log.d("EventInApp: ", "Fired");
}
@ReactMethod
public void identity(String value, String type, Promise promise) {
SASCollector.getInstance().identity(value, SASCollector.IDENTITY_TYPE_CUSTOMER_ID, new SASCollector.IdentityCallback() {
@Override
public void onComplete(boolean b) {
Log.d("Identity", "Identity called with: " + (b ? "success" : "failure"));
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
promise.resolve(b);
}
});
}
});
}
@ReactMethod
public void detachIdentity(Promise promise) { //SASCollector.DetachIdentityCallback callback
SASCollector.getInstance().detachIdentity(new SASCollector.DetachIdentityCallback() {
@Override
public void onComplete(boolean b) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
promise.resolve(b);
}
});
}
});
}
@ReactMethod
public void startMonitoringLocation() {
SASCollector.getInstance().startMonitoringLocation();
}
@ReactMethod
public void disableLocationMonitoring() {
SASCollector.getInstance().disableLocationMonitoring();
}
@ReactMethod
public void resetDeviceID() {
SASCollector.getInstance().resetDeviceID();
}
@ReactMethod
public void getDeviceID(Callback callback) {
callback.invoke(SASCollector.getInstance().getDeviceID());
}
@ReactMethod
public void getTenantID(Callback callback) {
callback.invoke(SASCollector.getInstance().getTenantID());
}
@ReactMethod
public void getAppVersion(Callback callback) {
callback.invoke(SASCollector.getInstance().getApplicationVersion());
}
@ReactMethod
public void getTagServer(Callback callback) {
callback.invoke(SASCollector.getInstance().getTagServer());
}
@ReactMethod
public void registerForMobileMessage(String token) {
SASCollector.getInstance().registerForMobileMessages(token);
}
@ReactMethod
public void handleMobileMessage(Map<String, String> data) {
SASCollector.getInstance().handleMobileMessage(data);
}
} And we also include the native module in the package in order to use it from react native: package com.services.movistar.ar;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MyAppPackage implements ReactPackage {
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
//return Collections.emptyList();
return Arrays.<ViewManager>asList(
new CI360InlineAdViewManager(reactContext),
new CI360InterstitialAdViewManager(reactContext)
);
}
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new SharedPreferencesModule(reactContext));
modules.add(new OpenAppModule(reactContext));
modules.add(new AdditionalPermissionsModule(reactContext));
modules.add(new CI360AndroidModule(reactContext));
return modules;
}
} As you can see, we also have another native SDK integrated in our app called DialMyAppLib-release.aar inside of the libs folder and its native module AdditionalPermissionsModule.java. The configuration of this SDK is so similar to CI360, and we have no problem with DialMyApp in our apk in release mode. I'm not telling you that CI360 sdk is the problem, but it's strange why in the release apk it isn´t working correctly.
... View more