SlideShare a Scribd company logo
Inside DVM
Basics

Nick Bova
@mykola_bova
Nov 14 2013
Why Java is vulnerable?
1. For portability, Java code is partially compiled
and then interpreted by the JVM.
2. Java’s compiled classes contain a lot of
symbolic information for the JVM.
3. The JVM is a simple stack machine.
4. Standard applications have no real protection
against decompilation.
Why Android apps are vulnerable?
1. There are multiple easy ways to gain access
to Android APKs.
2. It’s simple to translate an APK to a Java jar
file for subsequent decompilation.
3. One-click decompilation is possible, using
tools such as apktool.
4. APKs are shared on hacker forums.
Legal Issues to Consider When
Decompiling
Цель оправдывает средства?
Legal Issues to Consider When
Decompiling
1. Don’t decompile an APK, recompile it, and then
pass it off as your own.
2. Don’t even think of trying to sell a recompiled
APK to any third parties.
3. Try not to decompile an APK or application that
comes with a license agreement that expressly
forbids decompiling or reverse-engineering the
code.
4. Don’t decompile an APK to remove any
protection mechanisms and then recompile it
for your own personal use..
Protecting Yourself (Protection
schemes)
Protection schemes in your code: Spreading
protection schemes throughout your code (such
as checking whether the phone is rooted) is
useless because the schemes can be
commented out of the decompiled code.
Protecting Yourself (Obfuscation)
Obfuscation: Obfuscation replaces the method
names and variable names in a class file with
weird and wonderful names. This can be an
excellent deterrent, but the source code is often
still visible, depending on your choice of
obfuscator.
Protecting Yourself (Server-side code)
Server-side code: The safest protection for APKs
is to hide all the interesting code on the web
server and only use the APK as a thin front-end
GUI. This has the downside that you may still
need to hide an API key somewhere to gain
access to the web server
Protecting Yourself (Native code)
Native code: The Android Native Development
Kit (NDK) allows you to hide password
information in C++ files that can be
disassembled but not decompiled and that still
run on top of the DVM. Done correctly, this
technique can add a significant layer of
protection.
Protecting Yourself (Encryption)
Encryption can also be used in conjunction with
the NDK to provide an additional layer of
protection from disassembly, or as a way of
passing public and private key information to
any backend web server.
Protecting Yourself
What else?

More Related Content

ZIP
Writing Code That Writes Code
PDF
Preparing Your Source Code for Distribution
 
PDF
Open source
PDF
20 Facts about Swift programming language
PPT
Swift Introduction
PPTX
SETCON'18 - Yauheni Pakala - .NET Embedding
PPTX
How to Build a Successful API Program: Best Practices For the Carrier
PDF
JavaScript as a First-Class Citizen on iOS 7
Writing Code That Writes Code
Preparing Your Source Code for Distribution
 
Open source
20 Facts about Swift programming language
Swift Introduction
SETCON'18 - Yauheni Pakala - .NET Embedding
How to Build a Successful API Program: Best Practices For the Carrier
JavaScript as a First-Class Citizen on iOS 7

What's hot (8)

PDF
Better Swift from the Foundation up #tryswiftnyc17 09-06
PDF
Swift GUI Development without Xcode
PDF
Spark: jsFiddle Meets Salesforce Lightning
PDF
Spark: jsFiddle Meets Salesforce Lightning
PDF
How to Automate Mobile P2P Application with Appium
PPT
Android Developer Meetup
PDF
JSDT 2.0 Eclipse DemoCamp (Walldorf)
PDF
Why documentation osidays
Better Swift from the Foundation up #tryswiftnyc17 09-06
Swift GUI Development without Xcode
Spark: jsFiddle Meets Salesforce Lightning
Spark: jsFiddle Meets Salesforce Lightning
How to Automate Mobile P2P Application with Appium
Android Developer Meetup
JSDT 2.0 Eclipse DemoCamp (Walldorf)
Why documentation osidays
Ad

Similar to Inside Dvm basics (20)

