{"id":178,"date":"2014-11-06T21:23:12","date_gmt":"2014-11-06T20:23:12","guid":{"rendered":"http:\/\/www.sarbyn.com\/tech\/?p=178"},"modified":"2014-11-06T21:25:02","modified_gmt":"2014-11-06T20:25:02","slug":"some-thoughts-about-whatsapp-voip","status":"publish","type":"post","link":"https:\/\/www.sarbyn.com\/blog\/2014\/11\/06\/some-thoughts-about-whatsapp-voip\/","title":{"rendered":"Some thoughts about WhatsApp + VoIP"},"content":{"rendered":"<p>Today WhatsApp has released a new version with the <del datetime=\"2014-11-06T20:24:52+00:00\">green<\/del> blue read notification icon.<\/p>\n<p>I downloaded it and tried to inspect the APK in searching of something\u00a0interesting.<\/p>\n<p>Tools:<\/p>\n<ul>\n<li>WhatsApp APK<\/li>\n<li><a href=\"https:\/\/code.google.com\/p\/android-apktool\/\">Apktool <\/a>&#8211; in order to analyze XML resources<\/li>\n<li><a href=\"https:\/\/code.google.com\/p\/dex2jar\/\">Dex2Jar<\/a> &#8211; if you want to analyze the (obfuscated) source code<\/li>\n<\/ul>\n<p>These are some thoughts about the next VoIP feature after a fast and quick analysis. I think that with enough time it&#8217;s possible to find a lot of interesting things (for example: it is possible to enable VoIP feature hacking the smali files?).<\/p>\n<p>VoIP engine is fully implemented (I think). The native library <em>libwhatsapp.so<\/em> contains a lot of <a href=\"http:\/\/www.pjsip.org\/\">PJSIP<\/a> references. This is an excerpt of a &#8220;strings libwhatsapp.so&#8221; command<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nError creating stream: %d\r\npjmedia_stream_get_port error\r\nError creating conf bridge\r\nstream_port\r\nError adding stream port to conf bridge\r\npjmedia_stream_start error\r\n....\r\nUnspecified audio device error (PJMEDIA_EAUD_ERR)\r\nUnknown error from audio driver (PJMEDIA_EAUD_SYSERR)\r\nAudio subsystem not initialized (PJMEDIA_EAUD_INIT)\r\nInvalid audio device (PJMEDIA_EAUD_INVDEV)\r\nFound no audio devices (PJMEDIA_EAUD_NODEV)\r\n<\/pre>\n<p>Another interesting thing is that there are a lot of references to <a href=\"https:\/\/en.wikipedia.org\/wiki\/Secure_Real-time_Transport_Protocol\">SRTP<\/a> protocol. SRTP\u00a0is implemented by default in PjSIP but there are also some little references in .class files, so maybe the VoIP calls will be made using SRTP encryption.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nerror during srtp key copy for offer\r\nerror during srtp key copy for offer accept\r\npjmedia_transport_srtp_create failed\r\npjmedia_transport_srtp_start failed: %d\r\nincompatible-srtp-key-exchange\r\n....\r\n%s: function srtp_protect\r\n%s: srtp auth tag: %s\r\n%s: function srtp_unprotect\r\n<\/pre>\n<p>The last interesting thing is the VoipActivity layout and the visual rendering made by Eclipse. This will be the &#8220;In call activity&#8221; ?<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sarbyn.com\/tech\/wp-content\/uploads\/2014\/11\/B1xFvPOCUAAm6Cw.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-183 size-medium\" src=\"https:\/\/i0.wp.com\/www.sarbyn.com\/tech\/wp-content\/uploads\/2014\/11\/B1xFvPOCUAAm6Cw-180x300.png?resize=180%2C300\" alt=\"WhatsApp Voip Activity\" width=\"180\" height=\"300\" srcset=\"https:\/\/i0.wp.com\/www.sarbyn.com\/blog\/wp-content\/uploads\/2014\/11\/B1xFvPOCUAAm6Cw.png?resize=180%2C300&amp;ssl=1 180w, https:\/\/i0.wp.com\/www.sarbyn.com\/blog\/wp-content\/uploads\/2014\/11\/B1xFvPOCUAAm6Cw.png?w=354&amp;ssl=1 354w\" sizes=\"(max-width: 180px) 100vw, 180px\" \/><\/a><\/p>\n<p>Below you can analyze the Activity XML file (sorry for the bad XML rendering on this page&#8230;I need to find a better WordPress Template)<\/p>\n<pre class=\"brush: xml; collapse: true; light: false; title: Activity XML file - click to expand; toolbar: true; notranslate\" title=\"Activity XML file - click to expand\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;RelativeLayout android:background=&quot;@*android:color\/black&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot;\r\n  xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; xmlns:app=&quot;http:\/\/schemas.android.com\/apk\/res-auto&quot;&gt;\r\n    &lt;TextView android:textSize=&quot;27.0sp&quot; android:textColor=&quot;@*android:color\/white&quot; android:gravity=&quot;left&quot; android:id=&quot;@id\/name&quot; android:paddingLeft=&quot;16.0dip&quot; android:paddingTop=&quot;10.0dip&quot; android:paddingRight=&quot;16.0dip&quot; android:paddingBottom=&quot;10.0dip&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:fontFamily=&quot;sans-serif-light&quot; \/&gt;\r\n    &lt;LinearLayout android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:layout_alignTop=&quot;@id\/name&quot; android:layout_alignRight=&quot;@id\/name&quot; android:layout_alignBottom=&quot;@id\/name&quot;&gt;\r\n        &lt;View android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;fill_parent&quot; android:layout_weight=&quot;2.0&quot; \/&gt;\r\n        &lt;Button android:id=&quot;@id\/report_audio_quality_btn&quot; android:background=&quot;@*android:color\/transparent&quot; android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;fill_parent&quot; android:layout_weight=&quot;1.0&quot; \/&gt;\r\n    &lt;\/LinearLayout&gt;\r\n    &lt;LinearLayout android:orientation=&quot;vertical&quot; android:id=&quot;@id\/footer&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:layout_alignParentBottom=&quot;true&quot;&gt;\r\n        &lt;com.whatsapp.AnswerCallView android:id=&quot;@id\/answer_call_slider&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;78.0dip&quot; \/&gt;\r\n        &lt;FrameLayout android:id=&quot;@id\/answer_call_btns&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;78.0dip&quot;&gt;\r\n            &lt;ImageButton android:layout_gravity=&quot;center&quot; android:id=&quot;@id\/reject_with_message&quot; android:background=&quot;@drawable\/reject_with_message_btn_background&quot; android:padding=&quot;12.0dip&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; android:src=&quot;@drawable\/ic_reject_with_message&quot; android:contentDescription=&quot;@string\/voip_call_goto_chat_description&quot; \/&gt;\r\n        &lt;\/FrameLayout&gt;\r\n        &lt;LinearLayout android:orientation=&quot;horizontal&quot; android:id=&quot;@id\/call_btns&quot; android:visibility=&quot;gone&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;78.0dip&quot;&gt;\r\n            &lt;ImageButton android:id=&quot;@id\/end_call_btn&quot; android:background=&quot;@drawable\/btn_end_call_background&quot; android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;fill_parent&quot; android:src=&quot;@drawable\/btn_end_call&quot; android:layout_weight=&quot;1.0&quot; android:contentDescription=&quot;@string\/voip_call_end_button_description&quot; \/&gt;\r\n            &lt;ImageButton android:id=&quot;@id\/voip_call_btn&quot; android:background=&quot;@drawable\/btn_start_call_background&quot; android:visibility=&quot;gone&quot; android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;fill_parent&quot; android:src=&quot;@drawable\/btn_start_call&quot; android:layout_weight=&quot;1.0&quot; android:contentDescription=&quot;@string\/voip_call_start_button_description&quot; \/&gt;\r\n        &lt;\/LinearLayout&gt;\r\n        &lt;LinearLayout android:orientation=&quot;horizontal&quot; android:id=&quot;@id\/audio_btns&quot; android:visibility=&quot;gone&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;78.0dip&quot;&gt;\r\n            &lt;LinearLayout android:orientation=&quot;vertical&quot; android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;wrap_content&quot; android:layout_weight=&quot;1.0&quot;&gt;\r\n                &lt;ImageButton android:id=&quot;@id\/speaker_btn&quot; android:background=&quot;#ff111111&quot; android:paddingTop=&quot;17.0dip&quot; android:paddingBottom=&quot;17.0dip&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:src=&quot;@drawable\/ic_speaker&quot; android:contentDescription=&quot;@string\/voip_call_speakerphone_toggle_description&quot; \/&gt;\r\n                &lt;View android:id=&quot;@id\/speaker_btn_on&quot; android:background=&quot;#b238caff&quot; android:visibility=&quot;invisible&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;10.0dip&quot; \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n            &lt;LinearLayout android:orientation=&quot;vertical&quot; android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;wrap_content&quot; android:layout_weight=&quot;1.0&quot;&gt;\r\n                &lt;ImageButton android:id=&quot;@id\/chat_btn&quot; android:background=&quot;#ff111111&quot; android:paddingTop=&quot;17.0dip&quot; android:paddingBottom=&quot;17.0dip&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:src=&quot;@drawable\/ic_chat&quot; android:contentDescription=&quot;@string\/voip_call_goto_chat_description&quot; \/&gt;\r\n                &lt;View android:id=&quot;@id\/chat_btn_on&quot; android:background=&quot;#b238caff&quot; android:visibility=&quot;invisible&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;10.0dip&quot; \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n            &lt;LinearLayout android:orientation=&quot;vertical&quot; android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;wrap_content&quot; android:layout_weight=&quot;1.0&quot;&gt;\r\n                &lt;ImageButton android:id=&quot;@id\/mute_btn&quot; android:background=&quot;#ff111111&quot; android:paddingTop=&quot;17.0dip&quot; android:paddingBottom=&quot;17.0dip&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:src=&quot;@drawable\/ic_mute&quot; android:contentDescription=&quot;@string\/voip_call_mute_toggle_description&quot; \/&gt;\r\n                &lt;View android:id=&quot;@id\/mute_btn_on&quot; android:background=&quot;#b238caff&quot; android:visibility=&quot;invisible&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;10.0dip&quot; \/&gt;\r\n            &lt;\/LinearLayout&gt;\r\n        &lt;\/LinearLayout&gt;\r\n    &lt;\/LinearLayout&gt;\r\n    &lt;FrameLayout android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; android:layout_above=&quot;@id\/footer&quot; android:layout_below=&quot;@id\/name&quot;&gt;\r\n        &lt;ImageView android:id=&quot;@id\/profile_picture&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; android:src=&quot;@drawable\/ic_pic_contact_xlarge&quot; android:scaleType=&quot;centerCrop&quot; android:contentDescription=&quot;@string\/contact_avatar_image&quot; \/&gt;\r\n        &lt;View android:layout_gravity=&quot;bottom&quot; android:background=&quot;@drawable\/call_photo_overlay&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;4.0dip&quot; \/&gt;\r\n        &lt;TextView android:textSize=&quot;28.0sp&quot; android:textColor=&quot;@*android:color\/white&quot; android:gravity=&quot;center&quot; android:layout_gravity=&quot;bottom&quot; android:id=&quot;@id\/user_hint&quot; android:padding=&quot;12.0dip&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:shadowColor=&quot;@*android:color\/black&quot; android:shadowDx=&quot;1.0&quot; android:shadowDy=&quot;1.0&quot; android:shadowRadius=&quot;2.0&quot; android:fontFamily=&quot;sans-serif-light&quot; \/&gt;\r\n    &lt;\/FrameLayout&gt;\r\n    &lt;LinearLayout android:gravity=&quot;center&quot; android:orientation=&quot;horizontal&quot; android:id=&quot;@id\/call_status_bar&quot; android:background=&quot;#cc4abc34&quot; android:paddingLeft=&quot;16.0dip&quot; android:paddingTop=&quot;7.0dip&quot; android:paddingRight=&quot;16.0dip&quot; android:paddingBottom=&quot;7.0dip&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:layout_below=&quot;@id\/name&quot; android:animateLayoutChanges=&quot;true&quot;&gt;\r\n        &lt;ImageView android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; android:layout_marginRight=&quot;6.0dip&quot; android:src=&quot;@drawable\/call_icon&quot; android:contentDescription=&quot;@string\/call_icon_content_description&quot; \/&gt;\r\n        &lt;TextView android:textSize=&quot;16.0sp&quot; android:textColor=&quot;#c6ffffff&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; android:text=&quot;@string\/voip_call_label&quot; \/&gt;\r\n        &lt;View android:layout_width=&quot;0.0dip&quot; android:layout_height=&quot;1.0dip&quot; android:layout_weight=&quot;1.0&quot; \/&gt;\r\n        &lt;TextView android:textSize=&quot;16.0sp&quot; android:textColor=&quot;#c6ffffff&quot; android:id=&quot;@id\/call_status&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; \/&gt;\r\n    &lt;\/LinearLayout&gt;\r\n&lt;\/RelativeLayout&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Today WhatsApp has released a new version with the green blue read notification icon. I downloaded it and tried to inspect the APK in searching of something\u00a0interesting. Tools: WhatsApp APK Apktool &#8211; in order to analyze XML resources Dex2Jar &#8211; if you want to analyze the (obfuscated) source code These are some thoughts about the <a class=\"read-more\" href=\"https:\/\/www.sarbyn.com\/blog\/2014\/11\/06\/some-thoughts-about-whatsapp-voip\/\">&hellip;&nbsp;<span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[5],"tags":[51,52,50],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-android","tag-apktool","tag-dex2jar","tag-whatsapp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3JApm-2S","jetpack_likes_enabled":true,"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts\/178"}],"collection":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":10,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts\/178\/revisions\/189"}],"wp:attachment":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}