Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanparajuli committed Nov 13, 2020
1 parent 2e17c7e commit 21cf5c6
Show file tree
Hide file tree
Showing 130 changed files with 7,429 additions and 6,759 deletions.
148 changes: 74 additions & 74 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,90 +6,90 @@ apply plugin: 'kotlin-kapt'
def fileProvider = "file_provider"

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.dp.logcatapp"
minSdkVersion 16
targetSdkVersion 29
versionCode 32
versionName "1.7.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
defaultConfig {
applicationId "com.dp.logcatapp"
minSdkVersion 16
targetSdkVersion 29
versionCode 32
versionName "1.7.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}

signingConfigs {
release {
try {
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
} catch (FileNotFoundException ignored) {
println("keystore file not found.")
}
}
signingConfigs {
release {
try {
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
} catch (FileNotFoundException ignored) {
println("keystore file not found.")
}
}
}

dexOptions {
javaMaxHeapSize "2g"
}
dexOptions {
javaMaxHeapSize "2g"
}

lintOptions {
abortOnError false
disable 'MissingTranslation'
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
}

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

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

buildTypes {
buildTypes.each {
it.buildConfigField("String", "FILE_PROVIDER", "\"$fileProvider\"")
it.addManifestPlaceholders(["fileProvider": fileProvider])
}
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
buildTypes {
buildTypes.each {
it.buildConfigField("String", "FILE_PROVIDER", "\"$fileProvider\"")
it.addManifestPlaceholders(["fileProvider": fileProvider])
}
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':collections')
implementation project(':logcat')
implementation project(':logger')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "androidx.core:core-ktx:$core_ktx_version"
implementation "androidx.fragment:fragment-ktx:$fragment_ktx_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "com.google.android.material:material:$material_version"
implementation "androidx.preference:preference:$preference_version"
implementation "androidx.legacy:legacy-preference-v14:$legacy_preference_v14_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_common_java8_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_extensions_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_viewmodel_ktx_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_runtime_version"
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.documentfile:documentfile:$documentfile_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_core_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_android_version"
testImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.test:runner:$runner_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core_version"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':collections')
implementation project(':logcat')
implementation project(':logger')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "androidx.core:core-ktx:$core_ktx_version"
implementation "androidx.fragment:fragment-ktx:$fragment_ktx_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "com.google.android.material:material:$material_version"
implementation "androidx.preference:preference:$preference_version"
implementation "androidx.legacy:legacy-preference-v14:$legacy_preference_v14_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_common_java8_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_extensions_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_viewmodel_ktx_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_runtime_version"
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.documentfile:documentfile:$documentfile_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_core_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_android_version"
testImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.test:runner:$runner_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@ package com.dp.logcatapp

import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4

import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.dp.logcatapp", appContext.packageName)
}
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.dp.logcatapp", appContext.packageName)
}
}
172 changes: 86 additions & 86 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,100 +3,100 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.dp.logcatapp">

<!-- adb shell pm grant com.dp.logcatapp android.permission.READ_LOGS -->
<uses-permission android:name="android.permission.READ_LOGS" />
<!-- adb shell pm grant com.dp.logcatapp android.permission.READ_LOGS -->
<uses-permission android:name="android.permission.READ_LOGS" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
android:name=".LogcatApp"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/LightTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".activities.SplashActivity"
android:theme="@style/SplashScreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<application
android:name=".LogcatApp"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/LightTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".activities.SplashActivity"
android:theme="@style/SplashScreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.MainActivity"
android:launchMode="singleTask" />
<activity
android:name=".activities.SettingsActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.MainActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.MainActivity"
android:launchMode="singleTask" />
<activity
android:name=".activities.SettingsActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.MainActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>

<activity
android:name=".activities.FiltersActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.MainActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.FiltersActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.MainActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>

<activity
android:name=".activities.SavedLogsActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.MainActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<activity
android:name=".activities.SavedLogsActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.MainActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>

<activity
android:name=".activities.SavedLogsViewerActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.SavedLogsActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.SavedLogsActivity" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<activity
android:name=".activities.SavedLogsViewerActivity"
android:launchMode="singleTask"
android:parentActivityName=".activities.SavedLogsActivity"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.SavedLogsActivity" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />

<data
android:mimeType="text/plain"
android:scheme="file" />
<data
android:mimeType="text/plain"
android:scheme="content" />
</intent-filter>
</activity>
<data
android:mimeType="text/plain"
android:scheme="file" />
<data
android:mimeType="text/plain"
android:scheme="content" />
</intent-filter>
</activity>

<service
android:name=".services.LogcatService"
android:exported="false"
android:stopWithTask="false" />
<service
android:name=".services.LogcatService"
android:exported="false"
android:stopWithTask="false" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.${fileProvider}"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths" />
</provider>
</application>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.${fileProvider}"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths" />
</provider>
</application>

</manifest>
8 changes: 4 additions & 4 deletions app/src/main/java/com/dp/logcatapp/LogcatApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.dp.logger.Logger

@Suppress("unused")
class LogcatApp : Application() {
override fun onCreate() {
super.onCreate()
Logger.init("LogcatReader")
}
override fun onCreate() {
super.onCreate()
Logger.init("LogcatReader")
}
}
Loading

0 comments on commit 21cf5c6

Please sign in to comment.