This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://developer.android.com/google/play/integrity/verdict#decrypt-verify | |
| // implementation 'com.google.api-client:google-api-client:1.32.2' | |
| // implementation 'com.google.apis:google-api-services-playintegrity:v1-rev20220211-1.32.1' | |
| package com.jraska.github.client.identity.integrity | |
| import com.google.api.client.googleapis.auth.oauth2.GoogleCredential | |
| import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PushIntegrationTest { | |
| lateinit var pushClient: PushServerClient | |
| lateinit var thisDeviceToken: String | |
| @get:Rule | |
| val pushRule = PushAwaitRule() | |
| @Before | |
| fun setUp() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Dependencies : Plugin<Project> { | |
| override fun apply(project: Project) { | |
| // Possibly common dependencies or can stay empty | |
| } | |
| companion object { | |
| val FIREBASE_MESSAGING = "com.google.firebase:firebase-messaging:20.1.7" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| moduleGraphAssert { | |
| maxHeight = 4 | |
| allowed = [':.* -> :core', ':feature.* -> :lib.*'] // regex to match module names - anyone can depend on :core, features can depend on libraries | |
| restricted = [':feature-[a-z]* -X> :forbidden-to-depend-on'] // no feature can depend on :forbidden-to-depend-on | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun moduleDependencies(project: Project): List<Project> { | |
| return project.configurations | |
| .filter { it.name == "api" || it.name == "implementation" } | |
| .flatMap { configuration -> | |
| configuration.dependencies.filterIsInstance(DefaultProjectDependency::class.java) | |
| .map { it.dependencyProject } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UsersViewModel(val navigator: Navigator) : ViewModel { | |
| fun onUserClicked(user: User) { | |
| // Business logic, analytics, any other compex interactions | |
| navigator.startUserDetail(user.login) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TopActivityProvider { | |
| private val pendingActions = mutableListOf<(Activity) -> Unit>() | |
| var topActivity: Activity? = null | |
| private set | |
| @AnyThread | |
| fun onTopActivity(action: (Activity) -> Unit) { | |
| val topActivity = this.topActivity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TopActivityProvider { | |
| var topActivity: Activity? = null | |
| private set | |
| private val callbacks: Application.ActivityLifecycleCallbacks = object : ActivityLifecycleCallbacks { | |
| override fun onActivityResumed(activity: Activity) { | |
| topActivity = activity | |
| } |
NewerOlder