{"id":74,"date":"2014-01-22T23:40:58","date_gmt":"2014-01-22T23:40:58","guid":{"rendered":"http:\/\/www.nerdlingen.de\/?p=74"},"modified":"2023-04-15T20:37:40","modified_gmt":"2023-04-15T19:37:40","slug":"fairphone-with-or-without-googles-apps","status":"publish","type":"post","link":"https:\/\/www.nerdlingen.de\/?p=74","title":{"rendered":"Fairphone with or without Google&#8217;s Apps"},"content":{"rendered":"<p>Yep, a brand new Fairphone! One of the probably most notable differences of the &#8220;Fairphone OS&#8221; to any stock Android is, that it does not include, by default, all these little Google thingies like the Play Store, GMail, the Location Service etc.! On the other hand, Fairphone did provide a way to install that crap by downloading an approximately 100 MB sized file from some &#8220;secured source&#8221;. Fair enough.<\/p>\n<figure id=\"attachment_76\" aria-describedby=\"caption-attachment-76\" style=\"width: 324px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-76\" src=\"http:\/\/www.nerdlingen.de\/wp-content\/uploads\/InstallGoogleApps.png\" alt=\"InstallGoogleApps\" width=\"324\" height=\"119\" srcset=\"https:\/\/www.nerdlingen.de\/wp-content\/uploads\/InstallGoogleApps.png 490w, https:\/\/www.nerdlingen.de\/wp-content\/uploads\/InstallGoogleApps-300x110.png 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><figcaption id=\"caption-attachment-76\" class=\"wp-caption-text\">The &#8220;Install Google Apps&#8221; widget is by default on the home screen<\/figcaption><\/figure>\n<p>Two things to check here. First, where does this download come from and second: how can I control what&#8217;s being installed, e.g. to install the Play Store and it&#8217;s bare essential dependencies, and nothing else; maybe to exchange some of the frameworks by the great replacements from the <a title=\"Link to the NOGAPPS-Project\" href=\"http:\/\/forum.xda-developers.com\/showthread.php?t=1715375\" target=\"_blank\" rel=\"noopener\">NOGAPPS<\/a> project?<\/p>\n<p>By the way, there&#8217;s a really great thread about the Fairphone and it&#8217;s Hard- &amp; Software on the <a title=\"Fairphone-Thread on xda-developers.com\" href=\"http:\/\/forum.xda-developers.com\/showthread.php?t=2362172\" target=\"_blank\" rel=\"noopener\">XDA-Developers Forum<\/a>.<\/p>\n<p><strong>Where does this come from?<\/strong><\/p>\n<p>First of all, I wanted to know where the files get downloaded. A quick search didn&#8217;t give satisfactory results. But, there&#8217;s a <a title=\"Fairphone Firmware\" href=\"https:\/\/fairphone.zendesk.com\/hc\/en-us\/articles\/201189497-Fairphone-FP1-Fairphone-OS\" target=\"_blank\" rel=\"noopener\">Firmware recovery image available for download<\/a>. Looking at the APKs residing in \/system\/apps of that image (which saves quite some time compared to pulling that from the actual device) it is easily discoverable that this &#8220;Install Google Apps&#8221; widget belongs to FairPhoneHome.apk. The two great tools <a title=\"Link to APKTool's Homepage\" href=\"http:\/\/code.google.com\/p\/android-apktool\/\" target=\"_blank\" rel=\"noopener\">APKTool<\/a> and <a title=\"Link to SMALI's Homepage\" href=\"http:\/\/code.google.com\/p\/smali\/\" target=\"_blank\" rel=\"noopener\">SMALI<\/a> ease up the digging a lot,&nbsp; and in the end there&#8217;s the App&#8217;s string-resource XML-File that reveals the download location of the first step:<\/p>\n<pre class=\"brush: xml; gutter: false\">&lt;string name=\"gapps_installer_download_url\"&gt;http:\/\/www.fairphone.com\/externalcontent\/fp_ga.zip&lt;\/string&gt;\n&lt;string name=\"gapps_installer_config_file\"&gt;fairphonegapps&lt;\/string&gt;\n&lt;string name=\"gapps_installer_zip\"&gt;.zip&lt;\/string&gt;\n&lt;string name=\"gapps_installer_cfg\"&gt;.cfg&lt;\/string&gt;<\/pre>\n<p><a href=\"http:\/\/www.fairphone.com\/externalcontent\/fp_ga.zip\" target=\"_blank\" rel=\"noopener\">fp_ga.zip<\/a> contains two files, fairphonegapps.cfg and fairphonegapps.sig. fairphonegapps.sig seams to be the signature signed with the private key that belongs to the public key in FairPhoneHome.apk&#8217;s resources. Being no crypto expert, it&#8217;s not easy to tell whether this approach is secure, but a short look at the disassembly and some testing did not reveal any easy way to replace fairphonegapps.cfg.<\/p>\n<p>This file however, contains the link to the &#8220;real&#8221; GApps archive, together with it&#8217;s MD5-Hash.<\/p>\n<pre class=\"brush: text; gutter: false\">http:\/\/www.hightail.com\/e?phi_action=app\/directDownload&amp;fl=SWhZekZucHZsamVFTmVLWHo4b01Eak9yZWt5UmdteDRsUjJuWENHRzVZbz0\n64c3df86f20ab9b557fd3e4fc781633f<\/pre>\n<p>Well, let&#8217;s download that and have a look.<\/p>\n<p><strong>How to change the apps being installed?<\/strong><\/p>\n<p>The Archive contains the usual set of object files and bundles etc. needed to install the Google Apps. Is copied to the \/system volume, the phone will &#8220;install&#8221; them on the next reboot. The installer contains some hardcoded filenames and desinations, it&#8217;s automatically issue the needed remount-command to make \/system writable and does all the copying for us. As it&#8217;s inconvenient to try to replace the file being downloaded, let&#8217;s just install everything we want our own.<\/p>\n<p>The Android-SDK contains a nifty tool called &#8220;adb&#8221; that allows to connect to the underlying linux-shell of any android phone, given USB-Debugging is active and USB is set up correctly. On Windows, the <a title=\"Drivers\" href=\"http:\/\/androidurdu.com\/download-mt65xx-android-drivers-windows-7-vista-xp-x86-x64-amd\/\" target=\"_blank\" rel=\"noopener\">right drivers will have to be installed<\/a> (you might want to change &#8220;My HTC&#8221; in the driver to &#8220;Fairphone&#8221; for device id 0x0C03 if you don&#8217;t mind installing unsigned drivers). On Linux, you&#8217;ll need to modify the udev rules to include HTCs vendor ID, 0xBB4.<\/p>\n<p>Then it&#8217;s quite easy to modify the apps installed. I removed everything except the Google Play Services, it&#8217;s dependencies (Text to Speech) and the initialization app. All these have to be copied to the internal storage &#8220;SDCard&#8221;, for example into the folder &#8220;apps-install&#8221;. After that, start the terminal by issuing &#8220;adb shell&#8221;, then become root and copy the files over. This of course only works if the \/system filesystem has been re-mounted writable:<\/p>\n<pre class=\"brush: bash; gutter: false\">mount -o remount,rw \/system\ncp -r \/mnt\/sdcard\/apps-install\/* \/system\/\nchmod 755 \/system\/addon.d\/70-gapps.sh\nmount -o remount,ro \/system<\/pre>\n<p>When installing the face recognition service, 71-gapps-faceunlock.sh also needs to be chmodded.<\/p>\n<p>After copying, reboot the phone &#8211; Android will &#8220;optimize&#8221; your applications, and that&#8217;s it. As far as I know, one cannot use the Play Store without Google Account Services and all it&#8217;s downsides (like advertising, google only provides the setting to &#8220;ask&#8221; applications not to track users). So, if possible, use the <a title=\"APKDownloader\" href=\"http:\/\/apps.evozi.com\/apk-downloader\/\" target=\"_blank\" rel=\"noopener\">APKDownloader<\/a> extension or alternate sources like <a title=\"F-Droid &quot;App Store&quot;\" href=\"https:\/\/f-droid.org\/\">F-Droid<\/a>. Unfortunately, only few developers sell their apps directly.<\/p>\n<p>(first version, changes pending)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yep, a brand new Fairphone! One of the probably most notable differences of the &#8220;Fairphone OS&#8221; to any stock Android is, that it does not include, by default, all these little Google thingies like the Play Store, GMail, the Location &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.nerdlingen.de\/?p=74\"> <span class=\"screen-reader-text\">Fairphone with or without Google&#8217;s Apps<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-english","category-fair"],"_links":{"self":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=74"}],"version-history":[{"count":10,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":300,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions\/300"}],"wp:attachment":[{"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nerdlingen.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}