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 com.scottyab.whatsnewplayground.data | |
import android.content.Context | |
import android.content.SharedPreferences | |
import androidx.security.crypto.EncryptedSharedPreferences | |
import androidx.security.crypto.MasterKeys | |
import com.scottyab.whatsnewplayground.BuildConfig | |
internal class SampleEncPrefs(context: Context) { |
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
import android.content.Context; | |
import android.content.pm.PackageInfo; | |
import android.content.pm.PackageManager; | |
import android.content.pm.PackageManager.NameNotFoundException; | |
import android.content.pm.Signature; | |
public class TamperCheck { | |
//we store the hash of the signture for a little more protection | |
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846"; |
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
{ "urlname": "YOUR URL PATH here, for https://www.meetup.com/swmobile the urlname is swmobile" } |
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
import org.assertj.core.api.AbstractObjectAssert | |
@Suppress("UNCHECKED_CAST") | |
inline fun <reified R> AbstractObjectAssert<*, *>.isNotInstanceOf(): AbstractObjectAssert<*, *>? = | |
isNotInstanceOf(R::class.java) | |
@Suppress("UNCHECKED_CAST") | |
inline fun <reified R> AbstractObjectAssert<*, *>.isInstanceOf(): AbstractObjectAssert<*, *>? = | |
isInstanceOf(R::class.java) |
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 ${PACKAGE_NAME} | |
import com.nhaarman.mockitokotlin2.verify | |
import com.nhaarman.mockitokotlin2.whenever | |
import org.assertj.core.api.Assertions.assertThat | |
import org.junit.Before | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
import org.mockito.Mock | |
import org.mockito.junit.MockitoJUnitRunner |
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
name: Build and Deploy to Firebase | |
'on': | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
name: Build and deploy Jekyll site | |
runs-on: ubuntu-latest | |
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
/** | |
* Implements whitelisting on host name | |
*/ | |
public class SaferWebViewClient extends WebViewClient { | |
private String[] hostsWhitelist; | |
public SaferWebViewClient(String hostsWhitelsit){ | |
super(); | |
this.hostsWhitelist = hostsWhitelist; |
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 MyAppFirebaseMessagingService : FirebaseMessagingService() { | |
override fun onMessageReceived(remoteMessage: RemoteMessage) { | |
if(remoteMessage.data.isNotEmpty()) { | |
processNewMessage(remoteMessage.data) | |
} | |
} | |
private fun processNewMessage(remoteMessageData: Map<String, String>) { | |
if (BeaconPushNotificationsProcessor.isBeaconNotification(remoteMessageData)) { |
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
import android.content.Context; | |
import android.content.pm.ApplicationInfo; | |
import android.content.pm.PackageInfo; | |
public class InstallerCheck{ | |
private static final String PLAY_STORE_APP_ID = "com.google.android"; | |
public static boolean verifyInstaller(final Context context) { |
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 me.angrybyte.coloringdemo; | |
import static android.graphics.PorterDuff.Mode.SRC_ATOP; | |
import android.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.graphics.Bitmap; |
NewerOlder