SlideShare a Scribd company logo
I just hacked
your app
Watch this
PWNED
Marcos Placona
@marcos_placona
marcos@twilio.com
github.com/mplacona
androidsecurity.info
NOT
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum euismod ipsum
et semper vestibulum. In congue, risus ac lobortis commodo, arcu elit congue nisi, e
ullamcorper diam quam in est. Quisque nec lectus eget metus pharetra placerat.
Quisque nisi lorem, convallis eget lobortis quis, suscipit eu sem. Sed ligula purus,
lacinia quis ultrices at, sollicitudin at lacus. Duis porta hendrerit semper. Sed vitae
mauris fringilla, porta turpis facilisis, facilisis risus. Integer quis lobortis velit. Vivamu
ut placerat ex. Nunc est purus, pretium vitae hendrerit fringilla, molestie at tortor.
Vestibulum vel purus et urna hendrerit pretium et quis nunc. Fusce sit amet neque in
justo elementum rutrum ut nec metus. Fusce sollicitudin, dui vel molestie aliquam,
ligula leo fringilla augue, a luctus quam sem sed tortor. Vivamus mattis nisi purus, si
amet efficitur lectus mollis nec. Etiam consectetur, nisl eu euismod posuere, justo
neque vehicula ex, nec lobortis augue neque id mi. Ut aliquam odio ac turpis
condimentum porttitor.
Mauris ut est eu sapien tempor congue. Proin ipsum sem, cursus quis magna eu,
finibus fringilla nulla. Vestibulum viverra felis ac arcu iaculis condimentum. Aenean
mattis magna non ipsum viverra accumsan. Suspendisse potenti. Nam quis dapibus
ipsum. Integer at tortor ac neque semper consectetur. Donec vitae mattis felis, quis
elementum dolor fringilla eu. Nulla luctus arcu et egestas ultrices. Quisque dignissim
lacinia vehicula. Suspendisse vitae nisl dapibus, dapibus elit quis, efficitur ex. Done
interdum est purus, nec tempor risus sollicitudin tincidunt. Vestibulum accumsan sed
libero ut tincidunt.
Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum vitae
consectetur ex, vitae viverra felis. Sed vitae imperdiet turpis. Donec eget velit
sagittis, hendrerit ante id, aliquet libero. Proin pulvinar ornare consectetur. Vestibulum
ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin
consequat tincidunt risus et aliquam. Donec vel vulputate sem, sed ornare lorem.
Curabitur a maximus urna, ut blandit tellus.
Suspendisse I haven’t nisl a ultricies semper. Cras really purus mollis vestibulum
rhoncus. Sed hacked your orci, imperdiet vitae pharetra app, tincidunt laoreet lacus
Vivamus posuere nisl diam, ut efficitur mauris facilisis vehicula. Vestibulum risus veli
tincidunt a libero a, vestibulum tincidunt orci. Pellentesque in finibus est. Praesent
tempus tortor ac magna iaculis, sed cursus quam venenatis. Quisque pharetra
euismod auctor.
Sue-y
/s(j)uːi/
1. To become annoyed with someone who broke your
toy without permission and want to sue them for that.
“Company X got all ‘sue-y’ on me when I hacked their
app and showed the world"
Kuba Gretzki
http://bit.ly/hack4beer
loyalty
ˈlȯi(-ə)l-tē
loyalty
+ =
loyalty
HTTP Proxy
POST /users/461845f5d03e6c052a43afbc/points
Accept: application/json
Accept-Language: en-gb
X-App-Version: 1.28.0
User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1;)
...
Content-Type: application/json; charset=UTF-8
Content-Length: 375
Host: api.eatapp.com
Connection: Keep-Alive
Accept-Encoding: gzip
{
"authentication_token":"boKUp9vBHNAJp7XbWZCK",
"latitude":...,
"longitude":...,
"point":{
"isDoneByGesture":false,
"main_beacon":{
"major":38995,
"minor":12702,
"uuid":"2C75E74B-41B7-49E3-BD26-CE86B2F569F8"
},
"place_id":"450",
"promoted_products_ids":[
{"id":"647035946536601578040000"},
{"id":"647035946536601578040000"},
{"id":"647035946536601578050000"}
]
}
}
POST /users/461845f5d03e6c052a43afbc/points
Accept: application/json
Accept-Language: en-gb
X-App-Version: 1.28.0
User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1;)
...
Content-Type: application/json; charset=UTF-8
Content-Length: 375
Host: api.eatapp.com
Connection: Keep-Alive
Accept-Encoding: gzip
{
"authentication_token":"boKUp9vBHNAJp7XbWZCK",
"latitude":...,
"longitude":...,
"point":{
"isDoneByGesture":false,
"main_beacon":{
"major":38995,
"minor":12702,
"uuid":"2C75E74B-41B7-49E3-BD26-CE86B2F569F8"
},
"place_id":"450",
"promoted_products_ids":[
{"id":"647035946536601578040000"},
{"id":"647035946536601578040000"},
{"id":"647035946536601578050000"}
]
}
}
POST /users/461845f5d03e6c052a43afbc/points
Accept: application/json
Accept-Language: en-gb
X-App-Version: 1.28.0
User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1;)
...
Content-Type: application/json; charset=UTF-8
Content-Length: 375
Host: api.eatapp.com
Connection: Keep-Alive
Accept-Encoding: gzip
{
"authentication_token":"boKUp9vBHNAJp7XbWZCK",
"latitude":...,
"longitude":...,
"point":{
"isDoneByGesture":false,
"main_beacon":{
"major":38995,
"minor":12702,
"uuid":"2C75E74B-41B7-49E3-BD26-CE86B2F569F8"
},
"place_id":"450",
"promoted_products_ids":[
{"id":"647035946536601578040000"},
{"id":"647035946536601578040000"},
{"id":"647035946536601578050000"}
]
}
}
stop!
• Encrypt all the values
• Utilise security features when they exist
• Certificate pinning
• DO NOT TRUST THE DEVICE
Encrypt all the values
dependencies {
compile 'com.scottyab:aescrypt:0.0.1'
}
String password = "password";
String message = "hello world";
try {
String encryptedMsg = AESCrypt.encrypt(password, message);
}catch (GeneralSecurityException e){
//handle error
}
String password = "password";
String encryptedMsg = "2B22cS3UC5s35WBihLBo8w==";
try {
String messageAfterDecrypt = AESCrypt.decrypt(password, encryptedMsg);
}catch (GeneralSecurityException e){
//handle error - could be due to incorrect password or tampered encryptedMsg
}
Caveat: Your keys will end up in GitHub
• Encrypt all the values
• Utilise security features when they exist
• Certificate pinning
• DO NOT TRUST THE DEVICE
Utilise security features when they exist
• Encrypt all the values
• Utilise security features when they exist
• Certificate pinning
• DO NOT TRUST THE DEVICE
Certificate pinning
String hostname = "publicobject.com";
CertificatePinner certificatePinner = new CertificatePinner.Builder()
.add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=")
.build();
OkHttpClient client = OkHttpClient.Builder()
.certificatePinner(certificatePinner)
.build();
Request request = new Request.Builder()
.url("https://" + hostname)
.build();
client.newCall(request).execute();
http://bit.ly/android-certificate-pinning
Certificate pinning
String hostname = "publicobject.com";
CertificatePinner certificatePinner = new CertificatePinner.Builder()
.add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=")
.build();
OkHttpClient client = OkHttpClient.Builder()
.certificatePinner(certificatePinner)
.build();
Request request = new Request.Builder()
.url("https://" + hostname)
.build();
client.newCall(request).execute();
http://bit.ly/android-certificate-pinning
Certificate pinning
String hostname = "publicobject.com";
CertificatePinner certificatePinner = new CertificatePinner.Builder()
.add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=")
.build();
OkHttpClient client = OkHttpClient.Builder()
.certificatePinner(certificatePinner)
.build();
Request request = new Request.Builder()
.url("https://" + hostname)
.build();
client.newCall(request).execute();
http://bit.ly/android-certificate-pinning
• Encrypt all the values
• Utilise security features when they exist
• Certificate pinning
• DO NOT TRUST THE DEVICE
Someone will decompile your app
And when they do…
–Every Developer
“But I need magic strings”
Options
http://bit.ly/SafeKey
Encrypt
Make sure you encrypt or at least
encode them
Server
Get your keys of a server you own
Store in the NDK
http://bit.ly/NDKStorage
start!
• Add tampering detection
• Check your app’s signature
• Check for rooted device
• Check for emulator
• Check if the app is debuggable
Tampering detection
// myPackageName should decode at runtime to "com.yourpackagename"
// google should decode at runtime to "com.android.vending";
// amazon should decode at runtime to "com.amazon.venezia";
public boolean isHacked(Context context, String myPackageName, String google, String amazon)
{
//Crooks renamed your app?
if (context.getPackageName().compareTo(myPackageName != 0)
return true; // BOOM!
//Rogues relocated your app?
String installer = context.getPackageManager().getInstallerPackageName(myPackageName);
if (installer == null)
return true; // BOOM!
if (installer.compareTo(google) != 0 && installer.compareTo(amazon) != 0)
return true; // BOOM!
return false;
}
http://bit.ly/android-tampering-detection
Tampering detection
// myPackageName should decode at runtime to "com.yourpackagename"
// google should decode at runtime to "com.android.vending";
// amazon should decode at runtime to "com.amazon.venezia";
public boolean isHacked(Context context, String myPackageName, String google, String amazon)
{
//Crooks renamed your app?
if (context.getPackageName().compareTo(myPackageName != 0)
return true; // BOOM!
//Rogues relocated your app?
String installer = context.getPackageManager().getInstallerPackageName(myPackageName);
if (installer == null)
return true; // BOOM!
if (installer.compareTo(google) != 0 && installer.compareTo(amazon) != 0)
return true; // BOOM!
return false;
}
http://bit.ly/android-tampering-detection
• Add tampering detection
• Check your app’s signature
• Check for rooted device
• Check for emulator
• Check if the app is debuggable
private static final int VALID = 0;
private static final int INVALID = 1;
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846";
public static int checkAppSignature(Context context) {
try {
PackageInfo packageInfo = context.getPackageManager()
.getPackageInfo(context.getPackageName(),
PackageManager.GET_SIGNATURES);
for (Signature signature : packageInfo.signatures) {
byte[] signatureBytes = signature.toByteArray();
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
//compare signatures
if (SIGNATURE.equals(APP_SIGNATURE)){
return VALID;
};
}
} catch (Exception e) {
//assumes an issue in checking signature., but we let the caller decide on what to do.
}
return INVALID;
}
Check your app’s signature
http://bit.ly/AndroidTampering
• Add tampering detection
• Check your app’s signature
• Check for rooted device
• Check for emulator
• Check if the app is debuggable
private static boolean canExecuteCommand(String command) {
try {
int exitValue =
Runtime.getRuntime().exec(command).waitFor();
if (exitValue != 0) return false;
else return true;
} catch (Exception e) {
return false;
}
}
Check for rooted device
• Add tampering detection
• Check your app’s signature
• Check for rooted device
• Check for emulator
• Check if the app is debuggable
Build.FINGERPRINT.startsWith("generic")
Check for emulator
• Add tampering detection
• Check your app’s signature
• Check for rooted device
• Check for emulator
• Check if the app is debuggable
public static boolean isDebuggable(Context context){
return (context.getApplicationInfo().flags &
ApplicationInfo.FLAG_DEBUGGABLE) != 0;
}
Check if the app is debuggable
Debuggable app
Things to look at
• Protect your apps with tools like ProGuard and
DexGuard.
• Look at the SafetyNet API by Google
• Implement Network Security Configuration
http://bit.ly/SafeKey
ProGuard DexGuard
• Installed by default
• Name Obfuscation
• Code Optimisation
• Removal of Redundant Code
• FREE
• Class Encryption
• Call Hiding through Reflection
• String Encryption
• Certificate Checks
• Debug Detection
• Emulator Detection
• Root Detection
• Tamper Detection
• Costs $$$
Things to look at
• Protect your apps with tools like ProGuard and
DexGuard.
• Look at the SafetyNet API by Google
• Implement Network Security Configuration
http://bit.ly/SafeKey
SafetyNet API by Google
Things to look at
• Protect your apps with tools like ProGuard and
DexGuard.
• Look at the SafetyNet API by Google
• Implement Network Security Configuration
http://bit.ly/SafeKey
Network Security Configuration
Marcos Placona
@marcos_placona
marcos@twilio.com
Thanks
github.com/mplacona
androidsecurity.info

More Related Content

Viewers also liked

Viewers also liked (20)

Insights into Chatbot Development - Implementing Cross-Platform Chatbots - Ba...
Insights into Chatbot Development - Implementing Cross-Platform Chatbots - Ba...Insights into Chatbot Development - Implementing Cross-Platform Chatbots - Ba...
Insights into Chatbot Development - Implementing Cross-Platform Chatbots - Ba...
 
Urban Legends: What You Code Makes You Who You Are - PJ Hagerty - Codemotion ...
Urban Legends: What You Code Makes You Who You Are - PJ Hagerty - Codemotion ...Urban Legends: What You Code Makes You Who You Are - PJ Hagerty - Codemotion ...
Urban Legends: What You Code Makes You Who You Are - PJ Hagerty - Codemotion ...
 
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
Cyber Wars in the Cyber Space - Andrea Pompili - Codemotion Rome 2017
 
Cyber Analysts: who they are, what they do, where they are - Marco Ramilli - ...
Cyber Analysts: who they are, what they do, where they are - Marco Ramilli - ...Cyber Analysts: who they are, what they do, where they are - Marco Ramilli - ...
Cyber Analysts: who they are, what they do, where they are - Marco Ramilli - ...
 
Kunos Simulazioni and Assetto Corsa, behind the scenes- Alessandro Piva, Fabr...
Kunos Simulazioni and Assetto Corsa, behind the scenes- Alessandro Piva, Fabr...Kunos Simulazioni and Assetto Corsa, behind the scenes- Alessandro Piva, Fabr...
Kunos Simulazioni and Assetto Corsa, behind the scenes- Alessandro Piva, Fabr...
 
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
Galateo semi-serio dell'Open Source -  Luigi Dell' Aquila - Codemotion Rome 2017Galateo semi-serio dell'Open Source -  Luigi Dell' Aquila - Codemotion Rome 2017
Galateo semi-serio dell'Open Source - Luigi Dell' Aquila - Codemotion Rome 2017
 
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
Il game audio come processo ingegneristico - Davide Pensato - Codemotion Rome...
 
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
Commodore 64 Mon Amour(2): sprite multiplexing. Il caso Catalypse e altre sto...
 
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
Comics and immersive storytelling in Virtual Reality - Fabio Corrirossi - Cod...
 
Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...
Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...
Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...
 
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
Pronti per la legge sulla data protection GDPR? No Panic! - Domenico Maracci,...
 
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
Component-Based UI Architectures for the Web  - Andrew Rota - Codemotion Rome...Component-Based UI Architectures for the Web  - Andrew Rota - Codemotion Rome...
Component-Based UI Architectures for the Web - Andrew Rota - Codemotion Rome...
 
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
Monitoring Big Data Systems Done "The Simple Way" - Demi Ben-Ari - Codemotion...
 
Meetup Code Garden Roma e Java User Group Roma: metodi asincroni con Spring -...
Meetup Code Garden Roma e Java User Group Roma: metodi asincroni con Spring -...Meetup Code Garden Roma e Java User Group Roma: metodi asincroni con Spring -...
Meetup Code Garden Roma e Java User Group Roma: metodi asincroni con Spring -...
 
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
Full-Text Search Explained - Philipp Krenn - Codemotion Rome 2017
 
A recommendation engine for your applications - M.Orselli - Codemotion Rome 17
A recommendation engine for your applications - M.Orselli - Codemotion Rome 17A recommendation engine for your applications - M.Orselli - Codemotion Rome 17
A recommendation engine for your applications - M.Orselli - Codemotion Rome 17
 
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
Introduction to gRPC - Mete Atamel - Codemotion Rome 2017
 
How to Leverage Machine Learning (R, Hadoop, Spark, H2O) for Real Time Proces...
How to Leverage Machine Learning (R, Hadoop, Spark, H2O) for Real Time Proces...How to Leverage Machine Learning (R, Hadoop, Spark, H2O) for Real Time Proces...
How to Leverage Machine Learning (R, Hadoop, Spark, H2O) for Real Time Proces...
 
Staying Alive: Patterns for Failure Management From the Bottom of the Ocean -...
Staying Alive: Patterns for Failure Management From the Bottom of the Ocean -...Staying Alive: Patterns for Failure Management From the Bottom of the Ocean -...
Staying Alive: Patterns for Failure Management From the Bottom of the Ocean -...
 
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017
 

Similar to I just hacked your app! - Marcos Placona - Codemotion Rome 2017

Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Caching on the Edge with Symfony2
Caching on the Edge with Symfony2
Fabien Potencier
 

Similar to I just hacked your app! - Marcos Placona - Codemotion Rome 2017 (20)

How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
 
Mastering Multiplayer Stage3d and AIR game development for mobile devices
Mastering Multiplayer Stage3d and AIR game development for mobile devicesMastering Multiplayer Stage3d and AIR game development for mobile devices
Mastering Multiplayer Stage3d and AIR game development for mobile devices
 
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backend
 
developer presentation templates
developer presentation templatesdeveloper presentation templates
developer presentation templates
 
Workshop: building your mobile backend with Parse - Droidcon Paris2014
Workshop: building your mobile backend with Parse - Droidcon Paris2014Workshop: building your mobile backend with Parse - Droidcon Paris2014
Workshop: building your mobile backend with Parse - Droidcon Paris2014
 
40 Minutes on Business Model Innovation
40 Minutes on Business Model Innovation40 Minutes on Business Model Innovation
40 Minutes on Business Model Innovation
 
Business Model Innovation
Business Model InnovationBusiness Model Innovation
Business Model Innovation
 
Achievement Unlocked: Drive development, increase velocity, and write blissfu...
Achievement Unlocked: Drive development, increase velocity, and write blissfu...Achievement Unlocked: Drive development, increase velocity, and write blissfu...
Achievement Unlocked: Drive development, increase velocity, and write blissfu...
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
 
Puppet at janrain
Puppet at janrainPuppet at janrain
Puppet at janrain
 
TV Messaging Broadcasting System using Android
TV Messaging Broadcasting System using AndroidTV Messaging Broadcasting System using Android
TV Messaging Broadcasting System using Android
 
Mobile Performance Testing Crash Course
Mobile Performance Testing Crash CourseMobile Performance Testing Crash Course
Mobile Performance Testing Crash Course
 
Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Caching on the Edge with Symfony2
Caching on the Edge with Symfony2
 
Creating Responsive Experiences
Creating Responsive ExperiencesCreating Responsive Experiences
Creating Responsive Experiences
 
Progressive Web Apps – the return of the web?
Progressive Web Apps – the return of the web?Progressive Web Apps – the return of the web?
Progressive Web Apps – the return of the web?
 
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
iOSDevCamp 2011 - Getting "Test"-y: Test Driven Development & Automated Deplo...
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shine
 
Recent Trends in Cyber Security
Recent Trends in Cyber SecurityRecent Trends in Cyber Security
Recent Trends in Cyber Security
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
 

More from Codemotion

More from Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

I just hacked your app! - Marcos Placona - Codemotion Rome 2017

  • 3.
  • 6. NOT
  • 7.
  • 8. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum euismod ipsum et semper vestibulum. In congue, risus ac lobortis commodo, arcu elit congue nisi, e ullamcorper diam quam in est. Quisque nec lectus eget metus pharetra placerat. Quisque nisi lorem, convallis eget lobortis quis, suscipit eu sem. Sed ligula purus, lacinia quis ultrices at, sollicitudin at lacus. Duis porta hendrerit semper. Sed vitae mauris fringilla, porta turpis facilisis, facilisis risus. Integer quis lobortis velit. Vivamu ut placerat ex. Nunc est purus, pretium vitae hendrerit fringilla, molestie at tortor. Vestibulum vel purus et urna hendrerit pretium et quis nunc. Fusce sit amet neque in justo elementum rutrum ut nec metus. Fusce sollicitudin, dui vel molestie aliquam, ligula leo fringilla augue, a luctus quam sem sed tortor. Vivamus mattis nisi purus, si amet efficitur lectus mollis nec. Etiam consectetur, nisl eu euismod posuere, justo neque vehicula ex, nec lobortis augue neque id mi. Ut aliquam odio ac turpis condimentum porttitor. Mauris ut est eu sapien tempor congue. Proin ipsum sem, cursus quis magna eu, finibus fringilla nulla. Vestibulum viverra felis ac arcu iaculis condimentum. Aenean mattis magna non ipsum viverra accumsan. Suspendisse potenti. Nam quis dapibus ipsum. Integer at tortor ac neque semper consectetur. Donec vitae mattis felis, quis
  • 9. elementum dolor fringilla eu. Nulla luctus arcu et egestas ultrices. Quisque dignissim lacinia vehicula. Suspendisse vitae nisl dapibus, dapibus elit quis, efficitur ex. Done interdum est purus, nec tempor risus sollicitudin tincidunt. Vestibulum accumsan sed libero ut tincidunt. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum vitae consectetur ex, vitae viverra felis. Sed vitae imperdiet turpis. Donec eget velit sagittis, hendrerit ante id, aliquet libero. Proin pulvinar ornare consectetur. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin consequat tincidunt risus et aliquam. Donec vel vulputate sem, sed ornare lorem. Curabitur a maximus urna, ut blandit tellus. Suspendisse I haven’t nisl a ultricies semper. Cras really purus mollis vestibulum rhoncus. Sed hacked your orci, imperdiet vitae pharetra app, tincidunt laoreet lacus Vivamus posuere nisl diam, ut efficitur mauris facilisis vehicula. Vestibulum risus veli tincidunt a libero a, vestibulum tincidunt orci. Pellentesque in finibus est. Praesent tempus tortor ac magna iaculis, sed cursus quam venenatis. Quisque pharetra euismod auctor.
  • 10. Sue-y /s(j)uːi/ 1. To become annoyed with someone who broke your toy without permission and want to sue them for that. “Company X got all ‘sue-y’ on me when I hacked their app and showed the world"
  • 11.
  • 12.
  • 13.
  • 18. POST /users/461845f5d03e6c052a43afbc/points Accept: application/json Accept-Language: en-gb X-App-Version: 1.28.0 User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1;) ... Content-Type: application/json; charset=UTF-8 Content-Length: 375 Host: api.eatapp.com Connection: Keep-Alive Accept-Encoding: gzip { "authentication_token":"boKUp9vBHNAJp7XbWZCK", "latitude":..., "longitude":..., "point":{ "isDoneByGesture":false, "main_beacon":{ "major":38995, "minor":12702, "uuid":"2C75E74B-41B7-49E3-BD26-CE86B2F569F8" }, "place_id":"450", "promoted_products_ids":[ {"id":"647035946536601578040000"}, {"id":"647035946536601578040000"}, {"id":"647035946536601578050000"} ] } }
  • 19. POST /users/461845f5d03e6c052a43afbc/points Accept: application/json Accept-Language: en-gb X-App-Version: 1.28.0 User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1;) ... Content-Type: application/json; charset=UTF-8 Content-Length: 375 Host: api.eatapp.com Connection: Keep-Alive Accept-Encoding: gzip { "authentication_token":"boKUp9vBHNAJp7XbWZCK", "latitude":..., "longitude":..., "point":{ "isDoneByGesture":false, "main_beacon":{ "major":38995, "minor":12702, "uuid":"2C75E74B-41B7-49E3-BD26-CE86B2F569F8" }, "place_id":"450", "promoted_products_ids":[ {"id":"647035946536601578040000"}, {"id":"647035946536601578040000"}, {"id":"647035946536601578050000"} ] } }
  • 20. POST /users/461845f5d03e6c052a43afbc/points Accept: application/json Accept-Language: en-gb X-App-Version: 1.28.0 User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1;) ... Content-Type: application/json; charset=UTF-8 Content-Length: 375 Host: api.eatapp.com Connection: Keep-Alive Accept-Encoding: gzip { "authentication_token":"boKUp9vBHNAJp7XbWZCK", "latitude":..., "longitude":..., "point":{ "isDoneByGesture":false, "main_beacon":{ "major":38995, "minor":12702, "uuid":"2C75E74B-41B7-49E3-BD26-CE86B2F569F8" }, "place_id":"450", "promoted_products_ids":[ {"id":"647035946536601578040000"}, {"id":"647035946536601578040000"}, {"id":"647035946536601578050000"} ] } }
  • 21.
  • 22.
  • 23.
  • 24. stop!
  • 25. • Encrypt all the values • Utilise security features when they exist • Certificate pinning • DO NOT TRUST THE DEVICE
  • 26. Encrypt all the values dependencies { compile 'com.scottyab:aescrypt:0.0.1' } String password = "password"; String message = "hello world"; try { String encryptedMsg = AESCrypt.encrypt(password, message); }catch (GeneralSecurityException e){ //handle error } String password = "password"; String encryptedMsg = "2B22cS3UC5s35WBihLBo8w=="; try { String messageAfterDecrypt = AESCrypt.decrypt(password, encryptedMsg); }catch (GeneralSecurityException e){ //handle error - could be due to incorrect password or tampered encryptedMsg }
  • 27. Caveat: Your keys will end up in GitHub
  • 28. • Encrypt all the values • Utilise security features when they exist • Certificate pinning • DO NOT TRUST THE DEVICE
  • 29. Utilise security features when they exist
  • 30. • Encrypt all the values • Utilise security features when they exist • Certificate pinning • DO NOT TRUST THE DEVICE
  • 31. Certificate pinning String hostname = "publicobject.com"; CertificatePinner certificatePinner = new CertificatePinner.Builder() .add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") .build(); OkHttpClient client = OkHttpClient.Builder() .certificatePinner(certificatePinner) .build(); Request request = new Request.Builder() .url("https://" + hostname) .build(); client.newCall(request).execute(); http://bit.ly/android-certificate-pinning
  • 32. Certificate pinning String hostname = "publicobject.com"; CertificatePinner certificatePinner = new CertificatePinner.Builder() .add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") .build(); OkHttpClient client = OkHttpClient.Builder() .certificatePinner(certificatePinner) .build(); Request request = new Request.Builder() .url("https://" + hostname) .build(); client.newCall(request).execute(); http://bit.ly/android-certificate-pinning
  • 33. Certificate pinning String hostname = "publicobject.com"; CertificatePinner certificatePinner = new CertificatePinner.Builder() .add(hostname, "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") .build(); OkHttpClient client = OkHttpClient.Builder() .certificatePinner(certificatePinner) .build(); Request request = new Request.Builder() .url("https://" + hostname) .build(); client.newCall(request).execute(); http://bit.ly/android-certificate-pinning
  • 34. • Encrypt all the values • Utilise security features when they exist • Certificate pinning • DO NOT TRUST THE DEVICE
  • 36. And when they do…
  • 37. –Every Developer “But I need magic strings”
  • 38. Options http://bit.ly/SafeKey Encrypt Make sure you encrypt or at least encode them Server Get your keys of a server you own
  • 39. Store in the NDK http://bit.ly/NDKStorage
  • 41. • Add tampering detection • Check your app’s signature • Check for rooted device • Check for emulator • Check if the app is debuggable
  • 42. Tampering detection // myPackageName should decode at runtime to "com.yourpackagename" // google should decode at runtime to "com.android.vending"; // amazon should decode at runtime to "com.amazon.venezia"; public boolean isHacked(Context context, String myPackageName, String google, String amazon) { //Crooks renamed your app? if (context.getPackageName().compareTo(myPackageName != 0) return true; // BOOM! //Rogues relocated your app? String installer = context.getPackageManager().getInstallerPackageName(myPackageName); if (installer == null) return true; // BOOM! if (installer.compareTo(google) != 0 && installer.compareTo(amazon) != 0) return true; // BOOM! return false; } http://bit.ly/android-tampering-detection
  • 43. Tampering detection // myPackageName should decode at runtime to "com.yourpackagename" // google should decode at runtime to "com.android.vending"; // amazon should decode at runtime to "com.amazon.venezia"; public boolean isHacked(Context context, String myPackageName, String google, String amazon) { //Crooks renamed your app? if (context.getPackageName().compareTo(myPackageName != 0) return true; // BOOM! //Rogues relocated your app? String installer = context.getPackageManager().getInstallerPackageName(myPackageName); if (installer == null) return true; // BOOM! if (installer.compareTo(google) != 0 && installer.compareTo(amazon) != 0) return true; // BOOM! return false; } http://bit.ly/android-tampering-detection
  • 44. • Add tampering detection • Check your app’s signature • Check for rooted device • Check for emulator • Check if the app is debuggable
  • 45. private static final int VALID = 0; private static final int INVALID = 1; private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846"; public static int checkAppSignature(Context context) { try { PackageInfo packageInfo = context.getPackageManager() .getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES); for (Signature signature : packageInfo.signatures) { byte[] signatureBytes = signature.toByteArray(); MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); //compare signatures if (SIGNATURE.equals(APP_SIGNATURE)){ return VALID; }; } } catch (Exception e) { //assumes an issue in checking signature., but we let the caller decide on what to do. } return INVALID; } Check your app’s signature http://bit.ly/AndroidTampering
  • 46. • Add tampering detection • Check your app’s signature • Check for rooted device • Check for emulator • Check if the app is debuggable
  • 47. private static boolean canExecuteCommand(String command) { try { int exitValue = Runtime.getRuntime().exec(command).waitFor(); if (exitValue != 0) return false; else return true; } catch (Exception e) { return false; } } Check for rooted device
  • 48. • Add tampering detection • Check your app’s signature • Check for rooted device • Check for emulator • Check if the app is debuggable
  • 50. • Add tampering detection • Check your app’s signature • Check for rooted device • Check for emulator • Check if the app is debuggable
  • 51. public static boolean isDebuggable(Context context){ return (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; } Check if the app is debuggable
  • 53.
  • 54. Things to look at • Protect your apps with tools like ProGuard and DexGuard. • Look at the SafetyNet API by Google • Implement Network Security Configuration http://bit.ly/SafeKey
  • 55. ProGuard DexGuard • Installed by default • Name Obfuscation • Code Optimisation • Removal of Redundant Code • FREE • Class Encryption • Call Hiding through Reflection • String Encryption • Certificate Checks • Debug Detection • Emulator Detection • Root Detection • Tamper Detection • Costs $$$
  • 56. Things to look at • Protect your apps with tools like ProGuard and DexGuard. • Look at the SafetyNet API by Google • Implement Network Security Configuration http://bit.ly/SafeKey
  • 58. Things to look at • Protect your apps with tools like ProGuard and DexGuard. • Look at the SafetyNet API by Google • Implement Network Security Configuration http://bit.ly/SafeKey
  • 60.
  • 61.