PDF
Droidcon it-2014-marco-grassi-viaforensics
PDF
MobSecCon 2015 - Dynamic Analysis of Android Apps
PDF
A taxonomy of obfuscating transformations
PDF
Reverse engineering Java et contournement du mécanisme de paiement inapp Android
PDF
Who Needs Thumbs? Reverse Engineering Scramble with Friends v1.1
PDF
Security Patterns for Microservice Architectures - London Java Community 2020
PDF
Security Patterns for Microservice Architectures
PDF
Security Patterns for Microservice Architectures - SpringOne 2020
PPTX
Decompiling Android
PDF
Security Patterns for Microservice Architectures - Oktane20
PDF
idsecconf2023 - Aan Wahyu - Hide n seek with android app protections and beat...
PPTX
Rooted con 2020 - from the heaven to hell in the CI - CD
PPTX
Features of java Part - 3
PDF
Decompiling Android Discover How Android Apps Are Compiled And Built To Secur...
PPTX
Android security
PDF
Breaking Secure Mobile Applications - Hack In The Box 2014 KL
DOCX
Java and its features
PDF
Android security and penetration testing | DIVA | Yogesh Ojha
PDF
Android Internals
Droidcon it-2014-marco-grassi-viaforensics
MobSecCon 2015 - Dynamic Analysis of Android Apps
A taxonomy of obfuscating transformations
Reverse engineering Java et contournement du mécanisme de paiement inapp Android
Who Needs Thumbs? Reverse Engineering Scramble with Friends v1.1
Security Patterns for Microservice Architectures - London Java Community 2020
Security Patterns for Microservice Architectures
Security Patterns for Microservice Architectures - SpringOne 2020
Decompiling Android
Security Patterns for Microservice Architectures - Oktane20
idsecconf2023 - Aan Wahyu - Hide n seek with android app protections and beat...
Rooted con 2020 - from the heaven to hell in the CI - CD
Features of java Part - 3
Decompiling Android Discover How Android Apps Are Compiled And Built To Secur...
Android security
Breaking Secure Mobile Applications - Hack In The Box 2014 KL
Java and its features
Android security and penetration testing | DIVA | Yogesh Ojha
Android Internals
Ad

More from Mykola Bova (6)

PDF
backbase-cxp-datasheet
PPTX
inside dvm internals
PPTX
Inside Dvm tools
PPTX
Dvm internals intro
PPTX
PPTX
backbase-cxp-datasheet
inside dvm internals
Inside Dvm tools
Dvm internals intro

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
A Presentation on Artificial Intelligence
Big Data Technologies - Introduction.pptx
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25-Week II
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
Encapsulation_ Review paper, used for researhc scholars
A comparative analysis of optical character recognition models for extracting...
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Mobile App Security Testing_ A Comprehensive Guide.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology

Inside Dvm basics

  • 2. Why Java is vulnerable? 1. For portability, Java code is partially compiled and then interpreted by the JVM. 2. Java’s compiled classes contain a lot of symbolic information for the JVM. 3. The JVM is a simple stack machine. 4. Standard applications have no real protection against decompilation.
  • 3. Why Android apps are vulnerable? 1. There are multiple easy ways to gain access to Android APKs. 2. It’s simple to translate an APK to a Java jar file for subsequent decompilation. 3. One-click decompilation is possible, using tools such as apktool. 4. APKs are shared on hacker forums.
  • 4. Legal Issues to Consider When Decompiling Цель оправдывает средства?
  • 5. Legal Issues to Consider When Decompiling 1. Don’t decompile an APK, recompile it, and then pass it off as your own. 2. Don’t even think of trying to sell a recompiled APK to any third parties. 3. Try not to decompile an APK or application that comes with a license agreement that expressly forbids decompiling or reverse-engineering the code. 4. Don’t decompile an APK to remove any protection mechanisms and then recompile it for your own personal use..
  • 6. Protecting Yourself (Protection schemes) Protection schemes in your code: Spreading protection schemes throughout your code (such as checking whether the phone is rooted) is useless because the schemes can be commented out of the decompiled code.
  • 7. Protecting Yourself (Obfuscation) Obfuscation: Obfuscation replaces the method names and variable names in a class file with weird and wonderful names. This can be an excellent deterrent, but the source code is often still visible, depending on your choice of obfuscator.
  • 8. Protecting Yourself (Server-side code) Server-side code: The safest protection for APKs is to hide all the interesting code on the web server and only use the APK as a thin front-end GUI. This has the downside that you may still need to hide an API key somewhere to gain access to the web server
  • 9. Protecting Yourself (Native code) Native code: The Android Native Development Kit (NDK) allows you to hide password information in C++ files that can be disassembled but not decompiled and that still run on top of the DVM. Done correctly, this technique can add a significant layer of protection.
  • 10. Protecting Yourself (Encryption) Encryption can also be used in conjunction with the NDK to provide an additional layer of protection from disassembly, or as a way of passing public and private key information to any backend web server.