<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aurélien Delogu on Medium]]></title>
        <description><![CDATA[Stories by Aurélien Delogu on Medium]]></description>
        <link>https://medium.com/@aurelien.delogu?source=rss-cdf2fa34de48------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hawyK11b9Ho-GPNh1Uqm3A.jpeg</url>
            <title>Stories by Aurélien Delogu on Medium</title>
            <link>https://medium.com/@aurelien.delogu?source=rss-cdf2fa34de48------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:58:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aurelien.delogu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Open Gmail app on Android with React Native]]></title>
            <link>https://medium.com/@aurelien.delogu/open-gmail-app-on-android-with-react-native-bb0a318606e1?source=rss-cdf2fa34de48------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb0a318606e1</guid>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Aurélien Delogu]]></dc:creator>
            <pubDate>Wed, 15 Nov 2023 15:14:38 GMT</pubDate>
            <atom:updated>2023-11-15T15:14:38.933Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJqz7pHqjjceo1K_Z4_Ugw.jpeg" /><figcaption>By <a href="https://unsplash.com/fr/photos/ecran-de-smartphone-montrant-lapplication-facebook-D2TZ-ashGzc">Justin Morgan</a>.</figcaption></figure><p>Here at Wizville, we are developing a mobile application using React Native and Expo. Our Ruby web application is incorporated into a webview. Recently, we have initiated efforts to enhance our UI/UX, allowing us, among other things, to facilitate Single Sign-On (SSO) for our clients.</p><p>To achieve this, users are prompted to enter their email and click on a “Send magic link” button. Subsequently, a new view is displayed, encouraging them to click on one of three buttons: “Open Gmail,” “Open Outlook,” and “Open Apple Mail.”</p><p>While there is an existing library, react-native-email-link, that facilitates opening various email applications for SSO authentication, its API only offers automatic app opening, without specificity. Consequently, users might encounter the wrong application if they have multiple mail apps on their phone. Moreover, upon inspecting the library code, it was observed that it opens the default mail app for Android, while for iOS, it attempts to open specific apps.</p><p>To address this issue, we decided to handle it ourselves. To open specific applications, we utilized the Linking module from React Native and opened the app using a precise URL registered by the application. For example, for Outlook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b20c84db5848747b4f2c6cb281f7cad/href">https://medium.com/media/7b20c84db5848747b4f2c6cb281f7cad/href</a></iframe><p>Similarly, for Apple Mail, it’s straightforward:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc58044245996ca78ca31d946b4d5538/href">https://medium.com/media/dc58044245996ca78ca31d946b4d5538/href</a></iframe><p>However, opening Gmail posed challenges. On iOS, the URL scheme is googlegmail://, but when the app is opened, Gmail displays an error. Although everything functions correctly afterward, this initial error is an inconvenience. Worse, on Android the scheme does not work at all!</p><p>After investigating the issue, we discovered that Gmail does not register any scheme for direct opening. However, it does register web URLs that a browser can catch to open the application. This method works well and is supported on iOS without displaying any error.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89ae2c537f57ce6325e4358b9898d53a/href">https://medium.com/media/89ae2c537f57ce6325e4358b9898d53a/href</a></iframe><p>While there may be variations depending on the installed Gmail version, especially on older devices, this workaround can be applied to any app or version. To identify the URLs an app is listening to (or the deep linking scheme) on Android 11, navigate to “Settings” — “Applications” — “Applications,” search for your application, and go to “Open by default” and “Links opened by the application” to view the list of links the application is listening to.</p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb0a318606e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I fixed a blank page issue in Android Webview component]]></title>
            <link>https://medium.com/@aurelien.delogu/how-i-fixed-a-blank-page-issue-in-android-webview-component-4193870e7cc0?source=rss-cdf2fa34de48------2</link>
            <guid isPermaLink="false">https://medium.com/p/4193870e7cc0</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[surge]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[webview]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[Aurélien Delogu]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 15:39:33 GMT</pubDate>
            <atom:updated>2023-11-15T15:16:20.624Z</atom:updated>
            <content:encoded><![CDATA[<h4>Spoiler alert: it’s an HTTP scheme issue</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iynKyzl5ov5dqFNSOryXjg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@loli_oni?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Masakaze Kawakami</a> on <a href="https://unsplash.com/s/photos/android?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>.</figcaption></figure><p>Lately, I was designing a mailing list landing page for my blogging activity. I was satisfied with it, found it beautiful, and decided to test it across major browsers as well as on mobiles.</p><p>As usual, I fixed some CSS issues like margins, paddings, fonts, etc… But <strong>when I tested the page on my Android phone I faced a white page with no error</strong>.</p><p>I noticed that I opened that page from a link and that it has been loaded on a webview component instead of the browser. Then <strong>I tested it on </strong><a href="https://vivaldi.com/"><strong>Vivaldi</strong></a><strong> and the page showed up as normal</strong>.</p><p>After googling a bit and read a few posts on StackOverflow, I found that the issue came from Android Webview and my hosting provider because the page was served from the HTTP scheme, not HTTPS. <strong>Android Webview does not allow anymore to connect to HTTP websites without explicit configuration</strong> on the app side (note that if an SSL certificate is invalid, a white page would also be displayed).</p><p>To fix this, <strong>I needed to serve my mailing list from HTTPS</strong>. At that time, I was using <a href="https://surge.sh/">Surge</a> as hosting provider but the HTTPS scheme was only available for premium users. Of course, I’m not against paying some fee to use a service but, for a simple page, it wasn’t worth it. So I migrated to <a href="https://vercel.com/">Vercel</a> (which is <em>really</em> easy to set up) since it provides transparent HTTPS support in its free plan.</p><p>As soon as I migrated to this new hosting provider, the page displayed gracefully in the webview.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FyoJC2COHSxjIqadyZW%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FyoJC2COHSxjIqadyZW%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FyoJC2COHSxjIqadyZW%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/726db25a110c269982f49b802c414227/href">https://medium.com/media/726db25a110c269982f49b802c414227/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4193870e7cc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recover your locked files on an encrypted Linux partition]]></title>
            <link>https://medium.com/@aurelien.delogu/recover-your-locked-files-on-an-encrypted-linux-partition-601d59addb7?source=rss-cdf2fa34de48------2</link>
            <guid isPermaLink="false">https://medium.com/p/601d59addb7</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[help]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Aurélien Delogu]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 14:35:17 GMT</pubDate>
            <atom:updated>2023-11-15T15:17:58.901Z</atom:updated>
            <content:encoded><![CDATA[<h4>And why it could be a bad idea to encrypt your whole disk</h4><p><em>If you want to see how you can fix your issue with eCryptfs ASAP, jump directly to the next section.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7BK6MrC910HmldffLxe-Q.jpeg" /><figcaption>Boohoo my files are locked down 😭️ (Photo by <a href="https://www.pexels.com/@olly?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Andrea Piacquadio</a> from <a href="https://www.pexels.com/photo/man-in-pink-and-brown-jacket-standing-beside-gray-locker-door-3966553/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a>)</figcaption></figure><p>Lately, I was updating my laptop to Linux Mint 20 “Ulyana” (very good Linux distribution, by the way). I did some backups with Timeshift, as requested in the installation notes, and processed the update.</p><p>Unfortunately, I wasn’t really satisfied with the upgrade since:</p><ul><li>it had reset my Trackpoint settings and it’s a real pain to configure well,</li><li>the process required me to remove many foreign packages installed from PPAs (like <a href="https://vivaldi.com/fr/">Vivaldi</a>, <a href="https://code.visualstudio.com/">VSCode</a> or PHP, that I use constantly) so I needed to reconfigure the PPAs and reinstall all the packages,</li><li>many installed packages were not useful anymore but it seemed hard to clean up because some of these packages had strong hidden dependencies in the system that I couldn’t figure out at first glance.</li></ul><p>So, I made a new backup and wanted to roll back to a previous system snapshot.</p><p>“I will get back to the upgrade another time”, I thought.</p><p>And how stupid I was…</p><p>Distro upgrades are the worst, and my experience has taught me that there is always a thing that messes up everything. This exact consideration made me abandon Linux several years ago and to turn to Windows (yeah, it happens). Why? Because of the time spent on administrative tasks. Linux is awesome, but regularly doing maintenance makes it really unproductive.</p><p>Anyway! Back to the matter at hand. When I restored the previous snapshot of the system, I knew if something went wrong at this point, really bad things would happen. And it happened: the restoration process stopped in the middle and backed me up to the desktop.</p><p>“Oh boy… Not now, please god please, not now, please please please!!!”</p><p>At this point, what can you do? Wait and see what would happen? I did. And then? Cross your fingers and reboot? That’s clearly the last thing to do. I should have better-checked things before, but I knew it was already nasty.</p><p>I rebooted and…</p><p>“Grub is dead. Shit. And my whole disk is encrypted. And I need to recover my data. That’s gonna be fun.”</p><h3>Steps I did to recover my encrypted data</h3><p>I put a Live USB key on with <a href="https://elementary.io/fr/">Elementary</a> on it, started it up and tried to mount my system partition (for me, it was /dev/sda5 ; if you don’t know what is the partition you need to mount, use Gparted or fdisk):</p><pre>elementary@elementary$ sudo mount /dev/sda5 mint/<br>mount: /home/elementary/mint : unknown « crypto_LUKS » filesystem type.</pre><p>Ok…</p><p>Now, let’s push the forward button to save you several hours of googling, testing, and messing things up, and let’s give you the actual solution (that worked for my specific case). First, let’s make us root:</p><pre>elementary@elementary$ sudo su<br>root@elementary#</pre><p>And ensure we have the right tools and modules loaded:</p><pre>root@elementary# apt install lvm2 cryptsetup ecryptfs-utils<br>root@elementary# modprobe dm-crypt</pre><p>We need to open our encrypted partition and give it a name. I chose mint because, obviously, it has Linux Mint on it.</p><pre>root@elementary# cryptsetup open --type luks /dev/sda5 mint</pre><p>It will ask for your passphrase. Yeah, the passphrase you used to encrypt your drive. This one. So enter it.</p><p>All good? Cool, now you need to scan the LVM2 volumes that are accessible:</p><pre>root@elementary# vgscan<br>  Reading volume groups from cache.<br>  Found volume group &quot;mint-vg&quot; using metadata type lvm2</pre><p>It found a mint-vg volume group. Let’s activate it:</p><pre>root@elementary# vgchange -ay mint-vg<br>  2 logical volume(s) in volume group &quot;mint-vg&quot; now active</pre><p>We now need to find the partition name that is interesting us:</p><pre>root@elementary# lvs<br>  LV     VG      Attr       LSize<br>  root   mint-vg -wi-a-----  236,80g<br>  swap_1 mint-vg -wi-a-----  980,00m</pre><p>For me, it’s named root, but it could differ for you according to your installation. Let’s mount it!</p><pre>root@elementary# mkdir mint<br>root@elementary# mount /dev/mint-vg/root mint/</pre><p>An ls on the mounted mint/ directory shows me that everything went well as I can see the usual root directories like /dev, /proc, /sys and so on. But a cd to my personal home directory throws an error to me, because it is encrypted too (yes, initially my system required me to enter the passphrase at boot up, and also to log in to my account).</p><p>To recover our home we’ll need another tool (please adapt &lt;username&gt; to your case). It will ask to another passphrase which should be the one you used to login to your account:</p><pre>root@elementary# ecryptfs-recover-private --rw mint/home/.ecryptfs/&lt;username&gt;/.Private/<br>INFO: Found [mint/home/.ecryptfs/pyrsmk/.Private/].<br>Try to recover this directory? [Y/n]: <br>INFO: Found your wrapped-passphrase<br>Do you know your LOGIN passphrase? [Y/n] <br>INFO: Enter your LOGIN passphrase...<br>Passphrase: <br>Inserted auth tok with sig [3ce4c488be78156a] into the user session keyring<br>mount: /tmp/ecryptfs.zfcHznz2 : échec de l’appel système mount(2) : Aucun fichier ou dossier de ce type.<br>ERROR: Failed to mount private data at [/tmp/ecryptfs.zfcHznz2].</pre><p>It seemed it didn’t work. But in fact, it comes from a weird behavior of the eCryptfs tools that can be fixed by typing:</p><pre>root@elementary# ecryptfs-manager</pre><p>And exiting it directly by choosing the 4 option.</p><p>Now, let’s try again:</p><pre>root@elementary# ecryptfs-recover-private --rw mint/home/.ecryptfs/&lt;username&gt;/.Private/<br>INFO: Found [mint/home/.ecryptfs/pyrsmk/.Private/].<br>Try to recover this directory? [Y/n]: <br>INFO: Found your wrapped-passphrase<br>Do you know your LOGIN passphrase? [Y/n] <br>INFO: Enter your LOGIN passphrase...<br>Passphrase: <br>Inserted auth tok with sig [3ce4c488be78156a] into the user session keyring<br>INFO: Success!  Private data mounted at [/tmp/ecryptfs.sLsBBVmV].</pre><p>It worked! Yay!</p><pre>root@elementary# cd /tmp/ecryptfs.bYXuxPIM/<br>root@elementary# ls</pre><p>It lists my personal files as expected. Now I can backup them on another drive and reinstall the system.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F10474493&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fexcited-hockey-kid-gif-10474493&amp;image=https%3A%2F%2Fmedia.tenor.com%2Fimages%2Ff2f9c9650472cfe059c3e7bed89fc84e%2Ftenor.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/e789790752fcea7fd4b74ebdd0549773/href">https://medium.com/media/e789790752fcea7fd4b74ebdd0549773/href</a></iframe><h3>Epilogue</h3><p>At the time, I encrypted my whole disk for security and privacy reasons in the unfortunate case where I lose my laptop. But some trade-offs are coming with this.</p><p>Encryption slows down I/O (<a href="https://www.mayrhofer.eu.org/post/ssd-linux-benchmark/">especially with eCryptfs</a>), that’s why it’s recommended to only encrypt your home instead of the whole disk. But it’s only true when there’s no sensitive data on, for example, your /etc directory.</p><p>I would also underline the fact that encryption is especially needed for professional activities as the data is clearly more sensitive. A malicious person could have access to the credentials saved on your .profile file, to private repositories with even more sensitive information (if things are not done well), or even commit code with your own identity <a href="https://docs.github.com/en/github/authenticating-to-github/signing-commits">if you have no GPG key to sign your commits</a> (and push them if your SSH key is compromised).</p><p>So…</p><p>Stay safe 🙃️.</p><p>Update 08/02/2020: many of you have noticed that I had double encryption in place, <a href="https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019">full disk encryption</a> on one hand and my home with eCryptfs on the other hand. I don’t remember how I ended in that state, but it surely is counter-productive.</p><p>Update 08/03/2020: <a href="https://ubuntu.com/server/docs/security-ecryptfs">eCryptfs is deprecated and should not be used anymore</a>.</p><p>Update 08/09/2020: the author of eCryptfs has left a <a href="https://www.reddit.com/r/linux/comments/i1u7to/recover_your_locked_files_from_an_ecryptfs/g0t81mv?utm_medium=android_app&amp;utm_source=share">detailed comment</a> on the state of its file system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=601d59addb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to solve a 401 error on a webmanifest file]]></title>
            <link>https://medium.com/@aurelien.delogu/401-error-on-a-webmanifest-file-cb9e3678b9f3?source=rss-cdf2fa34de48------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb9e3678b9f3</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[cross-origin]]></category>
            <category><![CDATA[cors]]></category>
            <dc:creator><![CDATA[Aurélien Delogu]]></dc:creator>
            <pubDate>Sun, 31 May 2020 19:15:13 GMT</pubDate>
            <atom:updated>2023-11-15T15:18:37.494Z</atom:updated>
            <content:encoded><![CDATA[<h4>The CORS, a story of love and hate, but above all of hatred</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl2SpZQK6yiANOohag%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl2SpZQK6yiANOohag%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl2SpZQK6yiANOohag%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="180" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d735514fc9a2942c0c3995768e91939/href">https://medium.com/media/8d735514fc9a2942c0c3995768e91939/href</a></iframe><p>A while ago, I wanted to put a new website into production. I was testing it on staging environment and suddenly I realized there was an error in my development console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*bHfRE1DhNJurZxyOMkuFRg.png" /><figcaption>Huh? A 401 error for a site.webmanifest file?</figcaption></figure><p>I did some research and discovered that a 401 HTTP error code is refering to an unauthorized resource. It’s “like a 403 but with possible authentication”, an obscure page said somewhere.</p><p>Um. Ok. If you say so.</p><p>Then I decided to ask me a not so idiot question: what’s a site.webmanifest file?</p><p>In my case, it was automatically generated by the <a href="http://realfavicongenerator.net/">RealFaviconGenerator</a> service I’m using in my <a href="https://gulpjs.com/">Gulp</a> development pipeline. This very handy service generates favicons for many medias and browsers (like app icons for smartphones, for example).</p><p>To get into the details of this site.webmanifest, it’s a JSON file which gives browsers details about the application/website : the name, what icons are available, or what color theme we want to use (for Windows Metro UI for example). We’re exposing it with a meta tag:</p><pre>&lt;link rel=&quot;manifest&quot; href=&quot;/application/favicons/site.webmanifest&quot;&gt;</pre><p>So, what’s happening ?</p><p>After some digging, it seems that a manifest is governed by CORS (like with &lt;img&gt;, &lt;video&gt; or &lt;script&gt;) and needs a crossorigin attribute, even if the file comes from the same origin.</p><p>Ok. That’s weird…</p><p>Anyway, we now know how to fix this, with:</p><pre>&lt;link rel=&quot;manifest&quot; href=&quot;/application/favicons/site.webmanifest&quot; crossorigin=&quot;use-credentials&quot;&gt;</pre><p>And thus the nasty issue disappeared from my console.</p><p><em>If you’re curious, you can have more information on this </em><em>crossorigin attribute on </em><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin"><em>MDN</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb9e3678b9f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>