Comments (26)
Did you grant ReVanced CLI/ Shell root access? Also try the install utility command with --mount
from revanced-cli.
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.
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.
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.
I got lost at Step 3 in setting up the IntelliJ IDEA Environment. I can't figure out how to do this:
- 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.
You don't need to manually add the XML file. You can create a Run configuration in IntelliJ IDEA
from revanced-cli.
I know, but I don't see an XML file format in the drop-down list:
from revanced-cli.
I suggest to get familiar with the IDE first:
https://www.jetbrains.com/help/idea/run-debug-configuration.html
from revanced-cli.
Got it bro. But turns out I just need to tick this so I can see the config file in the project directory😩
from revanced-cli.
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?
from revanced-cli.
As the documentation as well as the sample XML suggests, the Main command class
from revanced-cli.
I also thought that'd be the case, but Idea couldn't find the class
from revanced-cli.
The class is present:
You may need to sync the project files with Gradle or troubleshoot your IDE
from revanced-cli.
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.
I honestly don't know what the problem is. Here's what I've been doing:
-
Clone all
revanced
dev repos. Each repo will be stored in their dedicated folders locally. -
Run
gradlew build
insiderevanced-cli
,revanced-patcher
, andrevanced-patches
. (I skipped buildingrevanced-integrations
since I already have an apk.) -
Open
revanced-cli
folder in IntelliJ IDEA. Go toProject Structure > Modules
then importrevanced-patches
folder as module. Just clickNext
>Next
>Next
>Next
>Create
. -
Back to the main project window, create a
Run/Debug Configuration
file (this will create an XML file inrevanced-cli/.run
folder. Using the sample XML, modify thevalue
of thePROGRAM_PARAMETERS
. IDEA should then be able to recognize that the script depends onKotlin SDK
and theMAIN_CLASS_NAME
beingapp.revanced.cli.command.MainCommand.kt
.
And then the error happens when the XML is run:
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.
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.
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.
Whohoo it's working now!
from revanced-cli.
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.
In which scenario would that folder not be present?
from revanced-cli.
When I delete the folder itself (I thought it'd be faster than running the unmount command in cli).
from revanced-cli.
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.
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.
Because the mounting code (AdbManager) is in ReVanced Library.
from revanced-cli.
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.
Because the mounting code (AdbManager) is in ReVanced Library.
I see
from revanced-cli.
Related Issues (20)
- bug: How to include the patches to be applied? HOT 3
- bug: how to apply only specific patches? HOT 3
- bug: formatting error when reading patch names HOT 8
- bug: --unsigned behaves incorrectly? HOT 3
- bug: Mounting causes app to crash on startup and changes app name to "com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application" HOT 13
- bug: Compiling error HOT 8
- feat: Index patches uniquely HOT 11
- bug: "INFO: " gets prepended to the output of `list-patches` command HOT 1
- patched reddit won't open bug: HOT 1
- feat: Interactive shell script HOT 5
- bug: YouTube patch: "Integrations have not been merged yet" error HOT 2
- bug: defined `-r` parameter is broken in patches v4.0.1 HOT 8
- bug: failure to build youtube 19.03.35 with default settings HOT 3
- bug (CLI v4.4.2): Certificate isn't installed properly in patched apk HOT 5
- bug: cant patch with the CLI HOT 3
- bug: Parameter -ii seems broken HOT 3
- bug: The fact that this exists
- bug: Failed to delete temp files
- bug: Too many WARNING about `null` value for `client-id` patch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from revanced-cli.