Git Product home page Git Product logo

Comments (26)

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024 1

Did you grant ReVanced CLI/ Shell root access? Also try the install utility command with --mount

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

Nice approach! Sure, on with the basics: Yep, my adb shell has been authorized already (I checked com.android.shell on Magisk). Also, the --mount flag is there when I executed the command:

java -jar revanced-cli.jar utility install --mount com.package.name -a patched.apk adb-device-serial-number

Tested on both revanced-cli-3.1.0 and revanced-cli-4.0.2. Only revanced-cli-3.1.0 mounted the patched app correctly.

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

I can not reproduce the issue. Can you debug it on your end? If so, check, if you get stuck anywhere in the function here: https://github.com/ReVanced/revanced-library/blob/fda3eca74f30b968d8ee816d63a3dcf493e026de/src/main/kotlin/app/revanced/library/adb/AdbManager.kt#L75

Dev env setup guide: https://github.com/ReVanced/revanced-documentation/tree/main/docs/revanced-development

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I can try. But I haven't touched Kotlin before. Let me get back to you on this maybe after next week.

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I got lost at Step 3 in setting up the IntelliJ IDEA Environment. I can't figure out how to do this:

  1. Add a new Run/Debug configuration for the revanced-cli project; Make sure to add Before launch tasks to build revanced-patches and optionally publish revanced-patcher

Do I create this xml file manually or is there a way in IntelliJ IDEA? What filename do I use? How to execute it? Do I place it in the root of revanced-cli?

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

You don't need to manually add the XML file. You can create a Run configuration in IntelliJ IDEA

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I know, but I don't see an XML file format in the drop-down list:

image

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

I suggest to get familiar with the IDE first:

https://www.jetbrains.com/help/idea/run-debug-configuration.html

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

Got it bro. But turns out I just need to tick this so I can see the config file in the project directory😩
image

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I finished writing the run/debug config. I'll add an adb device parameter later:

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Run ReVanced CLI" type="JetRunConfigurationType">
    <option name="MAIN_CLASS_NAME" value="app.revanced.cli.command.MainCommand.kt" />
    <module name="revanced-cli.main" />
    <option name="PROGRAM_PARAMETERS" value="
             patch
             -b ../revanced-patches/build/libs/revanced-patches-2.196.0-dev.11.jar
             -m ../revanced-integrations.apk
             -o ../revanced.apk
             ../unpatched.apk
    "/>
    <method v="2">
      <option name="RunConfigurationTask" enabled="true" run_configuration_name="revanced-patcher [publish]" run_configuration_type="GradleRunConfiguration" />
      <option name="RunConfigurationTask" enabled="true" run_configuration_name="revanced-patches [build]" run_configuration_type="GradleRunConfiguration" />
      <option name="Make" enabled="true" />
    </method>
  </configuration>
</component>

I just want to be able to run this successfully, but it won't just yet. What class name do I put here?

image

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

As the documentation as well as the sample XML suggests, the Main command class

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I also thought that'd be the case, but Idea couldn't find the class

image

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

The class is present:

You may need to sync the project files with Gradle or troubleshoot your IDE

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

You're correct, I can confirm the .kt file is in that exact directory. I need to figure something out... I'll get back to you

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I honestly don't know what the problem is. Here's what I've been doing:

  1. Clone all revanced dev repos. Each repo will be stored in their dedicated folders locally.

  2. Run gradlew build inside revanced-cli, revanced-patcher, and revanced-patches. (I skipped building revanced-integrations since I already have an apk.)

  3. Open revanced-cli folder in IntelliJ IDEA. Go to Project Structure > Modules then import revanced-patches folder as module. Just click Next > Next > Next > Next > Create.

  4. Back to the main project window, create a Run/Debug Configuration file (this will create an XML file in revanced-cli/.run folder. Using the sample XML, modify the value of the PROGRAM_PARAMETERS. IDEA should then be able to recognize that the script depends on Kotlin SDK and the MAIN_CLASS_NAME being app.revanced.cli.command.MainCommand.kt.

And then the error happens when the XML is run:

image

If you have any ideas, please tell me. I'm not proficient at all in Gradle/Kotlin/IntelliJ IDEA, let alone troubleshooting this error.

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

If you can see a Run button in the line I sent, you can click on it. The IDE will automatically create a run configuration

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

Goodness broo, of course IDEA wouldn't find app.revanced.cli.command.MainCommand.kt because it should have been app.revanced.cli.command.MainCommandKt by now! This is the classname that was generated from the latest revanced-cli project.

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

Whohoo it's working now!

image

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I can now run revanced-cli in IDEA. I tested two methods of mounting a patched apk:

  • Patching a stock apk via patch and mounting it with --mount flag, all in one go.
  • Using utilities to mount an already patched apk with --mount flag.

The IDE didn't raise an error.

Unlike in my initial issue, the patched apk now gets written in /data/adb/revanced even if the folder is not yet present. However, the mount shell script does not get created in /data/adb/service.d if this folder is not present.

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

In which scenario would that folder not be present?

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

When I delete the folder itself (I thought it'd be faster than running the unmount command in cli).

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

I don't think ReVanced has to handle this case. You are not supposed to delete folders in your file system and programs should be able to assume they exist for that reason. Though, if you want, you can PR handling this case in the ReVanced Library repository. If there is anything else, please reopen this issue

from revanced-cli.

Ushie avatar Ushie commented on June 20, 2024

I don't see how this is better fit in revanced library instead of here.. this can simply be fixed by creating the dir if it doesn't exist which should've been the case to begin with, ReVanced will always write to that directory so I don't see a con to doing that

from revanced-cli.

oSumAtrIX avatar oSumAtrIX commented on June 20, 2024

Because the mounting code (AdbManager) is in ReVanced Library.

from revanced-cli.

exconvinced avatar exconvinced commented on June 20, 2024

I don't think ReVanced has to handle this case. You are not supposed to delete folders in your file system and programs should be able to assume they exist for that reason. Though, if you want, you can PR handling this case in the ReVanced Library repository. If there is anything else, please reopen this issue

That's perfectly reasonable. I'll consider creating a PR since I've sunk deep enough into this rabbit hole. Because of my silly issue, I got to touch IntelliJ 🤤

from revanced-cli.

Ushie avatar Ushie commented on June 20, 2024

Because the mounting code (AdbManager) is in ReVanced Library.

I see

from revanced-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.