diff --git a/.github/config.yml b/.github/config.yml
new file mode 100644
index 0000000..09ed019
--- /dev/null
+++ b/.github/config.yml
@@ -0,0 +1,2 @@
+firstPRMergeComment: >
+ Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) if you want to receive a contributor role.
diff --git a/.gitignore b/.gitignore
index 5e80ec3..9dbd27a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -74,6 +74,7 @@ cmake-build-*/
# IntelliJ
out/
+.idea/
# mpeltonen/sbt-idea plugin
.idea_modules/
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 0583f12..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
-/kotlinc.xml
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 1bec35e..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index 79ee123..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/discord.xml b/.idea/discord.xml
deleted file mode 100644
index d8e9561..0000000
--- a/.idea/discord.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml
deleted file mode 100644
index 02b915b..0000000
--- a/.idea/git_toolbox_prj.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 73ab2c8..0000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 6a8d183..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 4c6280e..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b50a677..b6f2459 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+# [7.1.0-dev.2](https://github.com/revanced/revanced-patcher/compare/v7.1.0-dev.1...v7.1.0-dev.2) (2023-05-05)
+
+
+### Features
+
+* add overload to get instruction as type ([49c173d](https://github.com/revanced/revanced-patcher/commit/49c173dc14137ddd198a611e9882dc71300831ee))
+
+# [7.1.0-dev.1](https://github.com/revanced/revanced-patcher/compare/v7.0.0...v7.1.0-dev.1) (2023-04-30)
+
+
+### Features
+
+* add appreciation message for new contributors ([d674362](https://github.com/revanced/revanced-patcher/commit/d67436271ddca9ccfe008272c1ca82c6123ae7ee))
+
# [7.0.0](https://github.com/revanced/revanced-patcher/compare/v6.4.3...v7.0.0) (2023-02-26)
diff --git a/build.gradle.kts b/build.gradle.kts
index 78ff4d4..904423d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,5 @@
plugins {
- kotlin("jvm") version "1.7.0"
- java
+ kotlin("jvm") version "1.8.10"
`maven-publish`
}
@@ -26,8 +25,8 @@ dependencies {
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
implementation("app.revanced:apktool-lib:2.7.0")
- implementation(kotlin("reflect"))
- testImplementation(kotlin("test"))
+ implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC")
+ testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.20-RC")
}
tasks {
diff --git a/gradle.properties b/gradle.properties
index 486f17c..e9061c4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,2 @@
kotlin.code.style = official
-version = 7.0.0
+version = 7.1.0-dev.2
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 608bd94..1f017e4 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt
index 6ccf06c..723c377 100644
--- a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt
+++ b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt
@@ -101,12 +101,20 @@ fun MutableMethod.removeInstruction(index: Int) = this.implementation!!.removeIn
fun MutableMethod.label(index: Int) = this.implementation!!.newLabelForIndex(index)
/**
- * Get the instruction at the given index in the method's implementation.
+ * Get an instruction at the given index in the method's implementation.
* @param index The index to get the instruction at.
* @return The instruction.
*/
fun MutableMethod.instruction(index: Int): BuilderInstruction = this.implementation!!.instructions[index]
+/**
+ * Get an instruction at the given index in the method's implementation.
+ * @param index The index to get the instruction at.
+ * @param T The type of instruction to return.
+ * @return The instruction.
+ */
+fun MutableMethod.instruction(index: Int): T = instruction(index) as T
+
/**
* Add smali instructions to the method.
* @param index The index to insert the instructions at.
diff --git a/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt b/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt
index 0abe1d7..9d1bbd4 100644
--- a/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt
+++ b/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt
@@ -44,7 +44,7 @@ internal class InlineSmaliCompilerTest {
"""
)
- val insn = method.instruction(insnIndex) as BuilderInstruction21t
+ val insn = method.instruction(insnIndex)
assertEquals(targetIndex, insn.target.location.index)
}
@@ -73,7 +73,7 @@ internal class InlineSmaliCompilerTest {
)
)
- val insn = method.instruction(insnIndex) as BuilderInstruction21t
+ val insn = method.instruction(insnIndex)
assertTrue(insn.target.isPlaced, "Label was not placed")
assertEquals(labelIndex, insn.target.location.index)
}