Code Monkey home page Code Monkey logo

Comments (2)

Col-E avatar Col-E commented on July 30, 2024 1

For 2.X switch to table mode.

For 3.X or 4.X use the Fields and Methods tab on the top right.

from recaf.

eleses avatar eleses commented on July 30, 2024

For 2.X switch to table mode.

How does one do that?

Ah, yeah, I have to right-click in the search -> "go to definition". Then in the main window, right click again on the class tab and choose table... And I'm still not able to rename anything there. The class name field is disabled (grayed out).

image

To have a snowball's chance in hell at renaming I have use the class list. The only problem with that is that actual obfuscators create many similar names...

image

So please consider this when (re-)designing the graphical user interface. And even then, it doesn't actually work

01:39:05.019 [ForkJoinPool-1-worker-2] ERROR: Failed to analyze phantom references for primary resource
java.lang.IllegalStateException: null
	at org.clyze.jphantom.methods.MethodLookupTable$CachingAdapter.visit(MethodLookupTable.java:74)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:570)
	at org.objectweb.asm.ClassReader.accept(ClassReader.java:425)
	at org.clyze.jphantom.Transformer.transform(Transformer.java:53)
	at org.clyze.jphantom.Phantoms.generateClasses(Phantoms.java:57)
	at org.clyze.jphantom.JPhantom.run(JPhantom.java:116)
	at me.coley.recaf.workspace.PhantomResource.populatePhantoms(PhantomResource.java:105)
	at me.coley.recaf.workspace.Workspace.lambda$analyzePhantoms$0(Workspace.java:160)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
	at me.coley.recaf.util.ClassUtil.getNode(ClassUtil.java:53)
	at me.coley.recaf.ui.controls.view.ClassViewport.updateView(ClassViewport.java:205)
	at me.coley.recaf.ui.controls.RenamingTextField.defaultAction(RenamingTextField.java:298)
	at me.coley.recaf.ui.controls.RenamingTextField.lambda$new$3(RenamingTextField.java:58)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Node.fireEvent(Node.java:8411)
	at com.sun.javafx.scene.control.behavior.TextFieldBehavior.fire(TextFieldBehavior.java:179)
	at com.sun.javafx.scene.control.behavior.TextInputControlBehavior.callAction(TextInputControlBehavior.java:178)
	at com.sun.javafx.scene.control.behavior.BehaviorBase.callActionForEvent(BehaviorBase.java:218)
	at com.sun.javafx.scene.control.behavior.TextInputControlBehavior.callActionForEvent(TextInputControlBehavior.java:127)
	at com.sun.javafx.scene.control.behavior.BehaviorBase.lambda$new$0(BehaviorBase.java:135)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.stage.PopupWindow$PopupEventRedirector.handleKeyEvent(PopupWindow.java:987)
	at javafx.stage.PopupWindow$PopupEventRedirector.handleRedirectedEvent(PopupWindow.java:959)
	at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:106)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
	at com.sun.javafx.event.EventRedirector.redirectEvent(EventRedirector.java:124)
	at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:103)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$KeyHandler.process(Scene.java:3964)
	at javafx.scene.Scene$KeyHandler.access$1800(Scene.java:3910)
	at javafx.scene.Scene.impl_processKeyEvent(Scene.java:2040)
	at javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2501)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:217)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:149)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:248)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:247)
	at com.sun.glass.ui.View.handleKeyEvent(View.java:546)
	at com.sun.glass.ui.View.notifyKey(View.java:966)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
	at java.lang.Thread.run(Thread.java:750)

Now, is there a cli way to rename a class?

Oh, it does work in v13. It's only broken in v14!

There was something telling on recaf startup too

$ java -jar recaf-2.21.14-J8-jar-with-dependencies.jar 
14:32:11.377 [main] INFO : Recaf-2.21.14
14:32:11.379 [main] INFO : - Java: 1.8.0_412 (OpenJDK 64-Bit Server VM)
14:32:11.484 [main] TRACE: Loading configuration
Gtk-Message: 14:32:11.636: Failed to load module "canberra-gtk-module"
14:32:25.489 [ForkJoinPool-1-worker-1] INFO : Loaded workspace from: XXX.jar
14:32:25.493 [ForkJoinPool-1-worker-2] DEBUG: Begin generating phantom classes, given 118 input classes
14:32:26.360 [ForkJoinPool-1-worker-2] DEBUG: Phantom analysis complete, generated 118 classes
14:32:26.605 [ForkJoinPool-1-worker-2] ERROR: Failed to analyze phantom references for primary resource
java.lang.IllegalStateException: null

but with v13

$java -jar recaf-2.21.13-J8-jar-with-dependencies.jar 
01:59:29.823 [main] INFO : Recaf-2.21.13
01:59:29.825 [main] INFO : - Java: 1.8.0_412 (OpenJDK 64-Bit Server VM)
01:59:29.922 [main] TRACE: Loading configuration
Gtk-Message: 01:59:30.047: Failed to load module "canberra-gtk-module"
01:59:39.983 [ForkJoinPool-1-worker-1] INFO : Loaded workspace from: XXX.jar
01:59:39.984 [ForkJoinPool-1-worker-2] DEBUG: Begin generating phantom classes, given 118 input classes
01:59:40.576 [ForkJoinPool-1-worker-2] DEBUG: Phantom analysis complete, generated 118 classes
01:59:40.577 [ForkJoinPool-1-worker-2] DEBUG: Generated 92 phantom classes in 594 ms

Maybe I should file a different bug report about this.

from recaf.

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.