Skip to content

Commit

Permalink
Merge pull request #63 from javiersantos/ax
Browse files Browse the repository at this point in the history
Migrate to Android X
  • Loading branch information
javiersantos committed Dec 24, 2018
2 parents 9a07683 + 0a02b13 commit bda5062
Show file tree
Hide file tree
Showing 29 changed files with 311 additions and 267 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
global:
- ANDROID_API=28
- ANDROID_BUILD_TOOLS=28.0.3
- EMULATOR_API=24
- EMULATOR_API=21

android:
components:
Expand Down
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,23 @@ repositories {

And add the library to your module **build.gradle**:

**AndroidX**

```gradle
dependencies {
implementation 'com.github.javiersantos:PiracyChecker:1.2.5'
}
```

**Pre AndroidX (no longer supported)**

```gradle
dependencies {
implementation 'com.github.javiersantos:PiracyChecker:1.2.4'
}
```


## Recommendations
* Always enable ProGuard in your production release. Always, without exceptions.
* PiracyChecker should be included in your `onCreate` method in order to check for a valid license as soon as possible.
Expand Down Expand Up @@ -159,7 +170,7 @@ It will check for: Lucky Patcher, Uret Patcher, Freedom, CreeHack and HappyMod.

```kotlin
piracyChecker {
enableUnauthorizedAppsCheck(true)
enableUnauthorizedAppsCheck()
...
}.start()
```
Expand All @@ -168,7 +179,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableUnauthorizedAppsCheck(true)
.enableUnauthorizedAppsCheck()
...
.start();
```
Expand Down Expand Up @@ -220,7 +231,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableUnauthorizedAppsCheck(true)
.enableUnauthorizedAppsCheck()
.blockIfUnauthorizedAppUninstalled(preferences, "app_unauthorized") // Change "app_unauthorized" with your own value
...
.start();
Expand All @@ -244,7 +255,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableUnauthorizedAppsCheck(true)
.enableUnauthorizedAppsCheck()
.blockIfUnauthorizedAppUninstalled("license_preferences", "app_unauthorized") // Change "license_preferences" and "app_unauthorized" with your own value
...
.start();
Expand All @@ -270,7 +281,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableStoresCheck(true)
.enableStoresCheck()
...
.start();
```
Expand All @@ -293,7 +304,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableFoldersCheck(true)
.enableFoldersCheck()
...
.start();
```
Expand All @@ -315,7 +326,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableAPKCheck(true)
.enableAPKCheck()
...
.start();
```
Expand All @@ -341,7 +352,7 @@ piracyChecker {

```java
new PiracyChecker(this)
.enableDebugCheck(true)
.enableDebugCheck()
...
.start();
```
Expand All @@ -353,8 +364,10 @@ new PiracyChecker(this)
### Verify if app is being run in an emulator
If your app is running on an emulator outside the development process, it gives an indication that someone other than you is trying to analyze the app.

**Warning!**: Using deep check can cause crashes in some specific devices.

```kotlin
val deepCheck = fals
val deepCheck = false
piracyChecker {
.enableEmulatorCheck(deepCheck)
...
Expand Down Expand Up @@ -550,7 +563,7 @@ piracyChecker {
new PiracyChecker(this)
.enableGooglePlayLicensing("BASE_64_LICENSE_KEY")
.enableSigningCertificate("YOUR_APK_SIGNATURE")
.enableUnauthorizedAppsCheck(true)
.enableUnauthorizedAppsCheck()
.saveResultToSharedPreferences("my_app_preferences", "valid_license")
...
.start();
Expand Down
15 changes: 9 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -36,17 +36,20 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation project(':library')

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'

// Testing-only dependencies
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test:runner:1.0.1', {
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation('androidx.test:runner:1.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}

0 comments on commit bda5062

Please sign in to comment.