From 71b7f1953949436b86af11dfd63e150921a3f278 Mon Sep 17 00:00:00 2001 From: Jonas Kamsker <11245306+JKamsker@users.noreply.github.com> Date: Thu, 6 Aug 2020 11:16:49 +0200 Subject: [PATCH] Updates --- asset-manifest.json | 8 ++++---- index.html | 2 +- ... precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js | 8 ++++---- service-worker.js | 2 +- static/js/main.3f748c09.chunk.js | 2 -- static/js/main.3f748c09.chunk.js.map | 1 - static/js/main.8bdafc37.chunk.js | 2 ++ static/js/main.8bdafc37.chunk.js.map | 1 + 8 files changed, 13 insertions(+), 13 deletions(-) rename precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js => precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js (76%) delete mode 100644 static/js/main.3f748c09.chunk.js delete mode 100644 static/js/main.3f748c09.chunk.js.map create mode 100644 static/js/main.8bdafc37.chunk.js create mode 100644 static/js/main.8bdafc37.chunk.js.map diff --git a/asset-manifest.json b/asset-manifest.json index 29911bf..af1d0aa 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,14 +1,14 @@ { "files": { "main.css": "/static/css/main.523f09c5.chunk.css", - "main.js": "/static/js/main.3f748c09.chunk.js", - "main.js.map": "/static/js/main.3f748c09.chunk.js.map", + "main.js": "/static/js/main.8bdafc37.chunk.js", + "main.js.map": "/static/js/main.8bdafc37.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.e9d18258.js", "runtime-main.js.map": "/static/js/runtime-main.e9d18258.js.map", "static/js/2.1affd113.chunk.js": "/static/js/2.1affd113.chunk.js", "static/js/2.1affd113.chunk.js.map": "/static/js/2.1affd113.chunk.js.map", "index.html": "/index.html", - "precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js": "/precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js", + "precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js": "/precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js", "service-worker.js": "/service-worker.js", "static/css/main.523f09c5.chunk.css.map": "/static/css/main.523f09c5.chunk.css.map", "static/js/2.1affd113.chunk.js.LICENSE.txt": "/static/js/2.1affd113.chunk.js.LICENSE.txt", @@ -18,6 +18,6 @@ "static/js/runtime-main.e9d18258.js", "static/js/2.1affd113.chunk.js", "static/css/main.523f09c5.chunk.css", - "static/js/main.3f748c09.chunk.js" + "static/js/main.8bdafc37.chunk.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index c09f17e..efeb857 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -React App
\ No newline at end of file +React App
\ No newline at end of file diff --git a/precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js b/precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js similarity index 76% rename from precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js rename to precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js index de7aa58..e2c6563 100644 --- a/precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js +++ b/precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js @@ -1,10 +1,10 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ { - "revision": "11c492f055fa87c0fd8a7aaeb4d9e035", + "revision": "fa2eff1b6c488d611abcdec3936cef84", "url": "/index.html" }, { - "revision": "e2b53bf95a20e259c85a", + "revision": "2692b556f6a144f347ac", "url": "/static/css/main.523f09c5.chunk.css" }, { @@ -16,8 +16,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "/static/js/2.1affd113.chunk.js.LICENSE.txt" }, { - "revision": "e2b53bf95a20e259c85a", - "url": "/static/js/main.3f748c09.chunk.js" + "revision": "2692b556f6a144f347ac", + "url": "/static/js/main.8bdafc37.chunk.js" }, { "revision": "d271f6cd182fc1f92a38", diff --git a/service-worker.js b/service-worker.js index a0407b5..40510d0 100644 --- a/service-worker.js +++ b/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "/precache-manifest.e10948c0cf468e11861f27c35c1dc63d.js" + "/precache-manifest.5391d0a29e5afe63372759b64ccbae3b.js" ); self.addEventListener('message', (event) => { diff --git a/static/js/main.3f748c09.chunk.js b/static/js/main.3f748c09.chunk.js deleted file mode 100644 index 5aeae3c..0000000 --- a/static/js/main.3f748c09.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpmaterial-pg-01"]=this["webpackJsonpmaterial-pg-01"]||[]).push([[0],{66:function(e,t,a){e.exports=a(80)},71:function(e,t,a){},72:function(e,t,a){e.exports=a.p+"static/media/logo.ee7cd8ed.svg"},73:function(e,t,a){},80:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a.n(n),c=a(9),r=a.n(c),o=(a(71),a(72),a(73),a(49),a(5)),s=a(115),l=a(114),u=a(111),m=a(112),p=a(108),v=a(113),h=a(35),d=a.n(h),f=a(81),g=a(109),y=a(110);Object(g.a)((function(e){return{paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%",marginTop:e.spacing(1)}}})),Object(o.a)({root:{marginRight:8,"& .MuiInputBase-root.Mui-disabled":{color:"rgba(0, 0, 0, 0.6)"}}})(m.a);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var b=a(36),k=a.n(b),B=a(44),E=a(45),w=a(46),x=a(50),C=a(48),A=a(47),O=a(20);function j(){return i.a.createElement(f.a,{variant:"body2",color:"textSecondary",align:"center"},"Copyright \xa9 ",i.a.createElement(p.a,{color:"inherit",href:"https://audible-tools.github.io/"},"audible-tools")," ",(new Date).getFullYear(),".")}var D=function(e){Object(x.a)(a,e);var t=Object(C.a)(a);function a(e){var n;return Object(E.a)(this,a),(n=t.call(this,e)).DarkerDisabledTextField=Object(o.a)({root:{marginRight:8,"& .MuiInputBase-root.Mui-disabled":{color:"rgba(0, 0, 0, 0.6)"}}})(m.a),n.setChecksum=function(e){e.length>40||n.setState({checksum:e})},n.isChecksumValid=function(){var e=n.state.checksum;return RegExp("[a-f0-9]{40}").test(e)},n.requestActivationBytes=function(){var e=n.state.checksum;O.a.event({category:"Action",action:"Request Activation Bytes",checksum:e}),fetch("https://aaxactivationserviceapi.azurewebsites.net/api/v2/activation/"+e).then((function(e){return e.json()})).then((function(t){var a=t.success,i=t.activationBytes;!0===a?(n.setState({activationBytes:t.activationBytes}),O.a.event({category:"Action",action:"Recevived valid activation bytes",checksum:e,activationBytes:i,success:!0})):(n.setState({activationBytes:"UNKNOWN"}),O.a.event({category:"Action",action:"Recevived invalid activation bytes",checksum:e,activationBytes:i,success:!1}))}),(function(e){n.setState({activationBytes:"UNKNOWN"})}))},n.acceptFile=function(){var e=Object(B.a)(k.a.mark((function e(t){var a,i,c;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t[0]).name.endsWith(".aax")){e.next=4;break}return alert("FileType not supported!"),e.abrupt("return");case 4:return i=a.slice(653,673),e.t0=n,e.next=8,i.arrayBuffer();case 8:e.t1=e.sent,c=e.t0.buf2hex.call(e.t0,e.t1),n.setChecksum(c),n.requestActivationBytes();case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.state={checksum:""},n}return Object(w.a)(a,[{key:"buf2hex",value:function(e){return Array.prototype.map.call(new Uint8Array(e),(function(e){return("00"+e.toString(16)).slice(-2)})).join("")}},{key:"render",value:function(){var e=this,t=this.props.classes,a=this.state,n=a.checksum,c=a.activationBytes;return i.a.createElement(y.a,{component:"main",maxWidth:"xs"},i.a.createElement(u.a,null),i.a.createElement("div",{className:t.paper},i.a.createElement(s.a,{className:t.avatar},i.a.createElement(d.a,null)),i.a.createElement(f.a,{component:"h1",variant:"h5"},"AAX Checksum Resolver"),i.a.createElement("form",{className:t.form,noValidate:!0},i.a.createElement(A.a,{noClick:!0,onDrop:function(t){console.log(t),e.acceptFile(t)}},(function(t){var a=t.getRootProps,c=t.getInputProps;return i.a.createElement("section",null,i.a.createElement("div",a(),i.a.createElement("input",c()),i.a.createElement(m.a,{error:!e.isChecksumValid(),variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"checksum",label:"Checksum or Drag&Drop .aax file",name:"checksum",autoComplete:"checksum",autoFocus:!0,onChange:function(t){return e.setChecksum(t.target.value)},value:n})))})),i.a.createElement(l.a,{fullWidth:!0,variant:"contained",onClick:function(){e.requestActivationBytes()},disabled:!this.isChecksumValid()},"Request Activation Bytes"),i.a.createElement(this.DarkerDisabledTextField,{value:c,disabled:!0,variant:"outlined",margin:"normal",fullWidth:!0,id:"activationBytes",label:c?"":"Activation Bytes",name:"activationBytes",autoComplete:"activationBytes","aria-readonly":!0,InputProps:{readOnly:!0}}))),i.a.createElement(v.a,{mt:1},i.a.createElement(j,null)))}}]),a}(i.a.Component),N=Object(o.a)((function(e){return{paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%",marginTop:e.spacing(1)}}}))(D);O.a.initialize("UA-174657678-1"),O.a.pageview(window.location.pathname+window.location.search),r.a.render(i.a.createElement(N,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[66,1,2]]]); -//# sourceMappingURL=main.3f748c09.chunk.js.map \ No newline at end of file diff --git a/static/js/main.3f748c09.chunk.js.map b/static/js/main.3f748c09.chunk.js.map deleted file mode 100644 index c6c59cf..0000000 --- a/static/js/main.3f748c09.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["logo.svg","SignIn.js","serviceWorker.js","ChecksumResolver.js","index.js"],"names":["module","exports","makeStyles","theme","paper","marginTop","spacing","display","flexDirection","alignItems","avatar","margin","backgroundColor","palette","secondary","main","form","width","withStyles","root","marginRight","color","TextField","Boolean","window","location","hostname","match","Copyright","Typography","variant","align","Link","href","Date","getFullYear","ChecksumResolver","props","DarkerDisabledTextField","setChecksum","value","length","setState","checksum","isChecksumValid","state","RegExp","test","requestActivationBytes","ReactGA","event","category","action","fetch","then","res","json","result","success","activationBytes","error","acceptFile","files","a","file","name","endsWith","alert","slic","slice","arrayBuffer","results","buf2hex","buffer","Array","prototype","map","call","Uint8Array","x","toString","join","classes","this","Container","component","maxWidth","CssBaseline","className","Avatar","noValidate","noClick","onDrop","acceptedFiles","console","log","getRootProps","getInputProps","required","fullWidth","id","label","autoComplete","autoFocus","onChange","target","Button","onClick","disabled","aria-readonly","InputProps","readOnly","Box","mt","React","Component","initialize","pageview","pathname","search","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","message"],"mappings":"mKAAAA,EAAOC,QAAU,IAA0B,kC,kOC2BzBC,aAAW,SAACC,GAAD,MAAY,CACvCC,MAAO,CACLC,UAAWF,EAAMG,QAAQ,GACzBC,QAAS,OACTC,cAAe,SACfC,WAAY,UAEdC,OAAQ,CACNC,OAAQR,EAAMG,QAAQ,GACtBM,gBAAiBT,EAAMU,QAAQC,UAAUC,MAE3CC,KAAM,CACJC,MAAO,OACPZ,UAAWF,EAAMG,QAAQ,QAKGY,YAAW,CACzCC,KAAM,CACJC,YAAa,EACb,oCAAqC,CACnCC,MAAO,wBAJmBH,CAO7BI,KCxCiBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,6ECgBN,SAASC,IACL,OACI,kBAACC,EAAA,EAAD,CAAYC,QAAQ,QAAQT,MAAM,gBAAgBU,MAAM,UACnD,kBACD,kBAACC,EAAA,EAAD,CAAMX,MAAM,UAAUY,KAAK,oCAA3B,iBAEI,KACH,IAAIC,MAAOC,cACX,K,IAKPC,E,kDACF,WAAYC,GAAQ,IAAD,8BACf,cAAMA,IAOVC,wBAA0BpB,YAAW,CACjCC,KAAM,C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C,GAAI,GACL,kBAAC,EAAD,Y,GApLWC,IAAMC,WA2LtBjG,eA1NG,SAAAf,GAAK,MAAK,CACxBC,MAAO,CACHC,UAAWF,EAAMG,QAAQ,GACzBC,QAAS,OACTC,cAAe,SACfC,WAAY,UAEhBC,OAAQ,CACJC,OAAQR,EAAMG,QAAQ,GACtBM,gBAAiBT,EAAMU,QAAQC,UAAUC,MAE7CC,KAAM,CACFC,MAAO,OACPZ,UAAWF,EAAMG,QAAQ,OA6MlBY,CAAsBkB,GClOrCa,IAAQmE,WAAW,kBACnBnE,IAAQoE,SAAS7F,OAAOC,SAAS6F,SAAW9F,OAAOC,SAAS8F,QAE5DC,IAASC,OACP,kBAAC,EAAD,MACAC,SAASC,eAAe,SFsHpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBxE,MAAK,SAAAyE,GACJA,EAAaC,gBAEdC,OAAM,SAAArE,GACLkC,QAAQlC,MAAMA,EAAMsE,c","file":"static/js/main.3f748c09.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.ee7cd8ed.svg\";","import React, { useState } from 'react';\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport Button from '@material-ui/core/Button';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport TextField from '@material-ui/core/TextField';\r\n\r\nimport Link from '@material-ui/core/Link';\r\nimport Box from '@material-ui/core/Box';\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\n\r\nfunction Copyright() {\r\n return (\r\n \r\n {'Copyright © '}\r\n \r\n Your Website\r\n {' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n }\r\n\r\n}));\r\n\r\nconst DarkerDisabledTextField = withStyles({\r\n root: {\r\n marginRight: 8,\r\n \"& .MuiInputBase-root.Mui-disabled\": {\r\n color: \"rgba(0, 0, 0, 0.6)\" // (default alpha is 0.38)\r\n }\r\n }\r\n})(TextField);\r\n\r\nexport default function SignIn() {\r\n const classes = useStyles();\r\n\r\n const [checksumValue, setChecksumValue] = useState(\"\");\r\n\r\n return (\r\n \r\n {/*
\r\n

You clicked {count} times

\r\n \r\n
*/}\r\n \r\n
\r\n \r\n \r\n \r\n \r\n AAX Checksum Resolver\r\n \r\n
\r\n setChecksumValue(x.target.value)}\r\n />\r\n\r\n { alert(checksumValue) }}\r\n >\r\n Request Activation Bytes\r\n \r\n\r\n \r\n\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React, { useState } from 'react';\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport Button from '@material-ui/core/Button';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport TextField from '@material-ui/core/TextField';\r\n\r\nimport Link from '@material-ui/core/Link';\r\nimport Box from '@material-ui/core/Box';\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Container from '@material-ui/core/Container';\r\n\r\nimport Dropzone from 'react-dropzone'\r\nimport ReactGA from 'react-ga';\r\n\r\nconst useStyles = theme => ({\r\n paper: {\r\n marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n }\r\n});\r\n\r\n\r\nfunction Copyright() {\r\n return (\r\n \r\n {'Copyright © '}\r\n \r\n audible-tools\r\n {' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n \r\n );\r\n}\r\n\r\nclass ChecksumResolver extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n checksum: \"\"\r\n }\r\n }\r\n\r\n\r\n DarkerDisabledTextField = withStyles({\r\n root: {\r\n marginRight: 8,\r\n \"& .MuiInputBase-root.Mui-disabled\": {\r\n color: \"rgba(0, 0, 0, 0.6)\" // (default alpha is 0.38)\r\n }\r\n }\r\n })(TextField);\r\n\r\n setChecksum = (value) => {\r\n if (value.length > 40) {\r\n return;\r\n }\r\n this.setState({ checksum: value })\r\n }\r\n\r\n isChecksumValid = () => {\r\n const { checksum } = this.state;\r\n const regex = RegExp('[a-f0-9]{40}');\r\n const testResults = regex.test(checksum);\r\n\r\n return testResults;\r\n }\r\n\r\n requestActivationBytes = () => {\r\n const { checksum } = this.state;\r\n\r\n ReactGA.event({\r\n category: 'Action',\r\n action: 'Request Activation Bytes',\r\n checksum: checksum\r\n });\r\n\r\n fetch(\"https://aaxactivationserviceapi.azurewebsites.net/api/v2/activation/\" + checksum)\r\n .then(res => res.json())\r\n .then(\r\n (result) => {\r\n const { success, activationBytes } = result;\r\n if (success === true) {\r\n this.setState({ activationBytes: result.activationBytes });\r\n\r\n ReactGA.event({\r\n category: 'Action',\r\n action: 'Recevived valid activation bytes',\r\n checksum: checksum,\r\n activationBytes: activationBytes,\r\n success: true\r\n });\r\n } else {\r\n this.setState({ activationBytes: 'UNKNOWN' });\r\n ReactGA.event({\r\n category: 'Action',\r\n action: 'Recevived invalid activation bytes',\r\n checksum: checksum,\r\n activationBytes: activationBytes,\r\n success: false\r\n });\r\n }\r\n\r\n\r\n },\r\n (error) => {\r\n this.setState({ activationBytes: 'UNKNOWN' });\r\n // this.setState({\r\n // isLoaded: true,\r\n // error\r\n // });\r\n }\r\n )\r\n }\r\n\r\n buf2hex(buffer) { // buffer is an ArrayBuffer\r\n return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');\r\n }\r\n\r\n acceptFile = async files => {\r\n const file = files[0];\r\n if (!file.name.endsWith(\".aax\")) {\r\n alert('FileType not supported!');\r\n return;\r\n }\r\n\r\n const slic = file.slice(653, 653 + 20);\r\n const results = this.buf2hex(await slic.arrayBuffer());\r\n this.setChecksum(results)\r\n this.requestActivationBytes();\r\n\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const { checksum, activationBytes } = this.state;\r\n\r\n return (\r\n \r\n\r\n \r\n
\r\n \r\n \r\n \r\n \r\n AAX Checksum Resolver\r\n \r\n\r\n
\r\n {\r\n console.log(acceptedFiles);\r\n this.acceptFile(acceptedFiles);\r\n //const file = document.getElementById('fileInput').files[0];\r\n\r\n\r\n }}>\r\n {({ getRootProps, getInputProps }) => (\r\n
\r\n
\r\n \r\n this.setChecksum(x.target.value)}\r\n value={checksum}\r\n\r\n />\r\n
\r\n
\r\n )}\r\n \r\n\r\n {\r\n this.requestActivationBytes();\r\n }}\r\n disabled={!this.isChecksumValid()}\r\n >\r\n Request Activation Bytes\r\n \r\n\r\n \r\n\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(useStyles)(ChecksumResolver);","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport App from './App';\r\nimport * as serviceWorker from './serviceWorker';\r\nimport ChecksumResolver from './ChecksumResolver';\r\n\r\nimport ReactGA from 'react-ga';\r\nReactGA.initialize('UA-174657678-1');\r\nReactGA.pageview(window.location.pathname + window.location.search);\r\n\r\nReactDOM.render(\r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.8bdafc37.chunk.js b/static/js/main.8bdafc37.chunk.js new file mode 100644 index 0000000..0304bb7 --- /dev/null +++ b/static/js/main.8bdafc37.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonpmaterial-pg-01"]=this["webpackJsonpmaterial-pg-01"]||[]).push([[0],{66:function(e,t,a){e.exports=a(80)},71:function(e,t,a){},72:function(e,t,a){e.exports=a.p+"static/media/logo.ee7cd8ed.svg"},73:function(e,t,a){},80:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a.n(n),c=a(9),r=a.n(c),o=(a(71),a(72),a(73),a(49),a(5)),s=a(115),l=a(114),u=a(111),m=a(112),v=a(108),p=a(113),h=a(35),d=a.n(h),f=a(81),g=a(109),y=a(110);Object(g.a)((function(e){return{paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%",marginTop:e.spacing(1)}}})),Object(o.a)({root:{marginRight:8,"& .MuiInputBase-root.Mui-disabled":{color:"rgba(0, 0, 0, 0.6)"}}})(m.a);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var b=a(36),k=a.n(b),B=a(44),E=a(45),w=a(46),x=a(50),C=a(48),A=a(47),O=a(20);function j(){return i.a.createElement(f.a,{variant:"body2",color:"textSecondary",align:"center"},"Copyright \xa9 ",i.a.createElement(v.a,{color:"inherit",href:"https://audible-tools.github.io/"},"audible-tools")," ",(new Date).getFullYear(),".")}var D=function(e){Object(x.a)(a,e);var t=Object(C.a)(a);function a(e){var n;return Object(E.a)(this,a),(n=t.call(this,e)).DarkerDisabledTextField=Object(o.a)({root:{marginRight:8,"& .MuiInputBase-root.Mui-disabled":{color:"rgba(0, 0, 0, 0.6)"}}})(m.a),n.setChecksum=function(e){e.length>40||n.setState({checksum:e})},n.isChecksumValid=function(){var e=n.state.checksum;return RegExp("[a-f0-9]{40}").test(e)},n.requestActivationBytes=function(){var e=n.state.checksum;O.a.event({category:"Action",action:"Request Activation Bytes",checksum:e,value:e}),fetch("https://aaxactivationserviceapi.azurewebsites.net/api/v2/activation/"+e).then((function(e){return e.json()})).then((function(t){var a=t.success,i=t.activationBytes;!0===a?(n.setState({activationBytes:t.activationBytes}),O.a.event({category:"Action",action:"Recevived valid activation bytes",checksum:e,activationBytes:i,value:"".concat(e," ").concat(i),success:!0})):(n.setState({activationBytes:"UNKNOWN"}),O.a.event({category:"Action",action:"Recevived invalid activation bytes",checksum:e,activationBytes:i,value:"".concat(e," ").concat(i),success:!1}))}),(function(e){n.setState({activationBytes:"UNKNOWN"})}))},n.acceptFile=function(){var e=Object(B.a)(k.a.mark((function e(t){var a,i,c;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=t[0]).name.endsWith(".aax")){e.next=4;break}return alert("FileType not supported!"),e.abrupt("return");case 4:return i=a.slice(653,673),e.t0=n,e.next=8,i.arrayBuffer();case 8:e.t1=e.sent,c=e.t0.buf2hex.call(e.t0,e.t1),n.setChecksum(c),n.requestActivationBytes();case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.state={checksum:""},n}return Object(w.a)(a,[{key:"buf2hex",value:function(e){return Array.prototype.map.call(new Uint8Array(e),(function(e){return("00"+e.toString(16)).slice(-2)})).join("")}},{key:"render",value:function(){var e=this,t=this.props.classes,a=this.state,n=a.checksum,c=a.activationBytes;return i.a.createElement(y.a,{component:"main",maxWidth:"xs"},i.a.createElement(u.a,null),i.a.createElement("div",{className:t.paper},i.a.createElement(s.a,{className:t.avatar},i.a.createElement(d.a,null)),i.a.createElement(f.a,{component:"h1",variant:"h5"},"AAX Checksum Resolver"),i.a.createElement("form",{className:t.form,noValidate:!0},i.a.createElement(A.a,{noClick:!0,onDrop:function(t){console.log(t),e.acceptFile(t)}},(function(t){var a=t.getRootProps,c=t.getInputProps;return i.a.createElement("section",null,i.a.createElement("div",a(),i.a.createElement("input",c()),i.a.createElement(m.a,{error:!e.isChecksumValid(),variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"checksum",label:"Checksum or Drag&Drop .aax file",name:"checksum",autoComplete:"checksum",autoFocus:!0,onChange:function(t){return e.setChecksum(t.target.value)},value:n})))})),i.a.createElement(l.a,{fullWidth:!0,variant:"contained",onClick:function(){e.requestActivationBytes()},disabled:!this.isChecksumValid()},"Request Activation Bytes"),i.a.createElement(this.DarkerDisabledTextField,{value:c,disabled:!0,variant:"outlined",margin:"normal",fullWidth:!0,id:"activationBytes",label:c?"":"Activation Bytes",name:"activationBytes",autoComplete:"activationBytes","aria-readonly":!0,InputProps:{readOnly:!0}}))),i.a.createElement(p.a,{mt:1},i.a.createElement(j,null)))}}]),a}(i.a.Component),N=Object(o.a)((function(e){return{paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%",marginTop:e.spacing(1)}}}))(D);O.a.initialize("UA-174657678-1"),O.a.pageview(window.location.pathname+window.location.search),r.a.render(i.a.createElement(N,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[66,1,2]]]); +//# sourceMappingURL=main.8bdafc37.chunk.js.map \ No newline at end of file diff --git a/static/js/main.8bdafc37.chunk.js.map b/static/js/main.8bdafc37.chunk.js.map new file mode 100644 index 0000000..6976c35 --- /dev/null +++ b/static/js/main.8bdafc37.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["logo.svg","SignIn.js","serviceWorker.js","ChecksumResolver.js","index.js"],"names":["module","exports","makeStyles","theme","paper","marginTop","spacing","display","flexDirection","alignItems","avatar","margin","backgroundColor","palette","secondary","main","form","width","withStyles","root","marginRight","color","TextField","Boolean","window","location","hostname","match","Copyright","Typography","variant","align","Link","href","Date","getFullYear","ChecksumResolver","props","DarkerDisabledTextField","setChecksum","value","length","setState","checksum","isChecksumValid","state","RegExp","test","requestActivationBytes","ReactGA","event","category","action","fetch","then","res","json","result","success","activationBytes","error","acceptFile","files","a","file","name","endsWith","alert","slic","slice","arrayBuffer","results","buf2hex","buffer","Array","prototype","map","call","Uint8Array","x","toString","join","classes","this","Container","component","maxWidth","CssBaseline","className","Avatar","noValidate","noClick","onDrop","acceptedFiles","console","log","getRootProps","getInputProps","required","fullWidth","id","label","autoComplete","autoFocus","onChange","target","Button","onClick","disabled","aria-readonly","InputProps","readOnly","Box","mt","React","Component","initialize","pageview","pathname","search","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","message"],"mappings":"mKAAAA,EAAOC,QAAU,IAA0B,kC,kOC2BzBC,aAAW,SAACC,GAAD,MAAY,CACvCC,MAAO,CACLC,UAAWF,EAAMG,QAAQ,GACzBC,QAAS,OACTC,cAAe,SACfC,WAAY,UAEdC,OAAQ,CACNC,OAAQR,EAAMG,QAAQ,GACtBM,gBAAiBT,EAAMU,QAAQC,UAAUC,MAE3CC,KAAM,CACJC,MAAO,OACPZ,UAAWF,EAAMG,QAAQ,QAKGY,YAAW,CACzCC,KAAM,CACJC,YAAa,EACb,oCAAqC,CACnCC,MAAO,wBAJmBH,CAO7BI,KCxCiBC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,6ECgBN,SAASC,IACL,OACI,kBAACC,EAAA,EAAD,CAAYC,QAAQ,QAAQT,MAAM,gBAAgBU,MAAM,UACnD,kBACD,kBAACC,EAAA,EAAD,CAAMX,MAAM,UAAUY,KAAK,oCAA3B,iBAEI,KACH,IAAIC,MAAOC,cACX,K,IAKPC,E,kDACF,WAAYC,GAAQ,IAAD,8BACf,cAAMA,IAOVC,wBAA0BpB,YAAW,CACjCC,KAAM,CACFC,YAAa,EACb,oCAAqC,CACjCC,MAAO,wBAJO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EAEAC,WAAY,CACRC,UAAU,OAO1B,kBAACC,EAAA,EAAD,CAAKC,GAAI,GACL,kBAAC,EAAD,Y,GAvLWC,IAAMC,WA8LtBjG,eA7NG,SAAAf,GAAK,MAAK,CACxBC,MAAO,CACHC,UAAWF,EAAMG,QAAQ,GACzBC,QAAS,OACTC,cAAe,SACfC,WAAY,UAEhBC,OAAQ,CACJC,OAAQR,EAAMG,QAAQ,GACtBM,gBAAiBT,EAAMU,QAAQC,UAAUC,MAE7CC,KAAM,CACFC,MAAO,OACPZ,UAAWF,EAAMG,QAAQ,OAgNlBY,CAAsBkB,GCrOrCa,IAAQmE,WAAW,kBACnBnE,IAAQoE,SAAS7F,OAAOC,SAAS6F,SAAW9F,OAAOC,SAAS8F,QAE5DC,IAASC,OACP,kBAAC,EAAD,MACAC,SAASC,eAAe,SFsHpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBxE,MAAK,SAAAyE,GACJA,EAAaC,gBAEdC,OAAM,SAAArE,GACLkC,QAAQlC,MAAMA,EAAMsE,c","file":"static/js/main.8bdafc37.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.ee7cd8ed.svg\";","import React, { useState } from 'react';\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport Button from '@material-ui/core/Button';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport TextField from '@material-ui/core/TextField';\r\n\r\nimport Link from '@material-ui/core/Link';\r\nimport Box from '@material-ui/core/Box';\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\n\r\nfunction Copyright() {\r\n return (\r\n \r\n {'Copyright © '}\r\n \r\n Your Website\r\n {' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n \r\n );\r\n}\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n }\r\n\r\n}));\r\n\r\nconst DarkerDisabledTextField = withStyles({\r\n root: {\r\n marginRight: 8,\r\n \"& .MuiInputBase-root.Mui-disabled\": {\r\n color: \"rgba(0, 0, 0, 0.6)\" // (default alpha is 0.38)\r\n }\r\n }\r\n})(TextField);\r\n\r\nexport default function SignIn() {\r\n const classes = useStyles();\r\n\r\n const [checksumValue, setChecksumValue] = useState(\"\");\r\n\r\n return (\r\n \r\n {/*
\r\n

You clicked {count} times

\r\n \r\n
*/}\r\n \r\n
\r\n \r\n \r\n \r\n \r\n AAX Checksum Resolver\r\n \r\n
\r\n setChecksumValue(x.target.value)}\r\n />\r\n\r\n { alert(checksumValue) }}\r\n >\r\n Request Activation Bytes\r\n \r\n\r\n \r\n\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React, { useState } from 'react';\r\nimport { withStyles } from \"@material-ui/core/styles\";\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport Button from '@material-ui/core/Button';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport TextField from '@material-ui/core/TextField';\r\n\r\nimport Link from '@material-ui/core/Link';\r\nimport Box from '@material-ui/core/Box';\r\nimport LockOutlinedIcon from '@material-ui/icons/LockOutlined';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Container from '@material-ui/core/Container';\r\n\r\nimport Dropzone from 'react-dropzone'\r\nimport ReactGA from 'react-ga';\r\n\r\nconst useStyles = theme => ({\r\n paper: {\r\n marginTop: theme.spacing(8),\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n avatar: {\r\n margin: theme.spacing(1),\r\n backgroundColor: theme.palette.secondary.main,\r\n },\r\n form: {\r\n width: '100%', // Fix IE 11 issue.\r\n marginTop: theme.spacing(1),\r\n }\r\n});\r\n\r\n\r\nfunction Copyright() {\r\n return (\r\n \r\n {'Copyright © '}\r\n \r\n audible-tools\r\n {' '}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n \r\n );\r\n}\r\n\r\nclass ChecksumResolver extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n checksum: \"\"\r\n }\r\n }\r\n\r\n\r\n DarkerDisabledTextField = withStyles({\r\n root: {\r\n marginRight: 8,\r\n \"& .MuiInputBase-root.Mui-disabled\": {\r\n color: \"rgba(0, 0, 0, 0.6)\" // (default alpha is 0.38)\r\n }\r\n }\r\n })(TextField);\r\n\r\n setChecksum = (value) => {\r\n if (value.length > 40) {\r\n return;\r\n }\r\n this.setState({ checksum: value })\r\n }\r\n\r\n isChecksumValid = () => {\r\n const { checksum } = this.state;\r\n const regex = RegExp('[a-f0-9]{40}');\r\n const testResults = regex.test(checksum);\r\n\r\n return testResults;\r\n }\r\n\r\n requestActivationBytes = () => {\r\n const { checksum } = this.state;\r\n\r\n ReactGA.event({\r\n category: 'Action',\r\n action: 'Request Activation Bytes',\r\n checksum: checksum,\r\n value: checksum\r\n });\r\n\r\n fetch(\"https://aaxactivationserviceapi.azurewebsites.net/api/v2/activation/\" + checksum)\r\n .then(res => res.json())\r\n .then(\r\n (result) => {\r\n const { success, activationBytes } = result;\r\n if (success === true) {\r\n this.setState({ activationBytes: result.activationBytes });\r\n\r\n ReactGA.event({\r\n category: 'Action',\r\n action: 'Recevived valid activation bytes',\r\n checksum: checksum,\r\n activationBytes: activationBytes,\r\n value: `${checksum} ${activationBytes}`,\r\n success: true\r\n });\r\n } else {\r\n this.setState({ activationBytes: 'UNKNOWN' });\r\n ReactGA.event({\r\n category: 'Action',\r\n action: 'Recevived invalid activation bytes',\r\n checksum: checksum,\r\n activationBytes: activationBytes,\r\n value: `${checksum} ${activationBytes}`,\r\n success: false\r\n });\r\n }\r\n\r\n\r\n },\r\n (error) => {\r\n this.setState({ activationBytes: 'UNKNOWN' });\r\n // this.setState({\r\n // isLoaded: true,\r\n // error\r\n // });\r\n }\r\n )\r\n }\r\n\r\n buf2hex(buffer) { // buffer is an ArrayBuffer\r\n return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');\r\n }\r\n\r\n acceptFile = async files => {\r\n const file = files[0];\r\n if (!file.name.endsWith(\".aax\")) {\r\n alert('FileType not supported!');\r\n return;\r\n }\r\n\r\n const slic = file.slice(653, 653 + 20);\r\n const results = this.buf2hex(await slic.arrayBuffer());\r\n this.setChecksum(results)\r\n this.requestActivationBytes();\r\n\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const { checksum, activationBytes } = this.state;\r\n\r\n return (\r\n \r\n\r\n \r\n
\r\n \r\n \r\n \r\n \r\n AAX Checksum Resolver\r\n \r\n\r\n
\r\n {\r\n console.log(acceptedFiles);\r\n this.acceptFile(acceptedFiles);\r\n //const file = document.getElementById('fileInput').files[0];\r\n\r\n\r\n }}>\r\n {({ getRootProps, getInputProps }) => (\r\n
\r\n
\r\n \r\n this.setChecksum(x.target.value)}\r\n value={checksum}\r\n\r\n />\r\n
\r\n
\r\n )}\r\n \r\n\r\n {\r\n this.requestActivationBytes();\r\n }}\r\n disabled={!this.isChecksumValid()}\r\n >\r\n Request Activation Bytes\r\n \r\n\r\n \r\n\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(useStyles)(ChecksumResolver);","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport App from './App';\r\nimport * as serviceWorker from './serviceWorker';\r\nimport ChecksumResolver from './ChecksumResolver';\r\n\r\nimport ReactGA from 'react-ga';\r\nReactGA.initialize('UA-174657678-1');\r\nReactGA.pageview(window.location.pathname + window.location.search);\r\n\r\nReactDOM.render(\r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""} \ No newline at end of file