Advertisement
Paceusa

p

Sep 24th, 2023
804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Originally created by cwke
  3.  * Reuploaded by Waxaranai
  4.  * Recoded by SlavyanDesu
  5.  *
  6.  * GitHub is an open-source community, so why are you so triggered when someone shared some simple code?
  7.  */
  8.  
  9. const fs = require('fs')
  10. const packID = 'com.snowcorp.stickerly.android.stickercontentprovider b5e7275f-f1de-4137-961f-57becfad34f2'
  11. const playstore = 'https://play.google.com/store/apps/details?id=com.snowcorp.stickerly.android'
  12. const itunes = 'https://apps.apple.com/us/app/pubg-mobile-3rd-anniversary/id1330123889'
  13.  
  14. /**
  15.  * @class Exif
  16.  */
  17. module.exports = class Exif {
  18.     /**
  19.      * Create an EXIF file.
  20.      * @param {String} packname
  21.      * @param {String} authorname
  22.      * @param {String} [filename=data]
  23.      */
  24.     create(packname, authorname, filename) {
  25.         if (!filename) filename = 'data'
  26.         const json = {
  27.             'sticker-pack-id': packID,
  28.             'sticker-pack-name': packname,
  29.             'sticker-pack-publisher': authorname,
  30.         //  'android-app-store-link': playstore,
  31.             'ios-app-store-link': itunes
  32.         }
  33.         let len = JSON.stringify(json).length
  34.         const f = Buffer.from([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x41, 0x57, 0x07, 0x00])
  35.         const code = [0x00, 0x00, 0x16, 0x00, 0x00, 0x00]
  36.         if (len > 256) {
  37.             len = len - 256
  38.             code.unshift(0x01)
  39.         } else {
  40.             code.unshift(0x00)
  41.         }
  42.         const fff = Buffer.from(code)
  43.         const ffff = Buffer.from(JSON.stringify(json))
  44.         if (len < 16) {
  45.             len = len.toString(16)
  46.             len = '0' + len
  47.         } else {
  48.             len = len.toString(16)
  49.         }
  50.         const ff = Buffer.from(len, 'hex')
  51.         const buffer = Buffer.concat([f, ff, fff, ffff])
  52.         fs.writeFile(`./sticker/${filename}.exif`, buffer, (err) => {
  53.             if (err) return console.error(err)
  54.         })
  55.     }
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement