Top Banner
MOBILE SDKS: USE WITH CAUTION Ori Lentzitzky [email protected] Ori Lentzitzky @orilentz orilentz
37

Mobile SDKs: Use with Caution - Ori Lentzitzky

Apr 14, 2017

Download

Technology

DroidConTLV
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mobile SDKs: Use with Caution - Ori Lentzitzky

MOBILE SDKS: USE WITH CAUTION

Ori Lentzitzky

[email protected] Ori Lentzitzky@orilentzorilentz

Page 2: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

AVERAGE OF

SDKS IN APPS

Page 3: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

WinIt58 SDKs

Wishbone60 SDKs

Destiny57 SDKs

Page 4: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

Page 5: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

POPULAR SDKs CATEGORIES

Page 6: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

FIREBASE & CRASH REPORTING

Page 7: Mobile SDKs: Use with Caution - Ori Lentzitzky

CHECK OUT YOUR APP OR SIMILAR APPS

safedk.com

Page 8: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

That’s all fine and dandy...

So what’s the problem?

Page 9: Mobile SDKs: Use with Caution - Ori Lentzitzky

IT IS SOMEONE ELSE’S CODE INSIDE YOURS

YET YOU ARE RESPONSIBLE FOR IT…

WHY IS IT A PROBLEM?

safedk.com

Page 10: Mobile SDKs: Use with Caution - Ori Lentzitzky

WHY ARE SDKS RISKY ?

SECURITY & PRIVACY

safedk.com

Page 11: Mobile SDKs: Use with Caution - Ori Lentzitzky

if (context.checkCallingOrSelfPermission("android.permission.ACCESS_FINE_LOCATION")) {

Location userLocation = locationManager.getLastKnownLocation("gps");

}

if (hasEmailPermission()) {Pattern emailPattern = Patterns.EMAIL_ADDRESS;Account[] accounts =

AccountManager.get(this.mContext).getAccounts();…

}

THE DARK SIDE OF SDK PERMISSIONS

safedk.com

Page 12: Mobile SDKs: Use with Caution - Ori Lentzitzky

SDKs & PERMISSIONS: WHAT THEY DON’T TELL YOU

safedk.com

60.94%

15.31%13.30%

10.87%

5.01% 4.01% 3.58% 3.29%0.72%

0.00%

10.00%

20.00%

30.00%

40.00%

50.00%

60.00%

70.00%

Network Files PhoneState

Location Wake Lock Pim Camera Microphone In AppPurchase

• 16.59% of SDKs access

the list of installed apps.

• 9.3% of SDKs access

Accounts.

• 5.86% of SDKs access

Microphone.

Page 14: Mobile SDKs: Use with Caution - Ori Lentzitzky

BAD NEWS FROM BADNEWS

safedk.com

Page 15: Mobile SDKs: Use with Caution - Ori Lentzitzky

BAD NEWS FROM BADNEWS: HOW IT WORKED

safedk.com

App uploaded to Play StoreApp passed Google checks:

no malware

Users downloadthe app

BadNews sets up a serviceon the device

Device polls BadNews’ C&Cserver every 4 hours

Server responds withmalicious data

And voila!Device is infected

with malware

Page 16: Mobile SDKs: Use with Caution - Ori Lentzitzky

NOT TO WORRY, I CAN PROTECT MYSELF

safedk.com

if (myCoolAwesomeConfiguration.isEnabled(SOME_SDK_KEY)) {new SomeSDK().init(SOME_SDK_KEY);

}

Page 17: Mobile SDKs: Use with Caution - Ori Lentzitzky

OOPS…

safedk.com

<receiver android:name="com.somesdk.sdk.BigMajorReceiver"><intent-filter>

<action android:name="android.intent.action.BOOT_COMPLETED"/><action android:name="android.intent.action.USER_PRESENT"/><action android:name=" android.intent.action. ACTION_POWER_CONNECTED"/>

</intent-filter></receiver>

Page 18: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

Page 19: Mobile SDKs: Use with Caution - Ori Lentzitzky

AARs: SELF-GRANTING PERMISSIONS

safedk.com

<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.google.android.gms.analytics">

<uses-sdk android:minSdkVersion="9"/>

<!-- Include required permissions for Analytics to run. --><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Optional permission for Analytics to run. --><uses-permission android:name="android.permission.WAKE_LOCK"/>

<application /></manifest>

* Google Play Analytics, v9.4.0

Page 20: Mobile SDKs: Use with Caution - Ori Lentzitzky

JUST SAY NO!

safedk.com

<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.mine.myawesomeapp">

<uses-permissionandroid:name="android.permission.WAKE_LOCK" tools:node=“remove”/>

</manifest>

Page 21: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

ANDROID DEX AND THE METHOD COUNT

Page 22: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

164,796Methods

134,313Methods 159,717

Methods

WinIt58 SDKs

Wishbone60 SDKs

Destiny57 SDKs

Page 23: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

THE GOOGLE PLAY SERVICES EXAMPLE

• Google offers its own SDK for Android withplenty of wonderful features and capabilities...

.........

• Adds many methods

~ 44K methods

Page 24: Mobile SDKs: Use with Caution - Ori Lentzitzky

THE CONSEQUENCES OF MULTIDEXING

Slower Compilation Slower Start Time

safedk.com

Page 25: Mobile SDKs: Use with Caution - Ori Lentzitzky

LOLLIPOP TO THE RESCUE

Slower compilation Slower Start Time

safedk.com

Page 26: Mobile SDKs: Use with Caution - Ori Lentzitzky

WHY ARE SDKS RISKY ?

SECURITY & PRIVACY QUALITY OF SERVICE

safedk.com

Page 27: Mobile SDKs: Use with Caution - Ori Lentzitzky

WHO’S SLOWING YOU DOWN?

safedk.com

Page 28: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

Start Time: 1 3𝐴𝑝𝑝 + 2 3 𝑆𝐷𝐾𝑠

Page 29: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

Start Time: 2ND TIME’S THE CHARM?

Page 30: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

LETS LOOK INSIDE THE APK…

What’s this?

Additional code.When is it loaded?

Page 31: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

WHO’S CRASHING YOUR PARTY?

Page 32: Mobile SDKs: Use with Caution - Ori Lentzitzky

MAIN CRASH REASONS

Out of Memory

Null Pointer Exceptions…

Concurrency & Threads

Views & Layouts

Permissions Mishap

safedk.com

Page 33: Mobile SDKs: Use with Caution - Ori Lentzitzky

KEEPING UP WITH THE ANDROIDS

safedk.com

Page 34: Mobile SDKs: Use with Caution - Ori Lentzitzky

SO ARE SDKs THE ENEMY?

safedk.com

Page 35: Mobile SDKs: Use with Caution - Ori Lentzitzky

SO ARE SDKs THE ENEMY?

safedk.com

Page 36: Mobile SDKs: Use with Caution - Ori Lentzitzky

safedk.com

When throwing a great party, be careful of any guests that might spike the punch

Page 37: Mobile SDKs: Use with Caution - Ori Lentzitzky

THANK YOU!

WWW.SAFEDK.COM

[email protected] Ori Lentzitzky@orilentzorilentz