mirror of
https://github.com/nicolabs/nicolabs.net.git
synced 2025-09-21 00:32:01 +02:00
2 lines
8.7 KiB
HTML
2 lines
8.7 KiB
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> nicolabs | Where Android Market stores the downloaded .apk </title> <meta name="description" content=" Work in progress... "> <meta name="keywords" content="android, development, java, javascript, python, web"> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <!-- Social: Facebook / Open Graph --> <meta property="og:type" content="article"> <meta property="article:author" content="nicobo"> <meta property="article:section" content=""> <meta property="article:tag" content=""> <meta property="article:published_time" content="2011-12-22 07:12:17 +0100"> <meta property="og:url" content="https://www.nicolabs.net/articles/where-android-market-stores-downloaded-apk"> <meta property="og:title" content=" nicolabs | Where Android Market stores the downloaded .apk "> <meta property="og:image" content="https://www.nicolabs.net"> <meta property="og:description" content=" Work in progress... "> <meta property="og:site_name" content="nicobo"> <meta property="og:locale" content="en_US"> <!-- Social: Twitter --> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="nic0b0"> <meta name="twitter:title" content=" nicolabs | Where Android Market stores the downloaded .apk "> <meta name="twitter:description" content=" Work in progress... "> <meta name="twitter:image:src" content="https://www.nicolabs.net"> <!-- Social: Google+ / Schema.org --> <meta itemprop="name" content=" nicolabs | Where Android Market stores the downloaded .apk "> <meta itemprop="description" content=" Work in progress... "> <meta itemprop="image" content="https://www.nicolabs.net"> <!-- rel prev and next --> <link rel="stylesheet" href="/assets/css/main.css"> <!-- Canonical link tag --> <link rel="canonical" href="https://www.nicolabs.net/articles/where-android-market-stores-downloaded-apk"> <link type="application/atom+xml" rel="alternate" href="https://www.nicolabs.net/feed.xml" title="nicolabs" /> <script type="text/javascript"> var disqus_shortname = 'nicolabs'; </script> <!-- Enable displaying pictures in full size using the Fullscreen API --> <!-- A polyfill that also simplifies the API. TODO maybe there are others closer to the norm and with more features. Still chances are this will not work on iPhone without using a full-fledged Js library. --> <script src="/assets/lib/screenfull.js/dist/screenfull.min.js"></script> <!-- This code selects which elements and how fullscreen is triggered --> <script> document.addEventListener("DOMContentLoaded", function(event) { var els = document.getElementsByClassName("plantuml"); for ( var e=0 ; e<els.length ; e++ ) { var el = els[e]; el.addEventListener('click', function() { if (screenfull.isEnabled) { screenfull.toggle(el); el.classList.toggle("fullscreen"); } else { console.log("Fullscreen not supported"); } }); } }); </script> <script> window.onscroll = function() { if (document.body.scrollTop > 0 || document.documentElement.scrollTop > 0) { document.querySelector('.site-header').classList.add('site-header-pinned'); } else { document.querySelector('.site-header').classList.remove('site-header-pinned'); } }; </script> </head> <body> <main class="wrapper"> <header class="site-header"> <nav class="nav"> <div class="container"> <h1 class="logo"><a href="/">nico<span>labs</span></a></h1> <ul class="navbar"> <li><a href="/about">about</a></li> <li><a href="/articles">articles</a></li> <li><a href="/feed.xml">feed</a></li> </ul> </div> </nav> </header> <article class="post container" itemscope itemtype="http://schema.org/BlogPosting"> <header class="post-header"> <h1 class="post-title" itemprop="name headline">Where Android Market stores the downloaded .apk</h1> <p class="post-meta"> <a href="https://github.com/nicolabs/nicolabs.github.io/commits/master/_posts/2011-12-22-Where-Android-Market-stores-the-downloaded-apk.md" title="Read full history of this post"> <time class="datePublished" datetime="2011-12-22T07:12:17+01:00" itemprop="datePublished">Dec 22, 2011</time> </a> <span class="post-meta-separator">•</span> <span itemprop="read_time"> 3 minutes read </span> <span class="post-meta-separator">•</span> <span itemprop="maturity"><a href="/2016/Migrating-from-Drupal-to-Jekyll" title="Maturity of this article : draft < good < stable or deprecated
Click for the explanation.">Maturity : <span class="maturity-label maturity-stable" title="Maturity of this article : draft < good < stable or deprecated">stable</span> </span></a> </p> </header> <div class="post-content" itemprop="articleBody"> <p>Today I ran into a small problem that might happen sometimes : trying to benefit from a 2 day-only offer to download for free <a href="https://market.android.com/details?id=com.machineworksnorthwest.duke3d">Duke Nukem 3d</a> (just for fun, I don’t think it’s going to be the killer app this year ;-), I found out that my phone had not enough free memory to install it (Market told me : 56MB required).</p> <p>After having removed several apps from the memory to free enough space to install the game - and after a first failed attempt to download the 28MB archive - I was able to download the <em>.apk</em> from the Market (that was “phase 1 : download”).</p> <p>Immediately after the file was downloaded, I started up my <a href="https://market.android.com/details?id=com.rechild.advancedtaskkiller&hl=en">Open Advanced Task Killer</a> to free more memory for the installation process.</p> <p>Unfortunately I got the very bad idea to kill the Android Market process, <em>while it was already installing the app</em> (“phase 2 : installation”).</p> <p>From there, even though Duke Nukem 3d was listed in my installed apps, I only had the option to install it, not to launch nor uninstall it. Even launching the Market again was not triggering the installation anymore.</p> <p>S**t happens.</p> <p>Luckily, after a short introspection into the SD card and device filesystem, I was able to get the downloaded .apk file and start the app without using more (of my limited) bandwith.</p> <p>Here is what I could observe :</p> <ul> <li>the original downloaded .apk was stored as <code class="language-plaintext highlighter-rouge">/cache/downloadfile-2.apk</code>, and fully functional</li> <li>there was <code class="language-plaintext highlighter-rouge">/data/app/com.machineworksnorthwest.duke3d.zip</code>, probably interrupted reconstruction or copy of the apk into its final destination And the procedure I used to get it working (type the given commands) :</li> </ul> <ol> <li><code class="language-plaintext highlighter-rouge">adb shell</code> (<em>adb</em> is a command from the <a href="http://developer.android.com/sdk/index.html">Android sdk</a>, which is therefore required)</li> <li><code class="language-plaintext highlighter-rouge">su</code> (root access is required, look for it on <a href="http://forum.xda-developers.com/">xda forums</a>)</li> <li><code class="language-plaintext highlighter-rouge">cat /cache/downloadfile-2.apk > /sdcard/com.machineworksnorthwest.duke3d.apk</code> (this simply copies from cache to SD card)</li> <li>Finally, use any file browser like <a href="https://market.android.com/details?id=com.metago.astro">Astro</a> to go to the root of the SD card and click on the .apk to uninstall/install/start it</li> </ol> <p>I didn’t look for more details, as I already got what I wanted, but this event made me curious about the internals of the Android Market app, and I might come back later to add more to this article…</p> <p><img src="/assets/blog/dn3d.png?style=centerme" alt="Duke Nukem 3d app icon" /></p> <aside class="tags"> <ul class="tags"> <li class="tag"><a href="/tags#android">#android</a></li> <li class="tag"><a href="/tags#apk">#apk</a></li> </ul> </aside> <!--aside class="share"> <strong>Share this :</strong> <a href="http://twitter.com/share?text=Where Android Market stores the downloaded .apk&url=https://www.nicolabs.net/articles/where-android-market-stores-downloaded-apk&hashtags=web,dev,blog,soudev&via=nic0b0" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">Twitter</a> <a href="https://www.facebook.com/sharer/sharer.php?u=https://www.nicolabs.net/articles/where-android-market-stores-downloaded-apk" onclick="window.open(this.href, 'facebook-share', 'width=550,height=235');return false;">Facebook</a> </aside--> </div> </article> <footer class="site-footer"> <div class="container"> <small class="pull-left">©2024 All rights reserved. Graphic banner from https://showyourstripes.info</small> <small class="pull-right">by <a rel="me" href="/about#contact">@nicobo</a></small> </div> </footer> </main> </body> </html>
|