Comments (5)
I've got the same problem on a different APK.
It seems that when using baksmali -> smali without modifications the new
classes.dex file is not the same as the original.
I've used baksmali on the new classes.dex and done some comparing, I found that
lines like:
.field public static result:Landroid/content/Intent; = null
bacame:
.field public static result:Landroid/content/Intent;
and:
.field public static final TEST_android_focusable:I = 0x0
became:
.field public static final TEST_android_focusable:I
I guess this can cause the unexpected behavior since the fields initialization
is missing.
Original comment by [email protected]
on 4 Mar 2015 at 10:21
- Added labels: ****
- Removed labels: ****
from smali.
Nah, those two are semantically identical. result and TEST_android_focusable
will be initialized to null and 0 in both cases.
Original comment by [email protected]
on 4 Mar 2015 at 6:30
- Added labels: ****
- Removed labels: ****
from smali.
OK, but this is not the only difference, take a look at the attached two smali
files.
con#.7 is the file after backsmali on the original classes.dex, conN#.7 is the
file after I smali and baksmali again to see the differences.
The content is pretty different (and for some reason it changed the N to upper
case, not sure if it matter).
Original comment by [email protected]
on 4 Mar 2015 at 11:23
- Added labels: ****
- Removed labels: ****
Attachments:
from smali.
Those are 2 completely unrelated classes. The #.7 is an arbitrary suffix, which
is based on the (potentially non-deterministic) order that the classes are
processed in.
It's common for obfuscators to use names like that, that differ only in case,
in an attempt to make tools mis-handle the classes.
baksmali detects that it is on a case-insensitive filesystem, and ensures that
files with names that only differ in case are written to distinct files. To
ensure they are distinct, it adds a suffix like #.1, #.2, etc. However, the
suffix is non-deterministic - in that it depends on the order that the classes
are processed in. So in this case, these are actually 2 different classes. The
other con class might be in con.smali, or con#.1.smali, etc.
When smali re-assembles the classes, the filename is ignored, so it doesn't
affect the resulting dex file. The class name is taken from the .class
directive. So it would be Lcon; and LcoN; respectively, regardless of the name
of the file.
Original comment by [email protected]
on 4 Mar 2015 at 11:45
- Added labels: ****
- Removed labels: ****
from smali.
This is likely to be due to some sort of tamper-checking code in the apk.
Original comment by [email protected]
on 17 Mar 2015 at 3:39
- Changed state: Done
- Added labels: ****
- Removed labels: ****
from smali.
Related Issues (20)
- baksmali on ICS not working HOT 2
- Issues with Google Guice with baksmali/smali v2.0.3 HOT 24
- ArrayIndexOutOfBoundsException - Dexlib2 - Iterating Instructions HOT 2
- Error occurred while disassembling class Landroid.support Invalid method index: 35 HOT 21
- Smali doesn't support odex instruction throw-verification-error HOT 1
- Unsigned short value out of range HOT 3
- Deodexing android L preview framework files issue HOT 19
- deodexerant BUG HOT 3
- please disable /4, /16, /jumbo in output HOT 1
- Cannot Deodex GT 5312 system app HOT 1
- How to write arabic strings in Smali code ? const-string ? HOT 3
- Enhancement: getTypeCount in DexBackedDexFile HOT 1
- problem with recompiling edited systemui HOT 3
- Can't build on Windows using JDK 1.6/1.7/1.8 HOT 2
- Exception in thread "main" org.jf.util.ExceptionWithContext: Calculator.odex is not an apk, dex file or odex file. HOT 4
- baksmali doesn't work on Windows 8.1 HOT 5
- Out-of-order encoded_annotation name_idx HOT 2
- Enhancement: Common base interfaces in org.jf.dexlib2.iface HOT 3
- Failed to load dvmGetInlineOpsTable HOT 4
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.