Device home needs to be run on booting time to handle remote device requests.
To do that, the device home package needs platform level signing.
Also, unused bin folders are removed.
Change-Id: Ibc2c46f35da395034f5ab563888e1dc14719000e
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
<tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/mediastorage"/>
- <tizen:service id="9z6IujVul3.DeviceHomeService" type="global">
+ <tizen:service id="9z6IujVul3.DeviceHomeService" type="global" auto-restart="true" on-boot="true">
<tizen:content src="service/service.js"/>
<tizen:name>DeviceHomeService</tizen:name>
<tizen:description>DeviceHomeService</tizen:description>
+++ /dev/null
-../mime/cli.js
\ No newline at end of file
+++ /dev/null
-../qrcode/bin/qrcode
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/env node
-let program=require("jake").program;delete global.jake,program.setTaskNames=function(e){this.taskNames=e};let ejs=require("../lib/ejs"),{hyphenToCamel:hyphenToCamel}=require("../lib/utils"),fs=require("fs"),args=process.argv.slice(2),usage=fs.readFileSync(`${__dirname}/../usage.txt`).toString();const CLI_OPTS=[{full:"output-file",abbr:"o",expectValue:!0},{full:"data-file",abbr:"f",expectValue:!0},{full:"data-input",abbr:"i",expectValue:!0},{full:"delimiter",abbr:"m",expectValue:!0,passThrough:!0},{full:"open-delimiter",abbr:"p",expectValue:!0,passThrough:!0},{full:"close-delimiter",abbr:"c",expectValue:!0,passThrough:!0},{full:"strict",abbr:"s",expectValue:!1,allowValue:!1,passThrough:!0},{full:"no-with",abbr:"n",expectValue:!1,allowValue:!1},{full:"locals-name",abbr:"l",expectValue:!0,passThrough:!0},{full:"rm-whitespace",abbr:"w",expectValue:!1,allowValue:!1,passThrough:!0},{full:"debug",abbr:"d",expectValue:!1,allowValue:!1,passThrough:!0},{full:"help",abbr:"h",passThrough:!0},{full:"version",abbr:"V",passThrough:!0},{full:"version",abbr:"v",passThrough:!0}];let preempts={version:function(){program.die(ejs.VERSION)},help:function(){program.die(usage)}},stdin="";function run(){program.availableOpts=CLI_OPTS,program.parseArgs(args);let e=program.taskNames[0],r=program.envVars,a={};for(let e in program.opts){let r=hyphenToCamel(e);a[r]=program.opts[e]}let l,t={},s={};CLI_OPTS.forEach((e=>{let r=hyphenToCamel(e.full);e.passThrough&&void 0!==a[r]&&(t[r]=a[r])}));for(let e in t)if(preempts[e])return preempts[e]();if(t.views=["."],!e)throw new Error("Please provide a template path. (Run ejs -h for help)");t.strict&&(a.noWith=!0),a.noWith&&(t._with=!1);let o=new Error("Please do not pass data multiple ways. Pick one of stdin, -f, or -i.");if(stdin)l=stdin;else if(a.dataInput){if(l)throw o;l=decodeURIComponent(a.dataInput)}else if(a.dataFile){if(l)throw o;l=fs.readFileSync(a.dataFile).toString()}l&&(s=JSON.parse(l));for(let e in r)s[e]=r[e];let i=fs.readFileSync(e).toString(),p=ejs.render(i,s,t);a.outputFile?fs.writeFileSync(a.outputFile,p):process.stdout.write(p),process.exit()}process.stdin.setEncoding("utf8"),process.stdin.on("readable",(()=>{let e;for(;null!==(e=process.stdin.read());)stdin+=e})),setImmediate(run);
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/env node
-try{require(`${process.cwd()}/node_modules/jake`)}catch(e){require("../lib/jake")}var args=process.argv.slice(2);jake.run.apply(jake,args);
\ No newline at end of file
+++ /dev/null
-#!/usr/bin/env node
-var yargs = require('yargs')
-var qr = require('../lib')
-
-function save (file, text, options) {
- qr.toFile(file, text, options, function (err, data) {
- if (err) {
- console.error('Error:', err.message)
- process.exit(1)
- }
-
- console.log('saved qrcode to: ' + file + '\n')
- })
-}
-
-function print (text, options) {
- options.type = 'terminal'
- qr.toString(text, options, function (err, text) {
- if (err) {
- console.error('Error:', err.message)
- process.exit(1)
- }
-
- console.log(text)
- })
-}
-
-function parseOptions (args) {
- return {
- version: args.qversion,
- errorCorrectionLevel: args.error,
- type: args.type,
- maskPattern: args.mask,
- margin: args.qzone,
- width: args.width,
- scale: args.scale,
- color: {
- light: args.lightcolor,
- dark: args.darkcolor
- }
- }
-}
-
-function processInputs (text, opts) {
- if (!text.length) {
- yargs.showHelp()
- process.exit(1)
- }
-
- if (opts.output) {
- save(opts.output, text, parseOptions(opts))
- } else {
- print(text, parseOptions(opts))
- }
-}
-
-var argv = yargs
- .detectLocale(false)
- .usage('Usage: $0 [options] <input string>')
- .option('v', {
- alias: 'qversion',
- description: 'QR Code symbol version (1 - 40)',
- group: 'QR Code options:',
- type: 'number'
- })
- .option('e', {
- alias: 'error',
- description: 'Error correction level',
- choices: ['L', 'M', 'Q', 'H'],
- group: 'QR Code options:'
- })
- .option('m', {
- alias: 'mask',
- description: 'Mask pattern (0 - 7)',
- group: 'QR Code options:',
- type: 'number'
- })
- .option('t', {
- alias: 'type',
- description: 'Output type',
- choices: ['png', 'svg', 'utf8'],
- implies: 'output',
- group: 'Renderer options:'
- })
- .option('w', {
- alias: 'width',
- description: 'Image width (px)',
- conflicts: 'scale',
- group: 'Renderer options:',
- type: 'number'
- })
- .option('s', {
- alias: 'scale',
- description: 'Scale factor',
- conflicts: 'width',
- group: 'Renderer options:',
- type: 'number'
- })
- .option('q', {
- alias: 'qzone',
- description: 'Quiet zone size',
- group: 'Renderer options:',
- type: 'number'
- })
- .option('l', {
- alias: 'lightcolor',
- description: 'Light RGBA hex color',
- group: 'Renderer options:'
- })
- .option('d', {
- alias: 'darkcolor',
- description: 'Dark RGBA hex color',
- group: 'Renderer options:'
- })
- .option('o', {
- alias: 'output',
- description: 'Output file'
- })
- .help('h')
- .alias('h', 'help')
- .version()
- .example('$0 "some text"', 'Draw in terminal window')
- .example('$0 -o out.png "some text"', 'Save as png image')
- .example('$0 -d F00 -o out.png "some text"', 'Use red as foreground color')
- .parserConfiguration({'parse-numbers': false})
- .argv
-
-if (process.stdin.isTTY) {
- processInputs(argv._.join(' '), argv)
-} else {
- var text = ''
- process.stdin.setEncoding('utf8')
- process.stdin.on('readable', function () {
- var chunk = process.stdin.read()
- if (chunk !== null) {
- text += chunk
- }
- })
-
- process.stdin.on('end', function () {
- // this process can be run as a command outside of a tty so if there was no
- // data on stdin read from argv
- processInputs(text.length?text:argv._.join(' '), argv)
- })
-}
+++ /dev/null
-<?xml version="1.0"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_ID@" type="wgt" version="@WRTJS_VERSION@" api-version="@TIZEN_VERSION@" nodisplay-setting="false" readonly="true" preload="true">
- <label>D2DGlobalService</label>
- <author/>
- <ui-application appid="@PACKAGE_ID@.DeviceHomeService" exec="/usr/apps/@PACKAGE_ID@/bin/@PACKAGE_ID@.DeviceHomeService" type="capp" taskmanage="false" nodisplay="true" multiple="false">
- <label>DeviceHomeService</label>
- </ui-application>
- <ui-application appid="@PACKAGE_ID@.SignalingService" exec="/usr/apps/@PACKAGE_ID@/bin/@PACKAGE_ID@.SignalingService" type="capp" taskmanage="false" nodisplay="true" multiple="false">
- <label>SignalingService</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- </privileges>
-</manifest>
touch debugsources.list
%define _tpk_file_name %{__pkgid}-%{version}-v%{tizen_version_major}.%{tizen_version_minor}.%{repo_name}.%{ARCHITECTURE}.tpk
%define __tpk_install_post \
- tizen/build/build_app.sh %{GENERATED_APP_DIR} wrtjs_tpk_root %{_tpk_file_name} tpk %{?profile}
+ tizen/build/build_app.sh %{GENERATED_APP_DIR} wrtjs_tpk_root %{_tpk_file_name} tpk platform %{?profile}
%define __spec_install_post \
%{?__tpk_install_post} \
%{nil}
%define _d2d_wgt_file_name device_home.wgt
install -m 0644 key.pem device_home/signaling_server/gen/
install -m 0644 cert.pem device_home/signaling_server/gen/
- tizen/build/build_devicehome.sh device_home/ %{buildroot} %{_d2d_wgt_file_name}
+ %if "%{?profile}" == "tv"
+ tizen/build/build_app.sh %{buildroot} device_home %{_d2d_wgt_file_name} wgt public %{?profile}
+ %else
+ tizen/build/build_app.sh %{buildroot} device_home %{_d2d_wgt_file_name} wgt platform %{?profile}
+ %endif
install -d %{buildroot}%{_appdir}/.preload-rw-wgt/
install -m 0644 %{buildroot}/%{_d2d_wgt_file_name} %{buildroot}%{_appdir}/.preload-rw-wgt/
source_path=${output_path}/${source_dir_name}
file_name=${3}
file_extension=${4}
-profile=${5}
+privilege=${5}
+profile=${6}
echo "Start $0..."
echo "ARGS=$@"
echo "output_path=$output_path"
echo "source_path=$source_path"
echo "file_name=$file_name"
+echo "privilege=$privilege"
echo "profile=$profile"
if [ "${file_extension}" == "tpk" ]; then
install -m 0644 packaging/tizen-manifest-tpk.xml ${source_path}/tizen-manifest.xml
install -m 0644 LICENSE ${source_path}/license
cp -rf out/gen/app ${source_path}/shared/res/wrt/app
+elif [ "${file_extension}" == "wgt" ]; then
+ # DeviceHome
+ cp -rf device_home ${source_path}
else
echo "Please add proper file extension."
exit 1
fi
# Test signing
-/usr/bin/hash-signer.sh -a -d -p platform -b ${output_path} ${source_dir_name}
+/usr/bin/hash-signer.sh -a -d -p ${privilege} -b ${output_path} ${source_dir_name}
pushd ${source_path}
echo "* zip"
-zip -yr $file_name *
+zip -yr $file_name .
mv $file_name ../
popd
# tpkresigning from app-signer package
-if [ "${profile}" == "tv" ]; then
- tpkresigner -a -d -p platform -n %{4} ${output_path}/${file_name}
+if [ "${profile}" == "tv" -a "${privilege}" != "public" ]; then
+ tpkresigner -a -d -p ${privilege} -n %{4} ${output_path}/${file_name}
fi
ls ${output_path}
rm -rf ${source_path}
-echo "Finished $0"
+echo "Finished $0 $@"
+++ /dev/null
-#!/bin/bash
-
-device_home_root=$1
-build_root=$2
-wgt_file_name=$3
-
-# This should be 'public' level with hash-signer
-/usr/bin/hash-signer.sh -a -d -b . ${device_home_root}
-
-cd ${device_home_root}
-zip -rq ${build_root}/${wgt_file_name} .