Comments (5)
My prototype for fixing this problem in a not-that-elegant way:
- Create wrapper classes for the main Ella class in the runtime. Each of those classes will be merged to one additional DEX file. Make sure that those classes have different names. A wrapper class looks like,
public abstract class EllaWrapper {
private static Method m_method;
static {
try {
Class<?> ella_class = Class.forName("com.apposcopy.ella.runtime.Ella");
m_method = ella_class.getDeclaredMethod("m", int.class);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static void m(int mId) {
try {
m_method.invoke(null, mId);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
Basically, I use Java reflection to get the reference to the main class at very beginning, and subsequent calls to m
will use the reference directly.
-
Modify Ella instrumentation to merge the main Ella classes to
classes.dex
and wrapper classes toclasses2.dex
,classes3.dex
, etc. This should make sure that main Ella classes are always loaded first (before wrapper classes try to find them via reflection). -
Modify Ella instrumentation to target the Ella classes that are included in the respective DEX files when instrumenting each method in the app. Otherwise the instrumentor will say that it cannot find reference to the Ella main class.
One issue of this approach is that, if classes.dex
already has too many methods (already reaching the 64K limitation), the approach will not work since main Ella classes cannot be merged into the main DEX file.
Hope this helps.
from ella.
@ms1995 Hi, I'm facing the same problem. Do you have a working prototype? Could you kindly share your code? Thanks a lot!
from ella.
@yisun92 I do have a working prototype and will release it later. Thanks.
from ella.
Please see my working version at,
https://github.com/ms1995/ella-customized
from ella.
Please see my working version at,
Thanks! I'll have a try
from ella.
Related Issues (14)
- Issue with deploying ella web app HOT 5
- Not considering the situation where message breaks are truncated due to the buffer length
- Caused by: org.jf.util.ExceptionWithContext: debug info items must have non-decreasing code addresses HOT 1
- ant error? HOT 2
- Error when build Ella, "java.lang.RuntimeException: The executable 'android' is not in the path" HOT 2
- Cannot run ella.sh i <apk path>
- issue: Error to execute ella.i.sh <path-to-apk> HOT 3
- Can Ella work without the front end, or web-server? HOT 1
- Cannot run program "dx". HOT 3
- FileNotFoundException ella.runtime.dex HOT 2
- Issue: Error occurred while instrumenting HOT 5
- Error on Instrument the app
- How to record timestamp and values of arguments of executed methods?
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 ella.