uninstall opera

14
How to recognise that the user has just uninstalled your Android app Przemek Jakubczyk Android Lead @Applause

Upload: przemyslaw-jakubczyk

Post on 15-Aug-2015

12 views

Category:

Mobile


1 download

TRANSCRIPT

Page 1: Uninstall opera

How to recognise that the user has just uninstalled your Android app

Przemek JakubczykAndroid Lead @Applause

Page 2: Uninstall opera

Let’s go!

Page 3: Uninstall opera

Read the broadcast

<receiver android:name=".PackageWatcher">

<intent-filter>

<action android:name="android.intent.action.PACKAGE_ADDED"/>

<action android:name="android.intent.action.PACKAGE_REMOVED"/>

<action android:name="android.intent.action.PACKAGE_REPLACED"/>

<data android:scheme="package"/>

</intent-filter>

</receiver>

Page 4: Uninstall opera

Read the broadcast

public void onReceive(Context context, final Intent intent) {

Bundle bundle = intent.getExtras();

Set<String> keys = bundle.keySet();

Iterator<String> it = keys.iterator();

Log.e("DDD", "Dumping Intent start");

while (it.hasNext()) {

String key = it.next();

Log.e("DDD", "[" + key + "=" + bundle.get(key) + "]");

}

Log.e("DDD", "Dumping Intent end");

}

Page 5: Uninstall opera

Usually we see (install)E/DDD (29199): Dumping Intent startE/DDD (29199): [android.intent.extra.UID=10089]E/DDD (29199): [android.intent.extra.user_handle=0]E/DDD (29199): Dumping Intent end

Page 6: Uninstall opera

Usually we see (reinstall)E/DDD (29199): Dumping Intent startE/DDD (29199): [android.intent.extra.REMOVED_FOR_ALL_USERS=false]E/DDD (29199): [android.intent.extra.UID=10089]E/DDD (29199): [android.intent.extra.DATA_REMOVED=false]E/DDD (29199): [android.intent.extra.REPLACING=true]E/DDD (29199): [android.intent.extra.user_handle=0]E/DDD (29199): Dumping Intent end

Page 7: Uninstall opera

Usually we see (uninstall)E/DDD (29199): Dumping Intent startE/DDD (29199): [android.intent.extra.REMOVED_FOR_ALL_USERS=true]E/DDD (29199): [android.intent.extra.UID=10089]E/DDD (29199): [android.intent.extra.DATA_REMOVED=true]E/DDD (29199): [android.intent.extra.user_handle=0]E/DDD (29199): Dumping Intent end

Page 8: Uninstall opera

Let’s uninstall our app

and there’s nothing ….

Why ?

OS unregisters us during removal

Page 9: Uninstall opera

What Opera does?

It does not listen for package removal

It registers I/O observer on /data/data

and it’s native code, not FileObserver

Page 10: Uninstall opera

Let’s delete Opera dir

root@mako:/data/datarm -rf com.opera.max

Page 11: Uninstall opera

How we did it?

● decompile apk using apktool● seek for native

find . -name *\.so● check the native code

`strings opera/lib/armeabi/libuo.so`

Page 12: Uninstall opera

rudy$ strings opera/lib/armeabi/libuo.so...inotify_initinotify_add_watchinotify_rm_watch...Androidstartandroid.intent.action.VIEW--usertruem:u:c:p:t:/data/data/%s/%s%s

Page 13: Uninstall opera

MoralFileObserver

Page 14: Uninstall opera

Thank youkudos to Aleksander Piotrowski

@pelotasplus