uninstall opera
TRANSCRIPT
How to recognise that the user has just uninstalled your Android app
Przemek JakubczykAndroid Lead @Applause
Let’s go!
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>
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");
}
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
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
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
Let’s uninstall our app
and there’s nothing ….
Why ?
OS unregisters us during removal
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
Let’s delete Opera dir
root@mako:/data/datarm -rf com.opera.max
How we did it?
● decompile apk using apktool● seek for native
find . -name *\.so● check the native code
`strings opera/lib/armeabi/libuo.so`
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
MoralFileObserver
Thank youkudos to Aleksander Piotrowski
@pelotasplus