@webos-tools/cli 3.1.3 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1271) hide show
  1. package/.vscode/c_cpp_properties.json +21 -0
  2. package/.vscode/launch.json +97 -0
  3. package/.vscode/settings.json +13 -0
  4. package/.vscode/tasks.json +32 -0
  5. package/CHANGELOG.md +34 -0
  6. package/README.md +226 -219
  7. package/bin/ares-config.js +210 -201
  8. package/bin/ares-device.js +222 -219
  9. package/bin/ares-launch.js +318 -318
  10. package/bin/ares-novacom.js +220 -220
  11. package/bin/ares-package.js +347 -336
  12. package/files/conf/ares.json +48 -48
  13. package/files/conf/command-service.json +78 -73
  14. package/files/conf/config.json +31 -31
  15. package/files/conf/novacom-devices.json +68 -51
  16. package/files/conf/sdk.json +8 -8
  17. package/files/conf/template.json +57 -57
  18. package/files/conf-base/env/sdk-signage.json +8 -0
  19. package/files/conf-base/key/pubkey-signage.pem +9 -0
  20. package/files/conf-base/profile/config-signage.json +29 -0
  21. package/files/conf-base/query/signage/query-app.json +14 -0
  22. package/files/conf-base/query/signage/query-service.json +6 -0
  23. package/files/conf-base/template-conf/signage-sdk-templates.json +239 -0
  24. package/files/help/ares-config.help +48 -48
  25. package/files/help/ares-generate.help +101 -91
  26. package/files/help/ares-inspect.help +77 -76
  27. package/files/help/ares-launch.help +111 -105
  28. package/files/help/ares-package.help +103 -101
  29. package/files/help/ares-setup-device.help +196 -156
  30. package/files/schema/NovacomDevices.schema +63 -62
  31. package/files/templates/signage-sdk-templates/Backlight_Scheduling/clockTable.js +29 -0
  32. package/files/templates/signage-sdk-templates/Backlight_Scheduling/index.html +53 -0
  33. package/files/templates/signage-sdk-templates/Backlight_Scheduling/js/idcap.js +21 -0
  34. package/files/templates/signage-sdk-templates/Backlight_Scheduling/remocon.js +214 -0
  35. package/files/templates/signage-sdk-templates/Backlight_Scheduling/scheduler.js +122 -0
  36. package/files/templates/signage-sdk-templates/Backlight_Scheduling/setanddelete.js +25 -0
  37. package/files/templates/signage-sdk-templates/Backlight_Scheduling/style.css +213 -0
  38. package/files/templates/signage-sdk-templates/Download_Progress/app.css +27 -0
  39. package/files/templates/signage-sdk-templates/Download_Progress/app.js +407 -0
  40. package/files/templates/signage-sdk-templates/Download_Progress/index.html +32 -0
  41. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova/2.7.0/cordova.webos.js +7038 -0
  42. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova/LICENSE +201 -0
  43. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/configuration.js +1 -0
  44. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/deviceInfo.js +1 -0
  45. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/inputSource.js +1 -0
  46. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/power.js +1 -0
  47. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/signage.js +1 -0
  48. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/sound.js +1 -0
  49. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/storage.js +1 -0
  50. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.0/video.js +1 -0
  51. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/configuration.js +1 -0
  52. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/deviceInfo.js +1 -0
  53. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/inputSource.js +1 -0
  54. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/power.js +1 -0
  55. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/signage.js +1 -0
  56. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/sound.js +1 -0
  57. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/storage.js +1 -0
  58. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.1/video.js +1 -0
  59. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/configuration.js +1 -0
  60. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/deviceInfo.js +1 -0
  61. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/inputSource.js +1 -0
  62. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/power.js +1 -0
  63. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/signage.js +1 -0
  64. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/sound.js +1 -0
  65. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/storage.js +23 -0
  66. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.2/video.js +1 -0
  67. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/configuration.js +1 -0
  68. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/deviceInfo.js +1 -0
  69. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/inputSource.js +1 -0
  70. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/power.js +1 -0
  71. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/signage.js +1 -0
  72. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/sound.js +1 -0
  73. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/storage.js +1 -0
  74. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.3/video.js +1 -0
  75. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/configuration.js +9 -0
  76. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/deviceInfo.js +9 -0
  77. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/inputSource.js +9 -0
  78. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/power.js +9 -0
  79. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/security.js +9 -0
  80. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/signage.js +9 -0
  81. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/sound.js +9 -0
  82. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/storage.js +9 -0
  83. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/time.js +9 -0
  84. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/utility.js +9 -0
  85. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.0/video.js +9 -0
  86. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/configuration.js +9 -0
  87. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/deviceInfo.js +9 -0
  88. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/inputSource.js +9 -0
  89. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/power.js +9 -0
  90. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/security.js +9 -0
  91. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/signage.js +9 -0
  92. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/sound.js +9 -0
  93. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/storage.js +9 -0
  94. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/time.js +9 -0
  95. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/utility.js +9 -0
  96. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.1/video.js +9 -0
  97. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/configuration.js +9 -0
  98. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/deviceInfo.js +9 -0
  99. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/inputSource.js +9 -0
  100. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/power.js +9 -0
  101. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/security.js +9 -0
  102. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/signage.js +8 -0
  103. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/sound.js +9 -0
  104. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/storage.js +9 -0
  105. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/time.js +9 -0
  106. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/utility.js +9 -0
  107. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.2/video.js +9 -0
  108. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/configuration.js +9 -0
  109. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/deviceInfo.js +9 -0
  110. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/inputSource.js +9 -0
  111. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/power.js +9 -0
  112. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/security.js +9 -0
  113. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/signage.js +9 -0
  114. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/sound.js +9 -0
  115. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/storage.js +9 -0
  116. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/time.js +9 -0
  117. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/utility.js +9 -0
  118. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.3/video.js +9 -0
  119. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/configuration.js +1 -0
  120. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/deviceInfo.js +1 -0
  121. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/inputSource.js +1 -0
  122. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/power.js +1 -0
  123. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/security.js +1 -0
  124. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/signage.js +1 -0
  125. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/sound.js +1 -0
  126. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/storage.js +1 -0
  127. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/time.js +1 -0
  128. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/utility.js +1 -0
  129. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.4/video.js +1 -0
  130. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/configuration.js +1 -0
  131. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/deviceInfo.js +1 -0
  132. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/inputSource.js +1 -0
  133. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/power.js +1 -0
  134. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/security.js +1 -0
  135. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/signage.js +1 -0
  136. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/sound.js +1 -0
  137. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/storage.js +1 -0
  138. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/time.js +1 -0
  139. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/utility.js +1 -0
  140. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.4.5/video.js +1 -0
  141. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/configuration.js +1 -0
  142. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/deviceInfo.js +1 -0
  143. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/inputSource.js +1 -0
  144. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/power.js +1 -0
  145. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/security.js +1 -0
  146. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/signage.js +1 -0
  147. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/sound.js +1 -0
  148. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/storage.js +1 -0
  149. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/time.js +1 -0
  150. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/utility.js +1 -0
  151. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.0/video.js +1 -0
  152. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/configuration.js +1 -0
  153. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/deviceInfo.js +1 -0
  154. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/inputSource.js +1 -0
  155. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/power.js +1 -0
  156. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/security.js +1 -0
  157. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/signage.js +1 -0
  158. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/sound.js +1 -0
  159. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/storage.js +1 -0
  160. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/time.js +1 -0
  161. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/utility.js +1 -0
  162. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.1/video.js +1 -0
  163. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/configuration.js +1 -0
  164. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/deviceInfo.js +1 -0
  165. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/inputSource.js +1 -0
  166. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/power.js +1 -0
  167. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/security.js +1 -0
  168. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/signage.js +1 -0
  169. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/sound.js +1 -0
  170. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/storage.js +1 -0
  171. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/time.js +1 -0
  172. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/utility.js +1 -0
  173. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.11/video.js +1 -0
  174. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/configuration.js +1 -0
  175. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/deviceInfo.js +1 -0
  176. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/inputSource.js +1 -0
  177. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/power.js +1 -0
  178. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/security.js +1 -0
  179. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/signage.js +1 -0
  180. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/sound.js +1 -0
  181. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/storage.js +1 -0
  182. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/time.js +1 -0
  183. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/utility.js +1 -0
  184. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.12/video.js +1 -0
  185. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/configuration.js +1 -0
  186. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/deviceInfo.js +1 -0
  187. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/inputSource.js +1 -0
  188. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/power.js +1 -0
  189. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/security.js +1 -0
  190. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/signage.js +1 -0
  191. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/sound.js +1 -0
  192. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/storage.js +1 -0
  193. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/time.js +1 -0
  194. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/utility.js +1 -0
  195. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.2/video.js +1 -0
  196. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/configuration.js +1 -0
  197. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/deviceInfo.js +1 -0
  198. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/inputSource.js +1 -0
  199. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/power.js +1 -0
  200. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/security.js +1 -0
  201. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/signage.js +1 -0
  202. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/sound.js +1 -0
  203. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/storage.js +1 -0
  204. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/time.js +1 -0
  205. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/utility.js +1 -0
  206. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.3/video.js +1 -0
  207. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/configuration.js +1 -0
  208. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/deviceInfo.js +1 -0
  209. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/inputSource.js +1 -0
  210. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/power.js +1 -0
  211. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/security.js +1 -0
  212. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/signage.js +1 -0
  213. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/sound.js +1 -0
  214. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/storage.js +1 -0
  215. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/time.js +1 -0
  216. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/utility.js +1 -0
  217. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.4/video.js +1 -0
  218. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/configuration.js +1 -0
  219. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/deviceInfo.js +1 -0
  220. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/inputSource.js +1 -0
  221. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/power.js +1 -0
  222. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/security.js +1 -0
  223. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/signage.js +1 -0
  224. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/sound.js +1 -0
  225. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/storage.js +1 -0
  226. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/time.js +1 -0
  227. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/utility.js +1 -0
  228. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.5/video.js +1 -0
  229. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/configuration.js +1 -0
  230. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/deviceInfo.js +1 -0
  231. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/inputSource.js +1 -0
  232. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/power.js +1 -0
  233. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/security.js +1 -0
  234. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/signage.js +1 -0
  235. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/sound.js +1 -0
  236. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/storage.js +1 -0
  237. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/time.js +1 -0
  238. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/utility.js +1 -0
  239. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.6/video.js +1 -0
  240. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/configuration.js +1 -0
  241. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/deviceInfo.js +1 -0
  242. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/inputSource.js +1 -0
  243. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/power.js +1 -0
  244. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/security.js +1 -0
  245. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/signage.js +1 -0
  246. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/sound.js +1 -0
  247. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/storage.js +1 -0
  248. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/time.js +1 -0
  249. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/utility.js +1 -0
  250. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.7/video.js +1 -0
  251. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/configuration.js +1 -0
  252. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/deviceInfo.js +1 -0
  253. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/inputSource.js +1 -0
  254. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/power.js +1 -0
  255. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/security.js +1 -0
  256. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/signage.js +1 -0
  257. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/sound.js +1 -0
  258. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/storage.js +1 -0
  259. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/time.js +1 -0
  260. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/utility.js +1 -0
  261. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.5.8/video.js +1 -0
  262. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/configuration.js +1 -0
  263. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/deviceInfo.js +1 -0
  264. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/inputSource.js +1 -0
  265. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/power.js +1 -0
  266. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/security.js +1 -0
  267. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/signage.js +1 -0
  268. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/sound.js +1 -0
  269. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/storage.js +1 -0
  270. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/time.js +1 -0
  271. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/utility.js +1 -0
  272. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.0/video.js +1 -0
  273. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/configuration.js +1 -0
  274. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/deviceInfo.js +1 -0
  275. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/inputSource.js +1 -0
  276. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/power.js +1 -0
  277. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/security.js +1 -0
  278. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/signage.js +1 -0
  279. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/sound.js +1 -0
  280. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/storage.js +1 -0
  281. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/time.js +1 -0
  282. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/utility.js +1 -0
  283. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.1/video.js +1 -0
  284. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/configuration.js +1 -0
  285. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/deviceInfo.js +1 -0
  286. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/inputSource.js +1 -0
  287. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/power.js +1 -0
  288. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/security.js +1 -0
  289. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/signage.js +1 -0
  290. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/sound.js +1 -0
  291. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/storage.js +1 -0
  292. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/time.js +1 -0
  293. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/utility.js +1 -0
  294. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.2/video.js +1 -0
  295. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/configuration.js +1 -0
  296. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/deviceInfo.js +1 -0
  297. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/inputSource.js +1 -0
  298. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/power.js +1 -0
  299. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/security.js +1 -0
  300. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/signage.js +1 -0
  301. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/sound.js +1 -0
  302. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/storage.js +1 -0
  303. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/time.js +1 -0
  304. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/utility.js +1 -0
  305. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.3/video.js +1 -0
  306. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/configuration.js +1 -0
  307. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/deviceInfo.js +1 -0
  308. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/inputSource.js +1 -0
  309. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/led.js +1 -0
  310. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/power.js +1 -0
  311. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/security.js +1 -0
  312. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/signage.js +1 -0
  313. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/sound.js +1 -0
  314. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/storage.js +1 -0
  315. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/time.js +1 -0
  316. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/utility.js +1 -0
  317. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.7/video.js +1 -0
  318. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/configuration.js +1 -0
  319. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/deviceInfo.js +1 -0
  320. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/inputSource.js +1 -0
  321. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/led.js +1 -0
  322. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/power.js +1 -0
  323. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/security.js +1 -0
  324. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/signage.js +1 -0
  325. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/sound.js +1 -0
  326. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/storage.js +1 -0
  327. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/time.js +1 -0
  328. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/utility.js +1 -0
  329. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.6.8/video.js +1 -0
  330. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/configuration.js +1 -0
  331. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/deviceInfo.js +1 -0
  332. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/inputSource.js +1 -0
  333. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/iot.js +1 -0
  334. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/power.js +1 -0
  335. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/security.js +1 -0
  336. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/signage.js +1 -0
  337. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/sound.js +1 -0
  338. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/storage.js +1 -0
  339. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/time.js +1 -0
  340. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/utility.js +1 -0
  341. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.0/video.js +1 -0
  342. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/configuration.js +1 -0
  343. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/deviceInfo.js +1 -0
  344. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/inputSource.js +1 -0
  345. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/iot.js +1 -0
  346. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/power.js +1 -0
  347. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/security.js +1 -0
  348. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/signage.js +1 -0
  349. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/sound.js +1 -0
  350. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/storage.js +1 -0
  351. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/time.js +1 -0
  352. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/utility.js +1 -0
  353. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.1/video.js +1 -0
  354. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/configuration.js +1 -0
  355. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/deviceInfo.js +1 -0
  356. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/inputSource.js +1 -0
  357. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/iot.js +1 -0
  358. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/led.js +1 -0
  359. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/power.js +1 -0
  360. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/security.js +1 -0
  361. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/signage.js +1 -0
  362. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/sound.js +1 -0
  363. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/storage.js +1 -0
  364. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/time.js +1 -0
  365. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/utility.js +1 -0
  366. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.5/video.js +1 -0
  367. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/configuration.js +1 -0
  368. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/deviceInfo.js +1 -0
  369. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/inputSource.js +1 -0
  370. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/iot.js +1 -0
  371. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/led.js +1 -0
  372. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/power.js +1 -0
  373. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/security.js +1 -0
  374. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/signage.js +1 -0
  375. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/sound.js +1 -0
  376. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/storage.js +1 -0
  377. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/time.js +1 -0
  378. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/utility.js +1 -0
  379. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.7.6/video.js +1 -0
  380. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/configuration.js +1 -0
  381. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/deviceInfo.js +1 -0
  382. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/inputSource.js +1 -0
  383. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/iot.js +1 -0
  384. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/power.js +1 -0
  385. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/security.js +1 -0
  386. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/signage.js +1 -0
  387. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/sound.js +1 -0
  388. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/storage.js +1 -0
  389. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/time.js +1 -0
  390. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/utility.js +1 -0
  391. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.0/video.js +1 -0
  392. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/configuration.js +1 -0
  393. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/deviceInfo.js +1 -0
  394. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/inputSource.js +1 -0
  395. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/iot.js +1 -0
  396. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/power.js +1 -0
  397. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/security.js +1 -0
  398. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/signage.js +1 -0
  399. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/sound.js +1 -0
  400. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/storage.js +1 -0
  401. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/time.js +1 -0
  402. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/utility.js +1 -0
  403. package/files/templates/signage-sdk-templates/Download_Progress/js/cordova-cd/1.8.1/video.js +1 -0
  404. package/files/templates/signage-sdk-templates/Download_Progress/js/custom/custom1.2.js +14 -0
  405. package/files/templates/signage-sdk-templates/Download_Progress/js/custom/custom1.3.1.js +1 -0
  406. package/files/templates/signage-sdk-templates/Download_Progress/js/custom/custom1.3.js +1 -0
  407. package/files/templates/signage-sdk-templates/Download_Progress/js/custom/custom1.4.js +14 -0
  408. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/README.txt +40 -0
  409. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/gpio.js +16 -0
  410. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/gps.js +16 -0
  411. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/humidity.js +16 -0
  412. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/light.js +16 -0
  413. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/nfc.js +16 -0
  414. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/rfid.js +16 -0
  415. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/temperature.js +16 -0
  416. package/files/templates/signage-sdk-templates/Download_Progress/js/harmony/thermalPrinter.js +16 -0
  417. package/files/templates/signage-sdk-templates/Download_Progress/js/idcap.js +21 -0
  418. package/files/templates/signage-sdk-templates/Download_Progress/js/webOS/LICENSE-2.0.txt +202 -0
  419. package/files/templates/signage-sdk-templates/Download_Progress/js/webOS/webOS.js +1 -0
  420. package/files/templates/signage-sdk-templates/Download_Progress/res/webossignage_logo.png +0 -0
  421. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/css/styles.css +270 -0
  422. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/data/data.json +12 -0
  423. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/fonts/MuseoSans300.otf +0 -0
  424. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/fonts/MuseoSans700Italic.otf +0 -0
  425. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/index.html +43 -0
  426. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/js/controller.js +263 -0
  427. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/js/helpers/util.js +130 -0
  428. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/readme.txt +26 -0
  429. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/res/images/tpl_01_img_sign.png +0 -0
  430. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/res/images/tpl_01_logo_nike.png +0 -0
  431. package/files/templates/signage-sdk-templates/Fashion_Multimedia_Ad/res/videos/tpl_01_video.mp4 +0 -0
  432. package/files/templates/signage-sdk-templates/File_Explorer/README.txt +16 -0
  433. package/files/templates/signage-sdk-templates/File_Explorer/index.html +12 -0
  434. package/files/templates/signage-sdk-templates/File_Explorer/js/Root.js +39 -0
  435. package/files/templates/signage-sdk-templates/File_Explorer/js/definition.js +59 -0
  436. package/files/templates/signage-sdk-templates/File_Explorer/js/explorer.js +367 -0
  437. package/files/templates/signage-sdk-templates/File_Explorer/js/explorerController.js +462 -0
  438. package/files/templates/signage-sdk-templates/File_Explorer/js/idcap.js +21 -0
  439. package/files/templates/signage-sdk-templates/File_Explorer/js/mainController.js +261 -0
  440. package/files/templates/signage-sdk-templates/File_Explorer/style.css +233 -0
  441. package/files/templates/signage-sdk-templates/Flight_Schedule/appinfo.json +11 -0
  442. package/files/templates/signage-sdk-templates/Flight_Schedule/css/styles.css +168 -0
  443. package/files/templates/signage-sdk-templates/Flight_Schedule/data/data.json +5 -0
  444. package/files/templates/signage-sdk-templates/Flight_Schedule/fonts/MuseoSans300.otf +0 -0
  445. package/files/templates/signage-sdk-templates/Flight_Schedule/fonts/MuseoSans500.otf +0 -0
  446. package/files/templates/signage-sdk-templates/Flight_Schedule/fonts/MuseoSans700.otf +0 -0
  447. package/files/templates/signage-sdk-templates/Flight_Schedule/images/AAir.png +0 -0
  448. package/files/templates/signage-sdk-templates/Flight_Schedule/images/BAirline.png +0 -0
  449. package/files/templates/signage-sdk-templates/Flight_Schedule/images/CAirline.png +0 -0
  450. package/files/templates/signage-sdk-templates/Flight_Schedule/images/DAir.png +0 -0
  451. package/files/templates/signage-sdk-templates/Flight_Schedule/images/EAirline.png +0 -0
  452. package/files/templates/signage-sdk-templates/Flight_Schedule/images/tpl_05_img_flight.png +0 -0
  453. package/files/templates/signage-sdk-templates/Flight_Schedule/index.html +32 -0
  454. package/files/templates/signage-sdk-templates/Flight_Schedule/js/controller.js +235 -0
  455. package/files/templates/signage-sdk-templates/Flight_Schedule/js/helpers/util.js +183 -0
  456. package/files/templates/signage-sdk-templates/Flight_Schedule/readme.txt +29 -0
  457. package/files/templates/signage-sdk-templates/Flight_Schedule/server/example.json +4 -0
  458. package/files/templates/signage-sdk-templates/Flight_Schedule/server/package.json +9 -0
  459. package/files/templates/signage-sdk-templates/Flight_Schedule/server/readme.txt +30 -0
  460. package/files/templates/signage-sdk-templates/Flight_Schedule/server/routes/flights.js +493 -0
  461. package/files/templates/signage-sdk-templates/Flight_Schedule/server/server.js +43 -0
  462. package/files/templates/signage-sdk-templates/Information_Board/css/styles.css +239 -0
  463. package/files/templates/signage-sdk-templates/Information_Board/data/data.json +49 -0
  464. package/files/templates/signage-sdk-templates/Information_Board/fonts/Museo Sans 300.otf +0 -0
  465. package/files/templates/signage-sdk-templates/Information_Board/fonts/Museo Sans 500.otf +0 -0
  466. package/files/templates/signage-sdk-templates/Information_Board/fonts/Museo Sans 700.otf +0 -0
  467. package/files/templates/signage-sdk-templates/Information_Board/index.html +101 -0
  468. package/files/templates/signage-sdk-templates/Information_Board/js/controller.js +111 -0
  469. package/files/templates/signage-sdk-templates/Information_Board/js/helpers/util.js +130 -0
  470. package/files/templates/signage-sdk-templates/Information_Board/readme.txt +22 -0
  471. package/files/templates/signage-sdk-templates/Information_Board/res/images/tpl_06_img_main_01.png +0 -0
  472. package/files/templates/signage-sdk-templates/Information_Board/res/images/tpl_06_img_news.png +0 -0
  473. package/files/templates/signage-sdk-templates/Information_Board/res/images/tpl_06_logo_harvard.png +0 -0
  474. package/files/templates/signage-sdk-templates/Information_Kiosk/css/styles.css +387 -0
  475. package/files/templates/signage-sdk-templates/Information_Kiosk/data/data.json +185 -0
  476. package/files/templates/signage-sdk-templates/Information_Kiosk/fonts/Museo Sans 300 Italic.otf +0 -0
  477. package/files/templates/signage-sdk-templates/Information_Kiosk/fonts/Museo Sans 300.otf +0 -0
  478. package/files/templates/signage-sdk-templates/Information_Kiosk/fonts/Museo Sans 500 Italic.otf +0 -0
  479. package/files/templates/signage-sdk-templates/Information_Kiosk/fonts/Museo Sans 500.otf +0 -0
  480. package/files/templates/signage-sdk-templates/Information_Kiosk/fonts/Museo Sans 700 Italic.otf +0 -0
  481. package/files/templates/signage-sdk-templates/Information_Kiosk/fonts/Museo Sans 700.otf +0 -0
  482. package/files/templates/signage-sdk-templates/Information_Kiosk/index.html +320 -0
  483. package/files/templates/signage-sdk-templates/Information_Kiosk/js/controller.js +373 -0
  484. package/files/templates/signage-sdk-templates/Information_Kiosk/js/helpers/util.js +130 -0
  485. package/files/templates/signage-sdk-templates/Information_Kiosk/readme.txt +26 -0
  486. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_arrow_l_n.png +0 -0
  487. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_arrow_l_p.png +0 -0
  488. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_arrow_r_n.png +0 -0
  489. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_arrow_r_p.png +0 -0
  490. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_close_n.png +0 -0
  491. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_close_p.png +0 -0
  492. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_rotation_n.png +0 -0
  493. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_btn_rotation_p.png +0 -0
  494. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_bg_01.png +0 -0
  495. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_01.png +0 -0
  496. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_02.png +0 -0
  497. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_03.png +0 -0
  498. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_04.png +0 -0
  499. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_05.png +0 -0
  500. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_06.png +0 -0
  501. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_07.png +0 -0
  502. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_08.png +0 -0
  503. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_09.png +0 -0
  504. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_10.png +0 -0
  505. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_11.png +0 -0
  506. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_12.png +0 -0
  507. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_3_01.png +0 -0
  508. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_3_02.png +0 -0
  509. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_3_03.png +0 -0
  510. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_3_04.png +0 -0
  511. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_3_05.png +0 -0
  512. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_list_3_06.png +0 -0
  513. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_01.png +0 -0
  514. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_02.png +0 -0
  515. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_03.png +0 -0
  516. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_04.png +0 -0
  517. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_05.png +0 -0
  518. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_06.png +0 -0
  519. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_07.png +0 -0
  520. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_08.png +0 -0
  521. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_09.png +0 -0
  522. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_10.png +0 -0
  523. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_11.png +0 -0
  524. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_popup_list_12.png +0 -0
  525. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_style_01.png +0 -0
  526. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_img_style_02.png +0 -0
  527. package/files/templates/signage-sdk-templates/Information_Kiosk/res/images/tpl_10_logo.png +0 -0
  528. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/index.html +40 -0
  529. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova/2.7.0/cordova.webos.js +7038 -0
  530. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova/LICENSE +201 -0
  531. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/configuration.js +1 -0
  532. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/deviceInfo.js +1 -0
  533. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/inputSource.js +1 -0
  534. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/power.js +1 -0
  535. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/signage.js +1 -0
  536. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/sound.js +1 -0
  537. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/storage.js +23 -0
  538. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.2/video.js +1 -0
  539. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/configuration.js +1 -0
  540. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/deviceInfo.js +1 -0
  541. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/inputSource.js +1 -0
  542. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/power.js +1 -0
  543. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/signage.js +1 -0
  544. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/sound.js +1 -0
  545. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/storage.js +1 -0
  546. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.3/video.js +1 -0
  547. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/configuration.js +1 -0
  548. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/deviceInfo.js +1 -0
  549. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/inputSource.js +1 -0
  550. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/power.js +1 -0
  551. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/security.js +1 -0
  552. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/signage.js +1 -0
  553. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/sound.js +1 -0
  554. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/storage.js +1 -0
  555. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/time.js +1 -0
  556. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/utility.js +1 -0
  557. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.4.5/video.js +1 -0
  558. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/configuration.js +1 -0
  559. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/deviceInfo.js +1 -0
  560. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/inputSource.js +1 -0
  561. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/power.js +1 -0
  562. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/security.js +1 -0
  563. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/signage.js +1 -0
  564. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/sound.js +1 -0
  565. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/storage.js +1 -0
  566. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/time.js +1 -0
  567. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/utility.js +1 -0
  568. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.5.12/video.js +1 -0
  569. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/configuration.js +1 -0
  570. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/deviceInfo.js +1 -0
  571. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/inputSource.js +1 -0
  572. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/led.js +1 -0
  573. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/power.js +1 -0
  574. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/security.js +1 -0
  575. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/signage.js +1 -0
  576. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/sound.js +1 -0
  577. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/storage.js +1 -0
  578. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/time.js +1 -0
  579. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/utility.js +1 -0
  580. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.6.8/video.js +1 -0
  581. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/configuration.js +1 -0
  582. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/deviceInfo.js +1 -0
  583. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/inputSource.js +1 -0
  584. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/iot.js +1 -0
  585. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/led.js +1 -0
  586. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/power.js +1 -0
  587. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/security.js +1 -0
  588. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/signage.js +1 -0
  589. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/sound.js +1 -0
  590. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/storage.js +1 -0
  591. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/time.js +1 -0
  592. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/utility.js +1 -0
  593. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.7.6/video.js +1 -0
  594. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/configuration.js +1 -0
  595. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/deviceInfo.js +1 -0
  596. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/inputSource.js +1 -0
  597. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/iot.js +1 -0
  598. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/power.js +1 -0
  599. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/security.js +1 -0
  600. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/signage.js +1 -0
  601. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/sound.js +1 -0
  602. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/storage.js +1 -0
  603. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/time.js +1 -0
  604. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/utility.js +1 -0
  605. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/cordova-cd/1.8.1/video.js +1 -0
  606. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/custom1.4.js +14 -0
  607. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/idcap.js +21 -0
  608. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/initializer.js +234 -0
  609. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/remocon.js +73 -0
  610. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/scheduler.js +84 -0
  611. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/js/videoPlayer.js +352 -0
  612. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/remocon.png +0 -0
  613. package/files/templates/signage-sdk-templates/Local_Content_Scheduling/style.css +99 -0
  614. package/files/templates/signage-sdk-templates/Mart/css/styles.css +248 -0
  615. package/files/templates/signage-sdk-templates/Mart/data/data.json +37 -0
  616. package/files/templates/signage-sdk-templates/Mart/fonts/Museo Sans 300 Italic.otf +0 -0
  617. package/files/templates/signage-sdk-templates/Mart/fonts/Museo Sans 300.otf +0 -0
  618. package/files/templates/signage-sdk-templates/Mart/fonts/Museo Sans 500.otf +0 -0
  619. package/files/templates/signage-sdk-templates/Mart/fonts/Museo Sans 700.otf +0 -0
  620. package/files/templates/signage-sdk-templates/Mart/index.html +81 -0
  621. package/files/templates/signage-sdk-templates/Mart/js/controller.js +102 -0
  622. package/files/templates/signage-sdk-templates/Mart/js/helpers/util.js +130 -0
  623. package/files/templates/signage-sdk-templates/Mart/readme.txt +26 -0
  624. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img.png +0 -0
  625. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_bg.png +0 -0
  626. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_brand.png +0 -0
  627. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_list_01.png +0 -0
  628. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_list_02.png +0 -0
  629. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_list_03.png +0 -0
  630. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_list_04.png +0 -0
  631. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_img_tag.png +0 -0
  632. package/files/templates/signage-sdk-templates/Mart/res/images/tpl_09_logo.png +0 -0
  633. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/css/styles.css +40 -0
  634. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/data/data.json +6 -0
  635. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/index.html +28 -0
  636. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/js/controller.js +427 -0
  637. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/js/helpers/util.js +134 -0
  638. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/readme.txt +26 -0
  639. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/res/images/tpl_02_img_poster.jpg +0 -0
  640. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/res/videos/tpl_02_video_01.mp4 +0 -0
  641. package/files/templates/signage-sdk-templates/Multimedia_Advertisement/res/videos/tpl_02_video_02.mp4 +0 -0
  642. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/css/styles.css +163 -0
  643. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/data/data.json +92 -0
  644. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/fonts/MuseoSans300.otf +0 -0
  645. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/fonts/MuseoSans500.otf +0 -0
  646. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/fonts/MuseoSans700.otf +0 -0
  647. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/fonts/MuseoSans700Italic.otf +0 -0
  648. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/index.html +197 -0
  649. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/js/controller.js +158 -0
  650. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/js/helpers/util.js +130 -0
  651. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/readme.txt +26 -0
  652. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_bg_top.png +0 -0
  653. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_01.png +0 -0
  654. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_02.png +0 -0
  655. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_03.png +0 -0
  656. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_04.png +0 -0
  657. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_05.png +0 -0
  658. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_06.png +0 -0
  659. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_07.png +0 -0
  660. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_08.png +0 -0
  661. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_img_menu_09.png +0 -0
  662. package/files/templates/signage-sdk-templates/Price_Board_for_QSR/res/images/tpl_04_logo.png +0 -0
  663. package/files/templates/signage-sdk-templates/Simple_Network_FailOver/index.html +29 -0
  664. package/files/templates/signage-sdk-templates/Simple_Network_FailOver/js/idcap.js +21 -0
  665. package/files/templates/signage-sdk-templates/Simple_Network_FailOver/networkMonitor.js +136 -0
  666. package/files/templates/signage-sdk-templates/Simple_Network_FailOver/style.css +142 -0
  667. package/files/templates/signage-sdk-templates/Special_Menu_Board/css/styles.css +281 -0
  668. package/files/templates/signage-sdk-templates/Special_Menu_Board/data/data.json +33 -0
  669. package/files/templates/signage-sdk-templates/Special_Menu_Board/fonts/Museo Sans 300 Italic.otf +0 -0
  670. package/files/templates/signage-sdk-templates/Special_Menu_Board/fonts/Museo Sans 300.otf +0 -0
  671. package/files/templates/signage-sdk-templates/Special_Menu_Board/fonts/Museo Sans 500 Italic.otf +0 -0
  672. package/files/templates/signage-sdk-templates/Special_Menu_Board/fonts/Museo Sans 500.otf +0 -0
  673. package/files/templates/signage-sdk-templates/Special_Menu_Board/fonts/Museo Sans 700 Italic.otf +0 -0
  674. package/files/templates/signage-sdk-templates/Special_Menu_Board/fonts/Museo Sans 700.otf +0 -0
  675. package/files/templates/signage-sdk-templates/Special_Menu_Board/index.html +110 -0
  676. package/files/templates/signage-sdk-templates/Special_Menu_Board/js/controller.js +171 -0
  677. package/files/templates/signage-sdk-templates/Special_Menu_Board/js/helpers/util.js +130 -0
  678. package/files/templates/signage-sdk-templates/Special_Menu_Board/readme.txt +26 -0
  679. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_bg.png +0 -0
  680. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_coffe_01.png +0 -0
  681. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_coffe_01_l.png +0 -0
  682. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_coffe_02.png +0 -0
  683. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_coffe_03.png +0 -0
  684. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_coffe_04.png +0 -0
  685. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_img_coffe_05.png +0 -0
  686. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_logo_01.png +0 -0
  687. package/files/templates/signage-sdk-templates/Special_Menu_Board/res/images/tpl_03_logo_02.png +0 -0
  688. package/files/templates/signage-sdk-templates/Wayfinder/css/styles.css +634 -0
  689. package/files/templates/signage-sdk-templates/Wayfinder/data/data.json +339 -0
  690. package/files/templates/signage-sdk-templates/Wayfinder/fonts/MuseoSans300.otf +0 -0
  691. package/files/templates/signage-sdk-templates/Wayfinder/fonts/MuseoSans500.otf +0 -0
  692. package/files/templates/signage-sdk-templates/Wayfinder/fonts/MuseoSans700.otf +0 -0
  693. package/files/templates/signage-sdk-templates/Wayfinder/fonts/MuseoSans700Italic.otf +0 -0
  694. package/files/templates/signage-sdk-templates/Wayfinder/index.html +171 -0
  695. package/files/templates/signage-sdk-templates/Wayfinder/js/controller.js +447 -0
  696. package/files/templates/signage-sdk-templates/Wayfinder/js/helpers/util.js +175 -0
  697. package/files/templates/signage-sdk-templates/Wayfinder/readme.txt +26 -0
  698. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_btn_back_n.png +0 -0
  699. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_icon_dot_n.png +0 -0
  700. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_icon_dot_s.png +0 -0
  701. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_01.png +0 -0
  702. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_02.png +0 -0
  703. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_03.png +0 -0
  704. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_01_d.png +0 -0
  705. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_01_n.png +0 -0
  706. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_02_d.png +0 -0
  707. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_02_n.png +0 -0
  708. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_03_d.png +0 -0
  709. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_03_n.png +0 -0
  710. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_all_shadow.png +0 -0
  711. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_home_01_n.png +0 -0
  712. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_home_02_n.png +0 -0
  713. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_floormap_home_03_n.png +0 -0
  714. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_point.png +0 -0
  715. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_img_point_shadow.png +0 -0
  716. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_list_icon_elevator.png +0 -0
  717. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_list_icon_escalator.png +0 -0
  718. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_list_icon_exit.png +0 -0
  719. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_list_icon_info.png +0 -0
  720. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_list_icon_parking.png +0 -0
  721. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_list_icon_toilet.png +0 -0
  722. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_logo_lg.png +0 -0
  723. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_logo_shoppingmall_name.png +0 -0
  724. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_logo_store.png +0 -0
  725. package/files/templates/signage-sdk-templates/Wayfinder/res/images/tpl_11_popup_bg.png +0 -0
  726. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/css/styles.css +136 -0
  727. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/data/data.json +33 -0
  728. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/fonts/Museo Sans 300.otf +0 -0
  729. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/fonts/Museo Sans 500.otf +0 -0
  730. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/fonts/Museo Sans 700.otf +0 -0
  731. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/index.html +51 -0
  732. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/js/controller.js +265 -0
  733. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/js/helpers/util.js +130 -0
  734. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/readme.txt +26 -0
  735. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/ajax.gif +0 -0
  736. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_cloudy.png +0 -0
  737. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_partlycloudy.png +0 -0
  738. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_rainy.png +0 -0
  739. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_snowy.png +0 -0
  740. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_sunny.png +0 -0
  741. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_thunder.png +0 -0
  742. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_icon_windy.png +0 -0
  743. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_01.png +0 -0
  744. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_02.png +0 -0
  745. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_03.png +0 -0
  746. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_04.png +0 -0
  747. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_05.png +0 -0
  748. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_06.png +0 -0
  749. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_img_07.png +0 -0
  750. package/files/templates/signage-sdk-templates/Weather-dependent_Ad/res/images/tpl_08_logo.png +0 -0
  751. package/files/templates/signage-sdk-templates/Widget_Overlay/css/styles.css +312 -0
  752. package/files/templates/signage-sdk-templates/Widget_Overlay/data/data.json +16 -0
  753. package/files/templates/signage-sdk-templates/Widget_Overlay/data/newsWidget.json +21 -0
  754. package/files/templates/signage-sdk-templates/Widget_Overlay/data/shareWidget.json +112 -0
  755. package/files/templates/signage-sdk-templates/Widget_Overlay/data/weatherWidget.json +45 -0
  756. package/files/templates/signage-sdk-templates/Widget_Overlay/fonts/MuseoSans300.otf +0 -0
  757. package/files/templates/signage-sdk-templates/Widget_Overlay/fonts/MuseoSans500.otf +0 -0
  758. package/files/templates/signage-sdk-templates/Widget_Overlay/fonts/MuseoSans700.otf +0 -0
  759. package/files/templates/signage-sdk-templates/Widget_Overlay/index.html +62 -0
  760. package/files/templates/signage-sdk-templates/Widget_Overlay/js/controller.js +390 -0
  761. package/files/templates/signage-sdk-templates/Widget_Overlay/js/helpers/util.js +162 -0
  762. package/files/templates/signage-sdk-templates/Widget_Overlay/readme.txt +26 -0
  763. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/Namo.jpg +0 -0
  764. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/NotAvailable.png +0 -0
  765. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/clear.png +0 -0
  766. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/clouds.png +0 -0
  767. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/default.png +0 -0
  768. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/koreanFt.jpg +0 -0
  769. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/mist.png +0 -0
  770. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/rain.png +0 -0
  771. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/snow.png +0 -0
  772. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/thunder.png +0 -0
  773. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_icon_down_01.png +0 -0
  774. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_icon_down_02.png +0 -0
  775. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_icon_up_01.png +0 -0
  776. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_icon_up_02.png +0 -0
  777. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_img_news.png +0 -0
  778. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_img_news1.png +0 -0
  779. package/files/templates/signage-sdk-templates/Widget_Overlay/res/images/tpl_07_video_dim.png +0 -0
  780. package/files/templates/signage-sdk-templates/Widget_Overlay/res/videos/tpl_07_video.mp4 +0 -0
  781. package/files/templates/signage-sdk-templates/appinfo/appinfo.json +11 -0
  782. package/files/templates/signage-sdk-templates/idcap_api/1.1.0/js/idcap.js +21 -0
  783. package/files/templates/signage-sdk-templates/idcap_api/1.1.0/js/release_notes.txt +25 -0
  784. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova/2.7.0/cordova.webos.js +7025 -0
  785. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova/LICENSE +7025 -0
  786. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/configuration.js +1 -0
  787. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/deviceInfo.js +1 -0
  788. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/inputSource.js +1 -0
  789. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/power.js +1 -0
  790. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/signage.js +1 -0
  791. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/sound.js +1 -0
  792. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/storage.js +1 -0
  793. package/files/templates/signage-sdk-templates/scap_api/1.3/js/cordova-cd/1.3/video.js +1 -0
  794. package/files/templates/signage-sdk-templates/scap_api/1.3/js/release_notes.txt +109 -0
  795. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova/2.7.0/cordova.webos.js +7038 -0
  796. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova/LICENSE +201 -0
  797. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/configuration.js +1 -0
  798. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/deviceInfo.js +1 -0
  799. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/inputSource.js +1 -0
  800. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/power.js +1 -0
  801. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/security.js +1 -0
  802. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/signage.js +1 -0
  803. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/sound.js +1 -0
  804. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/storage.js +1 -0
  805. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/time.js +1 -0
  806. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/utility.js +1 -0
  807. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/cordova-cd/video.js +1 -0
  808. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/all.css +358 -0
  809. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-bold-webfont.eot +0 -0
  810. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-bold-webfont.svg +134 -0
  811. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-bold-webfont.ttf +0 -0
  812. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-bold-webfont.woff +0 -0
  813. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-regular-webfont.eot +0 -0
  814. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-regular-webfont.svg +134 -0
  815. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-regular-webfont.ttf +0 -0
  816. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/fonts/mplus-1m-regular-webfont.woff +0 -0
  817. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/handheld.css +217 -0
  818. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/css/screen.css +405 -0
  819. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/files.html +577 -0
  820. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/index.html +1203 -0
  821. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/intro.html +100 -0
  822. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/all.js +326 -0
  823. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/dessert.css +34 -0
  824. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-apollo.js +51 -0
  825. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-clj.js +64 -0
  826. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-css.js +78 -0
  827. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-go.js +58 -0
  828. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-hs.js +101 -0
  829. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-lisp.js +93 -0
  830. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-lua.js +59 -0
  831. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-ml.js +56 -0
  832. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-n.js +62 -0
  833. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-proto.js +35 -0
  834. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-scala.js +54 -0
  835. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-sql.js +57 -0
  836. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-tex.js +46 -0
  837. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-vb.js +61 -0
  838. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-vhdl.js +34 -0
  839. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-wiki.js +53 -0
  840. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-xq.js +67 -0
  841. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/lang-yaml.js +27 -0
  842. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/prettify.css +52 -0
  843. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/highlighter/prettify.js +1477 -0
  844. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/javascript/html5.js +6 -0
  845. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#clearCache.html +550 -0
  846. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getCurrentTime.html +560 -0
  847. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getLocaleList.html +560 -0
  848. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getOSDLanguage.html +560 -0
  849. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getOSDLock.html +560 -0
  850. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getPictureMode.html +560 -0
  851. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getPictureProperty.html +560 -0
  852. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getProperty.html +561 -0
  853. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getServerProperty.html +560 -0
  854. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getTimeZone.html +560 -0
  855. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getTimeZoneList.html +560 -0
  856. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getUSBLock.html +560 -0
  857. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#getVirtualKeyboardLanguage.html +560 -0
  858. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#restartApplication.html +550 -0
  859. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setCurrentTime.html +566 -0
  860. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setOSDLanguage.html +566 -0
  861. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setOSDLock.html +566 -0
  862. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setPictureMode.html +566 -0
  863. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setPictureProperty.html +566 -0
  864. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setProperty.html +561 -0
  865. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setServerProperty.html +610 -0
  866. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setTimeZone.html +566 -0
  867. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setUSBLock.html +566 -0
  868. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration#setVirtualKeyboardLanguage.html +566 -0
  869. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration.AppMode.html +685 -0
  870. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration.AppType.html +640 -0
  871. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Configuration.PictureMode.html +910 -0
  872. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#connectWifi.html +561 -0
  873. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getBeaconInfo.html +560 -0
  874. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getEddystoneInfo.html +560 -0
  875. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getNetworkInfo.html +560 -0
  876. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getNetworkMacInfo.html +560 -0
  877. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getPlatformInfo.html +560 -0
  878. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getProxyInfo.html +560 -0
  879. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getSoftApInfo.html +560 -0
  880. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getSystemUsageInfo.html +566 -0
  881. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getWifiList.html +560 -0
  882. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#getiBeaconInfo.html +560 -0
  883. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#setBeaconInfo.html +561 -0
  884. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#setEddystoneInfo.html +566 -0
  885. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#setNetworkInfo.html +561 -0
  886. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#setProxyInfo.html +566 -0
  887. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#setSoftApInfo.html +561 -0
  888. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#setiBeaconInfo.html +566 -0
  889. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#startWps.html +566 -0
  890. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo#stopWps.html +555 -0
  891. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/DeviceInfo.EddystoneFrame.html +640 -0
  892. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Error.ERROR_CODE.html +820 -0
  893. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Error.html +460 -0
  894. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/InputSource#changeInputSource.html +566 -0
  895. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/InputSource#getInputSourceStatus.html +560 -0
  896. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/InputSource#initialize.html +561 -0
  897. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#addOffTimer.html +566 -0
  898. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#addOnTimer.html +566 -0
  899. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#deleteOffTimer.html +566 -0
  900. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#deleteOnTimer.html +566 -0
  901. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#enableAllOffTimer.html +566 -0
  902. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#enableAllOnTimer.html +566 -0
  903. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#enableWakeOnLan.html +566 -0
  904. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#executePowerCommand.html +566 -0
  905. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#getDPMWakeup.html +560 -0
  906. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#getOffTimerList.html +560 -0
  907. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#getOnTimerList.html +560 -0
  908. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#getPMMode.html +560 -0
  909. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#getPowerOnDelay.html +560 -0
  910. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#getPowerStatus.html +560 -0
  911. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#setDPMWakeup.html +566 -0
  912. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#setDisplayMode.html +566 -0
  913. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#setPMMode.html +566 -0
  914. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power#setPowerOnDelay.html +566 -0
  915. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power.DPMSignalType.html +640 -0
  916. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power.DisplayMode.html +640 -0
  917. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power.PMMode.html +775 -0
  918. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power.PowerCommand.html +640 -0
  919. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Power.TimerWeek.html +910 -0
  920. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Security#existServerCertificate.html +561 -0
  921. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Security#registerServerCertificate.html +561 -2
  922. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Security#unregisterServerCertificate.html +561 -0
  923. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#captureScreen.html +561 -0
  924. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#enableCheckScreen.html +566 -0
  925. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getFailoverMode.html +555 -0
  926. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getIntelligentAuto.html +560 -0
  927. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getLanDaisyChain.html +560 -0
  928. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getPowerSaveMode.html +555 -0
  929. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getSignageInfo.html +555 -0
  930. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getStudioMode.html +560 -0
  931. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getSystemMonitoringInfo.html +555 -0
  932. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getTileInfo.html +555 -0
  933. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getUsageData.html +555 -0
  934. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#getUsagePermission.html +555 -0
  935. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#registerSystemMonitor.html +573 -0
  936. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setDigitalAudioInputMode.html +567 -0
  937. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setFailoverMode.html +567 -0
  938. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setIntelligentAuto.html +566 -0
  939. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setIsmMethod.html +567 -0
  940. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setLanDaisyChain.html +566 -0
  941. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setPortraitMode.html +567 -0
  942. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setPowerSaveMode.html +567 -0
  943. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setStudioMode.html +566 -0
  944. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setTileInfo.html +567 -0
  945. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#setUsagePermission.html +567 -0
  946. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage#unregisterSystemMonitor.html +555 -0
  947. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.AutomaticStandbyMode.html +640 -0
  948. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.DigitalAudioInput.html +640 -0
  949. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.DpmMode.html +910 -0
  950. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.EventType.html +775 -0
  951. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.FailoverMode.html +685 -0
  952. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.ImgResolution.html +640 -0
  953. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.IsmMethod.html +910 -0
  954. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.KeyOperationMode.html +685 -0
  955. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.MonitoringSource.html +775 -0
  956. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Signage.OsdPortraitMode.html +640 -0
  957. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#getSoundMode.html +560 -0
  958. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#getSoundOut.html +560 -0
  959. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#getSoundStatus.html +560 -0
  960. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#setExternalSpeaker.html +566 -0
  961. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#setMuted.html +566 -0
  962. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#setSoundMode.html +566 -0
  963. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#setSoundOut.html +566 -0
  964. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound#setVolumeLevel.html +566 -0
  965. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound.SoundMode.html +820 -0
  966. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Sound.SpeakerType.html +640 -0
  967. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#changeLogoImage.html +566 -0
  968. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#copyFile.html +561 -0
  969. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#downloadFirmware.html +566 -0
  970. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#exists.html +561 -0
  971. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#fsync.html +561 -0
  972. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#getFirmwareUpgradeStatus.html +560 -0
  973. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#getStorageInfo.html +555 -0
  974. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#listFiles.html +561 -0
  975. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#mkdir.html +561 -0
  976. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#moveFile.html +561 -0
  977. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#readFile.html +563 -0
  978. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#removeAll.html +561 -0
  979. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#removeApplication.html +566 -0
  980. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#removeFile.html +561 -0
  981. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#statFile.html +561 -0
  982. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#unzipFile.html +561 -0
  983. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#upgradeApplication.html +566 -0
  984. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#upgradeFirmware.html +560 -0
  985. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage#writeFile.html +561 -0
  986. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage.AppMode.html +640 -0
  987. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage.AppType.html +640 -0
  988. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Storage.SCAP_URI.html +512 -0
  989. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Time#addHolidaySchedule.html +566 -0
  990. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Time#delAllHolidaySchedules.html +566 -0
  991. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Time#delHolidaySchedule.html +566 -0
  992. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Time#getAllHolidaySchedules.html +560 -0
  993. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Time#getHolidayScheduleMode.html +560 -0
  994. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Time#setHolidayScheduleMode.html +566 -0
  995. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Utility#createToast.html +561 -0
  996. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Video#getContentRotation.html +560 -0
  997. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Video#getVideoStatus.html +560 -0
  998. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Video#setContentRotation.html +566 -0
  999. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Video#setRotatedVideoTransform.html +566 -0
  1000. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Video#setVideoSize.html +566 -0
  1001. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/Video#setVideoViewTransform.html +566 -0
  1002. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/_global_.html +453 -0
  1003. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/image/media_status.jpg +0 -0
  1004. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/image/setVideoSize.png +0 -0
  1005. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_configuration.js.html +2651 -0
  1006. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_deviceInfo.js.html +1860 -0
  1007. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_inputSource.js.html +1382 -0
  1008. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_power.js.html +2697 -0
  1009. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_security.js.html +357 -0
  1010. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_signage.js.html +3601 -0
  1011. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_sound.js.html +1123 -0
  1012. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_storage.js.html +2615 -0
  1013. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_time.js.html +720 -0
  1014. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_utility.js.html +196 -0
  1015. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/doc/symbols/src/js_video.js.html +1090 -0
  1016. package/files/templates/signage-sdk-templates/scap_api/1.4.1/js/release_notes.txt +148 -0
  1017. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova/2.7.0/cordova.webos.js +7038 -0
  1018. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova/LICENSE +201 -0
  1019. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/configuration.js +1 -0
  1020. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/deviceInfo.js +1 -0
  1021. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/inputSource.js +1 -0
  1022. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/power.js +1 -0
  1023. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/security.js +1 -0
  1024. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/signage.js +1 -0
  1025. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/sound.js +1 -0
  1026. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/storage.js +1 -0
  1027. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/time.js +1 -0
  1028. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/utility.js +1 -0
  1029. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/cordova-cd/video.js +1 -0
  1030. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/all.css +358 -0
  1031. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-bold-webfont.eot +0 -0
  1032. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-bold-webfont.svg +134 -0
  1033. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-bold-webfont.ttf +0 -0
  1034. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-bold-webfont.woff +0 -0
  1035. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-regular-webfont.eot +0 -0
  1036. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-regular-webfont.svg +134 -0
  1037. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-regular-webfont.ttf +0 -0
  1038. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/fonts/mplus-1m-regular-webfont.woff +0 -0
  1039. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/handheld.css +217 -0
  1040. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/css/screen.css +405 -0
  1041. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/files.html +599 -0
  1042. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/index.html +1280 -0
  1043. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/intro.html +100 -0
  1044. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/all.js +326 -0
  1045. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/dessert.css +34 -0
  1046. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-apollo.js +51 -0
  1047. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-clj.js +64 -0
  1048. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-css.js +78 -0
  1049. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-go.js +58 -0
  1050. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-hs.js +101 -0
  1051. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-lisp.js +93 -0
  1052. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-lua.js +59 -0
  1053. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-ml.js +56 -0
  1054. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-n.js +62 -0
  1055. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-proto.js +35 -0
  1056. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-scala.js +54 -0
  1057. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-sql.js +57 -0
  1058. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-tex.js +46 -0
  1059. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-vb.js +61 -0
  1060. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-vhdl.js +34 -0
  1061. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-wiki.js +53 -0
  1062. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-xq.js +67 -0
  1063. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/lang-yaml.js +27 -0
  1064. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/prettify.css +52 -0
  1065. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/highlighter/prettify.js +1477 -0
  1066. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/javascript/html5.js +6 -0
  1067. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#clearCache.html +572 -0
  1068. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getCurrentTime.html +582 -0
  1069. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getLocaleList.html +582 -0
  1070. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getOSDLanguage.html +582 -0
  1071. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getOSDLock.html +582 -0
  1072. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getPictureMode.html +582 -0
  1073. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getPictureProperty.html +582 -0
  1074. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getProperty.html +583 -0
  1075. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getServerProperty.html +582 -0
  1076. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getTimeZone.html +582 -0
  1077. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getTimeZoneList.html +582 -0
  1078. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getUSBLock.html +582 -0
  1079. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#getVirtualKeyboardLanguage.html +582 -0
  1080. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#restartApplication.html +572 -0
  1081. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setCurrentTime.html +588 -0
  1082. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setOSDLanguage.html +588 -0
  1083. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setOSDLock.html +588 -0
  1084. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setPictureMode.html +588 -0
  1085. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setPictureProperty.html +588 -0
  1086. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setProperty.html +583 -0
  1087. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setServerProperty.html +632 -0
  1088. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setTimeZone.html +588 -0
  1089. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setUSBLock.html +588 -0
  1090. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration#setVirtualKeyboardLanguage.html +588 -0
  1091. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration.AppMode.html +707 -0
  1092. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration.AppType.html +662 -0
  1093. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Configuration.PictureMode.html +932 -0
  1094. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#connectWifi.html +583 -0
  1095. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getBeaconInfo.html +582 -0
  1096. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getEddystoneInfo.html +582 -0
  1097. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getExternalInputList.html +588 -0
  1098. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getNetworkInfo.html +582 -0
  1099. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getNetworkMacInfo.html +582 -0
  1100. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getPlatformInfo.html +582 -0
  1101. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getProxyInfo.html +582 -0
  1102. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getSoftApInfo.html +582 -0
  1103. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getSystemUsageInfo.html +588 -0
  1104. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getWifiList.html +582 -0
  1105. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#getiBeaconInfo.html +582 -0
  1106. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#setBeaconInfo.html +583 -0
  1107. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#setEddystoneInfo.html +588 -0
  1108. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#setNetworkInfo.html +583 -0
  1109. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#setProxyInfo.html +588 -0
  1110. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#setSoftApInfo.html +583 -0
  1111. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#setiBeaconInfo.html +588 -0
  1112. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#startWps.html +588 -0
  1113. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo#stopWps.html +577 -0
  1114. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/DeviceInfo.EddystoneFrame.html +662 -0
  1115. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Error.ERROR_CODE.html +842 -0
  1116. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Error.html +482 -0
  1117. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/InputSource#changeInputSource.html +588 -0
  1118. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/InputSource#getInputSourceStatus.html +582 -0
  1119. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/InputSource#initialize.html +583 -0
  1120. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#addOffTimer.html +588 -0
  1121. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#addOnTimer.html +588 -0
  1122. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#deleteOffTimer.html +588 -0
  1123. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#deleteOnTimer.html +588 -0
  1124. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#enableAllOffTimer.html +588 -0
  1125. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#enableAllOnTimer.html +588 -0
  1126. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#enableWakeOnLan.html +588 -0
  1127. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#executePowerCommand.html +588 -0
  1128. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getDPMWakeup.html +582 -0
  1129. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getOffTimerList.html +582 -0
  1130. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getOnOffTimeSchedule.html +582 -0
  1131. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getOnTimerList.html +582 -0
  1132. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getPMMode.html +582 -0
  1133. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getPowerOnDelay.html +582 -0
  1134. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#getPowerStatus.html +582 -0
  1135. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#setDPMWakeup.html +588 -0
  1136. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#setDisplayMode.html +588 -0
  1137. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#setOnOffTimeSchedule.html +583 -0
  1138. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#setPMMode.html +588 -0
  1139. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#setPowerOnDelay.html +588 -0
  1140. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power#unsetOnOffTimeSchedule.html +582 -0
  1141. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power.DPMSignalType.html +662 -0
  1142. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power.DisplayMode.html +662 -0
  1143. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power.PMMode.html +797 -0
  1144. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power.PowerCommand.html +662 -0
  1145. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Power.TimerWeek.html +932 -0
  1146. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Security#existServerCertificate.html +583 -0
  1147. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Security#registerServerCertificate.html +583 -2
  1148. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Security#unregisterServerCertificate.html +583 -0
  1149. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#captureScreen.html +583 -0
  1150. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#enableCheckScreen.html +588 -0
  1151. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getFailoverMode.html +577 -0
  1152. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getIntelligentAuto.html +582 -0
  1153. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getLanDaisyChain.html +582 -0
  1154. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getPowerSaveMode.html +577 -0
  1155. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getSignageInfo.html +577 -0
  1156. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getStudioMode.html +582 -0
  1157. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getSystemMonitoringInfo.html +577 -0
  1158. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getTileInfo.html +577 -0
  1159. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getUsageData.html +577 -0
  1160. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#getUsagePermission.html +577 -0
  1161. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#registerRS232CEventListener.html +594 -0
  1162. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#registerSystemMonitor.html +595 -0
  1163. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setDigitalAudioInputMode.html +589 -0
  1164. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setFailoverMode.html +589 -0
  1165. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setIntelligentAuto.html +588 -0
  1166. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setIsmMethod.html +589 -0
  1167. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setLanDaisyChain.html +588 -0
  1168. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setPortraitMode.html +589 -0
  1169. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setPowerSaveMode.html +589 -0
  1170. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setStudioMode.html +588 -0
  1171. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setTileInfo.html +589 -0
  1172. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#setUsagePermission.html +589 -0
  1173. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#unregisterRS232CEventListener.html +582 -0
  1174. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage#unregisterSystemMonitor.html +577 -0
  1175. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.AutomaticStandbyMode.html +662 -0
  1176. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.DigitalAudioInput.html +662 -0
  1177. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.DpmMode.html +932 -0
  1178. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.EventType.html +797 -0
  1179. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.FailoverMode.html +707 -0
  1180. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.ImgResolution.html +662 -0
  1181. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.IsmMethod.html +932 -0
  1182. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.KeyOperationMode.html +707 -0
  1183. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.MonitoringSource.html +797 -0
  1184. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Signage.OsdPortraitMode.html +662 -0
  1185. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#getSoundMode.html +582 -0
  1186. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#getSoundOut.html +582 -0
  1187. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#getSoundStatus.html +582 -0
  1188. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#setExternalSpeaker.html +588 -0
  1189. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#setMuted.html +588 -0
  1190. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#setSoundMode.html +588 -0
  1191. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#setSoundOut.html +588 -0
  1192. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound#setVolumeLevel.html +588 -0
  1193. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound.SoundMode.html +842 -0
  1194. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Sound.SpeakerType.html +662 -0
  1195. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#changeLogoImage.html +588 -0
  1196. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#copyFile.html +583 -0
  1197. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#decryptFile.html +583 -0
  1198. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#downloadFirmware.html +588 -0
  1199. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#exists.html +583 -0
  1200. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#fsync.html +583 -0
  1201. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#getFirmwareUpgradeStatus.html +582 -0
  1202. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#getMD5Hash.html +583 -0
  1203. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#getStorageInfo.html +577 -0
  1204. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#listFiles.html +583 -0
  1205. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#mkdir.html +583 -0
  1206. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#moveFile.html +583 -0
  1207. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#readFile.html +585 -0
  1208. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#removeAll.html +583 -0
  1209. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#removeApplication.html +588 -0
  1210. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#removeFile.html +583 -0
  1211. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#statFile.html +583 -0
  1212. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#unzipFile.html +583 -0
  1213. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#upgradeApplication.html +588 -0
  1214. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#upgradeFirmware.html +582 -0
  1215. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage#writeFile.html +583 -0
  1216. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage.AppMode.html +662 -0
  1217. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage.AppType.html +662 -0
  1218. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Storage.SCAP_URI.html +534 -0
  1219. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#addHolidaySchedule.html +588 -0
  1220. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#delAllHolidaySchedules.html +588 -0
  1221. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#delHolidaySchedule.html +588 -0
  1222. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#getAllHolidaySchedules.html +582 -0
  1223. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#getHolidaySchedule.html +582 -0
  1224. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#getHolidayScheduleMode.html +582 -0
  1225. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#setHolidaySchedule.html +583 -0
  1226. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#setHolidayScheduleMode.html +588 -0
  1227. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Time#unsetHolidaySchedule.html +582 -0
  1228. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Utility#createToast.html +583 -0
  1229. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Video#getContentRotation.html +586 -0
  1230. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Video#getVideoStatus.html +582 -0
  1231. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Video#setContentRotation.html +592 -0
  1232. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Video#setRotatedVideoTransform.html +592 -0
  1233. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Video#setVideoSize.html +588 -0
  1234. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/Video#setVideoViewTransform.html +592 -0
  1235. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/_global_.html +475 -0
  1236. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/image/media_status.jpg +0 -0
  1237. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/image/setVideoSize.png +0 -0
  1238. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_configuration.js.html +2651 -0
  1239. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_deviceInfo.js.html +1930 -0
  1240. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_inputSource.js.html +1383 -0
  1241. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_power.js.html +2942 -0
  1242. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_security.js.html +352 -0
  1243. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_signage.js.html +3853 -0
  1244. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_sound.js.html +1123 -0
  1245. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_storage.js.html +2747 -0
  1246. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_time.js.html +976 -0
  1247. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_utility.js.html +196 -0
  1248. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/doc/symbols/src/js_video.js.html +754 -0
  1249. package/files/templates/signage-sdk-templates/scap_api/1.5.0/js/release_notes.txt +148 -0
  1250. package/files/templates/signage-sdk-templates/serviceinfo/package.json +11 -0
  1251. package/files/templates/signage-sdk-templates/serviceinfo/services.json +8 -0
  1252. package/files/templates/signage-sdk-templates/signageicon/icon.png +0 -0
  1253. package/files/templates/signage-sdk-templates/signageicon/largeIcon.png +0 -0
  1254. package/files/templates/signage-sdk-templates/webos-service/helloclient.js +23 -0
  1255. package/files/templates/signage-sdk-templates/webos-service/helloworld_webos_service.js +128 -0
  1256. package/lib/base/novacom.js +1214 -1202
  1257. package/lib/base/setup-device.js +25 -7
  1258. package/lib/com.sdk.ares.signage.hostedapp.ipk +0 -0
  1259. package/lib/install.js +465 -463
  1260. package/lib/launch.js +607 -605
  1261. package/lib/package.js +2307 -2149
  1262. package/npm-shrinkwrap.json +2 -2
  1263. package/package.json +1 -1
  1264. package/spec/jsSpecs/ares-launch.spec.js +303 -301
  1265. package/spec/jsSpecs/ares-package.spec.js +1277 -1211
  1266. package/spec/jsSpecs/ares-server.spec.js +160 -160
  1267. package/spec/jsSpecs/ares-setup-device.spec.js +300 -300
  1268. package/spec/jsSpecs/common-spec.js +177 -169
  1269. package/spec/tempFiles/com.lg.app.signage.dev_0.0.1_all.ipk +0 -0
  1270. package/webos-tools-cli-3.2.1.tgz +0 -0
  1271. package/webos-tools-cli-3.1.3.tgz +0 -0
