0.0.8 • Published 2 years ago

react-native-app-integrity-checksum v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-app-integrity-checksum

The library supports the VAPT requirement called app integrity. The library can generate a unique checksum based on the files of your react native application source code. It mainly focuses to React Native JS bundle file changes.

Installation

npm install react-native-app-integrity-checksum

IOS Guide:

The current implementation of the library (For IOS) is to only detect JS bundle changes and generating a unique hash key when there are changes.

1) Add this line to your project podfile.

your project directory -> ios -> podfile -> under the target

   pod "AWFileHash"

then run,

   pod install

2) Run the below command to generate the bundle file manually. When you are in production, this will create automatically.

   npx react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'

This will generate the relevant bundle file in your project, ios folder.

3) Open your ios project in XCode (your project directory -> ios -> example.xcworkspace), and go to the Build Phases and expand the copy bundle resources. click on the + button and add the main.jsbundle as below.

(bundle will be generated usually inside of the ios folder. when adding the file, please tick on copy if items needed)

https://images2.imgbox.com/84/1b/1RQiTMWo_o.png

Android Guide:

The current implementation of the library (For Android) is to detect the JS bundle changes and as well the native source code changes. It also generates a unique hash key when there are changes.

1). First, you have to create an assets folder under the main folder.

your project directory -> android -> app -> src -> main -> assets

https://images2.imgbox.com/52/a3/uA4nRdyK_o.png

If you have this folder already, you are good to go.

2). Run the below command to generate the bundle file manually. When you are in production, this will create automatically.

   npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

Now you can see the android bundle file inside the previously created assets folder.

Usage

import { getChecksum } from 'react-native-app-integrity-checksum';

// ...

const result = await getChecksum();

Troubleshoot

  • In development mode, when you are doing the source code changes, the previously generated JS bundle will not be changed. You have to generate it manually once you have done the changes. But production mode will automatically generate it when building the application.
  • If the library does not return anything, you need to follow the steps previously defined. This happenes when missing the JS bundle file.

  • Try with the given example application. If not it works, Please open an Issue.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

