Jekyll2021-12-30T01:21:56-05:00https://evanamara.com/feed.xmlEvan AmaraBlog & PortfolioEvan Amara[email protected]Downgrading Android Apps Without Erasing User Data2021-12-30T00:00:00-05:002021-12-30T00:00:00-05:00https://evanamara.com/posts/2021/12/android-app-downgrade<p>I recently ran into an issue where I installed a broken unstable-branch update to the Android app <a href="https://f-droid.org/">F-Droid</a> on my phone. This led to the app immediately crashing when launched. When considering how I could roll back the app to an older version, I was surprised to find out that Android does not allow you to roll back app updates through the user interface. Instead, it forces you to uninstall the app first, erasing all of the app’s user data in the process.</p> <p>After doing some research, I found out that <em>you can</em> actually roll back Android applications by enabling USB-debugging and using Android Debug Bridge to force-install an old version of an app over a newer version, keeping all existing user data.</p> <h2 id="overview">Overview</h2> <p>Here is a quick overview of the steps that need to be taken to successfully downgrade an app on Android without erasing user data:</p> <ol> <li>Download and install Android Debug Bridge (adb)</li> <li>Download the apk for the older version of the app you want to downgrade</li> <li>Enable USB debugging</li> <li>Connect the phone to your computer and perform the downgrade using adb</li> <li>Disable USB debugging</li> </ol> <h2 id="downgrading-android-apps">Downgrading Android Apps</h2> <h3 id="1-download-and-install-android-debug-bridge-adb">1. Download and install Android Debug Bridge (adb)</h3> <p>Android Debug Bridge is available on multiple platforms through the Android SDK Platform-Tools. You can find the link to download it for Windows, Mac, and Linux <a href="https://developer.android.com/studio/releases/platform-tools">here</a>. Additionally, if you are on a Linux distribution, adb is likely available in your distribution’s standard software repositories and can be installed that way. (Ex. <code class="language-plaintext highlighter-rouge">apt install adb</code>).</p> <h3 id="2-download-the-apk-for-the-older-version-of-the-app-you-want-to-downgrade">2. Download the apk for the older version of the app you want to downgrade</h3> <p><img src="/images/blog/f-droid-downgrade.png" alt="F-Droid.org" width="50%" /></p> <p>This part will differ for you if you are doing this with a different app. For me, I downloaded the apk for an older version of F-Droid directly from the official website at the <a href="https://f-droid.org/en/packages/org.fdroid.fdroid/">bottom of this page</a>.</p> <h3 id="3-enable-usb-debugging">3. Enable USB debugging</h3> <p><img src="/images/blog/android-enable-developer-options.png" alt="Android settings screen for enabling developer options" width="33%" /></p> <p>To enable USB debugging, you must first enable the hidden Developer options in the Android Settings app. In Settings, go to About Phone and tap on Build Number until you receive a small popup that says you are now a developer.</p> <p><img src="/images/blog/android-enable-usb-debugging.png" alt="Android settings screen for enabling USB debugging" width="33%" /></p> <p>Then, you will see Developer options listed under Settings &gt; System &gt; Developer options. Inside the Developer options screen, scroll down to the Debugging section and enable the USB debugging option.</p> <h3 id="4-connect-the-phone-to-your-computer-and-perform-the-downgrade-using-adb">4. Connect the phone to your computer and perform the downgrade using adb</h3> <p>Connect your phone to your computer over USB. Open a terminal window and run the command:<br /> <code class="language-plaintext highlighter-rouge">adb install -r -d appname.apk</code><br /> where appname.apk is replaced with the apk downloaded in step 2. The -r switch specifies that we are reinstalling an already installed app. The -d switch specifies that we want to allow downgrading.</p> <p>When you first run this command, if you have never used USB debugging on your phone, you will receive a permission denied error and a prompt on your phone asking if you want to allow USB debugging. Accept the prompt that asks if you want to authorize your computer for USB debugging. Then, rerun the above command. It will take a few seconds as the app is installed onto your device.</p> <h3 id="5-disable-usb-debugging">5. Disable USB debugging</h3> <p>For security reasons, it is a good idea to disable USB debugging on your phone after you are done using it. To do so, go back to Settings &gt; System &gt; Developer options, scroll down to the Debugging section, and disable the USB debugging option.</p>Evan Amara[email protected]I recently ran into an issue where I installed a broken unstable-branch update to the Android app F-Droid on my phone. This led to the app immediately crashing when launched. When considering how I could roll back the app to an older version, I was surprised to find out that Android does not allow you to roll back app updates through the user interface. Instead, it forces you to uninstall the app first, erasing all of the app’s user data in the process.New Website2021-10-01T00:00:00-04:002021-10-01T00:00:00-04:00https://evanamara.com/posts/2021/10/new-website<p>Welcome to my new blog and portfolio website!</p> <h2 id="who-am-i">Who am I?</h2> <p>I’m Evan, a recent graduate from Central Connecticut State University with a bachelor’s degree in management information systems and specialization in information security and infrastructure.</p> <p>Some of my areas of interest are:</p> <ul> <li>System administration</li> <li>Security and privacy</li> <li>Free and open source software</li> <li>Data storage, management, and compression</li> </ul> <p><a href="https://evanamara.com/">More about me on the homepage</a></p> <h2 id="creating-this-blog">Creating this blog</h2> <h3 id="project-goals">Project goals</h3> <p>There were a few goals and features I wanted to accomplish when creating this website:</p> <ul> <li>Simple design that works on multiple screen sizes</li> <li>Open source</li> <li>Encrypted and secured with TLS</li> <li>JavaScript optional</li> <li>Static site</li> <li>RSS</li> </ul> <p>Considering these project goals, I determined that <a href="https://gohugo.io/">Hugo</a> or <a href="https://jekyllrb.com/">Jekyll</a> would be a good static site generator to use and that I would use GitLab Pages for hosting. Ultimately, I chose Jekyll over Hugo for its better documentation and that fact that I found a theme for it that I liked.</p> <h3 id="migrating-a-github-pages-theme-to-gitlab-pages">Migrating a GitHub Pages theme to GitLab Pages</h3> <p>While looking at other websites for ideas of how I want the website to look, I discovered a great Jekyll theme on GitHub called <a href="https://github.com/academicpages/academicpages.github.io">AcademicPages</a>. After working with it for a little while and trying it out, I decided that it would fit perfectly for my website, with only a few minor changes needed. The first thing I had to do was migrate the GitHub repository to GitLab since I wanted the site to be hosted on GitLab Pages due to its better freely-available features and the fact that GitLab is an open source project.</p> <p>I started by cloning the AcademicPages repo to a GitLab project and renamed the repo to the GitLab pages name format when being used inside a project (&lt;projectname&gt;.gitlab.io). Cloning the repo to a project instead of just cloning it to your user has the benefit of allowing you to change the subdomain to whatever you want instead of it just being your GitLab username. Next, I added the default gitlab-ci.yml Jekyll template to the repository. GitLab then immediately built the website template theme and put it up at &lt;projectname&gt;.gitlab.io without any need to modify the default gitlab-ci.yml file.</p> <h3 id="theme-adjustments-made">Theme adjustments made</h3> <p>The AcademicPages theme was almost perfect out of the box, but I wanted to make a few minor changes to it:</p> <ul> <li>Added support for GitLab links on the sidebar</li> <li>Turned the Portfolio page into a Projects page and sorted the items by creation date</li> <li>Replaced any http links with https links</li> <li>Removed pages that wouldn’t be useful for me</li> <li>Replaced the CV page with a Resume link in the navigation bar that goes directly to a pdf of my public resume</li> <li>Disabled Google Analytics</li> </ul> <h3 id="setting-a-custom-domain-and-https-on-gitlab-pages">Setting a custom domain and HTTPS on GitLab Pages</h3> <p>When I was ready, I started looking at different domain name registrars. I went with <a href="https://www.namecheap.com/">Namecheap</a> because their prices for a .com were the best I could find while also providing free WHOIS protection. After purchasing evanamara.com, I had to go to the Pages settings in the repo and add the custom domain name. I was surprised to see that GitLab now had a built in option for automatically getting a certificate from Let’s Encrypt, enabled by default. Last time I used GitLab pages, you had to manually secure a site with Let’s Encrypt by downloading certbot, exporting a certificate, and manually uploading it. It is much less annoying to do so now! All that was left was to add the following DNS records… <img src="/images/blog/nc-advanced-dns.png" alt="Namecheap DNS records required for GitLab Pages" /> The changes took a few hours to propagate and then everything was working fine! I used <a href="https://www.whatsmydns.net/">whatsmydns.net’s DNS Propagation Checker</a> to watch this happen in real time. After it propagated, all I did was press the recheck verification button. GitLab handled setting up the certificate by itself.</p> <h2 id="whats-next">What’s next?</h2> <p>Overall, setting up the website was a lot easier than I expected it would be. I still have a few minor adjustments I want to make to the theme, which I intend to do within the coming few days. I’ll also make a short blog post here when the changes are complete. Feel free to follow the RSS feed to be notified of any new posts. I have some ideas already for posts I want to write.</p>Evan Amara[email protected]Welcome to my new blog and portfolio website! Who am I? I’m Evan, a recent graduate from Central Connecticut State University with a bachelor’s degree in management information systems and specialization in information security and infrastructure.