chore: merge branch dev to main (#161)

This commit is contained in:
oSumAtrIX 2023-05-06 01:05:01 +02:00 committed by GitHub
commit 119d05f469
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 33 additions and 83 deletions

2
.github/config.yml vendored Normal file
View file

@ -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.

1
.gitignore vendored
View file

@ -74,6 +74,7 @@ cmake-build-*/
# IntelliJ # IntelliJ
out/ out/
.idea/
# mpeltonen/sbt-idea plugin # mpeltonen/sbt-idea plugin
.idea_modules/ .idea_modules/

9
.idea/.gitignore vendored
View file

@ -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

View file

@ -1,10 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

View file

@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT_FILES" />
<option name="description" value="" />
</component>
</project>

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>

View file

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="UnusedSymbol" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="azul-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -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) # [7.0.0](https://github.com/revanced/revanced-patcher/compare/v6.4.3...v7.0.0) (2023-02-26)

View file

@ -1,6 +1,5 @@
plugins { plugins {
kotlin("jvm") version "1.7.0" kotlin("jvm") version "1.8.10"
java
`maven-publish` `maven-publish`
} }
@ -26,8 +25,8 @@ dependencies {
implementation("app.revanced:multidexlib2:2.5.3-a3836654") implementation("app.revanced:multidexlib2:2.5.3-a3836654")
implementation("app.revanced:apktool-lib:2.7.0") implementation("app.revanced:apktool-lib:2.7.0")
implementation(kotlin("reflect")) implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC")
testImplementation(kotlin("test")) testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.20-RC")
} }
tasks { tasks {

View file

@ -1,2 +1,2 @@
kotlin.code.style = official kotlin.code.style = official
version = 7.0.0 version = 7.1.0-dev.2

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -101,12 +101,20 @@ fun MutableMethod.removeInstruction(index: Int) = this.implementation!!.removeIn
fun MutableMethod.label(index: Int) = this.implementation!!.newLabelForIndex(index) 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. * @param index The index to get the instruction at.
* @return The instruction. * @return The instruction.
*/ */
fun MutableMethod.instruction(index: Int): BuilderInstruction = this.implementation!!.instructions[index] 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 <T> MutableMethod.instruction(index: Int): T = instruction(index) as T
/** /**
* Add smali instructions to the method. * Add smali instructions to the method.
* @param index The index to insert the instructions at. * @param index The index to insert the instructions at.

View file

@ -44,7 +44,7 @@ internal class InlineSmaliCompilerTest {
""" """
) )
val insn = method.instruction(insnIndex) as BuilderInstruction21t val insn = method.instruction<BuilderInstruction21t>(insnIndex)
assertEquals(targetIndex, insn.target.location.index) assertEquals(targetIndex, insn.target.location.index)
} }
@ -73,7 +73,7 @@ internal class InlineSmaliCompilerTest {
) )
) )
val insn = method.instruction(insnIndex) as BuilderInstruction21t val insn = method.instruction<BuilderInstruction21t>(insnIndex)
assertTrue(insn.target.isPlaced, "Label was not placed") assertTrue(insn.target.isPlaced, "Label was not placed")
assertEquals(labelIndex, insn.target.location.index) assertEquals(labelIndex, insn.target.location.index)
} }