absolute-pathabort-controlleracornacorn-jsxacceptsJSONStreamaggregate-erroragent-baseadd-streamacorn-walkansi-alignanserajvansi-escapesansi-regexansi-fragmentsansi-stylesappdirsjsarr-flattenarr-diffanymatcharr-unionargargparsearray-ifyarray-includesarray-unionarray.prototype.flatmaparray-buffer-byte-lengtharray.prototype.mapasapassign-symbolsast-typesarray-uniquearrifyastral-regexasync-limiterarray.prototype.tosortedavailable-typed-arraysasync-retrybabel-jestatobasyncbabel-plugin-istanbulbabel-plugin-polyfill-corejs2babel-plugin-polyfill-regeneratorbabel-plugin-jest-hoistbabel-plugin-syntax-trailing-function-commasbabel-preset-fbjsbabel-plugin-polyfill-corejs3babel-preset-current-node-syntaxbabel-corebalanced-matchbase64-jsbasebabel-preset-jestbig-integerbefore-after-hookbplist-parserboxenbrace-expansionblbserbufferbuffer-frombundle-namebracesbytescacheable-requestcache-basebrowserslistcacheable-lookupcall-bindcaller-pathcamelcasecaller-callsitecaniuse-litecallsitescamelcase-keyschar-regexci-infochardetclass-utilscjs-module-lexerchalkclean-stackcli-boxescli-spinnerscli-widthcliuiclone-deepcli-cursorcollect-v8-coveragecoclonecolor-namecommandercolorettecolor-convertcollection-visitcommand-existscommondircompressioncompare-funccompressibleconcat-mapconfig-chainconcat-streamcomponent-emitterconfigstoreconventional-changelog-angularconventional-changelog-atomconnectconventional-changelog-codemirrorconventional-changelog-coreconventional-changelog-conventionalcommitsconventional-changelogconventional-changelog-emberconventional-changelog-jshintconventional-changelog-eslintconventional-changelog-jqueryconventional-changelog-preset-loaderconventional-changelog-expressconventional-changelog-writerconventional-recommended-bumpconventional-commits-parserconvert-source-mapcopy-descriptorcore-js-compatcore-util-isconventional-commits-filtercosmiconfigcsstypecreate-requirecross-spawncross-spawn-asynccrypto-random-stringdargsdata-uri-to-bufferdecamelizedecamelize-keysdebugdateformatdecode-uri-componentdayjsdecompress-responsedeep-extenddeep-isdeepmergedefault-browserdefaultsdedentdefer-to-connectdefine-lazy-propdefault-browser-iddefine-propertiesdeldegeneratordenodeifydefine-propertydeprecationdepddetect-newlinedeprecated-react-native-prop-typesdiff-sequencesdestroydiffdir-globdoctrineeastasianwidthdot-propee-firstelectron-to-chromiumemitteryend-of-streamemoji-regexencodeurlerror-stack-parsererror-exenvinfoes-get-iteratorerrorhandleres-array-method-boxes-properlyes-set-tostringtagescaladees-abstractes-to-primitiveescape-goatescape-htmlescodegenescape-string-regexpes-shim-unscopableseslint-plugin-ft-floweslint-plugin-reacteslint-plugin-react-nativeeslint-plugin-jesteslint-plugin-react-hookseslint-scopeeslint-plugin-eslint-commentseslint-visitor-keyseslint-plugin-react-native-globalsespreeesqueryesrecurseesutilsexpectestraverseesprimaetagevent-target-shimexitexecaexpand-bracketsextend-shallowextglobfast-deep-equalfast-diffexternal-editorfast-json-stable-stringifyfastqfast-xml-parserfetch-blobfast-levenshteinfiguresfast-globfile-uri-to-pathfb-watchmanfinalhandlerfind-cache-dirflat-cachefill-rangeflattedfor-eachfile-entry-cacheformdata-polyfillform-data-encoderfind-upfreshfs.realpathfor-infragment-cacheftpfs-extrafunction-bindfunction.prototype.namefseventsflow-parserfunctions-have-namesget-package-typeget-pkg-repogensyncget-intrinsicget-symbol-descriptionget-streamget-uriget-valueget-caller-filegit-raw-commitsgitconfiglocalgit-semver-tagsgit-remote-origin-urlglobgit-upglobalsglob-parentglobal-dirsgotgopdgit-url-parseglobbygraceful-fshard-rejectionglobalthisgrapheme-splitterhandlebarshas-bigintshas-symbolshashas-protohas-tostringtaghas-flaghas-valueshas-property-descriptorshermes-parserhas-valuehermes-estreehermes-profile-transformerhas-yarnhosted-git-infohttp-cache-semanticshtml-escaperhttps-proxy-agenthttp-errorsiconv-litehttp2-wrapperhuman-signalshttp-proxy-agentieee754ignoreimport-lazyinflightimage-sizeimport-localimport-freshinquireriniimurmurhashindent-stringinterpretinheritsis-absoluteinternal-slotis-array-bufferinvariantipis-arrayishis-bigintis-argumentsis-accessor-descriptoris-boolean-objectis-ciis-callableis-date-objectis-data-descriptoris-descriptoris-directoryis-dockeris-bufferis-extglobis-generator-fnis-core-moduleis-extendableis-git-dirtyis-globis-inside-containeris-git-repositoryis-installed-globallyis-mapis-fullwidth-code-pointis-numberis-negative-zerois-objis-path-insideis-number-objectis-interactiveis-path-cwdis-npmis-plain-objis-relativeis-plain-objectis-regexis-sshis-setis-shared-array-bufferis-stringis-text-pathis-typed-arrayis-symbolis-unicode-supportedis-weakrefis-unc-pathis-typedarrayis-streamis-windowsis-wslisarrayistanbul-lib-reportiterate-iteratoris-yarn-globalistanbul-lib-instrumentistanbul-lib-source-mapsistanbul-reportsjest-diffisexeiterate-valueistanbul-lib-coveragejest-changed-filesjest-docblockjest-environment-nodejest-matcher-utilsjest-eachjest-circusisobjectjest-configjest-get-typejest-clijest-mockjest-leak-detectorjest-message-utiljest-pnp-resolverjest-haste-mapjest-resolvejest-resolve-dependenciesjest-runtimejest-runnerjest-regex-utiljest-snapshotjest-validatejest-watcherjest-utiljest-serializerjoijs-sdsljest-workerjetifierjsc-androidjs-tokensjscodeshiftjs-yamljsescjson-parse-better-errorsjson-parse-even-better-errorsjson-schema-traversejson-stringify-safejson-bufferjson5json-stable-stringify-without-jsonifyjsonfilejsonparsejsx-ast-utilskeyvlevenkind-oflevnlatest-versionlines-and-columnslocate-pathload-json-filelodash.camelcasekleurlodash.debouncelodash.ismatchlodashlodash.isplainobjectlodash.kebabcaselodash.mergewithlodash.isfunctionlodash.startcaselodash.throttlelodash.snakecaselodash.uniqlog-symbolsloose-envifylogkittylodash.upperfirstlowercase-keyslodash.mergelru-cachemacos-releasemap-cachemake-dirmakeerrormap-objmeowmake-errormap-visitmerge-streammetro-cachemetro-babel-transformermetromerge2metro-corememoize-onemetro-inspector-proxymetro-configmetro-file-mapmetro-hermes-compilermetro-minify-tersermetro-react-native-babel-transformermetro-minify-uglifymetro-react-native-babel-presetmetro-cache-keymetro-resolvermetro-source-mapmetro-symbolicatemetro-transform-pluginsmetro-transform-workermimemimic-responsemicromatchmime-typesmetro-runtimemin-indentmimic-fnmime-dbminimistminimatchmixin-deepmodify-valuesmsmute-streamnanomatchnatural-comparenegotiatormkdirpnetmaskminimist-optionsnatural-compare-liteneo-asyncnew-github-release-urlnice-trynode-dirnocachenode-releasesnode-int64node-domexceptionnode-stream-zipnormalize-package-datanode-fetchnullthrowsnormalize-pathob1object-assignobject-copyobject-visitobject-inspectobject.assignobject.hasownnpm-run-pathobject-keysnormalize-urlobject.fromentrieson-finishedobject.valueson-headersonceonetimeobject.entriesoraobject.pickopenos-namep-limitp-locateos-tmpdirp-mappac-proxy-agentp-cancelableoptionatorp-finallypac-resolverparse-jsonparent-moduleparseurlparse-urlp-trypascalcasepackage-jsonparse-pathpath-existspath-typepath-parsepath-keypiratespath-is-absolutepifypkg-dirpicomatchpretty-formatprettier-linter-helperspicocolorsposix-character-classesprelude-lspromiseprop-typesprocess-nextick-argspromptspromise.allsettledproto-listproxy-agentprotocolspumppseudomappunycodeqproxy-from-envpupaqueue-microtaskquick-lruraw-bodyreact-devtools-corerange-parserreact-isreact-native-codegenrcreact-native-gradle-pluginreadable-streamread-pkgread-pkg-upreadlineredentreact-shallow-rendererreact-refreshrechoirregenerator-transformregenerate-unicode-propertiesregex-notregexp.prototype.flagsregenerator-runtimeregexpu-coreregjsparserrecastregistry-auth-tokenregenerateregistry-urlrepeat-elementrequire-from-stringresolverequire-directoryresolve-alpnresolve-cwdresolve-globalresolve-urlrepeat-stringresponselikeresolve-fromresolve.exportsrequire-main-filenameretryrun-applescriptreusifyrun-asyncrun-parallelretrestore-cursorschedulersafe-bufferrxjssafe-regexrimrafsemver-diffsafer-buffersemversendsafe-regex-testserialize-errorserve-staticset-blockingshallow-cloneset-valuesetprototypeofshebang-commandside-channelsignal-exitshell-quoteslashshelljssmart-buffershebang-regexsisteransisockssnapdragonsnapdragon-nodesocks-proxy-agentsnapdragon-utilsource-map-resolveslice-ansisource-map-urlsource-map-supportsource-mapspdx-exceptionsspdx-expression-parsespdx-license-idsspdx-correctsplit2split-stringsprintf-jsstack-utilssplitstacktrace-parserstdin-discarderstatic-extendstatusesstring-lengthstackframestring-widthstring.prototype.trimstring.prototype.trimendstring-natural-comparestring_decoderstop-iteration-iteratorstrip-ansistring.prototype.trimstartstring.prototype.matchallstrip-indentstrip-bomstrip-json-commentssupports-colorsudo-promptstrip-final-newlinestrnumstrip-eofterminal-linksupports-hyperlinkstest-excludetext-extensionsterserthroattext-tabletempthrough2supports-preserve-symlinks-flagtmplthroughtitleizetoidentifierto-fast-propertiestmpto-object-pathto-regex-rangetype-checktrim-newlinestype-detecttype-festto-regextypedarraytsutilstslibtr46uglify-esunc-path-regexuglify-jstyped-array-lengthunbox-primitivetypedarray-to-bufferunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunion-valueunique-stringuniversalifyunpipeuniversal-user-agentunset-valueunicode-match-property-value-ecmascriptuntildifyunicode-property-aliases-ecmascripturi-jsuseurl-joinupdate-notifierurixutil-deprecatev8-compile-cache-libuse-sync-external-storevalidate-npm-package-licensev8-to-istanbulutils-mergevaryvm2update-browserslist-dbwcwidthvlqwalkerweb-streams-polyfillwebidl-conversionswhatwg-urlwhich-boxed-primitivewhich-typed-arraywidest-linewildcard-matchwhich-moduleword-wrapwrappywrap-ansiwhichwhatwg-fetchwrite-file-atomicwordwrapwindows-releasewsxregexpxdg-basedirxtendyargs-parserxdg-default-browseryallistyargsyamly18nynyocto-queue
0.0.8

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago