-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add bootlaces to demo app. * add hasOverlay function to library.
- Loading branch information
1 parent
37d5dce
commit db3886c
Showing
7 changed files
with
48 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
26 changes: 7 additions & 19 deletions
26
app/src/main/java/com/evilthreads/jackhammer/MainActivity.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
package com.evilthreads.jackhammer | ||
|
||
import android.Manifest | ||
import android.content.Intent | ||
import android.os.Build | ||
import android.os.Bundle | ||
import android.util.Log | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.candroid.bootlaces.bootService | ||
import com.evilthreads.jackhammerlib.checkOverlayPermission | ||
import com.evilthreads.jackhammerlib.requestpermission | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | ||
super.onActivityResult(requestCode, resultCode, data) | ||
bruteForce() | ||
} | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
bruteForce() | ||
bootService(this){ | ||
service = MyService::class | ||
} | ||
} | ||
|
||
fun bruteForce(){ | ||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ | ||
if(checkOverlayPermission()) | ||
requestpermission(Manifest.permission.READ_CALENDAR){ | ||
Log.d("JACKJAMMER", "WE DID IT") | ||
} | ||
} | ||
override fun onResume() { | ||
super.onResume() | ||
checkOverlayPermission() | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.evilthreads.jackhammer | ||
|
||
import android.Manifest | ||
import android.os.Build | ||
import android.util.Log | ||
import androidx.lifecycle.lifecycleScope | ||
import com.candroid.bootlaces.BootService | ||
import com.evilthreads.jackhammerlib.hasOverlayPermission | ||
import com.evilthreads.jackhammerlib.requestpermission | ||
import kotlinx.coroutines.delay | ||
|
||
class MyService: BootService(){ | ||
init { | ||
lifecycleScope.launchWhenCreated { | ||
while(!hasOverlayPermission()) | ||
delay(1000) | ||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) | ||
requestpermission(Manifest.permission.READ_CALENDAR){ | ||
Log.d("JACKJAMMER", "EVIL THREADS") | ||
} | ||
else | ||
Log.d("JACKJAMMER", "EVIL THREADS") | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ allprojects { | |
repositories { | ||
google() | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
|
||
|
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