-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed broken code and permissions checks, optimized UI (104)
- Loading branch information
1 parent
0f68346
commit 8d84273
Showing
21 changed files
with
301 additions
and
699 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.andreacioccarelli.impactor | ||
|
||
import android.app.Application | ||
import com.jaredrummler.android.device.DeviceName | ||
|
||
class App : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
DeviceName.init(this) | ||
} | ||
|
||
} |
16 changes: 0 additions & 16 deletions
16
app/src/main/java/com/andreacioccarelli/impactor/base/BaseActivity.kt
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/andreacioccarelli/impactor/base/ImpactorActivity.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.andreacioccarelli.impactor.base | ||
|
||
import android.content.Context | ||
import android.os.Vibrator | ||
import android.widget.ImageView | ||
import android.widget.TextView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.andreacioccarelli.impactor.tools.AssetsProvider | ||
import com.andreacioccarelli.impactor.tools.CodeExecutor | ||
import com.google.android.material.floatingactionbutton.FloatingActionButton | ||
import com.jrummyapps.android.shell.Shell | ||
import es.dmoral.toasty.Toasty | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
import kotlinx.coroutines.withContext | ||
|
||
open class ImpactorActivity : AppCompatActivity() { | ||
|
||
fun vibrate(time: Int) { | ||
try { | ||
val v = baseContext.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator | ||
v.vibrate(time.toLong()) | ||
} catch (ignored: Exception) {} | ||
} | ||
|
||
|
||
var root = false | ||
var busybox = false | ||
|
||
fun refreshRootLogic( | ||
i1: ImageView, | ||
i2: ImageView, | ||
c1: TextView, | ||
c2: TextView, | ||
fab: FloatingActionButton | ||
) { | ||
CoroutineScope(Dispatchers.IO).launch { | ||
root = false | ||
busybox = CodeExecutor().checkBusyBox() | ||
|
||
try { | ||
root = Shell.SU.available() | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
withContext(Dispatchers.Main) { | ||
Toasty.error(this@ImpactorActivity, "Error raised while checking root", 1).show() | ||
} | ||
} | ||
|
||
AssetsProvider.init(root, busybox, i1, i2, c1, c2, fab) | ||
} | ||
} | ||
|
||
|
||
} |
6 changes: 0 additions & 6 deletions
6
app/src/main/java/com/andreacioccarelli/impactor/constants/AdsConstants.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.