Full Code of vladikoff/chromeos-apk for AI

master f13a94d2c08c cached
17 files
23.4 KB
7.1k tokens
2 symbols
1 requests
Download .txt
Repository: vladikoff/chromeos-apk
Branch: master
Commit: f13a94d2c08c
Files: 17
Total size: 23.4 KB

Directory structure:
gitextract_gb4qcla8/

├── .gitignore
├── .travis.yml
├── CHANGELOG
├── LICENSE
├── README.md
├── _template/
│   ├── _locales/
│   │   └── en/
│   │       └── messages.json
│   ├── app_main.html
│   ├── manifest.json
│   └── vendor/
│       └── chromium/
│           └── crx/
│               └── README.txt
├── archon.md
├── chromeos-apk
├── chromeos-apk.js
├── lib/
│   └── parseApk.js
├── manifest.md
├── manually-convert.md
├── multiple-apps.md
└── package.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript


================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
  - "0.10"

script:
  - cd .. && npm link chromeos-apk
  - wget https://github.com/uberspot/2048-android/archive/v1.91.zip && unzip v1.91.zip
  - chromeos-apk 2048-android-1.91/2048.apk -a -t
  - stat com.uberspot.a2048.android/vendor/chromium/crx/custom-android-release-1400197.apk
  - rm -rf com.uberspot.a2048.android
  - chromeos-apk 2048-android-1.91/2048.apk
  - stat com.uberspot.a2048.android/vendor/chromium/crx/custom-android-release-1400197.apk
  - rm -rf com.uberspot.a2048.android
  - chromeos-apk 2048-android-1.91/2048.apk --scale
  - stat com.uberspot.a2048.android/vendor/chromium/crx/custom-android-release-1400197.apk


================================================
FILE: CHANGELOG
================================================
v4.0.0:
  changes:
    - "key" param is not required anymore for ChromeOS (Chrome 38+).
    - "--scale" option added to enable application window scaling.
v3.0.0:
  changes:
    - Windows support for the CLI tool.
v2.0.0:
  changes:
    - ARChon runtime.
v1.0.0:
  changes:
    - Initial release.


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2014 Vlad Filippov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
chromeos-apk
======================

> Run Android APKs on Chrome OS, OS X, Linux and Windows.

<img src="http://v14d.com/g/chromeapks/1.png" width="250px" />
<img src="http://v14d.com/g/chromeapks/2.png" width="250px" />
<img src="http://v14d.com/g/chromeapks/3.png" width="250px" />
<img src="http://v14d.com/g/chromeapks/4.png" width="250px" />
<img src="http://v14d.com/g/chromeapks/5.png" width="250px" />
<img src="http://v14d.com/g/chromeapks/6.png" width="250px" />
<img src="http://v14d.com/g/chromeapks/7.png" height="160px" />

### Now supports OS X, Linux and Windows

<img src="http://v14d.com/g/multiple.png" width="250px" />
<img src="http://v14d.com/g/WinApk.jpg" width="250px" />

>See the [Custom ARChon runtime guide](archon.md) to run apps on other operating systems besides Chrome OS.


### [Video Demo](https://www.youtube.com/watch?v=O-yFLqp_sXs)

