Comments (3)
Figred it out.
I added class and method references wrong way. When implementing new class or method one should add reference to *Definition
class not *Reference
.
Thanks!
from dexer.
Something like this:
var dex = new Dex();
var cref = new ClassReference("fullname");
dex.Import(cref);
var returntype = PrimitiveType.Void;
dex.Import(returntype);
var parameterType = PrimitiveType.Int;
var parameter = new Parameter(parameterType);
dex.Import(parameterType);
Prototype prototype = new Prototype(returntype, parameter);
var mref = new MethodReference(cref, "methodname", prototype);
dex.Import(mref);
dex.Write("output.dex");
When you start from scratch, or when you need to add new stuff, you have to make sure all the types you plan to use are properly imported in the system.
from dexer.
@sailro, thanks for fast response!
a bit of clarification - I need to write down method instructions.
ps
Of course I added all references (classes, fields, methods) so all lookup collections have them. Either I do something wrong (order wise) or there might be some bug with objects comparison.
from dexer.
Related Issues (9)
- Null descriptor strings
- OpCodes.FilledNewArrayRange Overflow
- OpCodes.MoveWide16 Not implemented in InstructionReader.cs HOT 1
- InstructionReader.ExtractSparseSwitch Fails to extract switch. HOT 2
- Please optimize these codes HOT 3
- Find a bug in ReadAnnotationSetRefList HOT 1
- Fix InstructionWriter.WriteTo if exrta data present HOT 2
- Crash InstructionReader on somes obfuscated dex 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 dexer.