輔助功能*
Alex Michael

Alex Michael

www.handyx.net*
出版日期:
2006 年 9 月 25 日
用户级别:
初級
產品:
Devices

建立 SIS 檔案以進行發送

SIS 格式可讓您將 SWF 應用程式檔案與任何其他檔案 (TXT 檔案等) 封裝為一個適用於 Symbian 裝置的安裝程式。 在本文中, 我將逐步引導您針對在 Symbian 作業系統 (OS) 上執行的 Flash Lite 應用程式建立 SIS 檔案。 我將討論本文隨附的一些範例檔、在建立 SIS 檔案時所需的開發工具和指令碼、如何建立 SIS 檔案以及如何測試 SIS 檔案。

在執行大型應用程式時, Flash Lite 播放器可能會將記憶體用完而造成應用程式當機。 為避免記憶體溢位, 您需要將不同的應用程式部分置於不同的檔案以便在執行時期時載入。 在範例 Arcade Heroes* (本文隨附的範例檔) 中, 有一個主要的 SWF 檔, 其中包含主功能表並可處理遊戲的載入。 這些遊戲位於 "games" 子資料夾中。 在本文的範例中, 我建立了一個包含 3 個檔案的子資料夾。 如要將它們安裝在裝置上, 您可以個別將所有檔案傳送到手機上, 但是使用者必須自行在裝置上重建您的目錄架構並個別設定每個檔案。 另一個方法則是建立一個安裝檔案:SIS 檔案。

此 SIS 檔案適用於針對使用 Symbian S60 第 2 和第 3 版作業系統的行動電話之 Flash Lite 1.1 和 Flash Lite 2.0 。

系統需求

為進行本教學課程, 您需要安裝下列軟體和檔案:

Flash Professional 8

範例檔案:

範例檔案

本文開頭連結的 make_sis_explained.zip 檔案包含建立 SIS 檔案所需的所有工具, 適用於 Nokia 第 2 和第 3 版平台。 這些工具也包含在完整的 Symbian SDK 中。 您可從此處*下載並安裝 Symbian SDK。

所需的 SDK 版本視您要發佈至的裝置而定。 您可在以下網址中找到各裝置及其 SDK 的清單: http://developer.symbian.com/main/tools_and_sdks/sdks/s60/index.jsp*

make_sis_explained.zip 封存檔中包含下列檔案:

ArcadeHeroes.swf SWF 內容
games/invaders.swf SWF 內容
games/pacman.swf SWF 內容
Arcade1_2nd_edition.SIS Nokia S60 第 2 版 SIS 封裝
Arcade1_3rd_edition_signed.sis Nokia S60 第 3 版含簽章的 SIS 封裝
Arcade1_2nd_edition.pkg Nokia S60 第 2 版 SIS 封裝描述項
Arcade1_3rd_edition.pkg Nokia S60 第 3 版 SIS 封裝描述項
makesis.php PHP 指令碼
mykey.key 範例認證金鑰, 使用 makekeys.exe 建立
mycert.cer 範例認證, 使用 makekeys.exe 建立
makekeys.exe Symbian 應用程式, 以便建立簽章金鑰
signsis.exe Symbian 應用程式, 以便在 SIS 檔案中加上簽章
makesis1.exe Symbian 應用程式, 以建立適用於 Nokia S60 第 2 版的 SIS 檔案
makesis2.exe Symbian 應用程式, 以建立適用於 Nokia S60 第 3 版的 SIS 檔案

開發工具及 PHP 指令碼

工具與開發

建立 SIS 檔的主要工具是 makesis。 它可輸出使用 PKG 組態檔來指定詳細資訊的 SIS 檔案。 在本範例中, 我也將提供您 PHP 指令碼, 讓您用來自動執行本 SIS 產生程序。 當您不想建立 PKG 檔案時, 可以使用此方式。此外, 您還可以使用它來建立包含多個檔案的簡易單一語言專案。 其他主要工具有 SWF2SISsisarunSis

PHP 指令碼

如之前所述, 我提供的 PHP 指令碼可為您的專案產生 SIS 和組態 PKG 檔案。 以下列出使用 PHP 指令碼而不使用 makesis 的一些優點:

  • 所需的 PKG 語法知識最少。
  • 本指令碼 (如之前所述) 中已正確設定以建立和安裝 Flash 內容。
  • 本指令碼僅會建置 PKG 必要的詳細資訊。

PHP 指令碼的主要缺點是, 它必須做修改才能用於多語言版專案。 此外, 您仍需要將 makesis 工具安裝為指令碼才能呼叫它來建立 SIS。

以下列出包含主要 SWF 檔的 SIS 檔大綱。 您可指定子資料夾中要安裝在 Symbian 第 2 版和 Symbian 第 3 版裝置上的所有 SWF 檔案。

"appName"=> "Arcade1"
// The name of your application
	
"vendor"=> "Sprite"
// The name of your company

