Comments (2)
Complex question, the actual size will vary, certain data can be shared between classes.
For instance, strings, two classes may have the same strings within, but you only get on entry into the string index table.
and some compilers use space saving tricks, such as if two methods have identical dubug info items, they with only write one and and set the debug_info_off to the same offset.
With such data sharing, how do you calculate the size contribution?
from smali.
java class files have a lot of redundancy, especially when they cross-link (eg: when they are part of the same program). java class files are heavily processed during class loading and the VMs are expected to have a very different and more compact representation in memory after loading, with much of this redundancy reduced.
dex files were designed for low memory devices and structured in such a way that they are ready for VM interpretation straight out of the file contents. they can simply be memory mapped and interpreted from there. so much of the java class loader processing needed to load java class files into memory is already done at dex build time when the dex file is constructed. redundancy is reduced and data is shared among classes.
so if A and B are classes, all you can (mostly) say is:
size(dex({A})) + size(dex({B})) >= size(dex({A, B}))
(in reality through, the use of larger indexes in bigger dex files might make that equation not hold.)
from smali.
Related Issues (20)
- Ive been Hacked please help me HOT 6
- Parsing smali methode HOT 1
- The Fields do not keep their initial values if they're default value
- odex error
- Error while writing instruction at code offset 0x8
- Dex file size increases by ~50% without making changes (DexFileFactory.loadDexFile then DexFileFactory.writeDexFile) HOT 7
- missing EOF at '.class'
- any method to replace one String with modifiedString in StringIds section of dex file using dexlib2? HOT 3
- How to create a new method using dexlib2 HOT 2
- Try to run examples/BracketedMemberNames HOT 1
- how to copy class to new dex using dexlib2 HOT 4
- Smali patcher does not support Dex version 039 HOT 1
- java.lang.NoSuchMethodError when calling DexPool.internClass
- smali report error
- how to move the useless classes to a new dex using dexlib2? HOT 1
- [Feature Request] Could we support dex v41? HOT 3
- Won't build under Debian WSL
- Regenerate correct boot.oat/.art/.vdex files after a recompile
- dexlib2 cannot open dex file extracted from framework.jar (/system/framework/framework.jar)
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 smali.