start with https://, first 10 bytes are almost same string with
base64 encoded.
Then, cut 10 bytes from its tail.
Change-Id: I8a73f19dd47a4ca45f8c249e8e6822810579d9f6
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
-function makeAppId(startUrl: string) {
+function makePkgId(startUrl: string) {
let id = Buffer.from(startUrl).toString('base64');
let id = Buffer.from(startUrl).toString('base64');
- id = id.replace(/=/i, '');
+ id = id.replace(/=/gi, '');
console.log(`id : ${id}`);
console.log(`id : ${id}`);
- return id.substr(2, 10);
}
function convertConfigXml(appName: string, startUrl: string) {
convertedConfigXml = `${baseWorkingDir}/${appName}/config.xml`;
}
function convertConfigXml(appName: string, startUrl: string) {
convertedConfigXml = `${baseWorkingDir}/${appName}/config.xml`;
- let id = makeAppId(startUrl);
+ let id = makePkgId(startUrl);
let configXml = `<?xml version='1.0' encoding='UTF-8'?>`;
configXml += `<widget xmlns='http://www.w3.org/ns/widgets' xmlns:tizen='http://tizen.org/ns/widgets' id='http://yourdomain/AppManifest' version='1.0.0' viewmodes='maximized'>`;
configXml += `<tizen:application id='${id}.${appName}' package='${id}' required_version='3.0' />`;
let configXml = `<?xml version='1.0' encoding='UTF-8'?>`;
configXml += `<widget xmlns='http://www.w3.org/ns/widgets' xmlns:tizen='http://tizen.org/ns/widgets' id='http://yourdomain/AppManifest' version='1.0.0' viewmodes='maximized'>`;
configXml += `<tizen:application id='${id}.${appName}' package='${id}' required_version='3.0' />`;