"player"=> "2"
// The version of the flash lite player your application is for
// (1.1 or 2)

"appUID_2nd"    => "0x10207F05"
// The UID of the application for 2nd Edition platform       
(get your block of id's at the symbian website)

"appUID_3rd"    => "0xA0000001"
// The UID of the application for 3rd Edition platform 
// (get your block of ID's at the symbian website)

"flashFolder_2nd"   => "!:\\Nokia\\Others\\",
// the folder where the  swf files will be installed on Series 60 2nd
// Edition handsets.

"flashFolder_3rd"   => "!:\\Others\\",
// the folder where the  swf files will be installed on Series 60 3rd
// Edition handsets.

"S60ProductID"  => "0x200005F9"
// See the ID's at http://www.newlc.com/Common-products-UIDs.html

"sign_password" => "yourpassword"
// The password you used with makekeys

$subFolder  = "games";
// The name of the subfolder which contains additional swf files

$MainSWF    => "ArcadeHeroes.swf";
// Your main swf file

建立 SIS 檔案

對於第 3 版平台, 您必須指定 SIS 適用的平台或裝置。 您可從 http://www.newlc.com/Common-products-UIDs.html* 中取得平台或裝置 UID。

對於第 3 版平台, 您將需要在 SIS 檔案中加上簽章。 否則裝置將不會接受它。 若要在 SIS 檔案中加上簽章, 您必須先建立金鑰。 若要這麼做, 請使用 makekeys.exe。使用以下程式碼行語法, 然後依照畫面指示進行。

makekeys -cert -password yourpassword -len 2048 -dname "CN=Your Name OU=Development OR=Your Company Ltd CO=GB EM=your@email.com" mykey.key mycert.cer

若要建立 SIS 檔案, 請使用我之前提供的 PHP 指令碼。 在文字編輯器中開啟此指令碼, 以檢視您需要針對您的專案編輯哪些參數。 若要執行指令碼, 請使用下列命令行:

php makesis.php

如果一切順利, 您應會看到下列輸出:

Creating Arcade1_2nd_edition.pkg ...
  Including games/invaders.swf
  Including games/pacman.swf
Processing Arcade1_2nd_edition.pkg...
Created Arcade1_2nd_edition.SIS

Creating Arcade1_3rd_edition.pkg ...
  Including games/invaders.swf
  Including games/pacman.swf
Processing Arcade1_3rd_edition.pkg...
Created Arcade1_3rd_edition.SIS

SIGNSIS Version 4, 0, 0, 1
A utility for signing Software Installation (SIS) files.
Copyright (c) 2004 Symbian Software Ltd. All rights reserved.

Signing

Primary:
Issued by Alex Michael.
Issued to Development.
Valid from 16/08/2006 to 16/08/2007.
Done!

如果您要手動執行封裝, 將需要編寫您自己的 PKG 檔。此 PKG 檔案將會指定哪些檔案會儲存在裝置上指定的資料夾、應用程式的名稱和 UID;對於第 3 版平台裝置, 則還會指定平台或裝置的 Vendor 和 ProductID。 以下為手動執行封裝的步驟:

  1. 執行 makesis 並將 pkg 檔案傳送為參數:

    makesis yourpackagefile.pkg
    

    現在, 您的 SIS 檔案應與 PKG 檔位於相同的目錄中。

  2. 使用 signsis.exe 在封裝檔中加上簽章:

    signsis -o -s -v yoursisfile.sis yoursignedsisfile.sis mycert.cer mykey.key yourpassword
    

mycert.cermykey.key 是您使用 makekeys.exe 建立的檔案, 而 yourpassword 則是當您建立金鑰時輸入的密碼。

測試 SIS 檔案

不同裝置的資料夾結構也不同。 若要使您的應用程式出現在 Nokia N70 上, 您必須將它安裝在 Nokia/Others。 在 Nokia N80 上, 您必須將它置於 Others。

N70 – Nokia\Others

N80 – Others //warning: install this in a folder called others not other.

在 Nokia N80 上, 您必須安裝在記憶卡上。 在 Nokia N70 上, 您必須安裝在手機記憶體上。

下一步

如需可在行動裝置上執行的 arcade heroes 以及其他 5 種 Flash Lite 1、1.1 和 2.0 版的阿給類型 (arcade-style) 遊戲的原始碼檔, 您可購買我的著作《Animating with Flash 8: Creative Animation Techniques》並檢視封面的 CD。

關於作者

Alex Michael 是 Sprite Interactive Ltd 的管理董事。Sprite Interactive 是一家新媒體公司, 主要針對行動裝置提供解決方案。 目前的客戶包括 Vodafone、Orange、T-Mobile、ESPN、Disney、Jamba、Jetix。 若要檢視 Sprite 提供的各種行動遊戲、應用程式和行動寵物, 請造訪我們的展示網站:www.Handyx.net*