This file contains 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
package io.fabric.sdk.android.services.common; | |
public class CommonUtils { | |
// ... | |
public static boolean isRooted(Context context) { | |
boolean isEmulator = isEmulator(context); | |
String buildTags = Build.TAGS; | |
if (!isEmulator && buildTags != null && buildTags.contains("test-keys")) { | |
return true; | |
} else { |
This file contains 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
public boolean isRooted() { | |
return detectRootManagementApps() || detectPotentiallyDangerousApps() || checkForBinary("su") | |
|| checkForBinary("busybox") || checkForDangerousProps() || checkForRWPaths() | |
|| detectTestKeys() || checkSuExists() || checkForRootNative() || checkForMagiskBinary(); | |
} |
This file contains 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 PluginDependenciesSpec.androidApp(): PluginDependencySpec = | |
id("com.android.application") | |
fun PluginDependenciesSpec.androidLibrary(): PluginDependencySpec = | |
id("com.android.library") | |
fun PluginDependenciesSpec.kotlinAndroid(): PluginDependencySpec = | |
kotlin("android") | |
fun PluginDependenciesSpec.kotlinAndroidExt(): PluginDependencySpec = |
This file contains 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
// For flavors usage | |
fun BaseFlavor.buildConfigBoolean(name: String, value: Boolean) = | |
buildConfigField("Boolean", name, value.toString()) | |
fun BaseFlavor.buildConfigString(name: String, value: String) = | |
buildConfigField("String", name, "\"$value\"") | |
// For build types usage | |
fun BuildType.buildConfigString(name: String, value: String) = | |
buildConfigField("String", name, "\"$value\"") |
This file contains 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
// Our custom task inside buildSrc folder | |
open class PingUrlTask : DefaultTask() { | |
@Input | |
lateinit var url: String | |
@TaskAction | |
fun updateTranslations() { | |
println("Begin task") |
This file contains 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
// In your buildSrc folder | |
sealed class BuildType(val secret: String) { | |
object DebugBuildType : BuildType(secret = "sword") | |
object ReleaseBuildType : BuildType(secret = "shield") | |
} |
This file contains 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 MainActivity : AppCompatActivity() { | |
private lateinit var binding: ActivityMainBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = ActivityMainBinding.inflate(layoutInflater) | |
setContentView(binding.root) | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<include layout="@layout/layout_merge" /> | |
</LinearLayout> |
This file contains 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
<merge xmlns:android="http://schemas.android.com/apk/res/android"> | |
<TextView | |
android:id="@+id/titleLbl" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" /> | |
</merge> |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<include | |
android:id="@+id/mergeLayout" | |
layout="@layout/layout_merge" /> | |
</LinearLayout> |
OlderNewer