<h2id="Practical_guide_on_how_to_build_a_sans-google_phone">Practical guide on how to build a sans-google phone</h2>
<spanclass="anchor"id="line-8"></span><spanclass="anchor"id="line-9"></span><pclass="line874">This guide aims to build a Gapps-free software setup on a LineageOS-compatible phone, <spanclass="anchor"id="line-10"></span>with a wide compatibility over Android applications. <spanclass="anchor"id="line-11"></span><spanclass="anchor"id="line-12"></span><pclass="line867">
<h3id="Steps_to_perform_to_increase_compatibility">Steps to perform to increase compatibility</h3>
<spanclass="anchor"id="line-13"></span><spanclass="anchor"id="line-14"></span><pclass="line862">1. Install <aclass="http"href="http://lineageos.org/">LineageOS</a> without installing GApps <spanclass="anchor"id="line-15"></span><ul><li>This is the starting point, you have a web browser and stock applications <spanclass="anchor"id="line-16"></span></li></ul><pclass="line862">2. Install <aclass="https"href="https://f-droid.org/">f-droid</a><spanclass="anchor"id="line-17"></span><ul><li>Access to a large collection of open-source applications such as k-9 mail <spanclass="anchor"id="line-18"></span></li></ul><pclass="line874">3. From f-droid install DAVdroid and add a calDAV and a cardDAV server <spanclass="anchor"id="line-19"></span><ul><li>Calendar and contacts synchronization <spanclass="anchor"id="line-20"></span></li></ul><pclass="line874">4. Add your gplayweb private repo to f-droid <spanclass="anchor"id="line-21"></span><ul><li><pclass="line862">Access to all <aclass="nonexistent"href="./GooglePlay.html">GooglePlay</a>-only applications which do not use Google Play Services <spanclass="anchor"id="line-22"></span></li><li>Whatsapp (with large delays in notification due to missing gsf) <spanclass="anchor"id="line-23"></span></li><li>Telegram (working perfectly) <spanclass="anchor"id="line-24"></span></li></ul><pclass="line862">5. Patch your rom to enable signature spoofing with <aclass="https"href="https://github.com/ale5000-git/tingle">tingle</a><spanclass="anchor"id="line-25"></span><spanclass="anchor"id="line-26"></span><pclass="line862">6. Install the latest complete version of <aclass="https"href="https://microg.org/">microg</a><spanclass="anchor"id="line-27"></span><ul><li><pclass="line862">Selected applications can now use <aclass="nonexistent"href="./GoogleServicesFramework.html">GoogleServicesFramework</a><spanclass="anchor"id="line-28"></span></li><li>Whatsapp will now work perfectly <spanclass="anchor"id="line-29"></span></li><li>Assisted GPS location using third-party services such as Mozilla Location <spanclass="anchor"id="line-30"></span></li><li>Opt-in into google services for using almost every Android application <spanclass="anchor"id="line-31"></span></li><li>Use applications which use maps API such as Citymapper <spanclass="anchor"id="line-32"></span></li></ul><pclass="line862">7. Install <aclass="https"href="https://github.com/microg/android_frameworks_mapsv1">mapsv1</a><spanclass="anchor"id="line-33"></span><ul><li>Use applications such as My Vodafone Italia which rely on legacy maps apis <spanclass="anchor"id="line-34"></span></li></ul><pclass="line862">8. Install <aclass="https"href="https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445">magisk</a><spanclass="anchor"id="line-35"></span>and enable suhide for selected applications <spanclass="anchor"id="line-36"></span><ul><li>Super Mario Run, Google Pay, Home Banking applications will now work <spanclass="anchor"id="line-37"></span></li><li>All the applications which check root privileges without safetynet can be used <spanclass="anchor"id="line-38"></span></li></ul><pclass="line874">9. Install droidguard helper and achieve safetynet certification <spanclass="anchor"id="line-39"></span><ul><li><pclass="line862">Play <aclass="nonexistent"href="./PokemonGo.html">PokemonGo</a> and other applications which perform a safetynet check <spanclass="anchor"id="line-40"></span><spanclass="anchor"id="line-41"></span></li></ul><pclass="line867">
<h2id="Suggestions_on_deploying_multiple_services">Suggestions on deploying multiple services</h2>
<spanclass="anchor"id="line-42"></span><spanclass="anchor"id="line-43"></span><pclass="line874">To deploy multiple web services on a single domain you can use a reverse proxy, <spanclass="anchor"id="line-44"></span>there are several alternatives to build such a setup: <spanclass="anchor"id="line-45"></span><ul><li><pclass="line891"><aclass="https"href="https://caddyserver.com/">Caddy</a> is a modern web server, very easy to setup, with built-in letsencrypt support, follow <aclass="https"href="https://caddyserver.com/docs/proxy">this guide</a> to use it as a reverse proxy <spanclass="anchor"id="line-46"></span></li><li><pclass="line891"><aclass="https"href="https://github.com/jwilder/nginx-proxy">Nginx-proxy</a> and its <aclass="https"href="https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion">letsencrypt companion</a>, are a good alternative, providing automatic letsencrypt certificates request for every new container that requires it <spanclass="anchor"id="line-47"></span><spanclass="anchor"id="line-48"></span></li></ul><pclass="line874">Always try to achieve full HTTPS support, it is an important security measure because it guarantees: <spanclass="anchor"id="line-49"></span><ul><li>The authenticity of the software that we are going to execute on our phones (APKs and custom ROMs) <spanclass="anchor"id="line-50"></span></li><li>The confidentiality of data we exchange with our server, for example HTTP basic authentication passwords will not be disclosed. <spanclass="anchor"id="line-51"></span><spanclass="anchor"id="line-52"></span></li></ul><pclass="line867">
<h2id="Detailed_instructions_to_perform_single_tasks">Detailed instructions to perform single tasks</h2>
<spanclass="anchor"id="line-53"></span><spanclass="anchor"id="line-54"></span><ul><li><pclass="line891"><aclass="https"href="https://fxaguessy.fr/en/articles/2017/02/11/effectively-using-android-without-google-play-services-gplayweb-in-docker/">Private fdroid repo with play store apps</a><spanclass="anchor"id="line-55"></span><ul><li><pclass="line862">to authenticate succesfully follow <aclass="https"href="https://github.com/matlink/gplaycli/issues/30">this procedure</a> and register an android id corresponding to your device with <aclass="nonexistent"href="./DummyDroid.html">DummyDroid</a>. <spanclass="anchor"id="line-56"></span></li></ul></li><li>Calendar and Contacts synchronization <spanclass="anchor"id="line-57"></span><ul><li>Install DAVdroid with fdroid. <spanclass="anchor"id="line-58"></span></li><li><pclass="line862">status: <aclass="https"href="https://github.com/tomsquest/docker-radicale docker">Radicale docker</a> works flawlessy, follow <aclass="http"href="http://radicale.org/user_documentation/#idid11">this guide</a> to setup with DAVdroid <spanclass="anchor"id="line-59"></span></li><li><pclass="line862">remember to put calendar as <aclass="https"href="https://<radicaleurl>/user">https://<radicaleurl>/user</a> (user mode) not as system <aclass="https"href="https://<radicaleurl>/">https://<radicaleurl>/</a> (system mode) otherwise your calendars will be visible to every other user of the radicale server. <spanclass="anchor"id="line-60"></span></li><li>radicale has no default authentication, consider to add an http simple authentication via your reverse proxy. Otherwise your data will be publicly accessible by everyone on the Internet. <spanclass="anchor"id="line-61"></span></li></ul></li><li>microG Unified Network Location Provider <spanclass="anchor"id="line-62"></span><ul><li><pclass="line862">On Lineage 7.1.1 follow <aclass="https"href="https://github.com/microg/android_packages_apps_UnifiedNlp#usage">these instructions</a> note, you have to install unifiednlp as system app, otherwise it won’t register as system location service provider. <spanclass="anchor"id="line-63"></span></li><li><pclass="line862">As location backend you can use Mozilla (needs internet, reliable) as backup service and <aclass="nonexistent"href="./LocalGsmNlpBackend.html">LocalGsmNlpBackend</a> (offline) as primary services. The latter uses gsm cells to aid geolocation, or if you use low-power mode gsm cells are used without gps to provide location. <spanclass="anchor"id="line-64"></span></li><li><pclass="line862">It is suggested to build the cells database on a laptop, to do this download <aclass="https"href="https://github.com/sobrus/FastLacellsGenerator">this script</a> and edit the config file with your <aclass="https"href="https://en.wikipedia.org/wiki/Mobile_country_code">country code</a> and <aclass="https"href="https://opencellid.org/">OpenCellId</a> account. <spanclass="anchor"id="line-65"></span></li><li><pclass="line862">The script will take some time, after that put the generated db file in <code>/<androidhome>/Android/Data/org.fitchfamily.android.gsmlocation/files/lacells.db</code>. <spanclass="anchor"id="line-66"></span></li></ul></li><li><pclass="line891"><aclass="nonexistent"href="./CityMapper.html">CityMapper</a> and ATMapp support <spanclass="anchor"id="line-67"></span><ul><li>These apps use google maps services instead of google location services, so they need microG gmscore. <spanclass="anchor"id="line-68"></span></li><li><pclass="line862">To install microG gmscore, signature spoofing is required, just clone <aclass="https"href="https://github.com/ale5000-git/tingle">this</a> repo, connect your phone via adb and run main.py <spanclass="anchor"id="line-69"></span></li><li><pclass="line891"><aclass="https"href="https://blogs.fsfe.org/larma/2016/microg-signature-spoofing-security/">This</a> is an interesting article on the security implications of signature spoofing. Apparently if used carefully it