Giter Site home page Giter Site logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 26, 2024
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)

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.