## Quick Demo for Chrome OS
- Download an official app, [such as Evernote](https://chrome.google.com/webstore/detail/evernote/dhfolfjkgpeaojbiicgheljefkfbbfkc), from the Chrome Web Store.
- Then download this open source game: [2048.APK Game](https://github.com/vladikoff/chromeos-apk/releases/download/v1.1.0/com.uberspot.a2048.android-OFFICIAL.zip) by [Uberspot](https://github.com/uberspot/2048-android) and load it as an unpacked extension. Go to chrome://apps and launch it there, ignore warnings.

## Setup for Chrome OS / App Conversion
> Conversion Tool Tested on OS X, Windows and Ubuntu. You can also [convert APKs manually](manually-convert.md).

- Install [a sample Android app from the Chrome Store](https://chrome.google.com/webstore/detail/kids-sight-words/inpoiemibmljfjmjmlokfdllnkjejhai) to get the runtime. Test out that app, make sure it runs on your hardware.
- (Ubuntu might need `sudo apt-get install lib32stdc++6`)
- Install Node.js (via http://nodejs.org/)
- Install the tool (might need a `sudo` prefix):
```
npm install chromeos-apk -g
```
or

```
sudo npm install chromeos-apk -g
```

## Usage

Run
`chromeos-apk [path to apk file]`

### Example phone app

```
chromeos-apk com.soundcloud.android.apk
```

#### Example tablet app

```
chromeos-apk com.soundcloud.android.apk --tablet
```

This will generate a directory for you, i.e `com.soundcloud.android`. Copy this directory to your Chromebook.
On your Chromebook go to `chrome://extensions`, enable "Developer mode", and load the directory using the "Load unpacked extension" button.
<img src="http://v14d.com/g/chromeapks/howto.png" width="500px" />

## Troubleshooting

Make sure Android applications are compatible with your Chromebook, first try to install an official application such as Vine:
https://chrome.google.com/webstore/detail/vine/plfjlfohfjjpmmifkbcmalnmcebkklkh

If you get a `Failed to parse package name in the APK.` error, then you will have to type it the proper package name for the application. You can find out the package name by looking at the URL of the app in the Play Store.

## Note

**Chrome OS:** With Chrome 38+ you can now side load as many applications as you want. If you have older apps that
were created using `chromeos-apk` tool then re-convert them or remove the `"key"` option from `manifest.json`.

**Windows, Linux and OS X:** To load unlimited number of apps on you need a custom runtime, see the [ARChon runtime guide](archon.md) for details.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## Tested Apps

Read [the manifest guide](manifest.md) to tweak applications. Android `Menu` key is accessible using `ctrl` + `ESC`.

- Flipboard, Flixster, Twitter - Works.
- Pandora - Works [[Screenshot](http://i.imgur.com/0d8XvXr.png)]
- Yahoo Screens, Weather and Mail work in Phone mode (might need to remove `gcm` from `usePlayServices` in `manifest.json`). 
- Soundcloud - Works, crashes when playing sound.
- Chrome, Firefox, Opera, Spotify - Crashes (require native libraries).
- Opera Mini - Works, issues with the back button.
- [Gyro Game](https://play.google.com/store/apps/details?id=pl.submachine.gyro&hl=en) - Works
- [Break Bricks Game](https://play.google.com/store/apps/details?id=com.tongwei.blockbreaker) - Works 
- Swing Copters - Crashes on Google Play Services.
- WhatsApp - Crashes
- IMDB - Works
- Skype `com.skype.raider` - Works, requires you to enter the package name manually in the CLI, use `com.skype.raider`. Use an older version of APK 5.0.0.x to get this to work.
- XBMC - Crash after initial load.
- Microsoft Remote Desktop - App seems to work properly after crashing once.  


### Author

| [![twitter/vladikoff](https://avatars3.githubusercontent.com/u/128755?s=70)](https://twitter.com/vladikoff "Follow @vladikoff on Twitter") |
|---|
| [@vladikoff](https://twitter.com/vladikoff) |


================================================
FILE: _template/_locales/en/messages.json
================================================
{
   "appNotSupported": {
      "description": "Message displayed when the app is not supported.",
      "message": "This app is incompatible with your device. Check to make sure other Android apps work for you from the Chrome Web Store"
   },
   "extName": {
      "description": "Extension name",
      "message": "App"
   }
}


================================================
FILE: _template/app_main.html
================================================
<!-- Copyright 2013 Google Inc. All Rights Reserved.

     ARC app_main.html.  This file is used as the background page for ARC apps.
     It only embeds an iframe for ARC's main.  This is so we do not have to
     specify a background page in the manifest.json that looks like
     '_modules/arcruntimeid/main.html', because the extension validator
     in Chrome does not understand _modules relative paths.  Rather than bake
     this knowledge and complexity into the validator, it is better to use this
     App relative app_main.html.  -->

<!DOCTYPE html>
<iframe src="_modules/mfaihdlpglflfgpfjcifdjdjcckigekc/main.html"></iframe>


================================================
FILE: _template/manifest.json
================================================
{
   "app": {
      "background": {
         "page": "app_main.html"
      }
   },
   "arc_metadata": {
      "apkList": [ "custom-android-release-1400197.apk" ],
      "enableExternalDirectory": false,
      "formFactor": "phone",
      "name": "__PACKAGE__",
      "orientation": "portrait",
      "packageName": "__PACKAGE__",
      "useGoogleContactsSyncAdapter": false,
      "usePlayServices": [ "gcm" ]
   },
   "default_locale": "en",
   "icons": {
      "128": "icon.png",
      "16": "icon.png"
   },
   "import": [ {
      "id": "mfaihdlpglflfgpfjcifdjdjcckigekc"
   } ],
   "manifest_version": 2,
   "name": "__MSG_extName__",
   "oauth2": {
      "client_id": "133701689125-jj0hr4gb0ff4ulsbrn0uk2i4th946d4c.apps.googleusercontent.com",
      "scopes": [  ]
   },
   "offline_enabled": true,
   "permissions": [ "gcm", {
      "socket": [ "tcp-connect", "tcp-listen", "udp-bind", "udp-send-to", "resolve-host" ]
   }, "unlimitedStorage", "notifications", "clipboardRead", {
      "fileSystem": [ "write" ]
   }, "https://clients2.google.com/", "videoCapture", "clipboardWrite", "identity.email", "alarms", "storage", "identity", "audioCapture" ],
   "requirements": {
      "3D": {
         "features": [ "webgl" ]
      }
   },
   "update_url": "https://localhost",
   "version": "1337"
}


================================================
FILE: _template/vendor/chromium/crx/README.txt
================================================
APK goes here.


================================================
FILE: archon.md
================================================
# ARChon Custom Runtime Guide

> ARChon runtime lets you run unlimited number of Android APKs created with `chromeos-apk` on Chrome OS and across any desktop platform that supports Chrome.

<img src="http://v14d.com/g/WinApk.jpg" width="350px" />
<img src="http://v14d.com/g/multiple.png" width="350px" />

<img src="http://v14d.com/g/chromeapks/ARChonLogo.png" height="100" /> 

**Warning: The custom runtime will replace the official runtime component. To go back to the official runtime you will need to uninstall the custom one and reinstall the official one.**

# Visit [archon-runtime.github.io](http://archon-runtime.github.io/) for latest releases

- Download the runtime that is appropriate for your system: 

| Runtime  | Download |
|---|---|
| ARChon 1.2 - Intel x86 **Chrome 64-bit / Chrome OS 64-bit**  |  [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.2-x86_64.zip) :: [Mirror](http://archon.vf.io/ARChon-v1.2-x86_64.zip) MD5:d77b468339cc512e121c003cc97715db |
| ARChon 1.2 - Intel x86 **Chrome 32-bit / Chrome OS 32-bit**  (Win7 32-bit: Use something like Chrome Beta 38.0.2125.77 beta-m) | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.2-x86_32.zip) :: [Mirror](http://archon.vf.io/ARChon-v1.2-x86_32.zip) MD5:9c9844e2591a27d952098581011a2bce |
| ARChon 1.2 - **ARM (i.e ARM-based Chromebooks)**  | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.2-ARM.zip) :: [Mirror](http://archon.vf.io/ARChon-v1.2-ARM.zip) MD5:3d6955c7702baf1e1d16a000d9f67b10   |


- Unzip it, Load it as an unpacked extension.

<img src="http://v14d.com/g/chromeapks/howto.png" width="500px" />
- (Try out this pre-packaged open source game: [2048-ARChon.APK](https://github.com/vladikoff/chromeos-apk/releases/download/v1.1.0/com.uberspot.a2048.android-ARChon-runtime.zip) by [Uberspot](https://github.com/uberspot/2048-android) and load it as an unpacked extension. Press "Launch", ignore warnings.)
- To load custom applications, make sure you have `chromeos-apk@2.0.0` or higher. (Update using `npm install -g chromeos-apk@latest`). See [README.md](README.md) for more help with the `chromeos-apk` tool.
- Create your custom APKs with the ARChon flag: `chromeos-apk com.imdb.mobile.apk`.
This will create an app directory for you.
- Load as many APKs as you want as unpacked extensions on any platform of your choice.


## Notes

### Google Play Services

- See https://github.com/vladikoff/chromeos-apk/issues/66

### Load additional files 

- Put any additional files into `/vendor/chromium/crx/`, those would be accessible within the app environment
- OBB files, one way: enable the `enableAdb` flag in `manifest.json`,  `adb push /<package>/<some.obb> /storage/sdcard/Android/obb/<package>/<some.obb>`

### Convert older apps created with `chromeos-apk` tool to ARChon runtime.

- Remove the `"key"` parameter from `manifest.json`.

### Uninstalling ARChon

- Remove the component and all applications that depend on it from `chrome://extensions` using the "Remove" button. 
- Chrome OS: Reinstall an app such as Evernote to get the official runtime.

### ARChon source

ARChon source is hosted here: https://bitbucket.org/vladikoff/archon/src. It's on BitBucket because GitHub has a 100mb file limit. Feel free to hack on ARChon and tweak it. 

### Changing app resolution

Tweak the runtime in 2 places: You need to change the tablet resolution values in these 2 places: https://bitbucket.org/vladikoff/archon/src/master/gen_main.min.js and
https://bitbucket.org/vladikoff/archon/src/master/gen_index.min.js

Find `tablet: {"long": 1280, "short": 800}`, tweak it, fit your resolution, reload the run time. 

### Tweak Apps

Add `"resize": "scale"` to `"arc_metadata"` in `manifest.json`.

**How to adjust font size**

1. Modify the two files (gen_index.min.js and gen_main.min.js).

2. Search a.prototype.computeValues_.

3. Change the value of a.prototype.computeValues_.

4. Let the value c double. Just like the following codes.
```JavaScript
a.prototype.computeValues_ = function (a) {
    var c = 2*window.devicePixelRatio / getCurrentZoom() 
    .....
}
```
Read [the manifest guide](manifest.md) for more advanced tweaks.

### Older downloads
> These are downloads for previous versions of ARChon

| Runtime  | Download |
|---|---|
| ARChon 1.1 - Intel x86 **Chrome 64-bit / Chrome OS 64-bit** (OSX: Use this in Chrome Canary)  | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.1-x86_64.zip) :: [GitHub](https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_64.zip)   MD5:d409801cac97cdff9ea6aad468ddc927 |
| ARChon 1.1.1 - Intel x86 **Chrome 32-bit / Chrome OS 32-bit** (OSX: Use this in Chrome Stable) (Win7 32-bit: Use something like Chrome Beta 38.0.2125.77 beta-m) | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.1.1-x86_32.zip) :: [GitHub](https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1.1-x86_32.zip)   MD5:5780637446ba941bd2969756f56f9671 |
| ARChon 1.1 - **ARM (i.e ARM-based Chromebooks)**  | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.1-ARM.zip) :: [GitHub](https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-ARM.zip) MD5:d0a69d822399545ff67292b50f8c4047   |
| ARChon 1.0 - Intel x86 64-bit | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.0.zip) MD5:3bd2e6014a0cba0b1ee3c69462a9b46d |
| ARChon 1.1 - Intel x86 **Chrome 32-bit / Chrome OS 32-bit** (OSX: Use this in Chrome Stable)   | [BitBucket](https://bitbucket.org/vladikoff/archon/get/v1.1-x86_32.zip) :: [GitHub](https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_32.zip)   MD5:873c4d116eabd1a5ebedec65d11d6d8a |


================================================
FILE: chromeos-apk
================================================
#!/usr/bin/env node

require('./chromeos-apk.js')();


================================================
FILE: chromeos-apk.js
================================================
var path = require('path');
var fs = require('fs');
var readline = require('readline');

var program = require('commander');
var ncp = require('ncp').ncp;
var chalk = require('chalk');
var rl = readline.createInterface(process.stdin, process.stdout);

var parseApk = require('./lib/parseApk');

function success(appPath) {
  console.log(chalk.green('Directory "', appPath, '" created. Copy that directory onto your Chromebook and use "Load unpacked extension" to load the application.'));
  process.exit(0);
}

module.exports = function (callback) {

  program
    .version('4.0.2')
    .option('-t, --tablet', 'Create a tablet version')
    .option('-s, --scale', 'Enable application window scaling')
    .option('-n, --ext-name [value]', 'Extension display name')
    .usage('<path_to_apk_file ...>')
    .parse(process.argv);

  var apk = program.args[0];
  callback = callback || success;

  if (!apk) {
    program.outputHelp();
    process.exit(0);
  }

  parseApk(apk, function (err, data) {
    if (err) {
      console.log(chalk.yellow('Failed to load APK'));
    }

    var packageName = null;

    try {
      packageName = data.package;
    } catch (e) {
      console.log(chalk.yellow('Failed to parse package name in the APK.'));
    }

    if (!packageName) {
      console.log(chalk.yellow('Unknown APK package.'));
      console.log('Please enter the package name (i.e "com.skype.raider", if you get this wrong your app will NOT work): ');
      rl.prompt();
      rl.on('line', function (text) {
        text = text.trim();

        if (/\.apk$/.test(text)) {
          console.log(chalk.red('Package names do not end with .apk'));
          console.log('They usually look like com.application.developer or com.website.www');
          process.exit(0);
        } else if (text.indexOf(' ') !== -1) {
          console.log(chalk.red('Package names do not contain spaces'));
          console.log('They usually look like com.application.developer or com.website.www');
          process.exit(0);
        }
        else {
          createExtension(text);
        }
      })
      .on('close', function () {
        process.exit(0);
      });
    } else {
      createExtension(packageName);
    }

    function createExtension(packageName) {
      var templatePath = path.join(__dirname, '_template');
      var appPath = path.join(packageName + '.android');

      // TODO: refactor this if needed in the future
      ncp(templatePath, appPath, function (err) {
        if (err) {
          throw err;
        }

        fs.writeFileSync(path.join(appPath, 'vendor', 'chromium', 'crx', 'custom-android-release-1400197.apk'), fs.readFileSync(apk));

        var manifest = JSON.parse(fs.readFileSync(path.join(templatePath, 'manifest.json')));
        var messages = JSON.parse(fs.readFileSync(path.join(templatePath, '_locales', 'en', 'messages.json')));
        manifest.arc_metadata.name = packageName;
        manifest.arc_metadata.packageName = packageName;
        manifest.version = '1337';

        if (program.extName && typeof program.name !== 'function') {
          messages.extName.message = program.extName;
        } else if (packageName) {
          messages.extName.message = packageName;
        } else {
          messages.extName.message = 'App';
        }

        if (program.tablet) {
          manifest.arc_metadata.formFactor = 'tablet';
          manifest.arc_metadata.orientation = 'landscape';
        }

        if (program.scale) {
          manifest.arc_metadata.resize = 'scale';
        }

        fs.writeFileSync(path.join(appPath, 'manifest.json'), JSON.stringify(manifest, null, 2));
        fs.writeFileSync(path.join(appPath, '_locales', 'en', 'messages.json'), JSON.stringify(messages, null, 2));

        // done.
        callback(appPath);
      });
    }
  });

};


================================================
FILE: lib/parseApk.js
================================================
var ApkReader = require('adbkit-apkreader');

module.exports = function parseApk(apk, cb) {
  try {
    var reader = ApkReader.readFile(apk);
    var manifest = reader.readManifestSync();

    cb(null, manifest);
  } catch (e) {
    cb(e);
  }
};


================================================
FILE: manifest.md
================================================
# `manifest.json` configuration

## `arc_metadata`
Raw list of possible values for `arc_metadata`:

```
"arc_metadata": {
  "allowEmptyActivityStack": false,
  "apkList": [
    "custom-android-release-1400197.apk"
  ], 
  "canRotate": false,
  "disableAutoBackButton": false,
  "enableAdb": false,
  "enableArcStrace": false,
  "enableExternalDirectory": false,
  "enableGlErrorCheck": false,
  "formFactor": "phone",
  "fpsLimit": 60,
  "isSlowDebugRun": false,
  "jdbPort": 0,
  "logLoadProgress": false,
  "minimumLaunchDelay": 0,
  "name": "",
  "ndkAbi": "",
  "orientation": "portrait",
  "packageName": "org.chromium.arc",
  "resize": "disabled",
  "shell": [],
  "stderrLog": "S",
  "useGoogleContactsSyncAdapter": false,
  "usePlayServices": [
   "gcm"
  ],
  "sleepOnBlur": true
}
```

## `file_handlers`

See https://developer.chrome.com/apps/manifest/file_handlers. 
This is useful for Chrome OS users. You can experiment opening files with certain Android apps by setting their file handlers. Add to `manifest.json` in your app: 
```
 "file_handlers": {
      "any": {
         "title": "Open with SOME_APP",
         "types": [ "*/*" ]
      }
  },
```
This way your file manager will get this option: 
<img src="http://i.imgur.com/zTjPaHc.png" width="250px" />


================================================
FILE: manually-convert.md
================================================
# Instructions to convert APKs manually
> Use this if the command line tool (`chromeos-apk`) fails to parse work for you. 

*****


- Get the APK that you want to convert. Find the package name of the APK (i.e `com.soundcloud.android`, you can easily find it by looking at the URL in the Play Store). This process will not work without the proper package name.
- Make a copy of the [_template](https://github.com/vladikoff/chromeos-apk/tree/master/_template) directory. Name the **new directory** `com.soundcloud.android` for instance.
- Using the new directory, put the APK file into the `crx` directory, like so: [com.soundcloud.android/vendor/chromium/crx](https://github.com/vladikoff/chromeos-apk/tree/master/_template/vendor/chromium/crx)
- Update the [manifest.json](https://github.com/vladikoff/chromeos-apk/blob/master/_template/manifest.json#L8) file to suite your APK file. You can also change other stuff, such as `formFactor`: (`phone` or `tablet`), `orientation`: (`landscape` or `portrait`) for tablet apps. Note: some apps may crash with `tablet` or `portrait` settings.  
- Now you can load the new directory and it as an unpacked extension in Chrome Extensions.

## For ARChon runtime

- Remove the `"key"` parameter from `manifest.json`.


================================================
FILE: multiple-apps.md
================================================
# Running Multiple Apps
<img src="http://v14d.com/g/chromeapks/multiple.png" width="450px" />

***** 

~~Currently you can load up to 4 of your favorite Android applications with the official ARC runtime.~~
~~By default the `chromeos-apk` tool replaces the Vine application and everytime you load a different app it replaces it. However you can load 3 more apps by replacing Evernote and other apps. For each extra app adjust the `"key"` value in the `manifest.json` file of that app, then use `"Load unpacked extension..."`.~~

**Chrome OS:** With Chrome 38+ you can now side load as many applications as you want. If you have older apps that
were created using `chromeos-apk` tool then re-convert them or remove the `"key"` option from `manifest.json`.

**Windows, Linux and OS X:** To load unlimited number of apps on you need a custom runtime, see the [ARChon runtime guide](archon.md) for details.


================================================
FILE: package.json
================================================
{
  "name": "chromeos-apk",
  "version": "4.0.2",
  "description": "Run Android APKs on Chromebooks",
  "main": "chromeos-apk.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "bin": {
    "chromeos-apk": "chromeos-apk"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/vladikoff/chromebook-apk-creator.git"
  },
  "author": "Vlad Filippov",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/vladikoff/chromebook-apk-creator/issues"
  },
  "homepage": "https://github.com/vladikoff/chromebook-apk-creator",
  "dependencies": {
    "adbkit-apkreader": "^1.0.0",
    "chalk": "^0.5.1",
    "commander": "^2.3.0",
    "ncp": "^0.6.0"
  }
}
Download .txt
gitextract_gb4qcla8/

├── .gitignore
├── .travis.yml
├── CHANGELOG
├── LICENSE
├── README.md
├── _template/
│   ├── _locales/
│   │   └── en/
│   │       └── messages.json
│   ├── app_main.html
│   ├── manifest.json
│   └── vendor/
│       └── chromium/
│           └── crx/
│               └── README.txt
├── archon.md
├── chromeos-apk
├── chromeos-apk.js
├── lib/
│   └── parseApk.js
├── manifest.md
├── manually-convert.md
├── multiple-apps.md
└── package.json
Download .txt
SYMBOL INDEX (2 symbols across 1 files)

FILE: chromeos-apk.js
  function success (line 12) | function success(appPath) {
  function createExtension (line 75) | function createExtension(packageName) {
Condensed preview — 17 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (26K chars).
[
  {
    "path": ".gitignore",
    "chars": 587,
    "preview": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nl"
  },
  {
    "path": ".travis.yml",
    "chars": 664,
    "preview": "language: node_js\nnode_js:\n  - \"0.10\"\n\nscript:\n  - cd .. && npm link chromeos-apk\n  - wget https://github.com/uberspot/2"
  },
  {
    "path": "CHANGELOG",
    "chars": 297,
    "preview": "v4.0.0:\n  changes:\n    - \"key\" param is not required anymore for ChromeOS (Chrome 38+).\n    - \"--scale\" option added to "
  },
  {
    "path": "LICENSE",
    "chars": 1080,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2014 Vlad Filippov\n\nPermission is hereby granted, free of charge, to any person obt"
  },
  {
    "path": "README.md",
    "chars": 5129,
    "preview": "chromeos-apk\n======================\n\n> Run Android APKs on Chrome OS, OS X, Linux and Windows.\n\n<img src=\"http://v14d.co"
  },
  {
    "path": "_template/_locales/en/messages.json",
    "chars": 329,
    "preview": "{\n   \"appNotSupported\": {\n      \"description\": \"Message displayed when the app is not supported.\",\n      \"message\": \"Thi"
  },
  {
    "path": "_template/app_main.html",
    "chars": 639,
    "preview": "<!-- Copyright 2013 Google Inc. All Rights Reserved.\n\n     ARC app_main.html.  This file is used as the background page "
  },
  {
    "path": "_template/manifest.json",
    "chars": 1302,
    "preview": "{\n   \"app\": {\n      \"background\": {\n         \"page\": \"app_main.html\"\n      }\n   },\n   \"arc_metadata\": {\n      \"apkList\":"
  },
  {
    "path": "_template/vendor/chromium/crx/README.txt",
    "chars": 15,
    "preview": "APK goes here.\n"
  },
  {
    "path": "archon.md",
    "chars": 5687,
    "preview": "# ARChon Custom Runtime Guide\n\n> ARChon runtime lets you run unlimited number of Android APKs created with `chromeos-apk"
  },
  {
    "path": "chromeos-apk",
    "chars": 53,
    "preview": "#!/usr/bin/env node\n\nrequire('./chromeos-apk.js')();\n"
  },
  {
    "path": "chromeos-apk.js",
    "chars": 3823,
    "preview": "var path = require('path');\nvar fs = require('fs');\nvar readline = require('readline');\n\nvar program = require('commande"
  },
  {
    "path": "lib/parseApk.js",
    "chars": 247,
    "preview": "var ApkReader = require('adbkit-apkreader');\n\nmodule.exports = function parseApk(apk, cb) {\n  try {\n    var reader = Apk"
  },
  {
    "path": "manifest.md",
    "chars": 1276,
    "preview": "# `manifest.json` configuration\n\n## `arc_metadata`\nRaw list of possible values for `arc_metadata`:\n\n```\n\"arc_metadata\": "
  },
  {
    "path": "manually-convert.md",
    "chars": 1257,
    "preview": "# Instructions to convert APKs manually\n> Use this if the command line tool (`chromeos-apk`) fails to parse work for you"
  },
  {
    "path": "multiple-apps.md",
    "chars": 903,
    "preview": "# Running Multiple Apps\n<img src=\"http://v14d.com/g/chromeapks/multiple.png\" width=\"450px\" />\n\n***** \n\n~~Currently you c"
  },
  {
    "path": "package.json",
    "chars": 708,
    "preview": "{\n  \"name\": \"chromeos-apk\",\n  \"version\": \"4.0.2\",\n  \"description\": \"Run Android APKs on Chromebooks\",\n  \"main\": \"chromeo"
  }
]

About this extraction

This page contains the full source code of the vladikoff/chromeos-apk GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 17 files (23.4 KB), approximately 7.1k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!