Skip to content

Commit

Permalink
4.0.0 updates, "key" switching is not needed for unpacked applications
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff committed Oct 16, 2014
1 parent 8577996 commit c45e218
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 58 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ script:
- 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
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
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.
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ If you get a `Failed to parse package name in the APK.` error, then you will hav

## Note

**This is a proof of concept. You can run up to 4 Android applications right now with the regular runtime.
By default the `chromeos-apk` tool replaces the Vine app. Read [the multiple apps manual](multiple-apps.md)
to load more than one application at a time. To load unlimited number of apps read the [ARChon runtime guide](archon.md)**
**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,
Expand Down
1 change: 0 additions & 1 deletion _template/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"import": [ {
"id": "mfaihdlpglflfgpfjcifdjdjcckigekc"
} ],
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh8HMM22e3J95V1TO1RSEF9j4eOATV+pIhGq5FFJek9l1aM9ot0B9rB25pWALNZdiW3hrgRcPR/8YGFaccFbcgneK29hnHbcbwSytdrhK2tF7iV3lbbd/FvENBODZXu3jGruWKRCtlsJgaOmA/97wpHEnn8vqkKLj4+W9kIU+dp+m9GzbB9eQijnt/7XQyJzS1YWsVZyrPaNrEibO33u+CesZ+9lSSJsvocd+r0CK+AvEY8mN27/OhNblDGLOQ/OC8L/AvEm9mU3wk11KyqS18e48XbH9Saxmsl72Z7FTcv4j/C0bqNyeJX1Ja2DMEoabuE2Jxm3vtP9jq+5UjRV1+wIDAQAB",
"manifest_version": 2,
"name": "__MSG_extName__",
"oauth2": {
Expand Down
13 changes: 0 additions & 13 deletions archon.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,6 @@ Add `"resize": "scale"` to `"arc_metadata"` in `manifest.json`.

Read [the manifest guide](manifest.md) for more advanced tweaks.

### Windows 32-bit NACL issues

TL;DR: use **ARChon 1.1.1**. There is a bug in Windows NACL that prevents applications from running (Issue [#38](https://github.com/vladikoff/chromeos-apk/issues/38)). You need to patch `runnable-ld.so` using a Python script:
```
import os
filename = 'runnable-ld.so'
size = os.stat(filename).st_size
fh = open(filename, 'r+b')
fh.truncate((size + 0xffff) & ~0xffff)
fh.close()
exit()
```

### Older downloads
> These are downloads for previous versions of ARChon
Expand Down
23 changes: 3 additions & 20 deletions chromeos-apk.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ module.exports = function (callback) {
program
.version('3.0.0')
.option('-t, --tablet', 'Create a tablet version')
.option('-a, --archon', 'Make app compatible with the custom ARChon runtime.')
.option('-k, --key <n>', 'Specify key to be used. Default: 1', parseInt)
.option('-s, --scale', 'Enable application window scaling')
.option('-n, --name [value]', 'Extension display name')
.usage('<path_to_apk_file ...>')
.parse(process.argv);
Expand Down Expand Up @@ -100,25 +99,9 @@ module.exports = function (callback) {
manifest.arc_metadata.formFactor = 'tablet';
manifest.arc_metadata.orientation = 'landscape';
}

if (program.key) {
switch (program.key) {
case 2:
manifest.key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArHskrdG5EmB5QnEBPXw3TuQ1eHtLF2U7tIywykq4Hh8JQkKsX1aNn6azroEtZ0EslCWlvTleP9rBazLDoGYkCktjc/NAXCdoX728k+H/nxulYAWRkxeZiSbuyGAwt6jA67mq/QYHvsTMuIss/nwhdPVTPRrSpXnrWdO3CMMNMZH49edcAfnvrV8qRhJy3h9B8Qak3KYI2P+F501lGc8P6Xf8zzevvcL+ynFj7UgpDVnwDYVbTrnroC1FOpV8oNfnf1nar0Ii2izgDXl4EUt6zfaxEwJtc8o6HDKtPj2VwILOuWphmuMWHKsC+icExHnIm/oF61FMzyARaoWH2PjpJQIDAQAB';
break;
case 3:
manifest.key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/bF1OTNX8Sqz6ZlYlTJb3S/XRnIxM7Wab4vzSb1oQltJi/YMrcxyYvnQZJRYZDN7AoBBlwNG/dx2yrNdSaNFN1bT3AhzNGa3STOlESF6FktWCHiy3HMkiguALaGGx95PPxSWpBjClHGePbFILwKdWQ75p+j4SiBO1mlNoZgP/F1n+rUVYMOfHKPUbb5zFDH7LbHyZWSAHTJWIZKIcLOcubYq8ITJq5nBFxW7mV0hcLdhflLJCbO/9yemi4Rfs0do7yRyLXuSB1EisBHY00kquIyaVJwJIiBDIKGk3KFhetTX3C1JLWTIuGAmjAsf3LBu7AuflDdia5fOANgPAGnJwIDAQAB';
break;
case 4:
manifest.key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq0UR3Z9iOO5m0taozmsdFdz1oKUCO02VRAMV3ZRwbHdYpg/Mo/dAauTeprLhnGY9N6aCjmDXrPXRcvLc/l8iV+v8U/zi32hvzcXw9d5G5WpQjIhCmLInG5eHOQWGXRTCF1wlrHlv+n4A0ZVYXBJ8zwhLZMrfR3jHhMVpJQOodmU2l/SjIOISfMseNSvkqIibLdzzyuaANh6EfgBOqLzC4yEG9rksTOU3Kr/Pqd/pxA7c1USM4iAZ7lWp8Tnf7m4XOya3K+CrMR0QKvspAF2aknK7eDyLNtG9lTxCDA2T5MD1BkUeHDlmn5ryr2D7myeFTYQqYXAgFrEYh/YKyIe22QIDAQAB';
break;
}
}

if (program.archon) {
try {
delete manifest.key;
} catch (e) {}
if (program.scale) {
manifest.arc_metadata.resize = 'scale';
}

fs.writeFileSync(path.join(appPath, 'manifest.json'), JSON.stringify(manifest, null, 2));
Expand Down
2 changes: 0 additions & 2 deletions lib/parseApk.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var util = require('util');
var ApkReader = require('adbkit-apkreader');

module.exports = function parseApk(apk, cb) {
Expand All @@ -11,4 +10,3 @@ module.exports = function parseApk(apk, cb) {
cb(e);
}
};

23 changes: 5 additions & 18 deletions multiple-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,10 @@

*****

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..."`.
~~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..."`.~~

To load unlimited number of apps you need a custom runtime, see the [ARChon runtime guide](archon.md) for details.


## Key1 - Default App Slot
> MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAh8HMM22e3J95V1TO1RSEF9j4eOATV+pIhGq5FFJek9l1aM9ot0B9rB25pWALNZdiW3hrgRcPR/8YGFaccFbcgneK29hnHbcbwSytdrhK2tF7iV3lbbd/FvENBODZXu3jGruWKRCtlsJgaOmA/97wpHEnn8vqkKLj4+W9kIU+dp+m9GzbB9eQijnt/7XQyJzS1YWsVZyrPaNrEibO33u+CesZ+9lSSJsvocd+r0CK+AvEY8mN27/OhNblDGLOQ/OC8L/AvEm9mU3wk11KyqS18e48XbH9Saxmsl72Z7FTcv4j/C0bqNyeJX1Ja2DMEoabuE2Jxm3vtP9jq+5UjRV1+wIDAQAB
## Key2
> MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArHskrdG5EmB5QnEBPXw3TuQ1eHtLF2U7tIywykq4Hh8JQkKsX1aNn6azroEtZ0EslCWlvTleP9rBazLDoGYkCktjc/NAXCdoX728k+H/nxulYAWRkxeZiSbuyGAwt6jA67mq/QYHvsTMuIss/nwhdPVTPRrSpXnrWdO3CMMNMZH49edcAfnvrV8qRhJy3h9B8Qak3KYI2P+F501lGc8P6Xf8zzevvcL+ynFj7UgpDVnwDYVbTrnroC1FOpV8oNfnf1nar0Ii2izgDXl4EUt6zfaxEwJtc8o6HDKtPj2VwILOuWphmuMWHKsC+icExHnIm/oF61FMzyARaoWH2PjpJQIDAQAB

## Key3
> MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/bF1OTNX8Sqz6ZlYlTJb3S/XRnIxM7Wab4vzSb1oQltJi/YMrcxyYvnQZJRYZDN7AoBBlwNG/dx2yrNdSaNFN1bT3AhzNGa3STOlESF6FktWCHiy3HMkiguALaGGx95PPxSWpBjClHGePbFILwKdWQ75p+j4SiBO1mlNoZgP/F1n+rUVYMOfHKPUbb5zFDH7LbHyZWSAHTJWIZKIcLOcubYq8ITJq5nBFxW7mV0hcLdhflLJCbO/9yemi4Rfs0do7yRyLXuSB1EisBHY00kquIyaVJwJIiBDIKGk3KFhetTX3C1JLWTIuGAmjAsf3LBu7AuflDdia5fOANgPAGnJwIDAQAB

## Key4
> MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq0UR3Z9iOO5m0taozmsdFdz1oKUCO02VRAMV3ZRwbHdYpg/Mo/dAauTeprLhnGY9N6aCjmDXrPXRcvLc/l8iV+v8U/zi32hvzcXw9d5G5WpQjIhCmLInG5eHOQWGXRTCF1wlrHlv+n4A0ZVYXBJ8zwhLZMrfR3jHhMVpJQOodmU2l/SjIOISfMseNSvkqIibLdzzyuaANh6EfgBOqLzC4yEG9rksTOU3Kr/Pqd/pxA7c1USM4iAZ7lWp8Tnf7m4XOya3K+CrMR0QKvspAF2aknK7eDyLNtG9lTxCDA2T5MD1BkUeHDlmn5ryr2D7myeFTYQqYXAgFrEYh/YKyIe22QIDAQAB
**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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chromeos-apk",
"version": "4.0.0-pre",
"version": "4.0.0",
"description": "Run Android APKs on Chromebooks",
"main": "chromeos-apk.js",
"scripts": {
Expand Down

0 comments on commit c45e218

Please sign in to comment.