-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b323c90
commit d089c6e
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Originally created by cwke and recoded by SlavyanDesu | ||
|
||
const fs = require('fs-extra') | ||
const packID = "com.snowcorp.stickerly.android.stickercontentprovider b5e7275f-f1de-4137-961f-57becfad34f2" | ||
const playstore = "https://play.google.com/store/apps/details?id=com.marsconstd.stickermakerforwhatsapp" | ||
const itunes = "https://itunes.apple.com/app/sticker-maker-studio/id1443326857" | ||
|
||
module.exports = class Exif { | ||
constructor() {} | ||
|
||
create(packname, authorname) { | ||
const json = { | ||
"sticker-pack-id": packID, | ||
"sticker-pack-name": packname, | ||
"sticker-pack-publisher": authorname, | ||
"android-app-store-link": playstore, | ||
"ios-app-store-link": itunes | ||
} | ||
let len = JSON.stringify(json).length | ||
const f = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00]) | ||
const code = [0x00, 0x00, 0x16, 0x00, 0x00, 0x00] | ||
if (len > 256) { | ||
len = len - 256 | ||
code.unshift(0x01) | ||
} else { | ||
code.unshift(0x00) | ||
} | ||
const fff = Buffer.from(code) | ||
const ffff = Buffer.from(JSON.stringify(json)) | ||
if (len < 16) { | ||
len = len.toString(16) | ||
len = "0" + len | ||
} else { | ||
len = len.toString(16) | ||
} | ||
const ff = Buffer.from(len, 'hex') | ||
const buffer = Buffer.concat([f, ff, fff, ffff]) | ||
fs.writeFile('./temp/data.exif', buffer, (err) => { | ||
if (err) return console.error(err) | ||
console.log('Success!') | ||
}) | ||
} | ||
} |