Skip to content

Commit

Permalink
- Bundled ReiNX payload
Browse files Browse the repository at this point in the history
- Updated Kotlin to 1.2.61
- Updated Kotlin Coroutines to 0.25.3
  • Loading branch information
Pavel Rekun committed Sep 10, 2018
1 parent 9d56fb4 commit 8eb3065
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
Binary file added app/src/main/assets/ReiNX.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PayloadsView(private val activity: BaseActivity, private val fragment: Fra
}

override fun initList() {
MemoryUtils.copyAsset()
MemoryUtils.copyBundledPayloads()

adapter = PayloadsAdapter(PayloadHelper.getAll())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PayloadsAdapter(var data: MutableList<Payload>) : RecyclerView.Adapter<Pay
fun bind(payload: Payload) {
itemPayloadName.text = payload.name

itemPayloadRemove.visibility = if (payload.name == PayloadHelper.BASIC_PAYLOAD_NAME) View.GONE else View.VISIBLE
itemPayloadRemove.visibility = if (payload.name == PayloadHelper.BUNDLED_PAYLOAD_SX || payload.name == PayloadHelper.BUNDLED_PAYLOAD_REINX) View.GONE else View.VISIBLE

itemPayloadRemove.setOnClickListener {
MemoryUtils.removeFile(payload.path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import java.io.File
object PayloadHelper {

val FOLDER_PATH = "${Environment.getExternalStorageDirectory()}/Rekado/"
const val BASIC_PAYLOAD_NAME = "sx_loader.bin"

const val BUNDLED_PAYLOAD_SX = "sx_loader.bin"
const val BUNDLED_PAYLOAD_REINX = "ReiNX.bin"

private const val CHOSEN_PAYLOAD = "CHOSEN_PAYLOAD"

Expand All @@ -32,7 +34,7 @@ object PayloadHelper {

fun clearFolder() {
File(FOLDER_PATH).listFiles().forEach {
if (it.name != BASIC_PAYLOAD_NAME) {
if (it.name != BUNDLED_PAYLOAD_SX || it.name != BUNDLED_PAYLOAD_REINX) {
it.delete()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import java.io.*

object MemoryUtils {

fun copyAsset() {
fun copyBundledPayloads() {
val assetManager = RekadoApplication.instance.applicationContext.assets
val sxPayloadFile = assetManager.open(PayloadHelper.BASIC_PAYLOAD_NAME)

copyFile(sxPayloadFile, FileOutputStream("${PayloadHelper.FOLDER_PATH}/${PayloadHelper.BASIC_PAYLOAD_NAME}"))
val sxPayloadFile = assetManager.open(PayloadHelper.BUNDLED_PAYLOAD_SX)
val reiNXPayloadFile = assetManager.open(PayloadHelper.BUNDLED_PAYLOAD_REINX)

copyFile(sxPayloadFile, FileOutputStream("${PayloadHelper.FOLDER_PATH}/${PayloadHelper.BUNDLED_PAYLOAD_SX}"))
copyFile(reiNXPayloadFile, FileOutputStream("${PayloadHelper.FOLDER_PATH}/${PayloadHelper.BUNDLED_PAYLOAD_REINX}"))

EventBus.getDefault().post(Events.UpdatePayloadsListEvent())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object SettingsUtils {
}

fun getAutoInjectorPayload(): String {
return Paper.book().read(AUTO_INJECTOR_PAYLOAD, PayloadHelper.BASIC_PAYLOAD_NAME)
return Paper.book().read(AUTO_INJECTOR_PAYLOAD, PayloadHelper.BUNDLED_PAYLOAD_SX)
}

}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.60"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61"
}
}

Expand All @@ -26,8 +26,8 @@ allprojects {
ext {
currentSDKVersion = 28
minimumSDKVersion = 21
kotlinVersion = '1.2.60'
kotlinCoroutines = '0.24.0'
kotlinVersion = '1.2.61'
kotlinCoroutines = '0.25.3'

androidSupportVersion = '27.1.1'

Expand Down

0 comments on commit 8eb3065

Please sign in to comment.