package/lib/package.js CHANGED
@@ -1,2149 +1,2307 @@
1
- /*
2
- * Copyright (c) 2020-2024 LG Electronics Inc.
3
- *
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- const ar = require('ar-async'),
8
- async = require('async'),
9
- chardet = require('chardet'),
10
- CombinedStream = require('combined-stream'),
11
- crypto = require('crypto'),
12
- decompress = require('decompress'),
13
- decompressTargz = require('decompress-targz'),
14
- ElfParser = require('elfy').Parser,
15
- encoding = require('encoding'),
16
- fs = require('fs'),
17
- fstream = require('fstream'),
18
- Validator = require('jsonschema').Validator,
19
- mkdirp = require('mkdirp'),
20
- log = require('npmlog'),
21
- path = require('path'),
22
- rimraf = require('rimraf'),
23
- shelljs = require('shelljs'),
24
- stripbom = require('strip-bom'),
25
- temp = require('temp'),
26
- uglify = require('terser'),
27
- util = require('util'),
28
- // zlib = require('zlib'),
29
- // tarFilterPack = require('./tar-filter-pack'),
30
- errHndl = require('./base/error-handler'),
31
- tar = require('tar');
32
-
33
- (function() {
34
- log.heading = 'packager';
35
- log.level = 'warn';
36
-
37
- const servicePkgMethod = 'id',
38
- defaultAssetsFields = {
39
- "main": true,
40
- "icon": true,
41
- "largeIcon": true,
42
- "bgImage": true,
43
- "splashBackground": true,
44
- "imageForRecents": true,
45
- "sysAssetsBasePath": true
46
- },
47
- FILE_TYPE = {
48
- file: 'file',
49
- dir: 'dir',
50
- symlink: 'symlink'
51
- },
52
- packager = {};
53
- let objectCounter = 0;
54
-
55
- if (typeof module !== 'undefined' && module.exports) {
56
- module.exports = packager;
57
- }
58
-
59
- function Packager() {
60
- this.objectId = objectCounter++;
61
- this.verbose = false;
62
- this.silent = true;
63
- this.noclean = false;
64
- this.nativecmd = false;
65
- this.minify = true;
66
- this.excludeFiles = [];
67
- this.rom = false;
68
- this.encrypt = false;
69
- this.sign = "";
70
- this.certificate = "";
71
- this.appCount = 0;
72
- this.services = [];
73
- this.pkgServiceNames = [];
74
- this.rscCount = 0;
75
- this.resources = [];
76
- this.pkgResourceNames = [];
77
- this.pkgId;
78
- this.pkginfofile;
79
- }
80
-
81
- packager.Packager = Packager;
82
-
83
- Packager.prototype = {
84
- prepareOptions: function(options, next) {
85
- if (options && options.level) {
86
- log.level = options.level;
87
- if (['warn', 'error'].indexOf(options.level) !== -1) {
88
- this.silent = false;
89
- }
90
- }
91
-
92
- if (options && options.noclean === true) {
93
- this.noclean = true;
94
- }
95
-
96
- if (options && options.nativecmd === true) {
97
- this.nativecmd = true;
98
- }
99
-
100
- if (options && Object.prototype.hasOwnProperty.call(options, 'minify')) {
101
- this.minify = options.minify;
102
- }
103
-
104
- if (options && Object.prototype.hasOwnProperty.call(options, 'excludefiles')) {
105
- if (options.excludefiles instanceof Array) {
106
- this.excludeFiles = options.excludefiles;
107
- } else {
108
- this.excludeFiles.push(options.excludefiles);
109
- }
110
-
111
- this.excludeFiles.forEach(function(excl_file) {
112
- if (excl_file === "appinfo.json") {
113
- return next(errHndl.getErrMsg("NOT_EXCLUDE_APPINFO"));
114
- }
115
- });
116
- }
117
-
118
- if (options && Object.prototype.hasOwnProperty.call(options, 'rom')) {
119
- this.rom = options.rom;
120
- }
121
-
122
- if (options && Object.prototype.hasOwnProperty.call(options, 'encrypt')) {
123
- this.encrypt = options.encrypt;
124
- }
125
-
126
- if (options && Object.prototype.hasOwnProperty.call(options, 'sign')) {
127
- if (!fs.existsSync(path.resolve(options.sign))) {
128
- return next(errHndl.getErrMsg("NOT_EXIST_PATH", options.sign));
129
- }
130
- this.sign = options.sign;
131
- }
132
-
133
- if (options && Object.prototype.hasOwnProperty.call(options, 'certificate')) {
134
- if (!fs.existsSync(path.resolve(options.certificate))) {
135
- return next(errHndl.getErrMsg("NOT_EXIST_PATH", options.certificate));
136
- }
137
- this.certificate = options.certificate;
138
- }
139
-
140
- // check sign option must be used with certificate option
141
- if ((this.sign && !this.certificate) ||
142
- (this.certificate && !this.sign)) {
143
- return next(errHndl.getErrMsg("USE_WITH_OPTIONS", "sign, certificate"));
144
- }
145
-
146
- log.verbose("package#Packager()", "Packager id:" + this.objectId);
147
-
148
- this.pkgVersion = options.pkgversion;
149
-
150
- if (options && Object.prototype.hasOwnProperty.call(options, 'pkgid')) {
151
- this.pkgId = options.pkgid;
152
- }
153
-
154
- if (options && Object.prototype.hasOwnProperty.call(options, 'pkginfofile')) {
155
- this.pkginfofile = options.pkginfofile;
156
- }
157
-
158
- if (this.pkgId && this.pkginfofile) {
159
- return next(errHndl.getErrMsg("NOT_USE_WITH_OPTIONS", "pkginfofile, pkgid"));
160
- }
161
- this.appCount = 0;
162
- },
163
- checkInputDirectories: function(inDirs, options, next) {
164
- log.verbose("package#Packager#checkInputDirectories()", "input directory:", inDirs);
165
- this.prepareOptions(options, next);
166
-
167
- async.forEachSeries(inDirs, checkDirectory.bind(this, options), function(err) {
168
- if (err) {
169
- setImmediate(next, err);
170
- return;
171
- }
172
- setImmediate(next);
173
- });
174
- return {app: this.appCount, resource: this.rscCount};
175
- },
176
- servicePackaging: function(inDirs, destination, options, middleCb, next) {
177
- log.info("package#Packager#servicePackaging()");
178
-
179
- if (!Object.hasOwnProperty.call(options, 'pkgid') && !Object.hasOwnProperty.call(options, 'pkginfofile')) {
180
- return next(errHndl.getErrMsg("USE_PKGID_PKGINFO"));
181
- }
182
-
183
- async.series([
184
- this.checkInputDirectories.bind(this, inDirs, options),
185
- setUmask.bind(this, 0),
186
- loadPkgInfo.bind(this),
187
- createTmpDir.bind(this),
188
- excludeIpkFileFromApp.bind(this),
189
- createPackageDir.bind(this),
190
- fillPackageDir.bind(this),
191
- findServiceDir.bind(this, this.services),
192
- loadServiceInfo.bind(this),
193
- checkServiceInfo.bind(this),
194
- createServiceDir.bind(this),
195
- copyService.bind(this),
196
- addServiceInPkgInfo.bind(this),
197
- copyData.bind(this, inDirs, options.force),
198
- loadPackageProperties.bind(this, inDirs),
199
- excludeFromApp.bind(this, middleCb),
200
- outputPackage.bind(this, destination),
201
- encryptPackage.bind(this),
202
- copyOutputToDst.bind(this, destination, middleCb),
203
- recoverUmask.bind(this),
204
- cleanupTmpDir.bind(this, middleCb)
205
- ], function(err) {
206
- if (err) {
207
- // TODO: call cleanupTmpDir() before returning
208
- setImmediate(next, err);
209
- return;
210
- }
211
- // TODO: probably some more checkings are needed
212
- setImmediate(next, null, {ipk: this.ipk, msg: "Success"});
213
- }.bind(this));
214
- },
215
- resourcePackaging: function(inDirs, destination, options, middleCb, next) {
216
- log.info("package#Packager#resourcePackaging()");
217
- this.dataCopyCount = 0;
218
- async.series([
219
- this.checkInputDirectories.bind(this, inDirs, options),
220
- setUmask.bind(this, 0),
221
- loadPkgInfo.bind(this),
222
- createTmpDir.bind(this),
223
- excludeIpkFileFromApp.bind(this),
224
- createPackageDir.bind(this),
225
- fillPackageDir.bind(this),
226
- loadResourceInfo.bind(this),
227
- checkResourceInfo.bind(this),
228
- createResourceDir.bind(this),
229
- copyResource.bind(this),
230
- addResourceInPkgInfo.bind(this),
231
- copyData.bind(this, inDirs, options.force),
232
- loadPackageProperties.bind(this, inDirs),
233
- excludeFromApp.bind(this, middleCb),
234
- outputPackage.bind(this, destination),
235
- encryptPackage.bind(this),
236
- copyOutputToDst.bind(this, destination, middleCb),
237
- recoverUmask.bind(this),
238
- cleanupTmpDir.bind(this, middleCb)
239
- ], function(err) {
240
- if (err) {
241
- setImmediate(next, err);
242
- return;
243
- }
244
- setImmediate(next, null, {ipk: this.ipk, msg: "Success"});
245
- }.bind(this));
246
- },
247
- generatePackage: function(inDirs, destination, options, middleCb, next) {
248
- log.info("package#Packager#generatePackage()", "from ", inDirs);
249
- // check whether app or service directories are copied or not
250
- this.dataCopyCount = 0;
251
- this.minifyDone = !this.minify;
252
-
253
- async.series([
254
- this.checkInputDirectories.bind(this, inDirs, options),
255
- setUmask.bind(this, 0),
256
- loadPkgInfo.bind(this),
257
- loadAppInfo.bind(this),
258
- checkAppInfo.bind(this),
259
- createTmpDir.bind(this),
260
- createAppDir.bind(this),
261
- checkELFHeader.bind(this),
262
- fillAssetsField.bind(this),
263
- copyAssets.bind(this),
264
- copyApp.bind(this),
265
- excludeIpkFileFromApp.bind(this),
266
- createPackageDir.bind(this),
267
- fillPackageDir.bind(this),
268
- findServiceDir.bind(this, this.services),
269
- loadServiceInfo.bind(this),
270
- checkServiceInfo.bind(this),
271
- createServiceDir.bind(this),
272
- copyService.bind(this),
273
- addServiceInPkgInfo.bind(this),
274
- removeServiceFromAppDir.bind(this, middleCb),
275
- copyData.bind(this, inDirs, options.force),
276
- loadPackageProperties.bind(this, inDirs),
277
- excludeFromApp.bind(this, middleCb),
278
- outputPackage.bind(this, destination),
279
- encryptPackage.bind(this),
280
- copyOutputToDst.bind(this, destination, middleCb),
281
- recoverUmask.bind(this),
282
- cleanupTmpDir.bind(this, middleCb)
283
- ], function(err) {
284
- if (err) {
285
- // TODO: call cleanupTmpDir() before returning
286
- setImmediate(next, err);
287
- return;
288
- }
289
- // TODO: probably some more checkings are needed
290
- setImmediate(next, null, {ipk: this.ipk, msg: "Success"});
291
- }.bind(this));
292
- },
293
- analyzeIPK: function(options, next) {
294
- log.info("package#Packager#analyzeIPK()");
295
- let ipkConfigFile, ipkFile, ipkConfig, tmpDirPath;
296
- this.prepareOptions(options);
297
-
298
- async.series([
299
- _setConfig,
300
- _unpackIpk,
301
- _unpackTar,
302
- _analyzeMetaFile,
303
- _removeTmpDir,
304
- ], function(err, results) {
305
- log.silly("package#analyzeIPK()", "err:", err, ", results:", results);
306
- if (err) {
307
- return next(err);
308
- }
309
- return next(null, {msg: results[3].trim()});
310
- });
311
-
312
- function _setConfig(next) {
313
- log.info("package#analyzeIPK()#_setConfig()");
314
- if (options.info === 'true') {
315
- return next(errHndl.getErrMsg("EMPTY_VALUE", 'info'));
316
- } else if (options.infodetail === 'true') {
317
- return next(errHndl.getErrMsg("EMPTY_VALUE", 'info-detail'));
318
- }
319
- ipkFile = options.info ? options.info : options.infodetail;
320
- ipkConfigFile = path.resolve(__dirname, "../files/conf/ipk.json");
321
-
322
- if (path.extname(ipkFile) !== ".ipk") {
323
- return next(errHndl.getErrMsg("SUPPORT_ONLY_IPK", ipkFile));
324
- }
325
- if (!fs.existsSync(ipkFile)) {
326
- return next(errHndl.getErrMsg("NOT_EXIST_PATH", ipkFile));
327
- }
328
- if (!fs.existsSync(ipkConfigFile)) {
329
- return next(errHndl.getErrMsg("NOT_EXIST_PATH", ipkConfigFile));
330
- }
331
- ipkConfig = JSON.parse(fs.readFileSync(ipkConfigFile));
332
- tmpDirPath = temp.path(ipkConfig.tmpPath);
333
-
334
- if (!fs.existsSync(tmpDirPath)) {
335
- fs.mkdirSync(tmpDirPath);
336
- }
337
- next();
338
- }
339
-
340
- function _unpackIpk(next) {
341
- log.info("package#analyzeIPK()#_unpackIpk()");
342
- const reader = new ar.ArReader(ipkFile);
343
-
344
- reader.on("entry", function(entry, next) {
345
- const name = entry.fileName();
346
- entry.fileData()
347
- .pipe(fs.createWriteStream(path.resolve(tmpDirPath, name)))
348
- .on("finish", next);
349
- });
350
- reader.on("error", function(err) {
351
- return next(err);
352
- });
353
- reader.on("close", function() {
354
- log.verbose("package#analyzeIPK()#_unpackIpk()", "unpack ipk close");
355
- next();
356
- });
357
- }
358
-
359
- function _unpackTar(next) {
360
- log.info("package#analyzeIPK()#_unpackTar()");
361
- if (fs.existsSync(path.resolve(tmpDirPath, "control.tar.gz"))) {
362
- (async function() {
363
- await decompress(path.resolve(tmpDirPath, "control.tar.gz"), tmpDirPath, {
364
- plugins: [
365
- decompressTargz()
366
- ]
367
- });
368
- log.verbose("package#analyzeIPK()#_unpackTar()", "control.tar.gz decompressed");
369
- })();
370
- } else if (fs.existsSync(path.resolve(tmpDirPath, "control.tar.xz"))) {
371
- return next(errHndl.getErrMsg("NOT_SUPPORT_XZ"));
372
- } else {
373
- return next(errHndl.getErrMsg("NO_COMPONENT_FILE", ", control tar file"));
374
- }
375
-
376
- if (fs.existsSync(path.resolve(tmpDirPath, "data.tar.gz"))) {
377
- (async function() {
378
- await decompress(path.resolve(tmpDirPath, "data.tar.gz"), tmpDirPath, {
379
- plugins: [
380
- decompressTargz()
381
- ]
382
- });
383
- log.verbose("package#analyzeIPK()#_unpackTar()", "data.tar.gz decompressed");
384
- next();
385
- })();
386
- } else if (fs.existsSync(path.resolve(tmpDirPath, "data.tar.xz"))) {
387
- return next(errHndl.getErrMsg("NOT_SUPPORT_XZ"));
388
- } else {
389
- return next(errHndl.getErrMsg("NO_COMPONENT_FILE", "data tar file"));
390
- }
391
- }
392
-
393
- function _analyzeMetaFile(next) {
394
- log.info("package#analyzeIPK()#_analyzeMetaFile()");
395
- let result = "", targetFile, tmpTxt;
396
-
397
- ipkConfig.webOSMetaFiles.forEach(function(item) {
398
- const targetPath = path.resolve(tmpDirPath, ipkConfig[item].path);
399
- // Analyze control file
400
- if (item === "control") {
401
- targetFile = path.resolve(targetPath, ipkConfig[item].fileName);
402
- if (!fs.existsSync(targetFile)) {
403
- return next(errHndl.getErrMsg("NO_COMPONENT_FILE", "control file"));
404
- }
405
-
406
- if (options.infodetail) {
407
- result = "\n\n< " + ipkConfig[item].fileName + " >\n";
408
- result += fs.readFileSync(targetFile).toString().trim();
409
- } else {
410
- result = ipkConfig[item].heading + "\n";
411
- tmpTxt = fs.readFileSync(targetFile).toString().trim();
412
- ipkConfig[item].info.forEach(function(field) {
413
- if (tmpTxt.match(new RegExp(field + ": (.*)", "gi"))) {
414
- result += tmpTxt.match(new RegExp(field + ": (.*)", "gi"))[0] + "\n";
415
- }
416
- });
417
- }
418
- // Analyze appinfo.json, packageinfo.json, services.json, package.json files
419
- } else if (fs.existsSync(targetPath)) {
420
- const dirArr = fs.readdirSync(targetPath);
421
- let beforeDir = dirArr[0];
422
-
423
- dirArr.forEach(function(dir) {
424
- if (ipkConfig[item].fileName) {
425
- ipkConfig[item].fileName.forEach(function(file) {
426
- targetFile = path.resolve(targetPath, dir, file);
427
- if (fs.existsSync(targetFile)) {
428
- if (options.infodetail) {
429
- result += "\n\n< " + file + " >\n";
430
- result += fs.readFileSync(targetFile).toString().trim();
431
- } else {
432
- if (ipkConfig[item].heading && beforeDir !== path.join(ipkConfig[item].path, dir)) {
433
- result += "\n" + ipkConfig[item].heading + "\n";
434
- }
435
- tmpTxt = fs.readFileSync(targetFile).toString().trim();
436
- const tmpJson = JSON.parse(tmpTxt);
437
- ipkConfig[item].info.forEach(function(field) {
438
- if (tmpJson[field]) {
439
- const fieldValue = tmpJson[field];
440
- if (typeof fieldValue === "object") {
441
- if (ipkConfig[item][field]) { // Case of services.json, services_name field
442
- const subField = ipkConfig[item][field],
443
- subResult = [];
444
- fieldValue.forEach(function(subItem) {
445
- subResult.push(subItem[subField]);
446
- });
447
- result += field + ": " + JSON.stringify(subResult) + "\n";
448
- } else { // Case of packageinfo.json, services field
449
- result += field + ": " + JSON.stringify(fieldValue) + "\n";
450
- }
451
- } else {
452
- result += field + ": " + fieldValue + "\n";
453
- }
454
- }
455
- });
456
- beforeDir = path.join(ipkConfig[item].path, dir);
457
- }
458
- }
459
- });
460
- }
461
- });
462
- }
463
- });
464
- next(null, result);
465
- }
466
-
467
- function _removeTmpDir(next) {
468
- log.info("package#analyzeIPK()#_removeTmpDir()");
469
- rimraf(tmpDirPath, function(err) {
470
- log.verbose("package#analyzeIPK()#_removeTmpDir()", "removed " + tmpDirPath);
471
- next(err);
472
- });
473
- }
474
- }
475
- };
476
-
477
- function Service() {
478
- this.srcDir = "";
479
- this.dstDirs = [];
480
- this.valid = false;
481
- this.serviceInfo = "";
482
- this.dirName = "";
483
- }
484
-
485
- // Private functions
486
- function loadPkgInfo(next) {
487
- log.verbose("loadPkgInfo");
488
- let data;
489
-
490
- if (this.pkginfofile) {
491
- log.silly("Use pkginfofile option");
492
- if (fs.existsSync(this.pkginfofile)) {
493
- if ("packageinfo.json" !== path.basename(this.pkginfofile)) {
494
- return setImmediate(next, errHndl.getErrMsg("INVALID_FILE", "packageinfo.json"));
495
- }
496
- data = rewriteFileWoBOMAsUtf8(this.pkginfofile, true);
497
- try {
498
- log.verbose("PKGINFO >>" + data + "<<");
499
- this.pkginfo = JSON.parse(data);
500
-
501
- if (!Object.prototype.hasOwnProperty.call(this.pkginfo, 'id')) {
502
- return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
503
- }
504
-
505
- this.pkgId = this.pkginfo.id;
506
- this.pkgVersion = this.pkgVersion || this.pkginfo.version;
507
- setImmediate(next);
508
- }
509
- catch (err) {
510
- return setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", "packageinfo.json"));
511
- }
512
- } else {
513
- return setImmediate(next, errHndl.getErrMsg("NOT_EXIST_PATH", this.pkginfofile));
514
- }
515
- } else if (this.pkgDir) {
516
- log.silly("Use packageinfo.json from PKG_DIR");
517
- data = rewriteFileWoBOMAsUtf8(path.join(this.pkgDir, "packageinfo.json"));
518
- try {
519
- log.verbose("PKGINFO >>" + data + "<<");
520
- this.pkginfo = JSON.parse(data);
521
-
522
- if (!Object.prototype.hasOwnProperty.call(this.pkginfo, 'id')) {
523
- return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
524
- }
525
- this.pkgId = this.pkginfo.id;
526
- this.pkgVersion = this.pkgVersion || this.pkginfo.version;
527
- setImmediate(next);
528
- }
529
- catch (err) {
530
- return setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", "packageinfo.json"));
531
- }
532
- } else {
533
- return setImmediate(next);
534
- }
535
- }
536
-
537
- function loadAppInfo(next) {
538
- log.verbose("loadAppInfo");
539
- if (this.appCount === 0) {
540
- return setImmediate(next);
541
- }
542
-
543
- const filepath = path.join(this.appDir, "appinfo.json"),
544
- data = rewriteFileWoBOMAsUtf8(filepath, true);
545
- try {
546
- this.appinfo = JSON.parse(data);
547
- log.silly("package#loadAppInfo()", "content of appinfo.json:", this.appinfo);
548
-
549
- if (!this.appinfo.version || this.appinfo.version === undefined) {
550
- this.appinfo.version = "1.0.0";
551
- }
552
-
553
- this.pkgVersion = this.pkgVersion || this.appinfo.version;
554
- setImmediate(next);
555
- } catch(err) {
556
- setImmediate(next, err);
557
- }
558
- }
559
-
560
- function checkAppInfo(next) {
561
- if (this.appCount === 0) {
562
- return setImmediate(next);
563
- }
564
-
565
- // check enyo app
566
- if (this.pkgJSExist && this.appinfo.main && this.appinfo.main.match(/(\.html|\.htm)$/gi)) {
567
- const mainFile = path.join(this.appDir, this.appinfo.main);
568
- if (!fs.existsSync(mainFile)) {
569
- return setImmediate(next, errHndl.getErrMsg("NOT_EXIST_PATH", this.appinfo.main));
570
- }
571
-
572
- const regex = new RegExp("(<script[^>]*src[ \t]*=[ \t]*['\"])[^'\"]*/enyo.js(['\"])"),
573
- data = fs.readFileSync(mainFile);
574
- if (data.toString().match(regex)) {
575
- // If enyo app, stop packaging.
576
- return setImmediate(next, errHndl.getErrMsg("NOT_SUPPORT_ENYO"));
577
- }
578
- }
579
-
580
- if (!this.appinfo.id || this.appinfo.id === undefined) {
581
- return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
582
- }
583
- if (this.appinfo.id.length < 1 || !(/^[a-z0-9.+-]*$/.test(this.appinfo.id))) {
584
- log.error(errHndl.getErrMsg("INVALID_VALUE", "id", this.appinfo.id));
585
- return setImmediate(next, errHndl.getErrMsg("INVALID_ID_RULE"));
586
- }
587
- if (this.pkgId && this.appinfo.id.indexOf(this.pkgId) !== 0) {
588
- log.error(errHndl.getErrMsg("INVALID_VALUE", "id", this.appinfo.id));
589
- return setImmediate(next, errHndl.getErrMsg("INVALID_APPID", this.pkgId));
590
- }
591
- if (!this.appinfo.version || this.appinfo.version === undefined) {
592
- return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "version"));
593
- }
594
- if (this.appinfo.version.length < 1 || !(/^([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)$/.test(this.appinfo.version))) {
595
- log.error(errHndl.getErrMsg("INVALID_VALUE", "version", this.appinfo.version));
596
- return setImmediate(next, errHndl.getErrMsg("INVALID_VERSION_RULE"));
597
- }
598
- if (this.appinfo.type && this.appinfo.type.match(/clock/gi)) {
599
- return setImmediate(next);
600
- }
601
-
602
- const schemaFile = path.resolve(__dirname, "../files/schema/ApplicationDescription.schema");
603
- async.waterfall([
604
- fs.readFile.bind(this, schemaFile, "utf-8"),
605
- function getSchema(data, next) {
606
- try {
607
- const schema = JSON.parse(data);
608
- /* "required" keyword is redefined in draft 4.
609
- But current jsonschema lib support only draft 3.
610
- So this line changes "required" attribute according to the draft 3.
611
- */
612
- const reqKeys = schema.required;
613
- if (reqKeys) {
614
- for (const key in schema.properties) {
615
- if (reqKeys.indexOf(key) !== -1) {
616
- schema.properties[key].required = true;
617
- }
618
- }
619
- }
620
- next(null, schema);
621
- } catch(err) {
622
- next(errHndl.getErrMsg("INVALID_JSON_FORMAT", "AppDescription schema"));
623
- }
624
- },
625
- function checkValid(schema, next) {
626
- try {
627
- next(null, new Validator().validate(this.appinfo, schema));
628
- } catch (err) {
629
- log.error(err);
630
- next(errHndl.getErrMsg("INVALID_JSON_FORMAT"));
631
- }
632
- }.bind(this)
633
- ], function(err, result) {
634
- if (err) {
635
- setImmediate(next, err);
636
- } else {
637
- if (result && result.errors.length > 0) {
638
- const errFile = "appinfo.json";
639
- let errMsg = "";
640
- for (const idx in result.errors) {
641
- let errMsgLine = result.errors[idx].property + " " + result.errors[idx].message;
642
- if (errMsgLine.indexOf("instance.") > -1) {
643
- errMsgLine = errMsgLine.substring("instance.".length);
644
- errMsg = errMsg.concat("\n");
645
- errMsg = errMsg.concat(errMsgLine);
646
- }
647
- }
648
- errMsg = errHndl.getErrMsg("INVALID_FILE", errFile, errMsg);
649
- return setImmediate(next, errMsg);
650
- } else {
651
- log.verbose("package#checkAppInfo()", "APPINFO is valid");
652
- }
653
- setImmediate(next);
654
- }
655
- });
656
- }
657
-
658
- function fillAssetsField(next) {
659
- if (this.appCount === 0) {
660
- return setImmediate(next);
661
- }
662
- // make appinfo.assets to have default values so that they can be copied into the package
663
- this.appinfo.assets = this.appinfo.assets || [];
664
- for (const i in this.appinfo) {
665
- if (Object.prototype.hasOwnProperty.call(this.appinfo, i) && defaultAssetsFields[i]) {
666
- // no duplicated adding & value should not null string & file/dir should exist
667
- if ((this.appinfo.assets.indexOf(this.appinfo[i]) === -1) && this.appinfo[i]) {
668
- this.appinfo.assets.push(this.appinfo[i]);
669
- }
670
- }
671
- }
672
-
673
- // refer to appinfo.json files in localization directory.
674
- const appInfoPath = this.originAppDir,
675
- checkDir = path.join(this.originAppDir, "resources"),
676
- foundFilePath = [],
677
- resourcesAssets = [];
678
-
679
- try {
680
- const stat = fs.lstatSync(checkDir);
681
- if (!stat.isDirectory()) {
682
- return setImmediate(next, null);
683
- }
684
- } catch(err) {
685
- if (err.code === "ENOENT") {
686
- return setImmediate(next, null);
687
- }
688
- }
689
-
690
- async.series([
691
- walkFolder.bind(null, checkDir, "appinfo.json", foundFilePath, 1),
692
- function(next) {
693
- async.forEach(foundFilePath, function(filePath, next) {
694
- rewriteFileWoBOMAsUtf8(filePath, true, function(err, data) {
695
- try {
696
- const appInfo = JSON.parse(data),
697
- dirPath = path.dirname(filePath);
698
- for (const i in appInfo) {
699
- if (Object.prototype.hasOwnProperty.call(appInfo, i) && defaultAssetsFields[i]) {
700
- if (appInfo[i]) {
701
- const itemPath = path.join(dirPath, appInfo[i]),
702
- relPath = path.relative(appInfoPath, itemPath);
703
- // no duplicated adding & value should not null string & file/dir should exist
704
- if ((resourcesAssets.indexOf(relPath) === -1)) {
705
- resourcesAssets.push(relPath);
706
- }
707
- }
708
- }
709
- }
710
- setImmediate(next, null);
711
- } catch(error) {
712
- setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", filePath));
713
- }
714
- });
715
- }, function(err) {
716
- setImmediate(next, err);
717
- });
718
- },
719
- function(next) {
720
- this.appinfo.assets = this.appinfo.assets.concat(resourcesAssets);
721
- setImmediate(next, null);
722
- }.bind(this)
723
- ], function(err) {
724
- setImmediate(next, err);
725
- });
726
- }
727
-
728
- function createTmpDir(next) {
729
- this.tempDir = temp.path({prefix: 'com.palm.ares.hermes.bdOpenwebOS'}) + '.d';
730
- log.verbose("package#createTmpDir()", "temp dir:", this.tempDir);
731
- mkdirp(this.tempDir, next);
732
- }
733
-
734
- function createAppDir(next) {
735
- if (this.appCount === 0) {
736
- return setImmediate(next);
737
- }
738
-
739
- try {
740
- this.applicationDir = path.resolve(this.tempDir, "data/usr/palm/applications", this.appinfo.id);
741
- log.info("package#createAppDir()", "application dir:" + this.applicationDir);
742
- mkdirp(this.applicationDir, next);
743
- } catch (err) {
744
- return setImmediate(next, err);
745
- }
746
- }
747
-
748
- function copySrcToDst(src, dst, next) {
749
- const fileList = [],
750
- self = this,
751
- requireMinify = !!((!!self.minify && !self.minifyDone));
752
- src = path.normalize(path.resolve(src));
753
- dst = path.normalize(path.resolve(dst));
754
-
755
- async.series([
756
- function(next) {
757
- const stat = fs.statSync(src);
758
- if (stat.isFile()) {
759
- _pushList(fileList, 'file', path.dirname(src), path.basename(src), true, null);
760
- setImmediate(next);
761
- } else {
762
- _getFileList(src, src, fileList, next);
763
- }
764
- },
765
- _copySrcToDst.bind(null, fileList, dst, requireMinify)
766
- ], function(err) {
767
- next(err);
768
- });
769
-
770
- function _pushList(list, type, basePath, relPath, isSubPath, indRelPath) {
771
- if (!FILE_TYPE[type]) {
772
- return;
773
- }
774
- list.push({
775
- type: type,
776
- basePath: basePath,
777
- relPath: relPath,
778
- isSubPath: isSubPath,
779
- indRelPath: indRelPath
780
- });
781
- }
782
-
783
- function _getFileList(dirPath, basePath, files, next) {
784
- // TODO: the following code should be more concise.
785
- // Handling symbolic links
786
- // if the path sym-link indicates is a sub-path of source directory, treat a sym-link as it is.
787
- // otherwise the files sym-link indicates should be copied
788
- async.waterfall([
789
- fs.readdir.bind(null, dirPath),
790
- function(fileNames, next) {
791
- if (fileNames.length === 0) {
792
- _pushList(files, 'dir', basePath, path.relative(basePath, dirPath), true, null);
793
- return setImmediate(next);
794
- }
795
-
796
- async.forEachSeries(fileNames, function(fileName, next) {
797
- const filePath = path.join(dirPath, fileName),
798
- relPath = path.relative(basePath, filePath);
799
-
800
- async.waterfall([
801
- fs.lstat.bind(null, filePath),
802
- function(lstat, next) {
803
- if (lstat.isSymbolicLink()) {
804
- let indicateFullPath;
805
- try {
806
- indicateFullPath = fs.realpathSync(filePath);
807
- } catch (err) {
808
- if (err.code === 'ENOENT') {
809
- log.warn("The file for symbolic link (" + filePath + ") is missing...");
810
- return setImmediate(next);
811
- }
812
- return setImmediate(next, err);
813
- }
814
-
815
- const indicateRelPath = fs.readlinkSync(filePath);
816
- if (indicateFullPath.indexOf(basePath) !== -1) {
817
- _pushList(files, 'symlink', basePath, relPath, true, indicateRelPath);
818
- } else {
819
- const stat = fs.statSync(filePath);
820
- if (stat.isDirectory()) {
821
- return _getFileList(filePath, basePath, files, next);
822
- } else if (stat.isFile()) {
823
- _pushList(files, 'file', basePath, relPath, true, null);
824
- }
825
- }
826
- setImmediate(next);
827
- } else if (lstat.isDirectory()) {
828
- return _getFileList(filePath, basePath, files, next);
829
- } else if (lstat.isFile()) {
830
- _pushList(files, 'file', basePath, relPath, true, null);
831
- setImmediate(next);
832
- } else {
833
- setImmediate(next);
834
- }
835
- }
836
- ], next); // async.waterfall
837
- }, next); // async.forEach
838
- }
839
- ], function(err) {
840
- return setImmediate(next, err);
841
- }); // async.waterfall
842
- }
843
-
844
- function _copySrcToDst(files, dstPath, minify, next) {
845
- try {
846
- async.forEachSeries(files, function(file, next) {
847
- if (!FILE_TYPE[file.type]) {
848
- log.verbose("package#copySrcToDst()#_copySrcToDst()", "ignore 'unknown file type'("+file.type+")");
849
- return;
850
- }
851
-
852
- if (!file.relPath) {
853
- log.verbose("package#copySrcToDst()#_copySrcToDst()", "ignore 'unknown path'");
854
- return setImmediate(next);
855
- }
856
-
857
- if (file.type === FILE_TYPE.dir) {
858
- mkdirp.sync(path.join(dstPath, file.relPath));
859
- return setImmediate(next);
860
- }
861
-
862
- const dstDirPath = path.dirname(path.join(dstPath, file.relPath));
863
- if (!fs.existsSync(dstDirPath)) {
864
- mkdirp.sync(dstDirPath);
865
- }
866
-
867
- if (file.type === FILE_TYPE.symlink) {
868
- if (file.isSubPath && file.indRelPath) {
869
- const linkFile = path.join(dstPath, file.relPath);
870
- if (fs.existsSync(linkFile)) {
871
- if (fs.lstatSync(linkFile).isSymbolicLink()) {
872
- fs.unlinkSync(linkFile);
873
- }
874
- }
875
- fs.symlinkSync(file.indRelPath, linkFile, null);
876
- }
877
- } else {
878
- const sourceFile = path.join(file.basePath, file.relPath);
879
- if (fs.existsSync(sourceFile)) {
880
- if (minify && '.js' === path.extname(sourceFile) && file.relPath.indexOf('node_modules') === -1) {
881
- log.verbose("package#copySrcToDst()#_copySrcToDst()", "require minification # sourceFile:", sourceFile);
882
- try {
883
- const data = uglify.minify(fs.readFileSync(sourceFile,'utf8'));
884
- if (data.error) {
885
- throw data.error;
886
- }
887
- fs.writeFileSync(path.join(dstPath, file.relPath), data.code, 'utf8');
888
- } catch (e) {
889
- log.verbose("package#copySrcToDst()#_copySrcToDst()", util.format('Failed to uglify code %s: %s', sourceFile, e.stack));
890
- return setImmediate(next, errHndl.getErrMsg("FAILED_MINIFY", sourceFile));
891
- }
892
- } else {
893
- shelljs.cp('-Rf', sourceFile, path.join(dstPath, file.relPath, '..'));
894
- }
895
- } else {
896
- log.verbose("package#copySrcToDst()#_copySrcToDst()", "ignore '" + file.relPath + "'");
897
- }
898
- }
899
- setImmediate(next);
900
- }, function(err) {
901
- if (!err && minify) {
902
- self.minifyDone = true;
903
- }
904
- setImmediate(next, err);
905
- });
906
- } catch(err) {
907
- setImmediate(next, err);
908
- }
909
- }
910
- }
911
-
912
- function checkELFHeader(next) {
913
- const self = this,
914
- ELF_HEADER_LEN = 64,
915
- buf = Buffer.alloc(ELF_HEADER_LEN),
916
- mainFile = path.resolve(path.join(this.appDir, this.appinfo.main));
917
-
918
- if (!fs.existsSync(mainFile)) {
919
- return setImmediate(next, errHndl.getErrMsg("NOT_EXIST_PATH", mainFile));
920
- }
921
-
922
- const fd = fs.openSync(mainFile, 'r'),
923
- stats = fs.fstatSync(fd),
924
- elfParser = new ElfParser(),
925
- _isELF = function(_buf) {
926
- if (_buf.slice(0, 4).toString() !== '\x7fELF') {
927
- return false;
928
- } else {
929
- return true;
930
- }
931
- };
932
-
933
- if (stats.size < ELF_HEADER_LEN) {
934
- log.verbose("package#checkELFHeader()", "file size is smaller than ELF Header size");
935
- return setImmediate(next);
936
- }
937
-
938
- fs.read(fd, buf, 0, ELF_HEADER_LEN, 0, function(err, bytesRead, _buf) {
939
- if (bytesRead < ELF_HEADER_LEN || err) {
940
- log.silly("package#checkELFHeader()", "err:", err, ", bytesRead:", bytesRead);
941
- log.silly("package#checkELFHeader()", "readBuf to parse ELF header is small or error occurred during reading file.");
942
- return setImmediate(next);
943
- }
944
-
945
- if (!_isELF(_buf)) {
946
- log.silly("package#checkELFHeader()", mainFile + " is not ELF format");
947
- } else {
948
- log.silly("package#checkELFHeader()", mainFile + " is ELF format");
949
- try {
950
- const elfHeader = elfParser.parseHeader(_buf);
951
- log.silly("package#checkELFHeader()", "elfHeader:", elfHeader);
952
-
953
- if (elfHeader.machine && elfHeader.machine.match(/86$/)) {
954
- // current emulator opkg is allowing only all, noarch and i586.
955
- // when it is used with --offline-root.
956
- self.architecture = 'i586';
957
- } else if (elfHeader.machine && elfHeader.machine.match(/amd64$/)) {
958
- // change amd64 to x86_64
959
- self.architecture = 'x86_64';
960
- } else if (elfHeader.machine && elfHeader.machine.match(/AArch64$/)) {
961
- // change AArch64 to aarch64
962
- self.architecture = 'aarch64';
963
- } else {
964
- self.architecture = elfHeader.machine;
965
- }
966
- } catch(e) {
967
- log.verbose("package#checkELFHeader()", "exception:", e);
968
- }
969
- }
970
- log.verbose("package#checkELFHeader()", "machine:", self.architecture);
971
- fs.close(fd);
972
- setImmediate(next);
973
- });
974
- }
975
-
976
- function copyApp(next) {
977
- if (this.appCount === 0) {
978
- return setImmediate(next);
979
- }
980
-
981
- this.dataCopyCount++;
982
- log.info("package#copyApp()", "copy " + this.appDir + " ==> " + this.applicationDir);
983
- copySrcToDst.call(this, this.appDir, this.applicationDir, next);
984
- }
985
-
986
- function copyAssets(next) {
987
- if (this.appCount === 0) {
988
- return setImmediate(next);
989
- }
990
-
991
- try {
992
- async.forEachSeries(this.appinfo.assets, _handleAssets.bind(this), next);
993
- } catch (err) {
994
- return setImmediate(next, err);
995
- }
996
-
997
- function _handleAssets(file, next) {
998
- if (path.resolve(this.originAppDir) === path.resolve(this.appDir)) {
999
- _checkAppinfo.call(this, file, next);
1000
- } else {
1001
- async.series([
1002
- _checkAppinfo.bind(this, file),
1003
- _copyAssets.bind(this, file)
1004
- ], next);
1005
- }
1006
- }
1007
-
1008
- function _checkAppinfo(file, next) {
1009
- let source;
1010
- if (path.resolve(file) === path.normalize(file)) {
1011
- return next(errHndl.getErrMsg("NOT_RELATIVE_PATH_APPINFO", file));
1012
- } else {
1013
- source = path.join(this.originAppDir, file);
1014
- }
1015
-
1016
- if (path.resolve(source).indexOf(this.originAppDir) !== 0) {
1017
- return next(errHndl.getErrMsg("NOT_RELATIVE_PATH_APPINFO", file));
1018
- }
1019
-
1020
- if (!fs.existsSync(source) && !this.rom) {
1021
- const msg = errHndl.getErrMsg("NOT_EXIST_PATH", file);
1022
- if (path.basename(source).indexOf('$') === 0) {
1023
- // ignore property with starting $ prefix (dynamic property handling in the platform)
1024
- return setImmediate(next);
1025
- } else {
1026
- return setImmediate(next, msg);
1027
- }
1028
- }
1029
- setImmediate(next);
1030
- }
1031
-
1032
- function _copyAssets(file, next) {
1033
- log.verbose("package#copyAssets()#_copyAssets", "'" + file + "' will be located in app directory");
1034
- const source = path.join(this.originAppDir, file),
1035
- destination = this.appDir;
1036
-
1037
- async.series([
1038
- function(next) {
1039
- if (!fs.existsSync(destination)) {
1040
- mkdirp(destination, next);
1041
- } else {
1042
- setImmediate(next);
1043
- }
1044
- }
1045
- ], function(err) {
1046
- if (err) {
1047
- return setImmediate(next, err);
1048
- }
1049
- shelljs.cp('-Rf', source, destination);
1050
- setImmediate(next);
1051
- });
1052
- }
1053
- }
1054
-
1055
- function excludeIpkFileFromApp(next) {
1056
- // Exclude a pre-built .ipk file
1057
- this.excludeFiles = this.excludeFiles.concat([
1058
- // eslint-disable-next-line no-useless-escape
1059
- "[.]*[\\.]ipk",
1060
- ".DS_Store",
1061
- // ".vscode",
1062
- // ".reloadignore",
1063
- // ".launchparams.json"
1064
- ]);
1065
- setImmediate(next);
1066
- }
1067
-
1068
- function _retrieve(list, regExp, dirPath, depth, next) {
1069
- async.waterfall([
1070
- fs.readdir.bind(null, dirPath), function(fileNames, next) {
1071
- async.forEach(fileNames, function(fileName, next) {
1072
- const filePath = path.join(dirPath, fileName);
1073
- async.waterfall([
1074
- fs.lstat.bind(null, filePath), function(stat, next) {
1075
- let result = false;
1076
- if (depth > 1 && regExp.test(fileName)) {
1077
- result = true;
1078
- list.push(filePath);
1079
- }
1080
-
1081
- if (!result && stat.isDirectory()) {
1082
- _retrieve(list, regExp, filePath, depth + 1, next);
1083
- } else {
1084
- setImmediate(next);
1085
- }
1086
- }
1087
- ], next);
1088
- }, next);
1089
- }
1090
- ], function(err) {
1091
- setImmediate(next, err);
1092
- });
1093
- }
1094
-
1095
- function excludeFromApp(middleCb, next) {
1096
- let excludes;
1097
- if (this.appCount === 0) {
1098
- excludes = this.excludeFiles;
1099
- } else {
1100
- excludes = this.excludeFiles.concat(this.appinfo.exclude || []);
1101
- }
1102
-
1103
- const regExpQueries = excludes.map(function(exclude) {
1104
- return exclude.replace(/^\./g,"^\\.").replace(/^\*/g,"").replace(/$/g,"$");
1105
- }, this),
1106
- strRegExp = regExpQueries.join("|"),
1107
- regExp = new RegExp(strRegExp, "i"),
1108
- excludeList = [],
1109
- tempDirPrefix = path.resolve(this.tempDir, "data/usr/palm");
1110
-
1111
- async.series([
1112
- _retrieve.bind(this, excludeList, regExp, tempDirPrefix, 0), function(next) {
1113
- const meta_files = ["appinfo.json", "services.json", "packageinfo.json", "resourceinfo.json"],
1114
- unexcludable = [],
1115
- excluded = [];
1116
- try {
1117
- excludeList.forEach(function(file) {
1118
- if (meta_files.includes(path.basename(file))) {
1119
- unexcludable.push(path.basename(file));
1120
- } else {
1121
- const sliced = file.slice(tempDirPrefix.length + 1);
1122
- excluded.push(sliced.slice(sliced.indexOf(path.sep) + 1));
1123
- shelljs.rm('-rf', file);
1124
- }
1125
- });
1126
- if (unexcludable.length > 0) {
1127
- middleCb("Cannot exclude: " + unexcludable); // FIXME
1128
- }
1129
- if (excluded.length > 0) {
1130
- middleCb("Excluded: " + excluded); // FIXME
1131
- }
1132
- setImmediate(next);
1133
- } catch(err) {
1134
- setImmediate(next, err);
1135
- }
1136
- }
1137
- ], function(err) {
1138
- if (err) {
1139
- return setImmediate(next, err);
1140
- }
1141
- setImmediate(next);
1142
- });
1143
- }
1144
-
1145
- function createPackageDir(next) {
1146
- if (!this.rom) {
1147
- const pkgDirName = this.pkgId || this.appinfo.id;
1148
- this.packageDir = path.join(this.tempDir, "data/usr/palm/packages", pkgDirName);
1149
- log.verbose("package#createPackageDir", "directory:", this.packageDir);
1150
- mkdirp(this.packageDir, next);
1151
- } else {
1152
- setImmediate(next);
1153
- }
1154
- }
1155
-
1156
- function fillPackageDir(next) {
1157
- log.verbose("fillPackageDir");
1158
-
1159
- if (!this.rom) {
1160
- let data = "";
1161
- if (this.pkginfo) {
1162
- // Use pkginfofile option or PKG_DIR
1163
- if (!this.pkginfo.version) {
1164
- this.pkginfo.version = this.pkgVersion || "1.0.0";
1165
- }
1166
- if (this.appinfo) {
1167
- this.pkginfo.app = this.appinfo.id;
1168
- }
1169
- _checkPkgInfo(this.pkginfo.id, this.pkginfo.version, next);
1170
- data = JSON.stringify(this.pkginfo, null, 2) + "\n";
1171
- } else {
1172
- // Use pkgid option or no option
1173
- const pkginfo = {
1174
- "id": this.pkgId || this.appinfo.id,
1175
- "version": this.pkgVersion || "1.0.0"
1176
- };
1177
- if (this.appinfo) {
1178
- pkginfo.app = this.appinfo.id;
1179
- }
1180
- _checkPkgInfo(pkginfo.id, pkginfo.version, next);
1181
- data = JSON.stringify(pkginfo, null, 2) + "\n";
1182
- }
1183
- log.verbose("Generating packageinfo.json: " + data);
1184
- fs.writeFile(path.join(this.packageDir, "packageinfo.json"), data, next);
1185
- } else {
1186
- setImmediate(next);
1187
- }
1188
-
1189
- function _checkPkgInfo(id, version, next) {
1190
- if (!(/^[a-z0-9.+-]*$/.test(id))) {
1191
- log.error(errHndl.getErrMsg("INVALID_VALUE", "pkg id", id));
1192
- return setImmediate(next, errHndl.getErrMsg("INVALID_ID_RULE"));
1193
- }
1194
-
1195
- if (!(/^([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)$/.test(version))) {
1196
- log.error(errHndl.getErrMsg("INVALID_VALUE", "pkg version", version));
1197
- return setImmediate(next, errHndl.getErrMsg("INVALID_VERSION_RULE"));
1198
- }
1199
- }
1200
- }
1201
-
1202
-
1203
- function loadPackageProperties(inDirs, next) {
1204
- const self = this;
1205
- self.packageProperties = {};
1206
-
1207
- async.forEach(inDirs, function(inDir, next) {
1208
- const filename = path.join(inDir, "package.properties");
1209
-
1210
- function _checkFileMode(file) {
1211
- file = file.replace(/\\/g, "/").trim();
1212
- const idx = file.lastIndexOf("/");
1213
- file = (idx !== -1) ? file.slice(idx + 1) : file;
1214
- self.packageProperties[file] = this.fileMode;
1215
- }
1216
-
1217
- if (fs.existsSync(filename)) {
1218
- const data = fs.readFileSync(filename);
1219
- try {
1220
- const lines = data.toString().split("\n");
1221
- let seperatorIndex;
1222
-
1223
- for (const i in lines) {
1224
- if (lines[i].indexOf("filemode.") === 0) {
1225
- seperatorIndex = lines[i].indexOf("=");
1226
- const fileList = lines[i].slice(seperatorIndex + 1).trim(),
1227
- fileArray = fileList.split(",");
1228
- this.fileMode = lines[i].slice(9, seperatorIndex).trim();
1229
-
1230
- fileArray.forEach(_checkFileMode);
1231
- }
1232
- }
1233
- setImmediate(next);
1234
- } catch (error) {
1235
- setImmediate(next, error);
1236
- }
1237
- } else {
1238
- setImmediate(next);
1239
- }
1240
- }, function(err) {
1241
- // Exclude package.propeties from ipk file
1242
- self.excludeFiles = self.excludeFiles.concat([
1243
- "package.properties"
1244
- ]);
1245
- setImmediate(next, err);
1246
- });
1247
- }
1248
-
1249
- function outputPackage(destination, next) {
1250
- log.info("package#outputPackage()");
1251
-
1252
- // Check that the directories exist
1253
- if (fs.existsSync(destination)) {
1254
- const stats = fs.statSync(destination);
1255
- if (!stats.isDirectory()) {
1256
- return next(errHndl.getErrMsg("NOT_DIRTYPE_PATH", destination));
1257
- }
1258
- } else {
1259
- log.verbose("setOutputDir()", "creating directory '" + destination + "' ...");
1260
- mkdirp.sync(destination);
1261
- }
1262
- destination = fs.realpathSync(destination);
1263
-
1264
- if (this.rom) {
1265
- copySrcToDst.call(this, path.join(this.tempDir, 'data'), destination, next);
1266
- } else {
1267
- const tempDir = this.tempDir,
1268
- tempCtrlDir = path.join(tempDir, 'ctrl'),
1269
- ctrlTgzFile = path.join(tempDir, 'control.tar.gz'),
1270
- tempDataDir = path.join(tempDir, 'data'),
1271
- dataTgzFile = path.join(tempDir, 'data.tar.gz');
1272
-
1273
- async.series([
1274
- decidePkgName.bind(this, this.pkgId, this.pkgVersion),
1275
- getFileSize.bind(this, tempDataDir),
1276
- makeTgz.bind(this, tempDataDir, dataTgzFile),
1277
- createDir.bind(this, tempCtrlDir),
1278
- createControlFile.bind(this, tempCtrlDir, false),
1279
- createSign.bind(this, tempCtrlDir, dataTgzFile),
1280
- makeTgz.bind(this, tempCtrlDir, ctrlTgzFile),
1281
- createDebianBinary.bind(this, tempDir),
1282
- setIpkFileName.bind(this),
1283
- removeExistingIpk.bind(this, destination),
1284
- makeIpk.bind(this, tempDir)
1285
- ], function(err) {
1286
- if (err) {
1287
- setImmediate(next, err);
1288
- return;
1289
- }
1290
- setImmediate(next);
1291
- });
1292
- }
1293
- }
1294
-
1295
- function decidePkgName(pkgName, pkgVersion, next) {
1296
- if (this.appCount !== 0) {
1297
- this.pkg = {
1298
- name: pkgName || this.appinfo.id,
1299
- version: pkgVersion || this.appinfo.version
1300
- };
1301
- } else if (this.services.length > 0) {
1302
- this.pkg = {
1303
- name: pkgName || this.services[0].serviceInfo.id || this.services[0].serviceInfo.services[0].name,
1304
- version: pkgVersion || "1.0.0"
1305
- };
1306
- } else {
1307
- this.pkg = {
1308
- name: pkgName || "unknown",
1309
- version: pkgVersion || "1.0.0"
1310
- };
1311
- }
1312
- setImmediate(next);
1313
- }
1314
-
1315
- function getFileSize(srcDir, next) {
1316
- const self = this;
1317
-
1318
- async.waterfall([
1319
- _readSizeRecursive.bind(this, srcDir)
1320
- ], function(err, size) {
1321
- if (!err && size) {
1322
- log.verbose("package#getFileSize()", "Installed-Size:", size);
1323
- self.size = size;
1324
- }
1325
- setImmediate(next, err);
1326
- });
1327
-
1328
- function _readSizeRecursive(item, next) {
1329
- fs.lstat(item, function(err, stats) {
1330
- let total = stats.size;
1331
-
1332
- if (!err && stats.isDirectory()) {
1333
- fs.readdir(item, function(error, list) {
1334
- if (error) {
1335
- return next(error);
1336
- }
1337
-
1338
- async.forEach(list, function(diritem, callback) {
1339
- _readSizeRecursive(path.join(item, diritem), function(_err, size) {
1340
- total += size;
1341
- callback(_err);
1342
- });
1343
- }, function(e) {
1344
- next(e, total);
1345
- }
1346
- );
1347
- });
1348
- } else {
1349
- next(err, total);
1350
- }
1351
- });
1352
- }
1353
- }
1354
-
1355
- function createDir(dstPath, next) {
1356
- log.verbose("package#createDir()", "createDir:" + dstPath);
1357
- mkdirp(dstPath, next);
1358
- }
1359
-
1360
- function createControlFile(dstDir, encInfo, next) {
1361
- const dstFilePath = path.join(dstDir, 'control');
1362
- log.verbose("package#createControlFile()", "createControlFile:" + dstFilePath);
1363
-
1364
- const lines = [
1365
- "Package: " + this.pkg.name,
1366
- "Version: " + this.pkg.version,
1367
- "Section: misc",
1368
- "Priority: optional",
1369
- "Architecture: " + (this.architecture || "all"),
1370
- "Installed-Size: " + (this.size || 1234), // TODO: TBC
1371
- "Maintainer: N/A <nobody@example.com>", // TODO: TBC
1372
- "Description: This is a webOS application.",
1373
- "webOS-Package-Format-Version: 2", // TODO: TBC
1374
- "webOS-Packager-Version: x.y.x" // TODO: TBC
1375
- ];
1376
-
1377
- if (encInfo) {
1378
- lines.push("Encrypt-Algorithm: AES-256-CBC");
1379
- }
1380
- lines.push(''); // for the trailing \n
1381
- fs.writeFile(dstFilePath, lines.join("\n"), next);
1382
- }
1383
-
1384
- function createSign(dstDir, dataTgzPath, next) {
1385
- if ((!this.sign) || (!this.certificate)) {
1386
- log.verbose("package#createSign()", "App signing is skipped");
1387
- return setImmediate(next);
1388
- }
1389
-
1390
- const sigFilePath = path.join(dstDir, 'data.tar.gz.sha256.txt'),
1391
- keyPath = path.resolve(this.sign),
1392
- crtPath = path.resolve(this.certificate);
1393
-
1394
- log.verbose("package#createSign()", "dataTgzPath:" + dataTgzPath + ", sigfile:" + sigFilePath);
1395
- log.verbose("package#createSign()", "keyPath:" + keyPath + ", crtPath:" + crtPath);
1396
-
1397
- try {
1398
- // Create certificate to tmp/ctrl directory
1399
- shelljs.cp('-f', crtPath, dstDir);
1400
-
1401
- // Create signature and write data.tar.gz.sha256.txt
1402
- const privateKey = fs.readFileSync(keyPath, 'utf-8'),
1403
- dataFile = fs.readFileSync(dataTgzPath), // data.tar.gz
1404
- signer = crypto.createSign('sha256');
1405
-
1406
- signer.update(dataFile);
1407
- signer.end();
1408
-
1409
- const signature = signer.sign(privateKey),
1410
- buff = Buffer.from(signature),
1411
- base64data = buff.toString('base64');
1412
-
1413
- fs.writeFile(sigFilePath, base64data, next);
1414
- } catch (err) {
1415
- setImmediate(next, err);
1416
- }
1417
- }
1418
-
1419
- function createDebianBinary(dstDir, next) {
1420
- const dstFilePath = path.join(dstDir, "debian-binary");
1421
- log.verbose("package#createDebianBinary()", dstFilePath);
1422
- fs.writeFile(dstFilePath, "2.0\n", next);
1423
- }
1424
-
1425
- function makeTgz(srcDir, dstDir, next) {
1426
- log.verbose("package#makeTgz()", "makeTgz " + dstDir + " from " + srcDir);
1427
- const pkgServiceNames = this.pkgServiceNames;
1428
- // @see https://github.com/isaacs/node-tar/issues/7
1429
- // it is a workaround for packaged ipk on windows can set +x into directory
1430
- const fixupDirs = function (filePath, entry) {
1431
- const fileOrFolderName = filePath.split("/").pop();
1432
- // opkg does not support Posix Tar fully
1433
- if (fileOrFolderName.length !== Buffer.byteLength(fileOrFolderName)) {
1434
- const errMsg = "Please use the file name in english letters. \n\t\t (" + filePath + ")",
1435
- em = new (require('events').EventEmitter)();
1436
- em.emit('error', new Error(errMsg));
1437
- }
1438
- // Make sure readable directories have execute permission
1439
- if (entry.isDirectory()) {
1440
- let maskingBits = 201; // 0311
1441
- // special case for service directory should have writable permission.
1442
- if (pkgServiceNames.indexOf(fileOrFolderName) !== -1) {
1443
- maskingBits = 219; // 0333
1444
- }
1445
- entry.mode |= (entry.mode >>> 2) & maskingBits;
1446
- } else if (entry.isFile()) {
1447
- // Add other user's readable permission to all files
1448
- entry.mode |= 4; // 04
1449
- }
1450
- if (entry.uid > 0o7777777) {
1451
- entry.uid = 0;
1452
- }
1453
-
1454
- if (entry.gid > 0o7777777) {
1455
- entry.gid = 0;
1456
- }
1457
-
1458
- return true;
1459
- };
1460
-
1461
- fs.readdir(srcDir, function (err, fileList) {
1462
- if (err) setImmediate(next, err);
1463
- else {
1464
- tar.c({
1465
- file: dstDir,
1466
- gzip: true,
1467
- cwd: srcDir,
1468
- filter: fixupDirs
1469
- }, fileList)
1470
- .then(() => setImmediate(next))
1471
- .catch(error => setImmediate(next, error));
1472
- }
1473
- });
1474
- }
1475
-
1476
- function setIpkFileName(next) {
1477
- let filename = this.pkg.name;
1478
- if (this.pkg.version) {
1479
- // This is asked to replace 'x86' from 'i586' as a file suffix (From NDK)
1480
- const archSuffix = ('i586' === this.architecture) ? 'x86' : (this.architecture || 'all');
1481
- filename = filename.concat("_" + this.pkg.version + "_" + archSuffix + ".ipk");
1482
- } else {
1483
- filename = filename.concat(".ipk");
1484
- }
1485
- this.ipkFileName = filename;
1486
- setImmediate(next);
1487
- }
1488
-
1489
- function removeExistingIpk(destination, next) {
1490
- if (this.appCount === 0) {
1491
- return setImmediate(next);
1492
- }
1493
-
1494
- const filename = path.join(destination, this.ipkFileName);
1495
- fs.exists(filename, function(exists) {
1496
- if (exists) {
1497
- fs.unlink(filename, next);
1498
- } else {
1499
- setImmediate(next); // Nothing to do
1500
- }
1501
- });
1502
- }
1503
-
1504
- function padSpace(input, length) {
1505
- // max field length in ar is 16
1506
- const ret = String(input + ' ');
1507
- return ret.slice(0, length);
1508
- }
1509
-
1510
- function arFileHeader(name, size) {
1511
- const epoch = Math.floor(Date.now() / 1000) ;
1512
- return padSpace(name, 16) +
1513
- padSpace(epoch, 12) +
1514
- "0 " + // UID, 6 bytes
1515
- "0 " + // GID, 6 bytes
1516
- "100644 " + // file mode, 8 bytes
1517
- padSpace(size, 10) +
1518
- "\x60\x0A"; // don't ask
1519
- }
1520
-
1521
- function makeIpk(srcDir, next) {
1522
- this.IpkDir = srcDir;
1523
- this.ipk = path.join(srcDir, this.ipkFileName);
1524
- log.info("package#makeIpk()", "makeIpk in dir " + this.IpkDir + " file " + this.ipkFileName);
1525
-
1526
- if (this.nativecmd) { // TODO: TBR
1527
- shelljs.cd(this.IpkDir);
1528
- shelljs.exec("ar -q " + this.ipk + " debian-binary control.tar.gz data.tar.gz", {silent: this.silent});
1529
-
1530
- setImmediate(next);
1531
- return;
1532
- }
1533
-
1534
- // global header, see http://en.wikipedia.org/wiki/Ar_%28Unix%29
1535
- const header = "!<arch>\n",
1536
- debBinary = arFileHeader("debian-binary",4) + "2.0\n",
1537
- that = this,
1538
- arStream = CombinedStream.create(),
1539
- pkgFiles = [ 'control.tar.gz', 'data.tar.gz' ],
1540
- ipkStream = fstream.Writer(this.ipk);
1541
-
1542
- arStream.append(header + debBinary);
1543
- pkgFiles.forEach(function(f) {
1544
- const fpath = path.join(that.IpkDir, f),
1545
- s = fstream.Reader({ path: fpath, type: 'File'}),
1546
- stat = fs.statSync(fpath); // TODO: move to asynchronous processing
1547
-
1548
- arStream.append(arFileHeader(f, stat.size));
1549
- arStream.append(s);
1550
- if ((stat.size % 2) !== 0) {
1551
- log.verbose("package#makeIpk()", 'adding a filler for file ' + f);
1552
- arStream.append('\n');
1553
- }
1554
- }, this);
1555
-
1556
- arStream.pipe(ipkStream);
1557
- ipkStream.on('close', function() {
1558
- setImmediate(next);
1559
- });
1560
- ipkStream.on('error', next);
1561
- }
1562
-
1563
- function cleanupTmpDir(middleCb, next) {
1564
- if (this.noclean) {
1565
- middleCb("Skipping removal of " + this.tempDir);
1566
- setImmediate(next);
1567
- } else {
1568
- rimraf(this.tempDir, function(err) {
1569
- log.verbose("package#cleanupTmpDir()", "removed " + this.tempDir);
1570
- setImmediate(next, err);
1571
- }.bind(this));
1572
- }
1573
- }
1574
-
1575
- function checkDirectory(options, directory, callback) {
1576
- log.verbose("package#checkDirectory()", directory);
1577
- if (fs.existsSync(directory)) { // TODO: move to asynchronous processing
1578
- const stat = fs.statSync(directory);
1579
- if (!stat.isDirectory()) {
1580
- callback(errHndl.getErrMsg("NOT_DIRTYPE_PATH", directory));
1581
- return;
1582
- }
1583
- directory = fs.realpathSync(directory);
1584
- } else {
1585
- callback(errHndl.getErrMsg("NOT_EXIST_PATH", directory));
1586
- return;
1587
- }
1588
-
1589
- if (options.force) {
1590
- return callback();
1591
- }
1592
-
1593
- if (fs.existsSync(path.join(directory, "packageinfo.json"))) {
1594
- return callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_PKGDIR"));
1595
- }
1596
-
1597
- if (fs.existsSync(path.join(directory, "appinfo.json"))) {// TODO: move to asynchronous processing
1598
- this.appCount++;
1599
- log.verbose("package#checkDirectory()", "FOUND appinfo.json, appCount " + this.appCount);
1600
-
1601
- if (this.appCount > 1) {
1602
- callback(errHndl.getErrMsg("OVER_APPCOUNT"));
1603
- } else if (this.rscCount > 0) {
1604
- callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1605
- } else {
1606
- this.appDir = directory;
1607
- this.originAppDir = directory;
1608
- if (fs.existsSync(path.join(directory, "package.js"))) {
1609
- this.pkgJSExist = true;
1610
- }
1611
- callback();
1612
- }
1613
- } else if (fs.existsSync(path.join(directory, "services.json"))) {
1614
- if (this.rscCount > 0) {
1615
- callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1616
- }
1617
- this.svcDir = this.svcDir || [];
1618
- this.svcDir = this.svcDir.concat(directory);
1619
- callback();
1620
- } else if (fs.existsSync(path.join(directory, "resourceinfo.json"))) {
1621
- this.rscCount++;
1622
- log.verbose("FOUND resourceinfo.json, rscCount " + this.rscCount);
1623
- if (this.appCount > 0 || this.svcDir && this.svcDir.length > 0) {
1624
- return callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1625
- }
1626
- this.resources = this.resources || [];
1627
- const rsc = {};
1628
- rsc.dir = directory;
1629
- this.resources = this.resources.concat(rsc);
1630
- callback();
1631
- } else if (fs.existsSync(path.join(directory, "account-templates.json"))) {
1632
- callback(errHndl.getErrMsg("NO_ACCOUNT"));
1633
- } else {
1634
- // find service directory recursively
1635
- const foundSvcDirs = [];
1636
- this.svcDir = this.svcDir || [];
1637
- this.svcDir = this.svcDir.concat(directory);
1638
-
1639
- findServiceDir.call(this, foundSvcDirs, function() {
1640
- if (foundSvcDirs.length > 0) {
1641
- if (this.rscCount > 0) {
1642
- callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1643
- }
1644
- callback();
1645
- } else {
1646
- callback(errHndl.getErrMsg("NO_METAFILE", "APP_DIR/SVC_DIR", directory));
1647
- }
1648
- });
1649
- }
1650
- }
1651
-
1652
- // find service directories checking if directory has services.json file
1653
- function findServiceDir(services, next) {
1654
- const checkDirs = [].concat(this.svcDir || this.originAppDir || []),
1655
- foundFilePath = [];
1656
- if (checkDirs.length === 0) {
1657
- return setImmediate(next);
1658
- }
1659
-
1660
- async.forEach(checkDirs, function(checkDir, next) {
1661
- walkFolder(checkDir, "services.json", foundFilePath, 3, function(err) {
1662
- if (err) {
1663
- return setImmediate(next, err);
1664
- }
1665
-
1666
- foundFilePath.forEach(function(filePath) {
1667
- const svc = new Service();
1668
- svc.srcDir = path.dirname(filePath);
1669
- svc.dirName = path.basename(svc.srcDir);
1670
- services.push(svc);
1671
- });
1672
- foundFilePath.pop();
1673
- setImmediate(next, err);
1674
- });
1675
- }, function(err) {
1676
- setImmediate(next, err);
1677
- });
1678
- }
1679
-
1680
- function walkFolder(dirPath, findFileName, foundFilePath, depth, next) {
1681
- if (depth <= 0) {
1682
- return next();
1683
- }
1684
- async.waterfall([
1685
- fs.readdir.bind(null, dirPath),
1686
- function(fileNames, next) {
1687
- async.forEach(fileNames, function(fileName, next) {
1688
- const filePath = path.join(dirPath, fileName);
1689
- async.waterfall([
1690
- fs.lstat.bind(null, filePath),
1691
- function(stat, next) {
1692
- if (stat.isFile()) {
1693
- if (fileName === findFileName) {
1694
- foundFilePath.push(filePath);
1695
- }
1696
- next();
1697
- } else if (stat.isDirectory()) {
1698
- walkFolder(filePath, findFileName, foundFilePath, (depth-1), next);
1699
- } else {
1700
- next();
1701
- }
1702
- }
1703
- ], next); // async.waterfall
1704
- }, next); // async.forEach
1705
- }
1706
- ], function(err) {
1707
- next(err);
1708
- }); // async.waterfall
1709
- }
1710
-
1711
- // read services.json recursivly
1712
- function loadServiceInfo(next) {
1713
- for (const idx in this.services) {
1714
- const filename = path.join(this.services[idx].srcDir, "services.json");
1715
- try {
1716
- const data = fs.readFileSync(filename),
1717
- info = JSON.parse(data);
1718
- if (!(Object.prototype.hasOwnProperty.call(info, 'id') &&
1719
- Object.prototype.hasOwnProperty.call(info, 'services'))) {
1720
- continue;
1721
- }
1722
- this.services[idx].serviceInfo = info;
1723
- this.services[idx].valid = true;
1724
- } catch (err) {
1725
- return setImmediate(next, err);
1726
- }
1727
- }
1728
- log.info("package#loadServiceInfo()", "num of serviceInfo: " + this.services.length);
1729
- setImmediate(next);
1730
- }
1731
-
1732
- // check services.json recursivly
1733
- function checkServiceInfo(next) {
1734
- const pkgId = this.pkgId || this.appinfo.id,
1735
- svcIds = [];
1736
- let errFlag = false;
1737
-
1738
- this.services.forEach(function(service) {
1739
- if (service.valid === false) {
1740
- return;
1741
- }
1742
-
1743
- svcIds.push(getPkgServiceNames(service.serviceInfo)[0]);
1744
- });
1745
-
1746
- svcIds.forEach(function(svcId) {
1747
- if (svcId.indexOf(pkgId + ".") !== 0) {
1748
- errFlag = true;
1749
- }
1750
- });
1751
-
1752
- if (errFlag) {
1753
- return setImmediate(next, errHndl.getErrMsg("INVALID_SERVICEID", pkgId));
1754
- }
1755
- setImmediate(next);
1756
- }
1757
-
1758
- // create dir with each service's name under (tmp) + data/usr/palm/services/
1759
- function createServiceDir(next) {
1760
- this.services.forEach(function(service) {
1761
- if (service.valid === false) {
1762
- return;
1763
- }
1764
-
1765
- getPkgServiceNames(service.serviceInfo).forEach(function(serviceName) {
1766
- const serviceDir = path.join(this.tempDir, "data/usr/palm/services", serviceName);
1767
- service.dstDirs.push(serviceDir);
1768
- try {
1769
- log.info("package#createServiceDir()", "service dir:" + serviceDir);
1770
- mkdirp.sync(serviceDir);
1771
- } catch (err) {
1772
- return setImmediate(next, err);
1773
- }
1774
- }.bind(this));
1775
- }.bind(this));
1776
- setImmediate(next);
1777
- }
1778
-
1779
- // copy service files into each serviceInfos[x].id directory.
1780
- function copyService(next) {
1781
- log.info("package#copyService()");
1782
- const self = this,
1783
- validServices = this.services.filter(function(service) {
1784
- return service.valid;
1785
- });
1786
- try {
1787
- async.forEachSeries(validServices, function(service, next) {
1788
- async.forEach(service.dstDirs, function(dstDir, next) {
1789
- self.dataCopyCount++;
1790
- self.minifyDone = !self.minify;
1791
- copySrcToDst.call(self, service.srcDir, dstDir, next);
1792
- }, next);
1793
- }, next);
1794
- } catch (err) {
1795
- setImmediate(next, err);
1796
- }
1797
- }
1798
-
1799
- // add service info into packageinfo.json.
1800
- function addServiceInPkgInfo(next) {
1801
- if (!this.rom) {
1802
- const filename = path.join(this.packageDir, "packageinfo.json");
1803
- let pkginfo, validServiceCount;
1804
- try {
1805
- const data = fs.readFileSync(filename);
1806
- validServiceCount = 0;
1807
- pkginfo = JSON.parse(data);
1808
- log.silly("package#addServiceInPkgInfo()", "PACKAGEINFO:", pkginfo);
1809
- } catch (err) {
1810
- console.error(err);
1811
- setImmediate(next, err);
1812
- }
1813
- this.services.filter(function(s) {
1814
- return s.valid;
1815
- }).forEach(function(service) {
1816
- getPkgServiceNames(service.serviceInfo).forEach(function(serviceName) {
1817
- this.pkgServiceNames.push(serviceName);
1818
- validServiceCount++;
1819
- }.bind(this));
1820
- }.bind(this));
1821
-
1822
- if (validServiceCount > 0) {
1823
- pkginfo.services = this.pkgServiceNames;
1824
- const data = JSON.stringify(pkginfo, null, 2) + "\n";
1825
- log.silly("package#addServiceInPkgInfo()", "Modified package.json:" + data);
1826
- fs.writeFile(path.join(this.packageDir, "packageinfo.json"), data, next);
1827
- } else {
1828
- setImmediate(next);
1829
- }
1830
- } else {
1831
- setImmediate(next);
1832
- }
1833
- }
1834
-
1835
- // remove service dir from tmp source dir before packaging
1836
- function removeServiceFromAppDir(middleCb, next) {
1837
- if (this.appCount === 0) {
1838
- return setImmediate(next);
1839
- }
1840
-
1841
- let checkDir = this.applicationDir,
1842
- needRmCheckDir = false;
1843
- const fileList = fs.readdirSync(checkDir);
1844
-
1845
- function _checkDir(dir) {
1846
- if (this.dirName === dir) {
1847
- try {
1848
- const rmDir = path.join(this.applicationDir, this.dirName);
1849
- shelljs.rm('-rf', rmDir);
1850
- } catch (err) {
1851
- next(Error("ERROR" + err), null);
1852
- }
1853
- }
1854
- }
1855
-
1856
- if (fileList.indexOf('services') !== -1) {
1857
- checkDir = path.join(this.applicationDir, 'services');
1858
- const stats = fs.statSync(checkDir);
1859
- if (stats.isDirectory()) {
1860
- needRmCheckDir = true;
1861
- }
1862
- }
1863
- if (needRmCheckDir === true) {
1864
- try {
1865
- shelljs.rm('-rf', checkDir);
1866
- } catch (err) {
1867
- middleCb("ERROR:" + err);
1868
- }
1869
- } else {
1870
- for (const idx in this.services) {
1871
- this.dirName = this.services[idx].dirName;
1872
- fileList.forEach(_checkDir, this);
1873
- }
1874
- }
1875
- setImmediate(next);
1876
- }
1877
-
1878
- function loadResourceInfo(next) {
1879
- log.verbose("loadResourceInfo");
1880
- if (this.rscCount === 0) {
1881
- return setImmediate(next);
1882
- }
1883
-
1884
- this.resources.forEach(function(resource) {
1885
- const filePath = path.join(resource.dir, "resourceinfo.json");
1886
- try {
1887
- const data = fs.readFileSync(filePath),
1888
- info = JSON.parse(data);
1889
- resource.info = info;
1890
- } catch (err) {
1891
- return setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", "resourceinfo.json"));
1892
- }
1893
- });
1894
- log.verbose("num of resourceInfo: " + this.resources.length);
1895
- setImmediate(next);
1896
- }
1897
-
1898
- function checkResourceInfo(next) {
1899
- log.verbose("checkResourceInfo");
1900
- const pkgId = this.pkgId;
1901
-
1902
- this.resources.forEach(function(resource) {
1903
- if (!resource.info.id) {
1904
- return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
1905
- } else if (resource.info.id.indexOf(pkgId) !== 0) {
1906
- return setImmediate(next, errHndl.getErrMsg("INVALID_RESOURCEID", pkgId));
1907
- } else if (resource.info.id.length < 1 || !(/^[a-z0-9.+-]*$/.test(resource.info.id))) {
1908
- log.error(errHndl.getErrMsg("INVALID_VALUE", "id", resource.info.id));
1909
- return setImmediate(next, errHndl.getErrMsg("INVALID_ID_RULE"));
1910
- }
1911
- });
1912
- setImmediate(next);
1913
- }
1914
-
1915
- function createResourceDir(next) {
1916
- log.verbose("createResourceDir");
1917
- this.resources.forEach(function(resource) {
1918
- try {
1919
- const resourceDir = path.join(this.tempDir, "data/usr/palm/resources", resource.info.id);
1920
- log.verbose("resource dir = " + resourceDir);
1921
- resource.dstDir = resourceDir;
1922
- mkdirp.sync(resourceDir);
1923
- } catch (err) {
1924
- return setImmediate(next, err);
1925
- }
1926
- }.bind(this));
1927
- log.silly("this.resources:", this.resources);
1928
- setImmediate(next);
1929
- }
1930
-
1931
- function copyResource(next) {
1932
- log.verbose("copyResource()");
1933
- if (this.rscCount === 0) {
1934
- return setImmediate(next);
1935
- }
1936
-
1937
- const self = this;
1938
- try {
1939
- async.forEachSeries(this.resources, function(resource, next) {
1940
- self.dataCopyCount++;
1941
- log.verbose("copyResource(), copy " + resource.dir + " ==> " + resource.dstDir);
1942
- copySrcToDst.call(self, resource.dir, resource.dstDir, next);
1943
- }, next);
1944
- } catch (err) {
1945
- setImmediate(next, err);
1946
- }
1947
- }
1948
-
1949
- function addResourceInPkgInfo(next) {
1950
- log.verbose("addResourceInPkgInfo");
1951
- if (!this.rom && this.rscCount > 0) {
1952
- const filename = path.join(this.packageDir, "packageinfo.json");
1953
- let pkginfo, data;
1954
- try {
1955
- data = fs.readFileSync(filename);
1956
- log.verbose("PACKAGEINFO: " + data);
1957
- pkginfo = JSON.parse(data);
1958
- } catch (err) {
1959
- console.error(err);
1960
- setImmediate(next, err);
1961
- }
1962
-
1963
- this.resources.forEach(function(resource) {
1964
- this.pkgResourceNames.push(resource.info.id);
1965
- }.bind(this));
1966
-
1967
- pkginfo.resources = this.pkgResourceNames;
1968
- data = JSON.stringify(pkginfo, null, 2) + "\n";
1969
- log.verbose("Modified package.json: " + data);
1970
- fs.writeFile(path.join(this.packageDir, "packageinfo.json"), data, next);
1971
- } else {
1972
- setImmediate(next);
1973
- }
1974
- }
1975
-
1976
- function copyData(inDirs, forceCopy, next) {
1977
- log.verbose("package#copyData()", "only run when force packaging");
1978
- if (forceCopy && this.dataCopyCount === 0) {
1979
- const dst = path.join(this.tempDir, "data");
1980
- async.forEachSeries(inDirs, function(src, next) {
1981
- copySrcToDst.call(this, src, dst, next);
1982
- }, function(err) {
1983
- setImmediate(next, err);
1984
- });
1985
- } else {
1986
- return setImmediate(next);
1987
- }
1988
- }
1989
-
1990
- function getPkgServiceNames(serviceInfo) {
1991
- let serviceNames = [];
1992
- if (servicePkgMethod === "id") {
1993
- serviceNames = [serviceInfo.id];
1994
- } else if (serviceInfo.services) {
1995
- const serviceProps = (serviceInfo.services instanceof Array)
1996
- ? serviceInfo.services : [serviceInfo.services];
1997
- serviceNames = serviceProps.map(function(serviceProp) {
1998
- return serviceProp.name;
1999
- });
2000
- }
2001
- return serviceNames;
2002
- }
2003
-
2004
- function setUmask(mask, next) {
2005
- this.oldmask = process.umask(mask);
2006
- setImmediate(next);
2007
- }
2008
-
2009
- function recoverUmask(next) {
2010
- if (this.oldmask) {
2011
- process.umask(this.oldmask);
2012
- }
2013
- setImmediate(next);
2014
- }
2015
-
2016
- function rewriteFileWoBOMAsUtf8(filePath, rewriteFlag, next) {
2017
- let data = fs.readFileSync(filePath);
2018
- const encodingFormat = chardet.detect(Buffer.from(data));
2019
-
2020
- if (['UTF-8', 'ISO-8895-1'].indexOf(encodingFormat) === -1) {
2021
- log.silly("package#rewriteFileWoBOMAsUtf8()", "current encoding type:" + encodingFormat);
2022
- data = encoding.convert(data, "UTF-8", encodingFormat);
2023
- }
2024
- data = stripbom(data);
2025
-
2026
- if (rewriteFlag) {
2027
- fs.writeFileSync(filePath,
2028
- data, { encoding: "utf8" }
2029
- );
2030
- }
2031
-
2032
- if (next !== 'undefined' && typeof next === 'function') {
2033
- setImmediate(next, null, data);
2034
- }
2035
- return data;
2036
- }
2037
-
2038
- function encryptPackage(next) {
2039
- if (this.rom || !this.encrypt) { // Do not encrypt when -rom option is given
2040
- setImmediate(next);
2041
- return;
2042
- } else {
2043
- this.encryptDir = path.join(this.tempDir, "encrypt");
2044
- const encryptDir = this.encryptDir,
2045
- encryptCtrlDir = path.join(encryptDir, 'ctrl'),
2046
- ctrlTgzFile = path.join(encryptDir, 'control.tar.gz'),
2047
- encryptDataDir = path.join(encryptDir, 'data'),
2048
- dataTgzFile = path.join(encryptDir, 'data.tar.gz');
2049
-
2050
- async.series([
2051
- createDir.bind(this, encryptDir),
2052
- createDir.bind(this, encryptCtrlDir),
2053
- createDir.bind(this, encryptDataDir),
2054
- createkeyIVfile.bind(this, encryptCtrlDir),
2055
- encryptIpk.bind(this, encryptDataDir),
2056
- makeTgz.bind(this, encryptDataDir, dataTgzFile),
2057
- createControlFile.bind(this, encryptCtrlDir, true),
2058
- makeTgz.bind(this, encryptCtrlDir, ctrlTgzFile),
2059
- createDebianBinary.bind(this, encryptDir),
2060
- makeIpk.bind(this, encryptDir)
2061
- ], function(err) {
2062
- if (err) {
2063
- setImmediate(next, err);
2064
- return;
2065
- }
2066
- log.verbose("package#encryptPackage()", "success to encrypt pacakge");
2067
- setImmediate(next);
2068
- });
2069
- }
2070
- }
2071
-
2072
- function createkeyIVfile(dstPath, next) {
2073
- // generate random key& IV
2074
- this.key = Buffer.from(crypto.randomBytes(32), 'base64');
2075
- this.iv = Buffer.from(crypto.randomBytes(16), 'base64');
2076
-
2077
- try {
2078
- // Read public key
2079
- const publickeyPath = path.join(__dirname, '../', 'files', 'conf', 'pubkey.pem'),
2080
- publickey = fs.readFileSync(publickeyPath, 'utf8');
2081
-
2082
- // Encrypt key, iv by publickey
2083
- const encryptedKey= crypto.publicEncrypt({
2084
- key: publickey,
2085
- padding: 4 /* crypto.constants.RSA_PKCS1_OAEP_PADDING */
2086
- }, Buffer.from(this.key.toString('base64')));
2087
-
2088
- const encryptedIV= crypto.publicEncrypt({
2089
- key: publickey,
2090
- padding: 4 /* crypto.constants.RSA_PKCS1_OAEP_PADDING */
2091
- }, Buffer.from(this.iv.toString('base64')));
2092
-
2093
- const keyFilePath = path.join(dstPath, "key");
2094
- fs.writeFileSync(keyFilePath, encryptedKey, 'binary');
2095
-
2096
- // write iv file on encrypt/control
2097
- const ivFilePath = path.join(dstPath , "iv");
2098
- fs.writeFileSync(ivFilePath, encryptedIV, 'binary');
2099
-
2100
- } catch (err) {
2101
- return setImmediate(next, errHndl.getErrMsg(err));
2102
- }
2103
- setImmediate(next);
2104
- }
2105
-
2106
- function copyOutputToDst(destination, middleCb, next) {
2107
- // copy data directory to destination
2108
- if (this.rom) {
2109
- middleCb("Create output directory to " + destination);
2110
- copySrcToDst.call(this, path.join(this.tempDir, 'data'), destination, next);
2111
- } else if (this.encrypt) {
2112
- // copy encrypted ipk to destination
2113
- middleCb("Create encrypted " + this.ipkFileName + " to " + destination);
2114
- copySrcToDst.call(this, path.join(this.encryptDir, this.ipkFileName), destination, next);
2115
- } else {
2116
- // copy plain ipk to destination
2117
- let outmsg = "Create ";
2118
- if (this.sign && this.certificate) {
2119
- outmsg = outmsg.concat("signed ");
2120
- }
2121
- middleCb(outmsg + this.ipkFileName + " to " + destination);
2122
- copySrcToDst.call(this, path.join(this.tempDir, this.ipkFileName), destination, next);
2123
- }
2124
- }
2125
-
2126
- function encryptIpk(dstPath, next) {
2127
- log.verbose("package#encryptPackage()#encrypIpk()", "encrypt plain ipk to /encrypt/data");
2128
- const plainIpkPath = path.join(this.tempDir, this.ipkFileName),
2129
- encrypedIpkPath = path.join(dstPath, this.ipkFileName);
2130
-
2131
- try {
2132
- const input = fs.createReadStream(plainIpkPath),
2133
- output = fs.createWriteStream(encrypedIpkPath),
2134
- cipher = crypto.createCipheriv('aes-256-cbc', this.key, this.iv);
2135
-
2136
- output.on('close', function() {
2137
- log.verbose("package#encryptPackage()#encrypIpk()", "encrypted Ipk to " + encrypedIpkPath);
2138
- setImmediate(next);
2139
- }).
2140
- on('error', function(err) {
2141
- setImmediate(next, err);
2142
- });
2143
-
2144
- input.pipe(cipher).pipe(output);
2145
- } catch (err) {
2146
- setImmediate(next, err);
2147
- }
2148
- }
2149
- }());
1
+ /*
2
+ * Copyright (c) 2020-2024 LG Electronics Inc.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ const ar = require('ar-async'),
8
+ async = require('async'),
9
+ chardet = require('chardet'),
10
+ CombinedStream = require('combined-stream'),
11
+ crypto = require('crypto'),
12
+ decompress = require('decompress'),
13
+ decompressTargz = require('decompress-targz'),
14
+ ElfParser = require('elfy').Parser,
15
+ encoding = require('encoding'),
16
+ fs = require('fs'),
17
+ fstream = require('fstream'),
18
+ Validator = require('jsonschema').Validator,
19
+ mkdirp = require('mkdirp'),
20
+ log = require('npmlog'),
21
+ path = require('path'),
22
+ rimraf = require('rimraf'),
23
+ shelljs = require('shelljs'),
24
+ stripbom = require('strip-bom'),
25
+ temp = require('temp'),
26
+ uglify = require('terser'),
27
+ util = require('util'),
28
+ // zlib = require('zlib'),
29
+ // tarFilterPack = require('./tar-filter-pack'),
30
+ errHndl = require('./base/error-handler'),
31
+ tar = require('tar'),
32
+ commonTools = require('./base/common-tools');
33
+
34
+ const appdata = commonTools.appdata;
35
+
36
+ (function() {
37
+ log.heading = 'packager';
38
+ log.level = 'warn';
39
+
40
+ const servicePkgMethod = 'id',
41
+ defaultAssetsFields = {
42
+ "main": true,
43
+ "icon": true,
44
+ "largeIcon": true,
45
+ "bgImage": true,
46
+ "splashBackground": true,
47
+ "imageForRecents": true,
48
+ "sysAssetsBasePath": true
49
+ },
50
+ FILE_TYPE = {
51
+ file: 'file',
52
+ dir: 'dir',
53
+ symlink: 'symlink'
54
+ },
55
+ packager = {};
56
+ let objectCounter = 0;
57
+
58
+ if (typeof module !== 'undefined' && module.exports) {
59
+ module.exports = packager;
60
+ }
61
+
62
+ function Packager() {
63
+ this.objectId = objectCounter++;
64
+ this.verbose = false;
65
+ this.silent = true;
66
+ this.noclean = false;
67
+ this.nativecmd = false;
68
+ this.minify = true;
69
+ this.excludeFiles = [];
70
+ this.sign = null;
71
+ this.certificate = null;
72
+ this.sign = "";
73
+ this.certificate = "";
74
+ this.appCount = 0;
75
+ this.services = [];
76
+ this.pkgServiceNames = [];
77
+ this.rscCount = 0;
78
+ this.resources = [];
79
+ this.pkgResourceNames = [];
80
+ this.pkgId;
81
+ this.pkginfofile;
82
+ this.remainPlainIPK = false;
83
+ // To check app signing
84
+ this.dataHash = '';
85
+ this.certificateHash = '';
86
+ this.controlSign = '';
87
+ }
88
+
89
+ packager.Packager = Packager;
90
+
91
+ Packager.prototype = {
92
+ prepareOptions: function(options, next) {
93
+ if (options && options.level) {
94
+ log.level = options.level;
95
+ if (['warn', 'error'].indexOf(options.level) !== -1) {
96
+ this.silent = false;
97
+ }
98
+ }
99
+
100
+ if (options && options.noclean === true) {
101
+ this.noclean = true;
102
+ }
103
+
104
+ if (options && options.nativecmd === true) {
105
+ this.nativecmd = true;
106
+ }
107
+
108
+ if (options && Object.prototype.hasOwnProperty.call(options, 'minify')) {
109
+ this.minify = options.minify;
110
+ }
111
+
112
+ if (options && Object.prototype.hasOwnProperty.call(options, 'excludefiles')) {
113
+ if (options.excludefiles instanceof Array) {
114
+ this.excludeFiles = options.excludefiles.map(filePath => {
115
+ if (filePath && filePath.length)
116
+ filePath = filePath.replace(/(^\\|^)/i, "\\").replaceAll(/\\/gi, "\\\\");
117
+ return filePath;
118
+ });
119
+ } else {
120
+ this.excludeFiles.push(options.excludefiles);
121
+ }
122
+
123
+ this.excludeFiles.forEach(function(excl_file) {
124
+ if (excl_file === "appinfo.json") {
125
+ return next(errHndl.getErrMsg("NOT_EXCLUDE_APPINFO"));
126
+ }
127
+ });
128
+ }
129
+
130
+ if (options && Object.prototype.hasOwnProperty.call(options, 'rom')) {
131
+ this.rom = options.rom;
132
+ }
133
+
134
+ if (options && Object.prototype.hasOwnProperty.call(options, 'encrypt')) {
135
+ this.encrypt = options.encrypt;
136
+ }
137
+
138
+ if (options && Object.prototype.hasOwnProperty.call(options, 'remainPlainIPK')) {
139
+ this.remainPlainIPK = options.remainPlainIPK;
140
+ }
141
+
142
+ if (options && Object.prototype.hasOwnProperty.call(options, 'sign')) {
143
+ if (!fs.existsSync(path.resolve(options.sign))) {
144
+ return next(errHndl.getErrMsg("NOT_EXIST_PATH", options.sign));
145
+ }
146
+ this.sign = options.sign;
147
+ }
148
+
149
+ if (options && Object.prototype.hasOwnProperty.call(options, 'certificate')) {
150
+ if (!fs.existsSync(path.resolve(options.certificate))) {
151
+ return next(errHndl.getErrMsg("NOT_EXIST_PATH", options.certificate));
152
+ }
153
+ this.certificate = options.certificate;
154
+ }
155
+
156
+ log.verbose("package#Packager()", "Packager id:" + this.objectId);
157
+
158
+ this.pkgVersion = options.pkgversion;
159
+
160
+ if (options && Object.prototype.hasOwnProperty.call(options, 'pkgid')) {
161
+ this.pkgId = options.pkgid;
162
+ }
163
+
164
+ if (options && Object.prototype.hasOwnProperty.call(options, 'pkginfofile')) {
165
+ this.pkginfofile = options.pkginfofile;
166
+ }
167
+
168
+ if (this.pkgId && this.pkginfofile) {
169
+ return next(errHndl.getErrMsg("NOT_USE_WITH_OPTIONS", "pkginfofile, pkgid"));
170
+ }
171
+ this.appCount = 0;
172
+ },
173
+ checkInputDirectories: function(inDirs, options, next) {
174
+ log.verbose("package#Packager#checkInputDirectories()", "input directory:", inDirs);
175
+ this.prepareOptions(options, next);
176
+
177
+ async.forEachSeries(inDirs, checkDirectory.bind(this, options), function(err) {
178
+ if (err) {
179
+ setImmediate(next, err);
180
+ return;
181
+ }
182
+ setImmediate(next);
183
+ });
184
+ return {app: this.appCount, resource: this.rscCount};
185
+ },
186
+ servicePackaging: function(inDirs, destination, options, middleCb, next) {
187
+ log.info("package#Packager#servicePackaging()");
188
+
189
+ if (!Object.hasOwnProperty.call(options, 'pkgid') && !Object.hasOwnProperty.call(options, 'pkginfofile')) {
190
+ return next(errHndl.getErrMsg("USE_PKGID_PKGINFO"));
191
+ }
192
+
193
+ async.series([
194
+ this.checkInputDirectories.bind(this, inDirs, options),
195
+ setUmask.bind(this, 0),
196
+ loadPkgInfo.bind(this),
197
+ createTmpDir.bind(this),
198
+ excludeIpkFileFromApp.bind(this),
199
+ createPackageDir.bind(this),
200
+ fillPackageDir.bind(this),
201
+ findServiceDir.bind(this, this.services),
202
+ loadServiceInfo.bind(this),
203
+ checkServiceInfo.bind(this),
204
+ createServiceDir.bind(this),
205
+ copyService.bind(this),
206
+ addServiceInPkgInfo.bind(this),
207
+ copyData.bind(this, inDirs, options.force),
208
+ loadPackageProperties.bind(this, inDirs),
209
+ excludeFromApp.bind(this, middleCb),
210
+ outputPackage.bind(this, destination),
211
+ encryptPackage.bind(this),
212
+ copyOutputToDst.bind(this, destination, middleCb),
213
+ recoverUmask.bind(this),
214
+ cleanupTmpDir.bind(this, middleCb)
215
+ ], function(err) {
216
+ if (err) {
217
+ // TODO: call cleanupTmpDir() before returning
218
+ setImmediate(next, err);
219
+ return;
220
+ }
221
+ // TODO: probably some more checkings are needed
222
+ setImmediate(next, null, {ipk: this.ipk, msg: "Success"});
223
+ }.bind(this));
224
+ },
225
+ resourcePackaging: function(inDirs, destination, options, middleCb, next) {
226
+ log.info("package#Packager#resourcePackaging()");
227
+ this.dataCopyCount = 0;
228
+ async.series([
229
+ this.checkInputDirectories.bind(this, inDirs, options),
230
+ setUmask.bind(this, 0),
231
+ loadPkgInfo.bind(this),
232
+ createTmpDir.bind(this),
233
+ excludeIpkFileFromApp.bind(this),
234
+ createPackageDir.bind(this),
235
+ fillPackageDir.bind(this),
236
+ loadResourceInfo.bind(this),
237
+ checkResourceInfo.bind(this),
238
+ createResourceDir.bind(this),
239
+ copyResource.bind(this),
240
+ addResourceInPkgInfo.bind(this),
241
+ copyData.bind(this, inDirs, options.force),
242
+ loadPackageProperties.bind(this, inDirs),
243
+ excludeFromApp.bind(this, middleCb),
244
+ outputPackage.bind(this, destination),
245
+ encryptPackage.bind(this),
246
+ copyOutputToDst.bind(this, destination, middleCb),
247
+ recoverUmask.bind(this),
248
+ cleanupTmpDir.bind(this, middleCb)
249
+ ], function(err) {
250
+ if (err) {
251
+ setImmediate(next, err);
252
+ return;
253
+ }
254
+ setImmediate(next, null, {ipk: this.ipk, msg: "Success"});
255
+ }.bind(this));
256
+ },
257
+ generatePackage: function(inDirs, destination, options, middleCb, next) {
258
+ log.info("package#Packager#generatePackage()", "from ", inDirs);
259
+ // check whether app or service directories are copied or not
260
+ this.dataCopyCount = 0;
261
+ this.minifyDone = !this.minify;
262
+
263
+ async.series([
264
+ this.checkInputDirectories.bind(this, inDirs, options),
265
+ setUmask.bind(this, 0),
266
+ loadPkgInfo.bind(this),
267
+ loadAppInfo.bind(this),
268
+ checkAppInfo.bind(this),
269
+ createTmpDir.bind(this),
270
+ createAppDir.bind(this),
271
+ checkELFHeader.bind(this),
272
+ fillAssetsField.bind(this),
273
+ copyAssets.bind(this),
274
+ copyApp.bind(this),
275
+ excludeIpkFileFromApp.bind(this),
276
+ createPackageDir.bind(this),
277
+ fillPackageDir.bind(this),
278
+ findServiceDir.bind(this, this.services),
279
+ loadServiceInfo.bind(this),
280
+ checkServiceInfo.bind(this),
281
+ createServiceDir.bind(this),
282
+ copyService.bind(this),
283
+ addServiceInPkgInfo.bind(this),
284
+ removeServiceFromAppDir.bind(this, middleCb),
285
+ copyData.bind(this, inDirs, options.force),
286
+ loadPackageProperties.bind(this, inDirs),
287
+ excludeFromApp.bind(this, middleCb),
288
+ outputPackage.bind(this, destination),
289
+ encryptPackage.bind(this),
290
+ copyOutputToDst.bind(this, destination, middleCb),
291
+ recoverUmask.bind(this),
292
+ cleanupTmpDir.bind(this, middleCb)
293
+ ], function(err) {
294
+ if (err) {
295
+ // TODO: call cleanupTmpDir() before returning
296
+ setImmediate(next, err);
297
+ return;
298
+ }
299
+ // TODO: probably some more checkings are needed
300
+ setImmediate(next, null, {ipk: this.ipk, msg: "Success"});
301
+ }.bind(this));
302
+ },
303
+ analyzeIPK: function(options, next) {
304
+ log.info("package#Packager#analyzeIPK()");
305
+ let ipkConfigFile, ipkFile, ipkConfig, tmpDirPath;
306
+ this.prepareOptions(options);
307
+
308
+ async.series([
309
+ _setConfig,
310
+ _unpackIpk,
311
+ _unpackTar,
312
+ _analyzeMetaFile,
313
+ _removeTmpDir,
314
+ ], function(err, results) {
315
+ log.silly("package#analyzeIPK()", "err:", err, ", results:", results);
316
+ if (err) {
317
+ return next(err);
318
+ }
319
+ return next(null, {msg: results[3].trim()});
320
+ });
321
+
322
+ function _setConfig(next) {
323
+ log.info("package#analyzeIPK()#_setConfig()");
324
+ if (options.info === 'true') {
325
+ return next(errHndl.getErrMsg("EMPTY_VALUE", 'info'));
326
+ } else if (options.infodetail === 'true') {
327
+ return next(errHndl.getErrMsg("EMPTY_VALUE", 'info-detail'));
328
+ }
329
+ ipkFile = options.info ? options.info : options.infodetail;
330
+ ipkConfigFile = path.resolve(__dirname, "../files/conf/ipk.json");
331
+
332
+ if (path.extname(ipkFile) !== ".ipk") {
333
+ return next(errHndl.getErrMsg("SUPPORT_ONLY_IPK", ipkFile));
334
+ }
335
+ if (!fs.existsSync(ipkFile)) {
336
+ return next(errHndl.getErrMsg("NOT_EXIST_PATH", ipkFile));
337
+ }
338
+ if (!fs.existsSync(ipkConfigFile)) {
339
+ return next(errHndl.getErrMsg("NOT_EXIST_PATH", ipkConfigFile));
340
+ }
341
+ ipkConfig = JSON.parse(fs.readFileSync(ipkConfigFile));
342
+ tmpDirPath = temp.path(ipkConfig.tmpPath);
343
+
344
+ if (!fs.existsSync(tmpDirPath)) {
345
+ fs.mkdirSync(tmpDirPath);
346
+ }
347
+ next();
348
+ }
349
+
350
+ function _unpackIpk(next) {
351
+ log.info("package#analyzeIPK()#_unpackIpk()");
352
+ const reader = new ar.ArReader(ipkFile);
353
+
354
+ reader.on("entry", function(entry, next) {
355
+ const name = entry.fileName();
356
+ entry.fileData()
357
+ .pipe(fs.createWriteStream(path.resolve(tmpDirPath, name)))
358
+ .on("finish", next);
359
+ });
360
+ reader.on("error", function(err) {
361
+ return next(err);
362
+ });
363
+ reader.on("close", function() {
364
+ log.verbose("package#analyzeIPK()#_unpackIpk()", "unpack ipk close");
365
+ next();
366
+ });
367
+ }
368
+
369
+ function _unpackTar(next) {
370
+ log.info("package#analyzeIPK()#_unpackTar()");
371
+ if (fs.existsSync(path.resolve(tmpDirPath, "control.tar.gz"))) {
372
+ (async function() {
373
+ await decompress(path.resolve(tmpDirPath, "control.tar.gz"), tmpDirPath, {
374
+ plugins: [
375
+ decompressTargz()
376
+ ]
377
+ });
378
+ log.verbose("package#analyzeIPK()#_unpackTar()", "control.tar.gz decompressed");
379
+ })();
380
+ } else if (fs.existsSync(path.resolve(tmpDirPath, "control.tar.xz"))) {
381
+ return next(errHndl.getErrMsg("NOT_SUPPORT_XZ"));
382
+ } else {
383
+ return next(errHndl.getErrMsg("NO_COMPONENT_FILE", ", control tar file"));
384
+ }
385
+
386
+ if (fs.existsSync(path.resolve(tmpDirPath, "data.tar.gz"))) {
387
+ (async function() {
388
+ await decompress(path.resolve(tmpDirPath, "data.tar.gz"), tmpDirPath, {
389
+ plugins: [
390
+ decompressTargz()
391
+ ]
392
+ });
393
+ log.verbose("package#analyzeIPK()#_unpackTar()", "data.tar.gz decompressed");
394
+ next();
395
+ })();
396
+ } else if (fs.existsSync(path.resolve(tmpDirPath, "data.tar.xz"))) {
397
+ return next(errHndl.getErrMsg("NOT_SUPPORT_XZ"));
398
+ } else {
399
+ return next(errHndl.getErrMsg("NO_COMPONENT_FILE", "data tar file"));
400
+ }
401
+ }
402
+
403
+ function _analyzeMetaFile(next) {
404
+ log.info("package#analyzeIPK()#_analyzeMetaFile()");
405
+ let result = "", targetFile, tmpTxt;
406
+
407
+ ipkConfig.webOSMetaFiles.forEach(function(item) {
408
+ const targetPath = path.resolve(tmpDirPath, ipkConfig[item].path);
409
+ // Analyze control file
410
+ if (item === "control") {
411
+ targetFile = path.resolve(targetPath, ipkConfig[item].fileName);
412
+ if (!fs.existsSync(targetFile)) {
413
+ return next(errHndl.getErrMsg("NO_COMPONENT_FILE", "control file"));
414
+ }
415
+
416
+ if (options.infodetail) {
417
+ result = "\n\n< " + ipkConfig[item].fileName + " >\n";
418
+ result += fs.readFileSync(targetFile).toString().trim();
419
+ } else {
420
+ result = ipkConfig[item].heading + "\n";
421
+ tmpTxt = fs.readFileSync(targetFile).toString().trim();
422
+ ipkConfig[item].info.forEach(function(field) {
423
+ if (tmpTxt.match(new RegExp(field + ": (.*)", "gi"))) {
424
+ result += tmpTxt.match(new RegExp(field + ": (.*)", "gi"))[0] + "\n";
425
+ }
426
+ });
427
+ }
428
+ // Analyze appinfo.json, packageinfo.json, services.json, package.json files
429
+ } else if (fs.existsSync(targetPath)) {
430
+ const dirArr = fs.readdirSync(targetPath);
431
+ let beforeDir = dirArr[0];
432
+
433
+ dirArr.forEach(function(dir) {
434
+ if (ipkConfig[item].fileName) {
435
+ ipkConfig[item].fileName.forEach(function(file) {
436
+ targetFile = path.resolve(targetPath, dir, file);
437
+ if (fs.existsSync(targetFile)) {
438
+ if (options.infodetail) {
439
+ result += "\n\n< " + file + " >\n";
440
+ result += fs.readFileSync(targetFile).toString().trim();
441
+ } else {
442
+ if (ipkConfig[item].heading && beforeDir !== path.join(ipkConfig[item].path, dir)) {
443
+ result += "\n" + ipkConfig[item].heading + "\n";
444
+ }
445
+ tmpTxt = fs.readFileSync(targetFile).toString().trim();
446
+ const tmpJson = JSON.parse(tmpTxt);
447
+ ipkConfig[item].info.forEach(function(field) {
448
+ if (tmpJson[field]) {
449
+ const fieldValue = tmpJson[field];
450
+ if (typeof fieldValue === "object") {
451
+ if (ipkConfig[item][field]) { // Case of services.json, services_name field
452
+ const subField = ipkConfig[item][field],
453
+ subResult = [];
454
+ fieldValue.forEach(function(subItem) {
455
+ subResult.push(subItem[subField]);
456
+ });
457
+ result += field + ": " + JSON.stringify(subResult) + "\n";
458
+ } else { // Case of packageinfo.json, services field
459
+ result += field + ": " + JSON.stringify(fieldValue) + "\n";
460
+ }
461
+ } else {
462
+ result += field + ": " + fieldValue + "\n";
463
+ }
464
+ }
465
+ });
466
+ beforeDir = path.join(ipkConfig[item].path, dir);
467
+ }
468
+ }
469
+ });
470
+ }
471
+ });
472
+ }
473
+ });
474
+ next(null, result);
475
+ }
476
+
477
+ function _removeTmpDir(next) {
478
+ log.info("package#analyzeIPK()#_removeTmpDir()");
479
+ rimraf(tmpDirPath, function(err) {
480
+ log.verbose("package#analyzeIPK()#_removeTmpDir()", "removed " + tmpDirPath);
481
+ next(err);
482
+ });
483
+ }
484
+ }
485
+ };
486
+
487
+ function Service() {
488
+ this.srcDir = "";
489
+ this.dstDirs = [];
490
+ this.valid = false;
491
+ this.serviceInfo = "";
492
+ this.dirName = "";
493
+ }
494
+
495
+ // Private functions
496
+ function loadPkgInfo(next) {
497
+ log.verbose("loadPkgInfo");
498
+ let data;
499
+
500
+ if (this.pkginfofile) {
501
+ log.silly("Use pkginfofile option");
502
+ if (fs.existsSync(this.pkginfofile)) {
503
+ if ("packageinfo.json" !== path.basename(this.pkginfofile)) {
504
+ return setImmediate(next, errHndl.getErrMsg("INVALID_FILE", "packageinfo.json"));
505
+ }
506
+ data = rewriteFileWoBOMAsUtf8(this.pkginfofile, true);
507
+ try {
508
+ log.verbose("PKGINFO >>" + data + "<<");
509
+ this.pkginfo = JSON.parse(data);
510
+
511
+ if (!Object.prototype.hasOwnProperty.call(this.pkginfo, 'id')) {
512
+ return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
513
+ }
514
+
515
+ this.pkgId = this.pkginfo.id;
516
+ this.pkgVersion = this.pkgVersion || this.pkginfo.version;
517
+ setImmediate(next);
518
+ }
519
+ catch (err) {
520
+ return setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", "packageinfo.json"));
521
+ }
522
+ } else {
523
+ return setImmediate(next, errHndl.getErrMsg("NOT_EXIST_PATH", this.pkginfofile));
524
+ }
525
+ } else if (this.pkgDir) {
526
+ log.silly("Use packageinfo.json from PKG_DIR");
527
+ data = rewriteFileWoBOMAsUtf8(path.join(this.pkgDir, "packageinfo.json"));
528
+ try {
529
+ log.verbose("PKGINFO >>" + data + "<<");
530
+ this.pkginfo = JSON.parse(data);
531
+
532
+ if (!Object.prototype.hasOwnProperty.call(this.pkginfo, 'id')) {
533
+ return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
534
+ }
535
+ this.pkgId = this.pkginfo.id;
536
+ this.pkgVersion = this.pkgVersion || this.pkginfo.version;
537
+ setImmediate(next);
538
+ }
539
+ catch (err) {
540
+ return setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", "packageinfo.json"));
541
+ }
542
+ } else {
543
+ return setImmediate(next);
544
+ }
545
+ }
546
+
547
+ function loadAppInfo(next) {
548
+ log.verbose("loadAppInfo");
549
+ if (this.appCount === 0) {
550
+ return setImmediate(next);
551
+ }
552
+
553
+ const filepath = path.join(this.appDir, "appinfo.json"),
554
+ data = rewriteFileWoBOMAsUtf8(filepath, true);
555
+ try {
556
+ this.appinfo = JSON.parse(data);
557
+ log.silly("package#loadAppInfo()", "content of appinfo.json:", this.appinfo);
558
+
559
+ if (!this.appinfo.version || this.appinfo.version === undefined) {
560
+ this.appinfo.version = "1.0.0";
561
+ }
562
+
563
+ this.pkgVersion = this.pkgVersion || this.appinfo.version;
564
+ setImmediate(next);
565
+ } catch(err) {
566
+ setImmediate(next, err);
567
+ }
568
+ }
569
+
570
+ function checkAppInfo(next) {
571
+ if (this.appCount === 0) {
572
+ return setImmediate(next);
573
+ }
574
+
575
+ // check enyo app
576
+ if (this.pkgJSExist && this.appinfo.main && this.appinfo.main.match(/(\.html|\.htm)$/gi)) {
577
+ const mainFile = path.join(this.appDir, this.appinfo.main);
578
+ if (!fs.existsSync(mainFile)) {
579
+ return setImmediate(next, errHndl.getErrMsg("NOT_EXIST_PATH", this.appinfo.main));
580
+ }
581
+
582
+ const regex = new RegExp("(<script[^>]*src[ \t]*=[ \t]*['\"])[^'\"]*/enyo.js(['\"])"),
583
+ data = fs.readFileSync(mainFile);
584
+ if (data.toString().match(regex)) {
585
+ // If enyo app, stop packaging.
586
+ return setImmediate(next, errHndl.getErrMsg("NOT_SUPPORT_ENYO"));
587
+ }
588
+ }
589
+
590
+ if (!this.appinfo.id || this.appinfo.id === undefined) {
591
+ return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
592
+ }
593
+ if (this.appinfo.id.length < 1 || !(/^[a-z0-9.+-]*$/.test(this.appinfo.id))) {
594
+ log.error(errHndl.getErrMsg("INVALID_VALUE", "id", this.appinfo.id));
595
+ return setImmediate(next, errHndl.getErrMsg("INVALID_ID_RULE"));
596
+ }
597
+ if (this.pkgId && this.appinfo.id.indexOf(this.pkgId) !== 0) {
598
+ log.error(errHndl.getErrMsg("INVALID_VALUE", "id", this.appinfo.id));
599
+ return setImmediate(next, errHndl.getErrMsg("INVALID_APPID", this.pkgId));
600
+ }
601
+ if (!this.appinfo.version || this.appinfo.version === undefined) {
602
+ return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "version"));
603
+ }
604
+ if (this.appinfo.version.length < 1 || !(/^([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)$/.test(this.appinfo.version))) {
605
+ log.error(errHndl.getErrMsg("INVALID_VALUE", "version", this.appinfo.version));
606
+ return setImmediate(next, errHndl.getErrMsg("INVALID_VERSION_RULE"));
607
+ }
608
+ if (this.appinfo.type && this.appinfo.type.match(/clock/gi)) {
609
+ return setImmediate(next);
610
+ }
611
+
612
+ const schemaFile = path.resolve(__dirname, "../files/schema/ApplicationDescription.schema");
613
+ async.waterfall([
614
+ fs.readFile.bind(this, schemaFile, "utf-8"),
615
+ function getSchema(data, next) {
616
+ try {
617
+ const schema = JSON.parse(data);
618
+ /* "required" keyword is redefined in draft 4.
619
+ But current jsonschema lib support only draft 3.
620
+ So this line changes "required" attribute according to the draft 3.
621
+ */
622
+ const reqKeys = schema.required;
623
+ if (reqKeys) {
624
+ for (const key in schema.properties) {
625
+ if (reqKeys.indexOf(key) !== -1) {
626
+ schema.properties[key].required = true;
627
+ }
628
+ }
629
+ }
630
+ next(null, schema);
631
+ } catch(err) {
632
+ next(errHndl.getErrMsg("INVALID_JSON_FORMAT", "AppDescription schema"));
633
+ }
634
+ },
635
+ function checkValid(schema, next) {
636
+ try {
637
+ next(null, new Validator().validate(this.appinfo, schema));
638
+ } catch (err) {
639
+ log.error(err);
640
+ next(errHndl.getErrMsg("INVALID_JSON_FORMAT"));
641
+ }
642
+ }.bind(this)
643
+ ], function(err, result) {
644
+ if (err) {
645
+ setImmediate(next, err);
646
+ } else {
647
+ if (result && result.errors.length > 0) {
648
+ const errFile = "appinfo.json";
649
+ let errMsg = "";
650
+ for (const idx in result.errors) {
651
+ let errMsgLine = result.errors[idx].property + " " + result.errors[idx].message;
652
+ if (errMsgLine.indexOf("instance.") > -1) {
653
+ errMsgLine = errMsgLine.substring("instance.".length);
654
+ errMsg = errMsg.concat("\n");
655
+ errMsg = errMsg.concat(errMsgLine);
656
+ }
657
+ }
658
+ errMsg = errHndl.getErrMsg("INVALID_FILE", errFile, errMsg);
659
+ return setImmediate(next, errMsg);
660
+ } else {
661
+ log.verbose("package#checkAppInfo()", "APPINFO is valid");
662
+ }
663
+ setImmediate(next);
664
+ }
665
+ });
666
+ }
667
+
668
+ function fillAssetsField(next) {
669
+ if (this.appCount === 0) {
670
+ return setImmediate(next);
671
+ }
672
+ // make appinfo.assets to have default values so that they can be copied into the package
673
+ this.appinfo.assets = this.appinfo.assets || [];
674
+ for (const i in this.appinfo) {
675
+ if (Object.prototype.hasOwnProperty.call(this.appinfo, i) && defaultAssetsFields[i]) {
676
+ // no duplicated adding & value should not null string & file/dir should exist
677
+ if ((this.appinfo.assets.indexOf(this.appinfo[i]) === -1) && this.appinfo[i]) {
678
+ this.appinfo.assets.push(this.appinfo[i]);
679
+ }
680
+ }
681
+ }
682
+
683
+ // refer to appinfo.json files in localization directory.
684
+ const appInfoPath = this.originAppDir,
685
+ checkDir = path.join(this.originAppDir, "resources"),
686
+ foundFilePath = [],
687
+ resourcesAssets = [];
688
+
689
+ try {
690
+ const stat = fs.lstatSync(checkDir);
691
+ if (!stat.isDirectory()) {
692
+ return setImmediate(next, null);
693
+ }
694
+ } catch(err) {
695
+ if (err.code === "ENOENT") {
696
+ return setImmediate(next, null);
697
+ }
698
+ }
699
+
700
+ async.series([
701
+ walkFolder.bind(null, checkDir, "appinfo.json", foundFilePath, 1),
702
+ function(next) {
703
+ async.forEach(foundFilePath, function(filePath, next) {
704
+ rewriteFileWoBOMAsUtf8(filePath, true, function(err, data) {
705
+ try {
706
+ const appInfo = JSON.parse(data),
707
+ dirPath = path.dirname(filePath);
708
+ for (const i in appInfo) {
709
+ if (Object.prototype.hasOwnProperty.call(appInfo, i) && defaultAssetsFields[i]) {
710
+ if (appInfo[i]) {
711
+ const itemPath = path.join(dirPath, appInfo[i]),
712
+ relPath = path.relative(appInfoPath, itemPath);
713
+ // no duplicated adding & value should not null string & file/dir should exist
714
+ if ((resourcesAssets.indexOf(relPath) === -1)) {
715
+ resourcesAssets.push(relPath);
716
+ }
717
+ }
718
+ }
719
+ }
720
+ setImmediate(next, null);
721
+ } catch(error) {
722
+ setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", filePath));
723
+ }
724
+ });
725
+ }, function(err) {
726
+ setImmediate(next, err);
727
+ });
728
+ },
729
+ function(next) {
730
+ this.appinfo.assets = this.appinfo.assets.concat(resourcesAssets);
731
+ setImmediate(next, null);
732
+ }.bind(this)
733
+ ], function(err) {
734
+ setImmediate(next, err);
735
+ });
736
+ }
737
+
738
+ function createTmpDir(next) {
739
+ this.tempDir = temp.path({prefix: 'com.palm.ares.hermes.bdOpenwebOS'}) + '.d';
740
+ log.verbose("package#createTmpDir()", "temp dir:", this.tempDir);
741
+ mkdirp(this.tempDir, next);
742
+ }
743
+
744
+ function createAppDir(next) {
745
+ if (this.appCount === 0) {
746
+ return setImmediate(next);
747
+ }
748
+
749
+ try {
750
+ this.applicationDir = path.resolve(this.tempDir, "data/usr/palm/applications", this.appinfo.id);
751
+ log.info("package#createAppDir()", "application dir:" + this.applicationDir);
752
+ mkdirp(this.applicationDir, next);
753
+ } catch (err) {
754
+ return setImmediate(next, err);
755
+ }
756
+ }
757
+
758
+ function copySrcToDst(src, dst, next) {
759
+ const fileList = [],
760
+ self = this,
761
+ requireMinify = !!((!!self.minify && !self.minifyDone));
762
+ src = path.normalize(path.resolve(src));
763
+ dst = path.normalize(path.resolve(dst));
764
+
765
+ async.series([
766
+ function(next) {
767
+ const stat = fs.statSync(src);
768
+ if (stat.isFile()) {
769
+ _pushList(fileList, 'file', path.dirname(src), path.basename(src), true, null);
770
+ setImmediate(next);
771
+ } else {
772
+ _getFileList(src, src, fileList, next);
773
+ }
774
+ },
775
+ _copySrcToDst.bind(null, fileList, dst, requireMinify)
776
+ ], function(err) {
777
+ next(err);
778
+ });
779
+
780
+ function _pushList(list, type, basePath, relPath, isSubPath, indRelPath) {
781
+ if (!FILE_TYPE[type]) {
782
+ return;
783
+ }
784
+ list.push({
785
+ type: type,
786
+ basePath: basePath,
787
+ relPath: relPath,
788
+ isSubPath: isSubPath,
789
+ indRelPath: indRelPath
790
+ });
791
+ }
792
+
793
+ function _getFileList(dirPath, basePath, files, next) {
794
+ // TODO: the following code should be more concise.
795
+ // Handling symbolic links
796
+ // if the path sym-link indicates is a sub-path of source directory, treat a sym-link as it is.
797
+ // otherwise the files sym-link indicates should be copied
798
+ async.waterfall([
799
+ fs.readdir.bind(null, dirPath),
800
+ function(fileNames, next) {
801
+ if (fileNames.length === 0) {
802
+ _pushList(files, 'dir', basePath, path.relative(basePath, dirPath), true, null);
803
+ return setImmediate(next);
804
+ }
805
+
806
+ async.forEachSeries(fileNames, function(fileName, next) {
807
+ const filePath = path.join(dirPath, fileName),
808
+ relPath = path.relative(basePath, filePath);
809
+
810
+ async.waterfall([
811
+ fs.lstat.bind(null, filePath),
812
+ function(lstat, next) {
813
+ if (lstat.isSymbolicLink()) {
814
+ let indicateFullPath;
815
+ try {
816
+ indicateFullPath = fs.realpathSync(filePath);
817
+ } catch (err) {
818
+ if (err.code === 'ENOENT') {
819
+ log.warn("The file for symbolic link (" + filePath + ") is missing...");
820
+ return setImmediate(next);
821
+ }
822
+ return setImmediate(next, err);
823
+ }
824
+
825
+ const indicateRelPath = fs.readlinkSync(filePath);
826
+ if (indicateFullPath.indexOf(basePath) !== -1) {
827
+ _pushList(files, 'symlink', basePath, relPath, true, indicateRelPath);
828
+ } else {
829
+ const stat = fs.statSync(filePath);
830
+ if (stat.isDirectory()) {
831
+ return _getFileList(filePath, basePath, files, next);
832
+ } else if (stat.isFile()) {
833
+ _pushList(files, 'file', basePath, relPath, true, null);
834
+ }
835
+ }
836
+ setImmediate(next);
837
+ } else if (lstat.isDirectory()) {
838
+ return _getFileList(filePath, basePath, files, next);
839
+ } else if (lstat.isFile()) {
840
+ _pushList(files, 'file', basePath, relPath, true, null);
841
+ setImmediate(next);
842
+ } else {
843
+ setImmediate(next);
844
+ }
845
+ }
846
+ ], next); // async.waterfall
847
+ }, next); // async.forEach
848
+ }
849
+ ], function(err) {
850
+ return setImmediate(next, err);
851
+ }); // async.waterfall
852
+ }
853
+
854
+ function _copySrcToDst(files, dstPath, minify, next) {
855
+ try {
856
+ async.forEachSeries(files, function(file, next) {
857
+ if (!FILE_TYPE[file.type]) {
858
+ log.verbose("package#copySrcToDst()#_copySrcToDst()", "ignore 'unknown file type'("+file.type+")");
859
+ return;
860
+ }
861
+
862
+ if (!file.relPath) {
863
+ log.verbose("package#copySrcToDst()#_copySrcToDst()", "ignore 'unknown path'");
864
+ return setImmediate(next);
865
+ }
866
+
867
+ if (file.type === FILE_TYPE.dir) {
868
+ mkdirp.sync(path.join(dstPath, file.relPath));
869
+ return setImmediate(next);
870
+ }
871
+
872
+ const dstDirPath = path.dirname(path.join(dstPath, file.relPath));
873
+ if (!fs.existsSync(dstDirPath)) {
874
+ mkdirp.sync(dstDirPath);
875
+ }
876
+
877
+ if (file.type === FILE_TYPE.symlink) {
878
+ if (file.isSubPath && file.indRelPath) {
879
+ const linkFile = path.join(dstPath, file.relPath);
880
+ if (fs.existsSync(linkFile)) {
881
+ if (fs.lstatSync(linkFile).isSymbolicLink()) {
882
+ fs.unlinkSync(linkFile);
883
+ }
884
+ }
885
+ fs.symlinkSync(file.indRelPath, linkFile, null);
886
+ }
887
+ } else {
888
+ const sourceFile = path.join(file.basePath, file.relPath);
889
+ if (fs.existsSync(sourceFile)) {
890
+ if (minify && '.js' === path.extname(sourceFile) && file.relPath.indexOf('node_modules') === -1) {
891
+ log.verbose("package#copySrcToDst()#_copySrcToDst()", "require minification # sourceFile:", sourceFile);
892
+ try {
893
+ const data = uglify.minify(fs.readFileSync(sourceFile,'utf8'));
894
+ if (data.error) {
895
+ throw data.error;
896
+ }
897
+ fs.writeFileSync(path.join(dstPath, file.relPath), data.code, 'utf8');
898
+ } catch (e) {
899
+ log.verbose("package#copySrcToDst()#_copySrcToDst()", util.format('Failed to uglify code %s: %s', sourceFile, e.stack));
900
+ return setImmediate(next, errHndl.getErrMsg("FAILED_MINIFY", sourceFile));
901
+ }
902
+ } else {
903
+ shelljs.cp('-Rf', sourceFile, path.join(dstPath, file.relPath, '..'));
904
+ }
905
+ } else {
906
+ log.verbose("package#copySrcToDst()#_copySrcToDst()", "ignore '" + file.relPath + "'");
907
+ }
908
+ }
909
+ setImmediate(next);
910
+ }, function(err) {
911
+ if (!err && minify) {
912
+ self.minifyDone = true;
913
+ }
914
+ setImmediate(next, err);
915
+ });
916
+ } catch(err) {
917
+ setImmediate(next, err);
918
+ }
919
+ }
920
+ }
921
+
922
+ function checkELFHeader(next) {
923
+ const self = this,
924
+ ELF_HEADER_LEN = 64,
925
+ buf = Buffer.alloc(ELF_HEADER_LEN),
926
+ mainFile = path.resolve(path.join(this.appDir, this.appinfo.main));
927
+
928
+ if (!fs.existsSync(mainFile)) {
929
+ return setImmediate(next, errHndl.getErrMsg("NOT_EXIST_PATH", mainFile));
930
+ }
931
+
932
+ const fd = fs.openSync(mainFile, 'r'),
933
+ stats = fs.fstatSync(fd),
934
+ elfParser = new ElfParser(),
935
+ _isELF = function(_buf) {
936
+ if (_buf.slice(0, 4).toString() !== '\x7fELF') {
937
+ return false;
938
+ } else {
939
+ return true;
940
+ }
941
+ };
942
+
943
+ if (stats.size < ELF_HEADER_LEN) {
944
+ log.verbose("package#checkELFHeader()", "file size is smaller than ELF Header size");
945
+ return setImmediate(next);
946
+ }
947
+
948
+ fs.read(fd, buf, 0, ELF_HEADER_LEN, 0, function(err, bytesRead, _buf) {
949
+ if (bytesRead < ELF_HEADER_LEN || err) {
950
+ log.silly("package#checkELFHeader()", "err:", err, ", bytesRead:", bytesRead);
951
+ log.silly("package#checkELFHeader()", "readBuf to parse ELF header is small or error occurred during reading file.");
952
+ return setImmediate(next);
953
+ }
954
+
955
+ if (!_isELF(_buf)) {
956
+ log.silly("package#checkELFHeader()", mainFile + " is not ELF format");
957
+ } else {
958
+ log.silly("package#checkELFHeader()", mainFile + " is ELF format");
959
+ try {
960
+ const elfHeader = elfParser.parseHeader(_buf);
961
+ log.silly("package#checkELFHeader()", "elfHeader:", elfHeader);
962
+
963
+ if (elfHeader.machine && elfHeader.machine.match(/86$/)) {
964
+ // current emulator opkg is allowing only all, noarch and i586.
965
+ // when it is used with --offline-root.
966
+ self.architecture = 'i586';
967
+ } else if (elfHeader.machine && elfHeader.machine.match(/amd64$/)) {
968
+ // change amd64 to x86_64
969
+ self.architecture = 'x86_64';
970
+ } else if (elfHeader.machine && elfHeader.machine.match(/AArch64$/)) {
971
+ // change AArch64 to aarch64
972
+ self.architecture = 'aarch64';
973
+ } else {
974
+ self.architecture = elfHeader.machine;
975
+ }
976
+ } catch(e) {
977
+ log.verbose("package#checkELFHeader()", "exception:", e);
978
+ }
979
+ }
980
+ log.verbose("package#checkELFHeader()", "machine:", self.architecture);
981
+ fs.close(fd);
982
+ setImmediate(next);
983
+ });
984
+ }
985
+
986
+ function copyApp(next) {
987
+ if (this.appCount === 0) {
988
+ return setImmediate(next);
989
+ }
990
+
991
+ this.dataCopyCount++;
992
+ log.info("package#copyApp()", "copy " + this.appDir + " ==> " + this.applicationDir);
993
+ copySrcToDst.call(this, this.appDir, this.applicationDir, next);
994
+ }
995
+
996
+ function copyAssets(next) {
997
+ if (this.appCount === 0) {
998
+ return setImmediate(next);
999
+ }
1000
+
1001
+ try {
1002
+ async.forEachSeries(this.appinfo.assets, _handleAssets.bind(this), next);
1003
+ } catch (err) {
1004
+ return setImmediate(next, err);
1005
+ }
1006
+
1007
+ function _handleAssets(file, next) {
1008
+ if (path.resolve(this.originAppDir) === path.resolve(this.appDir)) {
1009
+ _checkAppinfo.call(this, file, next);
1010
+ } else {
1011
+ async.series([
1012
+ _checkAppinfo.bind(this, file),
1013
+ _copyAssets.bind(this, file)
1014
+ ], next);
1015
+ }
1016
+ }
1017
+
1018
+ function _checkAppinfo(file, next) {
1019
+ let source;
1020
+ if (path.resolve(file) === path.normalize(file)) {
1021
+ return next(errHndl.getErrMsg("NOT_RELATIVE_PATH_APPINFO", file));
1022
+ } else {
1023
+ source = path.join(this.originAppDir, file);
1024
+ }
1025
+
1026
+ if (path.resolve(source).indexOf(this.originAppDir) !== 0) {
1027
+ return next(errHndl.getErrMsg("NOT_RELATIVE_PATH_APPINFO", file));
1028
+ }
1029
+
1030
+ if (!fs.existsSync(source) && !this.rom) {
1031
+ const msg = errHndl.getErrMsg("NOT_EXIST_PATH", file);
1032
+ if (path.basename(source).indexOf('$') === 0) {
1033
+ // ignore property with starting $ prefix (dynamic property handling in the platform)
1034
+ return setImmediate(next);
1035
+ } else {
1036
+ return setImmediate(next, msg);
1037
+ }
1038
+ }
1039
+ setImmediate(next);
1040
+ }
1041
+
1042
+ function _copyAssets(file, next) {
1043
+ log.verbose("package#copyAssets()#_copyAssets", "'" + file + "' will be located in app directory");
1044
+ const source = path.join(this.originAppDir, file),
1045
+ destination = this.appDir;
1046
+
1047
+ async.series([
1048
+ function(next) {
1049
+ if (!fs.existsSync(destination)) {
1050
+ mkdirp(destination, next);
1051
+ } else {
1052
+ setImmediate(next);
1053
+ }
1054
+ }
1055
+ ], function(err) {
1056
+ if (err) {
1057
+ return setImmediate(next, err);
1058
+ }
1059
+ shelljs.cp('-Rf', source, destination);
1060
+ setImmediate(next);
1061
+ });
1062
+ }
1063
+ }
1064
+
1065
+ function excludeIpkFileFromApp(next) {
1066
+ // Exclude a pre-built .ipk file
1067
+ this.excludeFiles = this.excludeFiles.concat([
1068
+ // eslint-disable-next-line no-useless-escape
1069
+ "[.]*[\\.]ipk",
1070
+ ".DS_Store",
1071
+ // ".vscode",
1072
+ // ".reloadignore",
1073
+ // ".launchparams.json"
1074
+ ]);
1075
+ setImmediate(next);
1076
+ }
1077
+
1078
+ function _retrieve(list, regExp, dirPath, depth, next) {
1079
+ async.waterfall([
1080
+ fs.readdir.bind(null, dirPath), function(fileNames, next) {
1081
+ async.forEach(fileNames, function(fileName, next) {
1082
+ const filePath = path.join(dirPath, fileName);
1083
+ async.waterfall([
1084
+ fs.lstat.bind(null, filePath), function(stat, next) {
1085
+ let result = false;
1086
+ if (depth > 1 && regExp.test(filePath)) {
1087
+ result = true;
1088
+ list.push(filePath);
1089
+ }
1090
+
1091
+ if (!result && stat.isDirectory()) {
1092
+ _retrieve(list, regExp, filePath, depth + 1, next);
1093
+ } else {
1094
+ setImmediate(next);
1095
+ }
1096
+ }
1097
+ ], next);
1098
+ }, next);
1099
+ }
1100
+ ], function(err) {
1101
+ setImmediate(next, err);
1102
+ });
1103
+ }
1104
+
1105
+ function excludeFromApp(middleCb, next) {
1106
+ let excludes;
1107
+ if (this.appCount === 0) {
1108
+ excludes = this.excludeFiles;
1109
+ } else {
1110
+ excludes = this.excludeFiles.concat(this.appinfo.exclude || []);
1111
+ }
1112
+
1113
+ const regExpQueries = excludes.map(function(exclude) {
1114
+ return exclude.replace(/^\./g,"^\\.").replace(/^\*/g,"").replace(/$/g,"$");
1115
+ }, this),
1116
+ strRegExp = regExpQueries.join("|"),
1117
+ regExp = new RegExp(strRegExp, "i"),
1118
+ excludeList = [],
1119
+ tempDirPrefix = path.resolve(this.tempDir, "data/usr/palm");
1120
+
1121
+ async.series([
1122
+ _retrieve.bind(this, excludeList, regExp, tempDirPrefix, 0), function(next) {
1123
+ const meta_files = ["appinfo.json", "services.json", "packageinfo.json", "resourceinfo.json"],
1124
+ unexcludable = [],
1125
+ excluded = [];
1126
+ try {
1127
+ excludeList.forEach(function(file) {
1128
+ if (meta_files.includes(path.basename(file))) {
1129
+ unexcludable.push(path.basename(file));
1130
+ } else {
1131
+ const sliced = file.slice(tempDirPrefix.length + 1);
1132
+ excluded.push(sliced.slice(sliced.indexOf(path.sep) + 1));
1133
+ shelljs.rm('-rf', file);
1134
+ }
1135
+ });
1136
+ if (unexcludable.length > 0) {
1137
+ middleCb("Cannot exclude: " + unexcludable); // FIXME
1138
+ }
1139
+ if (excluded.length > 0) {
1140
+ middleCb("Excluded: " + excluded); // FIXME
1141
+ }
1142
+ setImmediate(next);
1143
+ } catch(err) {
1144
+ setImmediate(next, err);
1145
+ }
1146
+ }
1147
+ ], function(err) {
1148
+ if (err) {
1149
+ return setImmediate(next, err);
1150
+ }
1151
+ setImmediate(next);
1152
+ });
1153
+ }
1154
+
1155
+ function createPackageDir(next) {
1156
+ if (!this.rom) {
1157
+ const pkgDirName = this.pkgId || this.appinfo.id;
1158
+ this.packageDir = path.join(this.tempDir, "data/usr/palm/packages", pkgDirName);
1159
+ log.verbose("package#createPackageDir", "directory:", this.packageDir);
1160
+ mkdirp(this.packageDir, next);
1161
+ } else {
1162
+ setImmediate(next);
1163
+ }
1164
+ }
1165
+
1166
+ function fillPackageDir(next) {
1167
+ log.verbose("fillPackageDir");
1168
+
1169
+ if (!this.rom) {
1170
+ let data = "";
1171
+ if (this.pkginfo) {
1172
+ // Use pkginfofile option or PKG_DIR
1173
+ if (!this.pkginfo.version) {
1174
+ this.pkginfo.version = this.pkgVersion || "1.0.0";
1175
+ }
1176
+ if (this.appinfo) {
1177
+ this.pkginfo.app = this.appinfo.id;
1178
+ }
1179
+ _checkPkgInfo(this.pkginfo.id, this.pkginfo.version, next);
1180
+ data = JSON.stringify(this.pkginfo, null, 2) + "\n";
1181
+ } else {
1182
+ // Use pkgid option or no option
1183
+ const pkginfo = {
1184
+ "id": this.pkgId || this.appinfo.id,
1185
+ "version": this.pkgVersion || "1.0.0"
1186
+ };
1187
+ if (this.appinfo) {
1188
+ pkginfo.app = this.appinfo.id;
1189
+ }
1190
+ _checkPkgInfo(pkginfo.id, pkginfo.version, next);
1191
+ data = JSON.stringify(pkginfo, null, 2) + "\n";
1192
+ }
1193
+ log.verbose("Generating packageinfo.json: " + data);
1194
+ fs.writeFile(path.join(this.packageDir, "packageinfo.json"), data, next);
1195
+ } else {
1196
+ setImmediate(next);
1197
+ }
1198
+
1199
+ function _checkPkgInfo(id, version, next) {
1200
+ if (!(/^[a-z0-9.+-]*$/.test(id))) {
1201
+ log.error(errHndl.getErrMsg("INVALID_VALUE", "pkg id", id));
1202
+ return setImmediate(next, errHndl.getErrMsg("INVALID_ID_RULE"));
1203
+ }
1204
+
1205
+ if (!(/^([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)\.([1-9]\d{0,8}|\d)$/.test(version))) {
1206
+ log.error(errHndl.getErrMsg("INVALID_VALUE", "pkg version", version));
1207
+ return setImmediate(next, errHndl.getErrMsg("INVALID_VERSION_RULE"));
1208
+ }
1209
+ }
1210
+ }
1211
+
1212
+
1213
+ function loadPackageProperties(inDirs, next) {
1214
+ const self = this;
1215
+ self.packageProperties = {};
1216
+
1217
+ async.forEach(inDirs, function(inDir, next) {
1218
+ const filename = path.join(inDir, "package.properties");
1219
+
1220
+ function _checkFileMode(file) {
1221
+ file = file.replace(/\\/g, "/").trim();
1222
+ const idx = file.lastIndexOf("/");
1223
+ file = (idx !== -1) ? file.slice(idx + 1) : file;
1224
+ self.packageProperties[file] = this.fileMode;
1225
+ }
1226
+
1227
+ if (fs.existsSync(filename)) {
1228
+ const data = fs.readFileSync(filename);
1229
+ try {
1230
+ const lines = data.toString().split("\n");
1231
+ let seperatorIndex;
1232
+
1233
+ for (const i in lines) {
1234
+ if (lines[i].indexOf("filemode.") === 0) {
1235
+ seperatorIndex = lines[i].indexOf("=");
1236
+ const fileList = lines[i].slice(seperatorIndex + 1).trim(),
1237
+ fileArray = fileList.split(",");
1238
+ this.fileMode = lines[i].slice(9, seperatorIndex).trim();
1239
+
1240
+ fileArray.forEach(_checkFileMode);
1241
+ }
1242
+ }
1243
+ setImmediate(next);
1244
+ } catch (error) {
1245
+ setImmediate(next, error);
1246
+ }
1247
+ } else {
1248
+ setImmediate(next);
1249
+ }
1250
+ }, function(err) {
1251
+ // Exclude package.propeties from ipk file
1252
+ self.excludeFiles = self.excludeFiles.concat([
1253
+ "package.properties"
1254
+ ]);
1255
+ setImmediate(next, err);
1256
+ });
1257
+ }
1258
+
1259
+ function outputPackage(destination, next) {
1260
+ log.info("package#outputPackage()");
1261
+
1262
+ // Check that the directories exist
1263
+ if (fs.existsSync(destination)) {
1264
+ const stats = fs.statSync(destination);
1265
+ if (!stats.isDirectory()) {
1266
+ return next(errHndl.getErrMsg("NOT_DIRTYPE_PATH", destination));
1267
+ }
1268
+ } else {
1269
+ log.verbose("setOutputDir()", "creating directory '" + destination + "' ...");
1270
+ mkdirp.sync(destination);
1271
+ }
1272
+ destination = fs.realpathSync(destination);
1273
+
1274
+ if (this.rom) {
1275
+ copySrcToDst.call(this, path.join(this.tempDir, 'data'), destination, next);
1276
+ } else {
1277
+ const tempDir = this.tempDir,
1278
+ tempCtrlDir = path.join(tempDir, 'ctrl'),
1279
+ ctrlTgzFile = path.join(tempDir, 'control.tar.gz'),
1280
+ tempDataDir = path.join(tempDir, 'data'),
1281
+ dataTgzFile = path.join(tempDir, 'data.tar.gz');
1282
+
1283
+ async.series([
1284
+ decidePkgName.bind(this, this.pkgId, this.pkgVersion),
1285
+ getFileSize.bind(this, tempDataDir),
1286
+ makeTgz.bind(this, tempDataDir, dataTgzFile),
1287
+ createDir.bind(this, tempCtrlDir),
1288
+ createDataHash.bind(this, tempCtrlDir, dataTgzFile),
1289
+ createCertificateHash.bind(this, tempCtrlDir),
1290
+ createControlFile.bind(this, tempCtrlDir, false),
1291
+ createSign.bind(this, tempCtrlDir, dataTgzFile),
1292
+ createControlSignFile.bind(this, tempCtrlDir),
1293
+ makeTgz.bind(this, tempCtrlDir, ctrlTgzFile),
1294
+ createDebianBinary.bind(this, tempDir),
1295
+ setIpkFileName.bind(this),
1296
+ removeExistingIpk.bind(this, destination),
1297
+ makeIpk.bind(this, tempDir)
1298
+ ], function(err) {
1299
+ if (err) {
1300
+ setImmediate(next, err);
1301
+ return;
1302
+ }
1303
+ setImmediate(next);
1304
+ });
1305
+ }
1306
+ }
1307
+
1308
+ function decidePkgName(pkgName, pkgVersion, next) {
1309
+ if (this.appCount !== 0) {
1310
+ this.pkg = {
1311
+ name: pkgName || this.appinfo.id,
1312
+ version: pkgVersion || this.appinfo.version
1313
+ };
1314
+ } else if (this.services.length > 0) {
1315
+ this.pkg = {
1316
+ name: pkgName || this.services[0].serviceInfo.id || this.services[0].serviceInfo.services[0].name,
1317
+ version: pkgVersion || "1.0.0"
1318
+ };
1319
+ } else {
1320
+ this.pkg = {
1321
+ name: pkgName || "unknown",
1322
+ version: pkgVersion || "1.0.0"
1323
+ };
1324
+ }
1325
+ setImmediate(next);
1326
+ }
1327
+
1328
+ function getFileSize(srcDir, next) {
1329
+ const self = this;
1330
+
1331
+ async.waterfall([
1332
+ _readSizeRecursive.bind(this, srcDir)
1333
+ ], function(err, size) {
1334
+ if (!err && size) {
1335
+ log.verbose("package#getFileSize()", "Installed-Size:", size);
1336
+ self.size = size;
1337
+ }
1338
+ setImmediate(next, err);
1339
+ });
1340
+
1341
+ function _readSizeRecursive(item, next) {
1342
+ fs.lstat(item, function(err, stats) {
1343
+ let total = stats.size;
1344
+
1345
+ if (!err && stats.isDirectory()) {
1346
+ fs.readdir(item, function(error, list) {
1347
+ if (error) {
1348
+ return next(error);
1349
+ }
1350
+
1351
+ async.forEach(list, function(diritem, callback) {
1352
+ _readSizeRecursive(path.join(item, diritem), function(_err, size) {
1353
+ total += size;
1354
+ callback(_err);
1355
+ });
1356
+ }, function(e) {
1357
+ next(e, total);
1358
+ }
1359
+ );
1360
+ });
1361
+ } else {
1362
+ next(err, total);
1363
+ }
1364
+ });
1365
+ }
1366
+ }
1367
+
1368
+ function createDir(dstPath, next) {
1369
+ log.verbose("package#createDir()", "createDir:" + dstPath);
1370
+ mkdirp(dstPath, next);
1371
+ }
1372
+
1373
+ function createDataHash(dstDir, dataTgzPath, next) {
1374
+ // This function applies only to the signage profile.
1375
+ if (appdata.config.profile !== 'signage') return setImmediate(next);
1376
+
1377
+ const self = this;
1378
+ log.verbose("package#createDataHash()", "Create data hash");
1379
+
1380
+ if (!this.sign) {
1381
+ log.verbose("package#createDataHash()", "App signing skipped");
1382
+ return setImmediate(next);
1383
+ }
1384
+ let signFilePath = path.join(dstDir, "data.tar.gz.sha256.txt");
1385
+ log.verbose("package#createDataHash()", "dataTgzPath : " + dataTgzPath + ", signfile : " + signFilePath);
1386
+
1387
+ let keyPath = path.resolve(this.sign);
1388
+ log.verbose("package#createDataHash()", "keyPath : " + keyPath);
1389
+
1390
+ try {
1391
+ // data.tar.gz can be big size, so it need to use filestream
1392
+ let readStream = fs.createReadStream(dataTgzPath);
1393
+
1394
+ let hasher = crypto.createHash("sha256");
1395
+
1396
+ readStream.on("readable", function() {
1397
+ const data = readStream.read();
1398
+ if (data) {
1399
+ hasher.update(data);
1400
+ }
1401
+ else {
1402
+ self.dataHash = hasher.digest("hex");
1403
+ log.verbose("package#createDataHash()", "Data.tar.gz Hash : " + self.dataHash)
1404
+ setImmediate(next);
1405
+ }
1406
+ });
1407
+ } catch (err) {
1408
+ setImmediate(next, err);
1409
+ }
1410
+ }
1411
+
1412
+ function createCertificateHash(dstDir, next) {
1413
+ // This function applies only to the signage profile.
1414
+ if (appdata.config.profile !== 'signage') return setImmediate(next);
1415
+
1416
+ const self = this;
1417
+ try {
1418
+ if (!self.certificate) {
1419
+ log.verbose("package#createCertificateHash()", "Including certificate skipped");
1420
+ return setImmediate(next);
1421
+ }
1422
+
1423
+ let crtPath = path.join(dstDir, "certifiate.crt");
1424
+ shelljs.cp("-f", path.resolve(self.certificate), crtPath );
1425
+
1426
+ fs.readFile(crtPath, function (err, certData) {
1427
+ if (err) {
1428
+ setImmediate(next, err);
1429
+ return;
1430
+ }
1431
+
1432
+ // Gets hash from certificate
1433
+ self.certificateHash = crypto.createHash("sha256").update(certData);
1434
+ self.certificateHash = self.certificateHash.digest("hex");
1435
+
1436
+ log.verbose("package#createCertificateHash()", "Certificate Hash : " + self.certificateHash);
1437
+
1438
+ setImmediate(next);
1439
+ });
1440
+ } catch (err) {
1441
+ setImmediate(next, err);
1442
+ }
1443
+ }
1444
+
1445
+ function createControlFile(dstDir, encInfo, next) {
1446
+ const dstFilePath = path.join(dstDir, 'control');
1447
+ log.verbose("package#createControlFile()", "createControlFile:" + dstFilePath);
1448
+
1449
+ const lines = [
1450
+ "Package: " + this.pkg.name,
1451
+ "Version: " + this.pkg.version,
1452
+ "Section: misc",
1453
+ "Priority: optional",
1454
+ "Architecture: " + (this.architecture || "all"),
1455
+ "Installed-Size: " + (this.size || 1234), // TODO: TBC
1456
+ "Maintainer: N/A <nobody@example.com>", // TODO: TBC
1457
+ "Description: This is a webOS application.",
1458
+ "webOS-Package-Format-Version: 2", // TODO: TBC
1459
+ "webOS-Packager-Version: x.y.x" // TODO: TBC
1460
+ ];
1461
+
1462
+ // To IPK security (SEAL)
1463
+ // The data hashs apply only to the signage profile.
1464
+ if (this.sign !== null && appdata.config.profile === 'signage') {
1465
+ lines.push('Application-Hash-Algorithm: SHA-256');
1466
+ lines.push('Application-Hash: ' + this.dataHash);
1467
+ }
1468
+ if (this.certificate !== null && appdata.config.profile === 'signage') {
1469
+ lines.push('Certificate-Hash: ' + this.certificateHash);
1470
+ lines.push('Signature-Algorithm: RSA');
1471
+ }
1472
+
1473
+ if (encInfo) {
1474
+ lines.push("Encrypt-Algorithm: AES-256-CBC");
1475
+ }
1476
+ lines.push(''); // for the trailing \n
1477
+ fs.writeFile(dstFilePath, lines.join("\n"), next);
1478
+ }
1479
+
1480
+ function createControlSignFile(ctrlDir, next) {
1481
+ // This function applies only to the signage profile.
1482
+ if (appdata.config.profile !== 'signage') return setImmediate(next);
1483
+
1484
+ try {
1485
+ if (this.sign === null) {
1486
+ log.verbose("package#createControlSignFile()", "App signing is skipped");
1487
+ return setImmediate(next);
1488
+ }
1489
+ let controlFilePath = path.join(ctrlDir, 'control'),
1490
+ controlSignFilePath = path.join(ctrlDir, 'control.sign'),
1491
+ keyPath = path.resolve(this.sign);
1492
+
1493
+ log.verbose("package#createControlSignFile()", "controlFilePath: " + controlFilePath);
1494
+ log.verbose("package#createControlSignFile()", "controlSignFilePath: " + controlSignFilePath);
1495
+ log.verbose("package#createControlSignFile()", "keyPath: " + keyPath);
1496
+
1497
+ let privateKey = fs.readFileSync(keyPath, 'utf-8');
1498
+
1499
+ fs.readFile(controlFilePath, function(err, controlData) {
1500
+ if (err) {
1501
+ setImmediate(next, err);
1502
+ return;
1503
+ }
1504
+
1505
+ // Gets hash from control
1506
+ let controlSigner = crypto.createSign('sha256')
1507
+ controlSigner.update(controlData);
1508
+ controlSigner.end();
1509
+ controlSign = controlSigner.sign(privateKey);
1510
+ let base64data = Buffer.from(controlSign).toString('base64');
1511
+
1512
+ fs.writeFile(controlSignFilePath, base64data, next);
1513
+ });
1514
+ } catch (err) {
1515
+ setImmediate(next, err);
1516
+ }
1517
+ }
1518
+
1519
+ function createSign(dstDir, dataTgzPath, next) {
1520
+ // This function does not apply to the signage profile.
1521
+ if (appdata.config.profile === 'signage') return setImmediate(next);
1522
+
1523
+ if ((!this.sign) || (!this.certificate)) {
1524
+ log.verbose("package#createSign()", "App signing is skipped");
1525
+ return setImmediate(next);
1526
+ }
1527
+
1528
+ const sigFilePath = path.join(dstDir, 'data.tar.gz.sha256.txt'),
1529
+ keyPath = path.resolve(this.sign),
1530
+ crtPath = path.resolve(this.certificate);
1531
+
1532
+ log.verbose("package#createSign()", "dataTgzPath:" + dataTgzPath + ", sigfile:" + sigFilePath);
1533
+ log.verbose("package#createSign()", "keyPath:" + keyPath + ", crtPath:" + crtPath);
1534
+
1535
+ try {
1536
+ // Create certificate to tmp/ctrl directory
1537
+ shelljs.cp('-f', crtPath, dstDir);
1538
+
1539
+ // Create signature and write data.tar.gz.sha256.txt
1540
+ const privateKey = fs.readFileSync(keyPath, 'utf-8'),
1541
+ dataFile = fs.readFileSync(dataTgzPath), // data.tar.gz
1542
+ signer = crypto.createSign('sha256');
1543
+
1544
+ signer.update(dataFile);
1545
+ signer.end();
1546
+
1547
+ const signature = signer.sign(privateKey),
1548
+ buff = Buffer.from(signature),
1549
+ base64data = buff.toString('base64');
1550
+
1551
+ fs.writeFile(sigFilePath, base64data, next);
1552
+ } catch (err) {
1553
+ setImmediate(next, err);
1554
+ }
1555
+ }
1556
+
1557
+ function createDebianBinary(dstDir, next) {
1558
+ const dstFilePath = path.join(dstDir, "debian-binary");
1559
+ log.verbose("package#createDebianBinary()", dstFilePath);
1560
+ fs.writeFile(dstFilePath, "2.0\n", next);
1561
+ }
1562
+
1563
+ function makeTgz(srcDir, dstDir, next) {
1564
+ log.verbose("package#makeTgz()", "makeTgz " + dstDir + " from " + srcDir);
1565
+ const pkgServiceNames = this.pkgServiceNames;
1566
+ // @see https://github.com/isaacs/node-tar/issues/7
1567
+ // it is a workaround for packaged ipk on windows can set +x into directory
1568
+ const fixupDirs = function (filePath, entry) {
1569
+ const fileOrFolderName = filePath.split("/").pop();
1570
+ // opkg does not support Posix Tar fully
1571
+ if (fileOrFolderName.length !== Buffer.byteLength(fileOrFolderName)) {
1572
+ const errMsg = "Please use the file name in english letters. \n\t\t (" + filePath + ")",
1573
+ em = new (require('events').EventEmitter)();
1574
+ em.emit('error', new Error(errMsg));
1575
+ }
1576
+ // Make sure readable directories have execute permission
1577
+ if (entry.isDirectory()) {
1578
+ let maskingBits = 201; // 0311
1579
+ // special case for service directory should have writable permission.
1580
+ if (pkgServiceNames.indexOf(fileOrFolderName) !== -1) {
1581
+ maskingBits = 219; // 0333
1582
+ }
1583
+ entry.mode |= (entry.mode >>> 2) & maskingBits;
1584
+ } else if (entry.isFile()) {
1585
+ // Add other user's readable permission to all files
1586
+ entry.mode |= 4; // 04
1587
+ }
1588
+ if (entry.uid > 0o7777777) {
1589
+ entry.uid = 0;
1590
+ }
1591
+
1592
+ if (entry.gid > 0o7777777) {
1593
+ entry.gid = 0;
1594
+ }
1595
+
1596
+ return true;
1597
+ };
1598
+
1599
+ fs.readdir(srcDir, function (err, fileList) {
1600
+ if (err) setImmediate(next, err);
1601
+ else {
1602
+ tar.c({
1603
+ file: dstDir,
1604
+ gzip: true,
1605
+ cwd: srcDir,
1606
+ filter: fixupDirs
1607
+ }, fileList)
1608
+ .then(() => setImmediate(next))
1609
+ .catch(error => setImmediate(next, error));
1610
+ }
1611
+ });
1612
+ }
1613
+
1614
+ function setIpkFileName(next) {
1615
+ let filename = this.pkg.name;
1616
+ if (this.pkg.version) {
1617
+ // This is asked to replace 'x86' from 'i586' as a file suffix (From NDK)
1618
+ const archSuffix = ('i586' === this.architecture) ? 'x86' : (this.architecture || 'all');
1619
+ filename = filename.concat("_" + this.pkg.version + "_" + archSuffix + ".ipk");
1620
+ } else {
1621
+ filename = filename.concat(".ipk");
1622
+ }
1623
+ this.ipkFileName = filename;
1624
+ this.plainIpkFileName = filename + '_plain';
1625
+ setImmediate(next);
1626
+ }
1627
+
1628
+ function removeExistingIpk(destination, next) {
1629
+ if (this.appCount === 0) {
1630
+ return setImmediate(next);
1631
+ }
1632
+
1633
+ const filename = path.join(destination, this.ipkFileName);
1634
+ fs.exists(filename, function(exists) {
1635
+ if (exists) {
1636
+ fs.unlink(filename, next);
1637
+ } else {
1638
+ setImmediate(next); // Nothing to do
1639
+ }
1640
+ });
1641
+ }
1642
+
1643
+ function padSpace(input, length) {
1644
+ // max field length in ar is 16
1645
+ const ret = String(input + ' ');
1646
+ return ret.slice(0, length);
1647
+ }
1648
+
1649
+ function arFileHeader(name, size) {
1650
+ const epoch = Math.floor(Date.now() / 1000) ;
1651
+ return padSpace(name, 16) +
1652
+ padSpace(epoch, 12) +
1653
+ "0 " + // UID, 6 bytes
1654
+ "0 " + // GID, 6 bytes
1655
+ "100644 " + // file mode, 8 bytes
1656
+ padSpace(size, 10) +
1657
+ "\x60\x0A"; // don't ask
1658
+ }
1659
+
1660
+ function makeIpk(srcDir, next) {
1661
+ this.IpkDir = srcDir;
1662
+ this.ipk = path.join(srcDir, this.ipkFileName);
1663
+ log.info("package#makeIpk()", "makeIpk in dir " + this.IpkDir + " file " + this.ipkFileName);
1664
+
1665
+ if (this.nativecmd) { // TODO: TBR
1666
+ shelljs.cd(this.IpkDir);
1667
+ shelljs.exec("ar -q " + this.ipk + " debian-binary control.tar.gz data.tar.gz", {silent: this.silent});
1668
+
1669
+ setImmediate(next);
1670
+ return;
1671
+ }
1672
+
1673
+ // global header, see http://en.wikipedia.org/wiki/Ar_%28Unix%29
1674
+ const header = "!<arch>\n",
1675
+ debBinary = arFileHeader("debian-binary",4) + "2.0\n",
1676
+ that = this,
1677
+ arStream = CombinedStream.create(),
1678
+ pkgFiles = [ 'control.tar.gz', 'data.tar.gz' ],
1679
+ ipkStream = fstream.Writer(this.ipk);
1680
+
1681
+ arStream.append(header + debBinary);
1682
+ pkgFiles.forEach(function(f) {
1683
+ const fpath = path.join(that.IpkDir, f),
1684
+ s = fstream.Reader({ path: fpath, type: 'File'}),
1685
+ stat = fs.statSync(fpath); // TODO: move to asynchronous processing
1686
+
1687
+ arStream.append(arFileHeader(f, stat.size));
1688
+ arStream.append(s);
1689
+ if ((stat.size % 2) !== 0) {
1690
+ log.verbose("package#makeIpk()", 'adding a filler for file ' + f);
1691
+ arStream.append('\n');
1692
+ }
1693
+ }, this);
1694
+
1695
+ arStream.pipe(ipkStream);
1696
+ ipkStream.on('close', function() {
1697
+ setImmediate(next);
1698
+ });
1699
+ ipkStream.on('error', next);
1700
+ }
1701
+
1702
+ function cleanupTmpDir(middleCb, next) {
1703
+ if (this.noclean) {
1704
+ middleCb("Skipping removal of " + this.tempDir);
1705
+ setImmediate(next);
1706
+ } else {
1707
+ rimraf(this.tempDir, function(err) {
1708
+ log.verbose("package#cleanupTmpDir()", "removed " + this.tempDir);
1709
+ setImmediate(next, err);
1710
+ }.bind(this));
1711
+ }
1712
+ }
1713
+
1714
+ function checkDirectory(options, directory, callback) {
1715
+ log.verbose("package#checkDirectory()", directory);
1716
+ if (fs.existsSync(directory)) { // TODO: move to asynchronous processing
1717
+ const stat = fs.statSync(directory);
1718
+ if (!stat.isDirectory()) {
1719
+ callback(errHndl.getErrMsg("NOT_DIRTYPE_PATH", directory));
1720
+ return;
1721
+ }
1722
+ directory = fs.realpathSync(directory);
1723
+ } else {
1724
+ callback(errHndl.getErrMsg("NOT_EXIST_PATH", directory));
1725
+ return;
1726
+ }
1727
+
1728
+ if (options.force) {
1729
+ return callback();
1730
+ }
1731
+
1732
+ if (fs.existsSync(path.join(directory, "packageinfo.json"))) {
1733
+ return callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_PKGDIR"));
1734
+ }
1735
+
1736
+ if (fs.existsSync(path.join(directory, "appinfo.json"))) {// TODO: move to asynchronous processing
1737
+ this.appCount++;
1738
+ log.verbose("package#checkDirectory()", "FOUND appinfo.json, appCount " + this.appCount);
1739
+
1740
+ if (this.appCount > 1) {
1741
+ callback(errHndl.getErrMsg("OVER_APPCOUNT"));
1742
+ } else if (this.rscCount > 0) {
1743
+ callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1744
+ } else {
1745
+ this.appDir = directory;
1746
+ this.originAppDir = directory;
1747
+ if (fs.existsSync(path.join(directory, "package.js"))) {
1748
+ this.pkgJSExist = true;
1749
+ }
1750
+ callback();
1751
+ }
1752
+ } else if (fs.existsSync(path.join(directory, "services.json"))) {
1753
+ if (this.rscCount > 0) {
1754
+ callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1755
+ }
1756
+ this.svcDir = this.svcDir || [];
1757
+ this.svcDir = this.svcDir.concat(directory);
1758
+ callback();
1759
+ } else if (fs.existsSync(path.join(directory, "resourceinfo.json"))) {
1760
+ this.rscCount++;
1761
+ log.verbose("FOUND resourceinfo.json, rscCount " + this.rscCount);
1762
+ if (this.appCount > 0 || this.svcDir && this.svcDir.length > 0) {
1763
+ return callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1764
+ }
1765
+ this.resources = this.resources || [];
1766
+ const rsc = {};
1767
+ rsc.dir = directory;
1768
+ this.resources = this.resources.concat(rsc);
1769
+ callback();
1770
+ } else if (fs.existsSync(path.join(directory, "account-templates.json"))) {
1771
+ callback(errHndl.getErrMsg("NO_ACCOUNT"));
1772
+ } else {
1773
+ // find service directory recursively
1774
+ const foundSvcDirs = [];
1775
+ this.svcDir = this.svcDir || [];
1776
+ this.svcDir = this.svcDir.concat(directory);
1777
+
1778
+ findServiceDir.call(this, foundSvcDirs, function() {
1779
+ if (foundSvcDirs.length > 0) {
1780
+ if (this.rscCount > 0) {
1781
+ callback(errHndl.getErrMsg("NOT_PACKAGE_WITH_RESOURCE"));
1782
+ }
1783
+ callback();
1784
+ } else {
1785
+ callback(errHndl.getErrMsg("NO_METAFILE", "APP_DIR/SVC_DIR", directory));
1786
+ }
1787
+ });
1788
+ }
1789
+ }
1790
+
1791
+ // find service directories checking if directory has services.json file
1792
+ function findServiceDir(services, next) {
1793
+ const checkDirs = [].concat(this.svcDir || this.originAppDir || []),
1794
+ foundFilePath = [];
1795
+ if (checkDirs.length === 0) {
1796
+ return setImmediate(next);
1797
+ }
1798
+
1799
+ async.forEach(checkDirs, function(checkDir, next) {
1800
+ walkFolder(checkDir, "services.json", foundFilePath, 3, function(err) {
1801
+ if (err) {
1802
+ return setImmediate(next, err);
1803
+ }
1804
+
1805
+ foundFilePath.forEach(function(filePath) {
1806
+ const svc = new Service();
1807
+ svc.srcDir = path.dirname(filePath);
1808
+ svc.dirName = path.basename(svc.srcDir);
1809
+ services.push(svc);
1810
+ });
1811
+ foundFilePath.pop();
1812
+ setImmediate(next, err);
1813
+ });
1814
+ }, function(err) {
1815
+ setImmediate(next, err);
1816
+ });
1817
+ }
1818
+
1819
+ function walkFolder(dirPath, findFileName, foundFilePath, depth, next) {
1820
+ if (depth <= 0) {
1821
+ return next();
1822
+ }
1823
+ async.waterfall([
1824
+ fs.readdir.bind(null, dirPath),
1825
+ function(fileNames, next) {
1826
+ async.forEach(fileNames, function(fileName, next) {
1827
+ const filePath = path.join(dirPath, fileName);
1828
+ async.waterfall([
1829
+ fs.lstat.bind(null, filePath),
1830
+ function(stat, next) {
1831
+ if (stat.isFile()) {
1832
+ if (fileName === findFileName) {
1833
+ foundFilePath.push(filePath);
1834
+ }
1835
+ next();
1836
+ } else if (stat.isDirectory()) {
1837
+ walkFolder(filePath, findFileName, foundFilePath, (depth-1), next);
1838
+ } else {
1839
+ next();
1840
+ }
1841
+ }
1842
+ ], next); // async.waterfall
1843
+ }, next); // async.forEach
1844
+ }
1845
+ ], function(err) {
1846
+ next(err);
1847
+ }); // async.waterfall
1848
+ }
1849
+
1850
+ // read services.json recursivly
1851
+ function loadServiceInfo(next) {
1852
+ for (const idx in this.services) {
1853
+ const filename = path.join(this.services[idx].srcDir, "services.json");
1854
+ try {
1855
+ const data = fs.readFileSync(filename),
1856
+ info = JSON.parse(data);
1857
+ if (!(Object.prototype.hasOwnProperty.call(info, 'id') &&
1858
+ Object.prototype.hasOwnProperty.call(info, 'services'))) {
1859
+ continue;
1860
+ }
1861
+ this.services[idx].serviceInfo = info;
1862
+ this.services[idx].valid = true;
1863
+ } catch (err) {
1864
+ return setImmediate(next, err);
1865
+ }
1866
+ }
1867
+ log.info("package#loadServiceInfo()", "num of serviceInfo: " + this.services.length);
1868
+ setImmediate(next);
1869
+ }
1870
+
1871
+ // check services.json recursivly
1872
+ function checkServiceInfo(next) {
1873
+ const pkgId = this.pkgId || this.appinfo.id,
1874
+ svcIds = [];
1875
+ let errFlag = false;
1876
+
1877
+ this.services.forEach(function(service) {
1878
+ if (service.valid === false) {
1879
+ return;
1880
+ }
1881
+
1882
+ svcIds.push(getPkgServiceNames(service.serviceInfo)[0]);
1883
+ });
1884
+
1885
+ svcIds.forEach(function(svcId) {
1886
+ if (svcId.indexOf(pkgId + ".") !== 0) {
1887
+ errFlag = true;
1888
+ }
1889
+ });
1890
+
1891
+ if (errFlag) {
1892
+ return setImmediate(next, errHndl.getErrMsg("INVALID_SERVICEID", pkgId));
1893
+ }
1894
+ setImmediate(next);
1895
+ }
1896
+
1897
+ // create dir with each service's name under (tmp) + data/usr/palm/services/
1898
+ function createServiceDir(next) {
1899
+ this.services.forEach(function(service) {
1900
+ if (service.valid === false) {
1901
+ return;
1902
+ }
1903
+
1904
+ getPkgServiceNames(service.serviceInfo).forEach(function(serviceName) {
1905
+ const serviceDir = path.join(this.tempDir, "data/usr/palm/services", serviceName);
1906
+ service.dstDirs.push(serviceDir);
1907
+ try {
1908
+ log.info("package#createServiceDir()", "service dir:" + serviceDir);
1909
+ mkdirp.sync(serviceDir);
1910
+ } catch (err) {
1911
+ return setImmediate(next, err);
1912
+ }
1913
+ }.bind(this));
1914
+ }.bind(this));
1915
+ setImmediate(next);
1916
+ }
1917
+
1918
+ // copy service files into each serviceInfos[x].id directory.
1919
+ function copyService(next) {
1920
+ log.info("package#copyService()");
1921
+ const self = this,
1922
+ validServices = this.services.filter(function(service) {
1923
+ return service.valid;
1924
+ });
1925
+ try {
1926
+ async.forEachSeries(validServices, function(service, next) {
1927
+ async.forEach(service.dstDirs, function(dstDir, next) {
1928
+ self.dataCopyCount++;
1929
+ self.minifyDone = !self.minify;
1930
+ copySrcToDst.call(self, service.srcDir, dstDir, next);
1931
+ }, next);
1932
+ }, next);
1933
+ } catch (err) {
1934
+ setImmediate(next, err);
1935
+ }
1936
+ }
1937
+
1938
+ // add service info into packageinfo.json.
1939
+ function addServiceInPkgInfo(next) {
1940
+ if (!this.rom) {
1941
+ const filename = path.join(this.packageDir, "packageinfo.json");
1942
+ let pkginfo, validServiceCount;
1943
+ try {
1944
+ const data = fs.readFileSync(filename);
1945
+ validServiceCount = 0;
1946
+ pkginfo = JSON.parse(data);
1947
+ log.silly("package#addServiceInPkgInfo()", "PACKAGEINFO:", pkginfo);
1948
+ } catch (err) {
1949
+ console.error(err);
1950
+ setImmediate(next, err);
1951
+ }
1952
+ this.services.filter(function(s) {
1953
+ return s.valid;
1954
+ }).forEach(function(service) {
1955
+ getPkgServiceNames(service.serviceInfo).forEach(function(serviceName) {
1956
+ this.pkgServiceNames.push(serviceName);
1957
+ validServiceCount++;
1958
+ }.bind(this));
1959
+ }.bind(this));
1960
+
1961
+ if (validServiceCount > 0) {
1962
+ pkginfo.services = this.pkgServiceNames;
1963
+ const data = JSON.stringify(pkginfo, null, 2) + "\n";
1964
+ log.silly("package#addServiceInPkgInfo()", "Modified package.json:" + data);
1965
+ fs.writeFile(path.join(this.packageDir, "packageinfo.json"), data, next);
1966
+ } else {
1967
+ setImmediate(next);
1968
+ }
1969
+ } else {
1970
+ setImmediate(next);
1971
+ }
1972
+ }
1973
+
1974
+ // remove service dir from tmp source dir before packaging
1975
+ function removeServiceFromAppDir(middleCb, next) {
1976
+ if (this.appCount === 0) {
1977
+ return setImmediate(next);
1978
+ }
1979
+
1980
+ let checkDir = this.applicationDir,
1981
+ needRmCheckDir = false;
1982
+ const fileList = fs.readdirSync(checkDir);
1983
+
1984
+ function _checkDir(dir) {
1985
+ if (this.dirName === dir) {
1986
+ try {
1987
+ const rmDir = path.join(this.applicationDir, this.dirName);
1988
+ shelljs.rm('-rf', rmDir);
1989
+ } catch (err) {
1990
+ next(Error("ERROR" + err), null);
1991
+ }
1992
+ }
1993
+ }
1994
+
1995
+ if (fileList.indexOf('services') !== -1) {
1996
+ checkDir = path.join(this.applicationDir, 'services');
1997
+ const stats = fs.statSync(checkDir);
1998
+ if (stats.isDirectory()) {
1999
+ needRmCheckDir = true;
2000
+ }
2001
+ }
2002
+ if (needRmCheckDir === true) {
2003
+ try {
2004
+ shelljs.rm('-rf', checkDir);
2005
+ } catch (err) {
2006
+ middleCb("ERROR:" + err);
2007
+ }
2008
+ } else {
2009
+ for (const idx in this.services) {
2010
+ this.dirName = this.services[idx].dirName;
2011
+ fileList.forEach(_checkDir, this);
2012
+ }
2013
+ }
2014
+ setImmediate(next);
2015
+ }
2016
+
2017
+ function loadResourceInfo(next) {
2018
+ log.verbose("loadResourceInfo");
2019
+ if (this.rscCount === 0) {
2020
+ return setImmediate(next);
2021
+ }
2022
+
2023
+ this.resources.forEach(function(resource) {
2024
+ const filePath = path.join(resource.dir, "resourceinfo.json");
2025
+ try {
2026
+ const data = fs.readFileSync(filePath),
2027
+ info = JSON.parse(data);
2028
+ resource.info = info;
2029
+ } catch (err) {
2030
+ return setImmediate(next, errHndl.getErrMsg("INVALID_JSON_FORMAT", "resourceinfo.json"));
2031
+ }
2032
+ });
2033
+ log.verbose("num of resourceInfo: " + this.resources.length);
2034
+ setImmediate(next);
2035
+ }
2036
+
2037
+ function checkResourceInfo(next) {
2038
+ log.verbose("checkResourceInfo");
2039
+ const pkgId = this.pkgId;
2040
+
2041
+ this.resources.forEach(function(resource) {
2042
+ if (!resource.info.id) {
2043
+ return setImmediate(next, errHndl.getErrMsg("REQUIRED_FIELD", "id"));
2044
+ } else if (resource.info.id.indexOf(pkgId) !== 0) {
2045
+ return setImmediate(next, errHndl.getErrMsg("INVALID_RESOURCEID", pkgId));
2046
+ } else if (resource.info.id.length < 1 || !(/^[a-z0-9.+-]*$/.test(resource.info.id))) {
2047
+ log.error(errHndl.getErrMsg("INVALID_VALUE", "id", resource.info.id));
2048
+ return setImmediate(next, errHndl.getErrMsg("INVALID_ID_RULE"));
2049
+ }
2050
+ });
2051
+ setImmediate(next);
2052
+ }
2053
+
2054
+ function createResourceDir(next) {
2055
+ log.verbose("createResourceDir");
2056
+ this.resources.forEach(function(resource) {
2057
+ try {
2058
+ const resourceDir = path.join(this.tempDir, "data/usr/palm/resources", resource.info.id);
2059
+ log.verbose("resource dir = " + resourceDir);
2060
+ resource.dstDir = resourceDir;
2061
+ mkdirp.sync(resourceDir);
2062
+ } catch (err) {
2063
+ return setImmediate(next, err);
2064
+ }
2065
+ }.bind(this));
2066
+ log.silly("this.resources:", this.resources);
2067
+ setImmediate(next);
2068
+ }
2069
+
2070
+ function copyResource(next) {
2071
+ log.verbose("copyResource()");
2072
+ if (this.rscCount === 0) {
2073
+ return setImmediate(next);
2074
+ }
2075
+
2076
+ const self = this;
2077
+ try {
2078
+ async.forEachSeries(this.resources, function(resource, next) {
2079
+ self.dataCopyCount++;
2080
+ log.verbose("copyResource(), copy " + resource.dir + " ==> " + resource.dstDir);
2081
+ copySrcToDst.call(self, resource.dir, resource.dstDir, next);
2082
+ }, next);
2083
+ } catch (err) {
2084
+ setImmediate(next, err);
2085
+ }
2086
+ }
2087
+
2088
+ function addResourceInPkgInfo(next) {
2089
+ log.verbose("addResourceInPkgInfo");
2090
+ if (!this.rom && this.rscCount > 0) {
2091
+ const filename = path.join(this.packageDir, "packageinfo.json");
2092
+ let pkginfo, data;
2093
+ try {
2094
+ data = fs.readFileSync(filename);
2095
+ log.verbose("PACKAGEINFO: " + data);
2096
+ pkginfo = JSON.parse(data);
2097
+ } catch (err) {
2098
+ console.error(err);
2099
+ setImmediate(next, err);
2100
+ }
2101
+
2102
+ this.resources.forEach(function(resource) {
2103
+ this.pkgResourceNames.push(resource.info.id);
2104
+ }.bind(this));
2105
+
2106
+ pkginfo.resources = this.pkgResourceNames;
2107
+ data = JSON.stringify(pkginfo, null, 2) + "\n";
2108
+ log.verbose("Modified package.json: " + data);
2109
+ fs.writeFile(path.join(this.packageDir, "packageinfo.json"), data, next);
2110
+ } else {
2111
+ setImmediate(next);
2112
+ }
2113
+ }
2114
+
2115
+ function copyData(inDirs, forceCopy, next) {
2116
+ log.verbose("package#copyData()", "only run when force packaging");
2117
+ if (forceCopy && this.dataCopyCount === 0) {
2118
+ const dst = path.join(this.tempDir, "data");
2119
+ async.forEachSeries(inDirs, function(src, next) {
2120
+ copySrcToDst.call(this, src, dst, next);
2121
+ }, function(err) {
2122
+ setImmediate(next, err);
2123
+ });
2124
+ } else {
2125
+ return setImmediate(next);
2126
+ }
2127
+ }
2128
+
2129
+ function getPkgServiceNames(serviceInfo) {
2130
+ let serviceNames = [];
2131
+ if (servicePkgMethod === "id") {
2132
+ serviceNames = [serviceInfo.id];
2133
+ } else if (serviceInfo.services) {
2134
+ const serviceProps = (serviceInfo.services instanceof Array)
2135
+ ? serviceInfo.services : [serviceInfo.services];
2136
+ serviceNames = serviceProps.map(function(serviceProp) {
2137
+ return serviceProp.name;
2138
+ });
2139
+ }
2140
+ return serviceNames;
2141
+ }
2142
+
2143
+ function setUmask(mask, next) {
2144
+ this.oldmask = process.umask(mask);
2145
+ setImmediate(next);
2146
+ }
2147
+
2148
+ function recoverUmask(next) {
2149
+ if (this.oldmask) {
2150
+ process.umask(this.oldmask);
2151
+ }
2152
+ setImmediate(next);
2153
+ }
2154
+
2155
+ function rewriteFileWoBOMAsUtf8(filePath, rewriteFlag, next) {
2156
+ let data = fs.readFileSync(filePath);
2157
+ const encodingFormat = chardet.detect(Buffer.from(data));
2158
+
2159
+ if (['UTF-8', 'ISO-8895-1'].indexOf(encodingFormat) === -1) {
2160
+ log.silly("package#rewriteFileWoBOMAsUtf8()", "current encoding type:" + encodingFormat);
2161
+ data = encoding.convert(data, "UTF-8", encodingFormat);
2162
+ }
2163
+ data = stripbom(data);
2164
+
2165
+ if (rewriteFlag) {
2166
+ fs.writeFileSync(filePath,
2167
+ data, { encoding: "utf8" }
2168
+ );
2169
+ }
2170
+
2171
+ if (next !== 'undefined' && typeof next === 'function') {
2172
+ setImmediate(next, null, data);
2173
+ }
2174
+ return data;
2175
+ }
2176
+
2177
+ function encryptPackage(next) {
2178
+ if (this.rom || !this.encrypt) { // Do not encrypt when -rom option is given
2179
+ setImmediate(next);
2180
+ return;
2181
+ } else {
2182
+ this.encryptDir = path.join(this.tempDir, "encrypt");
2183
+ const encryptDir = this.encryptDir,
2184
+ encryptCtrlDir = path.join(encryptDir, 'ctrl'),
2185
+ ctrlTgzFile = path.join(encryptDir, 'control.tar.gz'),
2186
+ encryptDataDir = path.join(encryptDir, 'data'),
2187
+ dataTgzFile = path.join(encryptDir, 'data.tar.gz');
2188
+
2189
+ async.series([
2190
+ createDir.bind(this, encryptDir),
2191
+ createDir.bind(this, encryptCtrlDir),
2192
+ createDir.bind(this, encryptDataDir),
2193
+ createkeyIVfile.bind(this, encryptCtrlDir),
2194
+ encryptIpk.bind(this, encryptDataDir),
2195
+ makeTgz.bind(this, encryptDataDir, dataTgzFile),
2196
+ createControlFile.bind(this, encryptCtrlDir, true),
2197
+ makeTgz.bind(this, encryptCtrlDir, ctrlTgzFile),
2198
+ createDebianBinary.bind(this, encryptDir),
2199
+ makeIpk.bind(this, encryptDir)
2200
+ ], function(err) {
2201
+ if (err) {
2202
+ setImmediate(next, err);
2203
+ return;
2204
+ }
2205
+ log.verbose("package#encryptPackage()", "success to encrypt pacakge");
2206
+ setImmediate(next);
2207
+ });
2208
+ }
2209
+ }
2210
+
2211
+ function createkeyIVfile(dstPath, next) {
2212
+ // generate random key& IV
2213
+ this.key = Buffer.from(crypto.randomBytes(32), 'base64');
2214
+ this.iv = Buffer.from(crypto.randomBytes(16), 'base64');
2215
+
2216
+ try {
2217
+ // Read public key
2218
+ const publickeyPath = path.join(__dirname, '../', 'files', 'conf', 'pubkey.pem'),
2219
+ publickey = fs.readFileSync(publickeyPath, 'utf8');
2220
+
2221
+ // Encrypt key, iv by publickey
2222
+ const encryptedKey= crypto.publicEncrypt({
2223
+ key: publickey,
2224
+ padding: 4 /* crypto.constants.RSA_PKCS1_OAEP_PADDING */
2225
+ }, Buffer.from(this.key.toString('base64')));
2226
+
2227
+ const encryptedIV= crypto.publicEncrypt({
2228
+ key: publickey,
2229
+ padding: 4 /* crypto.constants.RSA_PKCS1_OAEP_PADDING */
2230
+ }, Buffer.from(this.iv.toString('base64')));
2231
+
2232
+ const keyFilePath = path.join(dstPath, "key");
2233
+ fs.writeFileSync(keyFilePath, encryptedKey, 'binary');
2234
+
2235
+ // write iv file on encrypt/control
2236
+ const ivFilePath = path.join(dstPath , "iv");
2237
+ fs.writeFileSync(ivFilePath, encryptedIV, 'binary');
2238
+
2239
+ } catch (err) {
2240
+ return setImmediate(next, errHndl.getErrMsg(err));
2241
+ }
2242
+ setImmediate(next);
2243
+ }
2244
+
2245
+ function copyOutputToDst(destination, middleCb, next) {
2246
+ let self = this;
2247
+ // copy data directory to destination
2248
+ if (this.rom) {
2249
+ middleCb("Create output directory to " + destination);
2250
+ copySrcToDst.call(this, path.join(this.tempDir, 'data'), destination, next);
2251
+ } else if (this.encrypt) {
2252
+ // copy encrypted ipk to destination
2253
+ if (this.remainPlainIPK) {
2254
+ log.verbose("Remain Plain IPK file from : " + self.tempDir, self.plainIpkFileName);
2255
+ log.verbose(" to : " + destination);
2256
+ middleCb("Remain Plain IPK file " + self.plainIpkFileName + " to " + destination);
2257
+ copySrcToDst.call(self, path.join(self.tempDir, self.plainIpkFileName), destination, function() {
2258
+ middleCb("Create encrypted " + self.ipkFileName + " to " + destination);
2259
+ copySrcToDst.call(self, path.join(self.encryptDir, self.ipkFileName), destination, next);
2260
+ });
2261
+
2262
+ } else {
2263
+ middleCb("Create encrypted " + this.ipkFileName + " to " + destination);
2264
+ copySrcToDst.call(this, path.join(this.encryptDir, this.ipkFileName), destination, next);
2265
+ }
2266
+ } else {
2267
+ // copy plain ipk to destination
2268
+ let outmsg = "Create ";
2269
+ if (this.sign && this.certificate) {
2270
+ outmsg = outmsg.concat("signed ");
2271
+ }
2272
+ middleCb(outmsg + this.ipkFileName + " to " + destination);
2273
+ copySrcToDst.call(this, path.join(this.tempDir, this.ipkFileName), destination, next);
2274
+ }
2275
+ }
2276
+
2277
+ function encryptIpk(dstPath, next) {
2278
+ log.verbose("package#encryptPackage()#encrypIpk()", "encrypt plain ipk to /encrypt/data");
2279
+ const plainIpkPath = path.join(this.tempDir, this.ipkFileName),
2280
+ encrypedIpkPath = path.join(dstPath, this.ipkFileName);
2281
+
2282
+ let self = this;
2283
+
2284
+ try {
2285
+ const input = fs.createReadStream(plainIpkPath),
2286
+ output = fs.createWriteStream(encrypedIpkPath),
2287
+ cipher = crypto.createCipheriv('aes-256-cbc', this.key, this.iv);
2288
+
2289
+ output.on('close', function() {
2290
+ log.verbose("package#encryptPackage()#encrypIpk()", "encrypted Ipk to " + encrypedIpkPath);
2291
+ if (self.remainPlainIPK === true) {
2292
+ log.verbose("Remain plain IPK file name : " + path.join(plainIpkPath));
2293
+ log.verbose("** to : " + path.join(self.tempDir, self.plainIpkFileName));
2294
+ fs.renameSync(plainIpkPath, path.join(self.tempDir, self.plainIpkFileName));
2295
+ }
2296
+ setImmediate(next);
2297
+ }).
2298
+ on('error', function(err) {
2299
+ setImmediate(next, err);
2300
+ });
2301
+
2302
+ input.pipe(cipher).pipe(output);
2303
+ } catch (err) {
2304
+ setImmediate(next, err);
2305
+ }
2306
+ }
2307
+ }());