TP-12345 | Refactor | Publishing | Spotless (#152)
This commit is contained in:
9
app/.gitignore
vendored
9
app/.gitignore
vendored
@@ -1,10 +1 @@
|
||||
/.idea/
|
||||
/build
|
||||
/captures
|
||||
/local.properties
|
||||
*.iml
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
.gradle
|
||||
.DS_Store
|
||||
local.properties
|
||||
|
||||
@@ -3,27 +3,47 @@ plugins {
|
||||
alias libs.plugins.kotlin.android
|
||||
}
|
||||
|
||||
def VERSION_CODE = 1
|
||||
def VERSION_NAME = "1.0.0"
|
||||
|
||||
android {
|
||||
namespace 'com.alfred.demo'
|
||||
namespace 'com.navi.alfred.demo'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'com.navi.alfred.demo'
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode VERSION_CODE
|
||||
versionName VERSION_NAME
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary true
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file('../keystore/navi-debug-key.jks')
|
||||
storePassword "android"
|
||||
keyAlias "androiddebugkey"
|
||||
keyPassword "android"
|
||||
}
|
||||
release {
|
||||
storeFile file('../keystore/navi-non-prod-release-key.jks')
|
||||
storePassword "android"
|
||||
keyAlias "navi"
|
||||
keyPassword "android"
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
debuggable false
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
@@ -31,30 +51,22 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += ["-Xstring-concat=inline"]
|
||||
jvmTarget = '17'
|
||||
}
|
||||
packagingOptions {
|
||||
resources {
|
||||
excludes += '/META-INF/{AL2.0,LGPL2.1}'
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':navi-alfred')
|
||||
|
||||
implementation libs.android.material
|
||||
|
||||
implementation libs.androidx.appcompat
|
||||
implementation libs.androidx.core.ktx
|
||||
implementation libs.androidx.lifecycle.viewmodel.ktx
|
||||
|
||||
implementation libs.anrwatchdog
|
||||
|
||||
implementation libs.gson
|
||||
|
||||
androidTestImplementation libs.androidx.test.espresso.core
|
||||
androidTestImplementation libs.androidx.test.junit
|
||||
|
||||
testImplementation libs.junit
|
||||
}
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:name=".MainApplication"
|
||||
android:name=".AlfredDemoApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AppCompat.Light"
|
||||
@@ -24,10 +25,10 @@
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.AppCompat.Light">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * Copyright © 2023-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.alfred.demo
|
||||
package com.navi.alfred.demo
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.IntentFilter
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.alfred.demo.activity.MainActivity
|
||||
import com.alfred.demo.activity.SWWActivity
|
||||
import com.github.anrwatchdog.ANRWatchDog
|
||||
import com.navi.alfred.AlfredConfig
|
||||
import com.navi.alfred.AlfredManager
|
||||
import com.navi.alfred.AlfredManager.isAlfredRecordingEnabled
|
||||
import com.navi.alfred.demo.activity.MainActivity
|
||||
import com.navi.alfred.demo.activity.SWWActivity
|
||||
import com.navi.alfred.utils.AlfredConstants
|
||||
import com.navi.alfred.utils.AlfredConstants.BROADCAST_ACTION_TYPE
|
||||
import com.navi.alfred.utils.log
|
||||
@@ -25,7 +25,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class MainApplication : Application(), Application.ActivityLifecycleCallbacks {
|
||||
class AlfredDemoApplication : Application(), Application.ActivityLifecycleCallbacks {
|
||||
private var appForegroundCounter: Int = 0
|
||||
|
||||
override fun onCreate() {
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
package com.alfred.demo
|
||||
package com.navi.alfred.demo
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * Copyright © 2023-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.alfred.demo.activity
|
||||
package com.navi.alfred.demo.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.MotionEvent
|
||||
import android.widget.Button
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.alfred.demo.R
|
||||
import com.navi.alfred.AlfredManager
|
||||
import com.navi.alfred.demo.R
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * Copyright © 2023-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.alfred.demo.activity
|
||||
package com.navi.alfred.demo.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.MotionEvent
|
||||
import android.widget.Button
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.alfred.demo.R
|
||||
import com.navi.alfred.AlfredManager
|
||||
import com.navi.alfred.demo.R
|
||||
|
||||
class SWWActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@@ -21,13 +21,20 @@ class SWWActivity : AppCompatActivity() {
|
||||
|
||||
val button = findViewById<Button>(R.id.sww_button)
|
||||
button.setOnClickListener {
|
||||
onSSWError("SWW Button Clicked", "400", "SWW Activity", "Alfred Demo App", 400, "WIFI")
|
||||
onSSWError(
|
||||
reason = "SWW Button Clicked",
|
||||
code = "400",
|
||||
screenName = "SWW Activity",
|
||||
moduleName = "Alfred Demo App",
|
||||
statusCode = 400,
|
||||
networkType = "WIFI"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
|
||||
AlfredManager.handleTouchEvent(
|
||||
ev,
|
||||
currentTouchEvent = ev,
|
||||
screenName = "Demo Activity",
|
||||
moduleName = "Alfred Demo App",
|
||||
)
|
||||
@@ -7,7 +7,7 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="app_name">Alfred Android</string>
|
||||
<string name="app_name">Alfred</string>
|
||||
<string name="crash">Crash Occurred</string>
|
||||
<string name="anr">Anr Occurred</string>
|
||||
<string name="app_background">App In Background</string>
|
||||
|
||||
19
app/src/main/res/xml/network_security_config.xml
Normal file
19
app/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
~
|
||||
~ * Copyright © 2024 by Navi Technologies Limited
|
||||
~ * All rights reserved. Strictly confidential
|
||||
~
|
||||
-->
|
||||
|
||||
<network-security-config>
|
||||
<debug-overrides>
|
||||
<trust-anchors>
|
||||
<certificates src="system" />
|
||||
<certificates
|
||||
overridePins="true"
|
||||
src="user" />
|
||||
</trust-anchors>
|
||||
</debug-overrides>
|
||||
</network-security-config>
|
||||
Reference in New Issue
Block a user