diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 50b9799..c3f800a 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -5,12 +5,12 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v5 with: - node-version: '20.x' + node-version: '24.x' - name: Cache dependencies id: yarn-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | **/node_modules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daf6cc4..8646432 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,13 +7,20 @@ on: jobs: build-and-publish: runs-on: ubuntu-latest + # Must match the Environment on npm's trusted publisher for this package + environment: prod # Prevent the app's own release commit from re-triggering this workflow if: github.actor != 'stallion-release-bot[bot]' - permissions: write-all + # id-token: write mints the OIDC token npm's trusted publisher verifies + permissions: + contents: write + issues: write + pull-requests: write + id-token: write steps: - name: Generate app token id: app-token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@v2 with: app-id: ${{ secrets.RELEASE_APP_ID }} private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} @@ -42,11 +49,13 @@ jobs: - name: Prep release run: yarn prepare-release + # Publishes to npm via trusted publishing, so no NPM_TOKEN is needed. + # npm binds the trusted publisher to this workflow's file name: renaming + # ci.yml means updating the publisher on npmjs.com in the same change. - name: Release package run: yarn semantic-release env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GIT_AUTHOR_EMAIL: ${{ secrets.GH_DEPLOY_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GH_DEPLOY_NAME }} GIT_COMMITTER_EMAIL: ${{ secrets.GH_DEPLOY_EMAIL }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d7165d3..1c98914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,104 +1,114 @@ -## [2.4.2](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.1...v2.4.2) (2026-08-08) +## [2.4.3-alpha.3](https://github.com/stallion-tech/[secure]-stallion/compare/v2.4.3-alpha.2...v2.4.3-alpha.3) (2026-09-27) ### Bug Fixes -* enabled config refresh export, jest import ([#129](https://github.com/stallion-tech/react-native-stallion/issues/129)) ([#131](https://github.com/stallion-tech/react-native-stallion/issues/131)) ([baaa7c3](https://github.com/stallion-tech/react-native-stallion/commit/baaa7c33120379ee6955dd640f56b8f5539bcd6c)) +* stabilize logic platform parity, file cleanup refactor ([#140](https://github.com/stallion-tech/[secure]-stallion/issues/140)) ([be24e13](https://github.com/stallion-tech/[secure]-stallion/commit/be24e13efe801015c91e70741b0a2268f997e500)) -## [2.4.2-alpha.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.1...v2.4.2-alpha.1) (2026-08-04) +## [2.4.3-alpha.2](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.3-alpha.1...v2.4.3-alpha.2) (2026-08-26) ### Bug Fixes -* enabled config refresh export, jest import ([#129](https://github.com/stallion-tech/react-native-stallion/issues/129)) ([e75dc96](https://github.com/stallion-tech/react-native-stallion/commit/e75dc96c74ebc865d514b0794ea9b42263df6f47)) +* added random uid as main identifier ([#136](https://github.com/stallion-tech/react-native-stallion/issues/136)) ([b5512ed](https://github.com/stallion-tech/react-native-stallion/commit/b5512ed7a322c4b693d232b0304573942d973f88)) -## [2.4.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0...v2.4.1) (2026-06-07) +## [2.4.3-alpha.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.2...v2.4.3-alpha.1) (2026-08-13) ### Bug Fixes -* multi region auto switching support ([#121](https://github.com/stallion-tech/react-native-stallion/issues/121)) ([4bc9eb7](https://github.com/stallion-tech/react-native-stallion/commit/4bc9eb7bab797858fda7ad841c627008c62158cf)) +* stallion dev menu refactor ([#133](https://github.com/stallion-tech/react-native-stallion/issues/133)) ([d4cbf8f](https://github.com/stallion-tech/react-native-stallion/commit/d4cbf8f5700e14cff7b14fff7ea0e97a4f7225d6)) -# [2.5.0-alpha.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0...v2.5.0-alpha.1) (2026-06-07) +## [2.4.2](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.1...v2.4.2) (2026-08-08) +### Bug Fixes + +- enabled config refresh export, jest import ([#129](https://github.com/stallion-tech/react-native-stallion/issues/129)) ([#131](https://github.com/stallion-tech/react-native-stallion/issues/131)) ([baaa7c3](https://github.com/stallion-tech/react-native-stallion/commit/baaa7c33120379ee6955dd640f56b8f5539bcd6c)) + +## [2.4.2-alpha.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.1...v2.4.2-alpha.1) (2026-08-04) ### Bug Fixes -* added 16kb support for bspatch lib also ([#114](https://github.com/stallion-tech/react-native-stallion/issues/114)) ([017e79a](https://github.com/stallion-tech/react-native-stallion/commit/017e79a124f0043c54cab302a47b1e1833927b16)) -* alpha 2.3.1 release ([5890a27](https://github.com/stallion-tech/react-native-stallion/commit/5890a27f0e39e7f3b698d0f155e50196c36f335d)) -* android 16kb, removed react codegen block ([#91](https://github.com/stallion-tech/react-native-stallion/issues/91)) ([c92e6cd](https://github.com/stallion-tech/react-native-stallion/commit/c92e6cd4dea287643ad1d87262a71303af805d6b)) -* android sdk token expriy logic fixed ([#66](https://github.com/stallion-tech/react-native-stallion/issues/66)) ([6c8202f](https://github.com/stallion-tech/react-native-stallion/commit/6c8202fff4a46c9eaf066d793b402e9d9084bed3)) -* custom base url support ([#109](https://github.com/stallion-tech/react-native-stallion/issues/109)) ([5dc99ec](https://github.com/stallion-tech/react-native-stallion/commit/5dc99ec5f6bd73ae91f0a3ef8f8aa87ba0427e67)) -* exception handling ios newarch ([#53](https://github.com/stallion-tech/react-native-stallion/issues/53)) ([f0d454f](https://github.com/stallion-tech/react-native-stallion/commit/f0d454fe9ebf83bcbc2b09fd96bb17dd5b2a8a82)), closes [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) -* getActiveBundleHash function added ([#101](https://github.com/stallion-tech/react-native-stallion/issues/101)) ([bb51fa5](https://github.com/stallion-tech/react-native-stallion/commit/bb51fa551b05b6eb3d4996e2db0d4c9b895a64d8)) -* ios precompiled deps fix pod deps installation ([#93](https://github.com/stallion-tech/react-native-stallion/issues/93)) ([0cdde47](https://github.com/stallion-tech/react-native-stallion/commit/0cdde4781b5e441e7b84803612e9949d5ccb07f7)) -* ios stage event typo ([c0c9bdb](https://github.com/stallion-tech/react-native-stallion/commit/c0c9bdbc4d15cad7934559fbef6a397dde4a6c50)) -* js error boundary, exception handler safety checks ([#86](https://github.com/stallion-tech/react-native-stallion/issues/86)) ([e7b9443](https://github.com/stallion-tech/react-native-stallion/commit/e7b94434f280f0160630b30890aced8ea36c3410)) -* modifed event emitter init, added fallback for mounting prod bundle ([#32](https://github.com/stallion-tech/react-native-stallion/issues/32)) ([f888820](https://github.com/stallion-tech/react-native-stallion/commit/f888820305f57bc76649673d289ff15949558ab8)) -* release v2.3.0-alpha.5 ([#75](https://github.com/stallion-tech/react-native-stallion/issues/75)) ([044a5ad](https://github.com/stallion-tech/react-native-stallion/commit/044a5addc9b36c153946e847ac9b34c59e5c5be5)) -* removed stallion enabled script reading logic from native, enabled by default ([ab3f0d4](https://github.com/stallion-tech/react-native-stallion/commit/ab3f0d4ba6d20f4277b0611c9a6783d49e44cb3f)) -* removeEventListener exported ([979640a](https://github.com/stallion-tech/react-native-stallion/commit/979640a8b485d8ab0bb03b5799fc176289429228)) +- enabled config refresh export, jest import ([#129](https://github.com/stallion-tech/react-native-stallion/issues/129)) ([e75dc96](https://github.com/stallion-tech/react-native-stallion/commit/e75dc96c74ebc865d514b0794ea9b42263df6f47)) + +## [2.4.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0...v2.4.1) (2026-06-07) +### Bug Fixes + +- multi region auto switching support ([#121](https://github.com/stallion-tech/react-native-stallion/issues/121)) ([4bc9eb7](https://github.com/stallion-tech/react-native-stallion/commit/4bc9eb7bab797858fda7ad841c627008c62158cf)) + +# [2.5.0-alpha.1](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0...v2.5.0-alpha.1) (2026-06-07) + +### Bug Fixes + +- added 16kb support for bspatch lib also ([#114](https://github.com/stallion-tech/react-native-stallion/issues/114)) ([017e79a](https://github.com/stallion-tech/react-native-stallion/commit/017e79a124f0043c54cab302a47b1e1833927b16)) +- alpha 2.3.1 release ([5890a27](https://github.com/stallion-tech/react-native-stallion/commit/5890a27f0e39e7f3b698d0f155e50196c36f335d)) +- android 16kb, removed react codegen block ([#91](https://github.com/stallion-tech/react-native-stallion/issues/91)) ([c92e6cd](https://github.com/stallion-tech/react-native-stallion/commit/c92e6cd4dea287643ad1d87262a71303af805d6b)) +- android sdk token expriy logic fixed ([#66](https://github.com/stallion-tech/react-native-stallion/issues/66)) ([6c8202f](https://github.com/stallion-tech/react-native-stallion/commit/6c8202fff4a46c9eaf066d793b402e9d9084bed3)) +- custom base url support ([#109](https://github.com/stallion-tech/react-native-stallion/issues/109)) ([5dc99ec](https://github.com/stallion-tech/react-native-stallion/commit/5dc99ec5f6bd73ae91f0a3ef8f8aa87ba0427e67)) +- exception handling ios newarch ([#53](https://github.com/stallion-tech/react-native-stallion/issues/53)) ([f0d454f](https://github.com/stallion-tech/react-native-stallion/commit/f0d454fe9ebf83bcbc2b09fd96bb17dd5b2a8a82)), closes [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) +- getActiveBundleHash function added ([#101](https://github.com/stallion-tech/react-native-stallion/issues/101)) ([bb51fa5](https://github.com/stallion-tech/react-native-stallion/commit/bb51fa551b05b6eb3d4996e2db0d4c9b895a64d8)) +- ios precompiled deps fix pod deps installation ([#93](https://github.com/stallion-tech/react-native-stallion/issues/93)) ([0cdde47](https://github.com/stallion-tech/react-native-stallion/commit/0cdde4781b5e441e7b84803612e9949d5ccb07f7)) +- ios stage event typo ([c0c9bdb](https://github.com/stallion-tech/react-native-stallion/commit/c0c9bdbc4d15cad7934559fbef6a397dde4a6c50)) +- js error boundary, exception handler safety checks ([#86](https://github.com/stallion-tech/react-native-stallion/issues/86)) ([e7b9443](https://github.com/stallion-tech/react-native-stallion/commit/e7b94434f280f0160630b30890aced8ea36c3410)) +- modifed event emitter init, added fallback for mounting prod bundle ([#32](https://github.com/stallion-tech/react-native-stallion/issues/32)) ([f888820](https://github.com/stallion-tech/react-native-stallion/commit/f888820305f57bc76649673d289ff15949558ab8)) +- release v2.3.0-alpha.5 ([#75](https://github.com/stallion-tech/react-native-stallion/issues/75)) ([044a5ad](https://github.com/stallion-tech/react-native-stallion/commit/044a5addc9b36c153946e847ac9b34c59e5c5be5)) +- removed stallion enabled script reading logic from native, enabled by default ([ab3f0d4](https://github.com/stallion-tech/react-native-stallion/commit/ab3f0d4ba6d20f4277b0611c9a6783d49e44cb3f)) +- removeEventListener exported ([979640a](https://github.com/stallion-tech/react-native-stallion/commit/979640a8b485d8ab0bb03b5799fc176289429228)) ### Features -* 2.4.0 alpha ([#96](https://github.com/stallion-tech/react-native-stallion/issues/96)) ([3430975](https://github.com/stallion-tech/react-native-stallion/commit/3430975b038b0d82f1549d104d7277ce2d540020)) -* added stream downloading for android ([#42](https://github.com/stallion-tech/react-native-stallion/issues/42)) ([3636acd](https://github.com/stallion-tech/react-native-stallion/commit/3636acd4d48c4ae2e5f5659e4f0a31239f745d4b)) -* bundle signing ([#44](https://github.com/stallion-tech/react-native-stallion/issues/44)) ([d4d8433](https://github.com/stallion-tech/react-native-stallion/commit/d4d84335409ef9b8b4eb5c223ef5217f4d0cd54f)), closes [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) -* bundle signing 2.3.0, back merge ([b16b74d](https://github.com/stallion-tech/react-native-stallion/commit/b16b74d7bba4a07aa52af6a1864e2c971cea46ab)) -* restart logic, ui revamp v0, ios sync and other bugfixes ([70b8067](https://github.com/stallion-tech/react-native-stallion/commit/70b806753d2a3784686b93ebe15eef802d2665e8)) -* resume download android ([1471b57](https://github.com/stallion-tech/react-native-stallion/commit/1471b5780608df29437fbe8048205fb3537d2859)) +- 2.4.0 alpha ([#96](https://github.com/stallion-tech/react-native-stallion/issues/96)) ([3430975](https://github.com/stallion-tech/react-native-stallion/commit/3430975b038b0d82f1549d104d7277ce2d540020)) +- added stream downloading for android ([#42](https://github.com/stallion-tech/react-native-stallion/issues/42)) ([3636acd](https://github.com/stallion-tech/react-native-stallion/commit/3636acd4d48c4ae2e5f5659e4f0a31239f745d4b)) +- bundle signing ([#44](https://github.com/stallion-tech/react-native-stallion/issues/44)) ([d4d8433](https://github.com/stallion-tech/react-native-stallion/commit/d4d84335409ef9b8b4eb5c223ef5217f4d0cd54f)), closes [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) +- bundle signing 2.3.0, back merge ([b16b74d](https://github.com/stallion-tech/react-native-stallion/commit/b16b74d7bba4a07aa52af6a1864e2c971cea46ab)) +- restart logic, ui revamp v0, ios sync and other bugfixes ([70b8067](https://github.com/stallion-tech/react-native-stallion/commit/70b806753d2a3784686b93ebe15eef802d2665e8)) +- resume download android ([1471b57](https://github.com/stallion-tech/react-native-stallion/commit/1471b5780608df29437fbe8048205fb3537d2859)) # [2.4.0-alpha.7](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.6...v2.4.0-alpha.7) (2026-06-06) -# [2.4.0](https://github.com/stallion-tech/react-native-stallion/compare/v2.3.2...v2.4.0) (2026-05-12) +# [2.4.0](https://github.com/stallion-tech/react-native-stallion/compare/v2.3.2...v2.4.0) (2026-05-12) ### Features -* patch updates ([#107](https://github.com/stallion-tech/react-native-stallion/issues/107)) ([cbd2c78](https://github.com/stallion-tech/react-native-stallion/commit/cbd2c780512b2fb5220a63809d5b2843906eb7f7)), closes [#32](https://github.com/stallion-tech/react-native-stallion/issues/32) [#38](https://github.com/stallion-tech/react-native-stallion/issues/38) [#41](https://github.com/stallion-tech/react-native-stallion/issues/41) [#42](https://github.com/stallion-tech/react-native-stallion/issues/42) [#44](https://github.com/stallion-tech/react-native-stallion/issues/44) [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) [#53](https://github.com/stallion-tech/react-native-stallion/issues/53) [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) [#66](https://github.com/stallion-tech/react-native-stallion/issues/66) [#75](https://github.com/stallion-tech/react-native-stallion/issues/75) [#86](https://github.com/stallion-tech/react-native-stallion/issues/86) +- patch updates ([#107](https://github.com/stallion-tech/react-native-stallion/issues/107)) ([cbd2c78](https://github.com/stallion-tech/react-native-stallion/commit/cbd2c780512b2fb5220a63809d5b2843906eb7f7)), closes [#32](https://github.com/stallion-tech/react-native-stallion/issues/32) [#38](https://github.com/stallion-tech/react-native-stallion/issues/38) [#41](https://github.com/stallion-tech/react-native-stallion/issues/41) [#42](https://github.com/stallion-tech/react-native-stallion/issues/42) [#44](https://github.com/stallion-tech/react-native-stallion/issues/44) [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) [#53](https://github.com/stallion-tech/react-native-stallion/issues/53) [#49](https://github.com/stallion-tech/react-native-stallion/issues/49) [#66](https://github.com/stallion-tech/react-native-stallion/issues/66) [#75](https://github.com/stallion-tech/react-native-stallion/issues/75) [#86](https://github.com/stallion-tech/react-native-stallion/issues/86) # [2.4.0-alpha.6](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.5...v2.4.0-alpha.6) (2026-04-24) - ### Bug Fixes -* custom base url support ([#109](https://github.com/stallion-tech/react-native-stallion/issues/109)) ([5dc99ec](https://github.com/stallion-tech/react-native-stallion/commit/5dc99ec5f6bd73ae91f0a3ef8f8aa87ba0427e67)) +- custom base url support ([#109](https://github.com/stallion-tech/react-native-stallion/issues/109)) ([5dc99ec](https://github.com/stallion-tech/react-native-stallion/commit/5dc99ec5f6bd73ae91f0a3ef8f8aa87ba0427e67)) # [2.4.0-alpha.6](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.5...v2.4.0-alpha.6) (2026-04-24) - ### Bug Fixes -* added 16kb support for bspatch lib also ([#114](https://github.com/stallion-tech/react-native-stallion/issues/114)) ([017e79a](https://github.com/stallion-tech/react-native-stallion/commit/017e79a124f0043c54cab302a47b1e1833927b16)) -* ios podspec precompiled deps support ([#94](https://github.com/stallion-tech/react-native-stallion/issues/94)) ([35f255f](https://github.com/stallion-tech/react-native-stallion/commit/35f255f74644f993a67d4e727dc751f31d4f08a0)) +- added 16kb support for bspatch lib also ([#114](https://github.com/stallion-tech/react-native-stallion/issues/114)) ([017e79a](https://github.com/stallion-tech/react-native-stallion/commit/017e79a124f0043c54cab302a47b1e1833927b16)) +- ios podspec precompiled deps support ([#94](https://github.com/stallion-tech/react-native-stallion/issues/94)) ([35f255f](https://github.com/stallion-tech/react-native-stallion/commit/35f255f74644f993a67d4e727dc751f31d4f08a0)) # [2.4.0-alpha.5](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.4...v2.4.0-alpha.5) (2026-02-13) - ### Bug Fixes -* getActiveBundleHash function added ([#101](https://github.com/stallion-tech/react-native-stallion/issues/101)) ([bb51fa5](https://github.com/stallion-tech/react-native-stallion/commit/bb51fa551b05b6eb3d4996e2db0d4c9b895a64d8)) +- getActiveBundleHash function added ([#101](https://github.com/stallion-tech/react-native-stallion/issues/101)) ([bb51fa5](https://github.com/stallion-tech/react-native-stallion/commit/bb51fa551b05b6eb3d4996e2db0d4c9b895a64d8)) # [2.4.0-alpha.4](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.3...v2.4.0-alpha.4) (2026-01-14) - ### Features -* 2.4.0 alpha ([#96](https://github.com/stallion-tech/react-native-stallion/issues/96)) ([3430975](https://github.com/stallion-tech/react-native-stallion/commit/3430975b038b0d82f1549d104d7277ce2d540020)) +- 2.4.0 alpha ([#96](https://github.com/stallion-tech/react-native-stallion/issues/96)) ([3430975](https://github.com/stallion-tech/react-native-stallion/commit/3430975b038b0d82f1549d104d7277ce2d540020)) # [2.4.0-alpha.3](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.2...v2.4.0-alpha.3) (2026-01-03) - ### Bug Fixes -* ios precompiled deps fix pod deps installation ([#93](https://github.com/stallion-tech/react-native-stallion/issues/93)) ([0cdde47](https://github.com/stallion-tech/react-native-stallion/commit/0cdde4781b5e441e7b84803612e9949d5ccb07f7)) +- ios precompiled deps fix pod deps installation ([#93](https://github.com/stallion-tech/react-native-stallion/issues/93)) ([0cdde47](https://github.com/stallion-tech/react-native-stallion/commit/0cdde4781b5e441e7b84803612e9949d5ccb07f7)) # [2.4.0-alpha.2](https://github.com/stallion-tech/react-native-stallion/compare/v2.4.0-alpha.1...v2.4.0-alpha.2) (2026-01-02) - ### Bug Fixes -* android 16kb page size fix, new arch codegen removed ([#92](https://github.com/stallion-tech/react-native-stallion/issues/92)) ([9b2f91a](https://github.com/stallion-tech/react-native-stallion/commit/9b2f91a71dc603c58653fd1c924221be7b81ee5b)) +- android 16kb page size fix, new arch codegen removed ([#92](https://github.com/stallion-tech/react-native-stallion/issues/92)) ([9b2f91a](https://github.com/stallion-tech/react-native-stallion/commit/9b2f91a71dc603c58653fd1c924221be7b81ee5b)) ## [2.3.2](https://github.com/stallion-tech/react-native-stallion/compare/v2.3.1...v2.3.2) (2026-01-13) diff --git a/android/src/main/java/com/stallion/networkmanager/StallionPatchHandler.java b/android/src/main/java/com/stallion/networkmanager/StallionPatchHandler.java index c1dbf89..d25f5f6 100644 --- a/android/src/main/java/com/stallion/networkmanager/StallionPatchHandler.java +++ b/android/src/main/java/com/stallion/networkmanager/StallionPatchHandler.java @@ -50,7 +50,10 @@ public static void applyPatch(String baseBundlePath, String diffPath, boolean is // Create a temporary directory for the patched bundle File tempPatchedDir = new File(diffDir.getParent(), diffDir.getName() + "_patched_temp"); try { - // Copy base bundle to temporary location + // Clear any leftover temp dir, then copy base bundle + if (tempPatchedDir.exists()) { + StallionFileManager.deleteFileOrFolderSilently(tempPatchedDir); + } StallionFileManager.copyDirectory(baseBundleDir, tempPatchedDir); // Read and parse manifest.json diff --git a/android/src/main/java/com/stallion/storage/StallionConfig.java b/android/src/main/java/com/stallion/storage/StallionConfig.java index 2b48e3b..b5096b0 100644 --- a/android/src/main/java/com/stallion/storage/StallionConfig.java +++ b/android/src/main/java/com/stallion/storage/StallionConfig.java @@ -4,7 +4,6 @@ import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.res.Resources; -import android.provider.Settings; import org.json.JSONException; import org.json.JSONObject; @@ -53,7 +52,7 @@ public StallionConfig(Context context, SharedPreferences sharedPreferences) { ); this.publicSigningKey = stallionPublicKeyRes != 0 ? context.getString(stallionPublicKeyRes) : ""; - // get or generate UID + // get or generate UID (random install-scoped UUID) String cachedUniqueId = sharedPreferences.getString( StallionConfigConstants.UNIQUE_ID_IDENTIFIER, "" @@ -61,14 +60,7 @@ public StallionConfig(Context context, SharedPreferences sharedPreferences) { if(!cachedUniqueId.isEmpty()) { this.uid = cachedUniqueId; } else { - try { - this.uid = Settings.Secure.getString( - context.getContentResolver(), - Settings.Secure.ANDROID_ID - ); - } catch (Exception ignored) { - this.uid = UUID.randomUUID().toString(); - } + this.uid = UUID.randomUUID().toString(); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(StallionConfigConstants.UNIQUE_ID_IDENTIFIER, this.uid); editor.apply(); diff --git a/android/src/main/java/com/stallion/utils/StallionSlotManager.java b/android/src/main/java/com/stallion/utils/StallionSlotManager.java index 1632085..747ca70 100644 --- a/android/src/main/java/com/stallion/utils/StallionSlotManager.java +++ b/android/src/main/java/com/stallion/utils/StallionSlotManager.java @@ -69,6 +69,7 @@ public static void stabilizeProd() { File newSlot = new File(baseFolderPath, StallionConfigConstants.PROD_DIRECTORY + StallionConfigConstants.NEW_FOLDER_SLOT); File stableSlot = new File(baseFolderPath, StallionConfigConstants.PROD_DIRECTORY + StallionConfigConstants.STABLE_FOLDER_SLOT); + StallionFileManager.deleteFileOrFolderSilently(stableSlot); StallionFileManager.copyDirectory(newSlot, stableSlot); String newReleaseHash = stateManager.stallionMeta.getProdNewHash(); diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ce45c5e..93707dd 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -266,7 +266,7 @@ PODS: - React-jsinspector (0.71.10) - React-logger (0.71.10): - glog - - react-native-stallion (2.4.0-alpha.4): + - react-native-stallion (2.4.2): - RCT-Folly (= 2021.07.22.00) - React-Core - ZIPFoundation @@ -497,7 +497,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 4bb480a183a354e4dbfb1012936b1a2bb9357de7 React-jsinspector: cdc854f8b13abd202afa54bc12578e5afb9cfae1 React-logger: ef2269b3afa6ba868da90496c3e17a4ec4f4cee0 - react-native-stallion: 24b0975e63e09e3437a86cbfcf665c7643d0a647 + react-native-stallion: 5723bb5ff2923719fad7c0cc6f1d3578c6dc601b React-perflogger: 217095464d5c4bb70df0742fa86bf2a363693468 React-RCTActionSheet: 8deae9b85a4cbc6a2243618ea62a374880a2c614 React-RCTAnimation: 59c62353a8b59ce206044786c5d30e4754bffa64 diff --git a/example/ios/StallionExample/Info.plist b/example/ios/StallionExample/Info.plist index 84f00b1..28efb3b 100644 --- a/example/ios/StallionExample/Info.plist +++ b/example/ios/StallionExample/Info.plist @@ -2,16 +2,8 @@ - StallionPublicSigningKey - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApm9SgaDU9lXLi5OD6sd9 -WpNP8bWeGRzLYOReqH5yuu21kYTDaDt1/+vTpCBNuyX2ZjtKNvKujnAXuWf8Zfj4 -JcWb/r4clDQK0sNy8G7x7s+4Mup6W73lW5AtUnREQZX8IA00lp76r9ii6HYxXTpO -CgHpXyRyPLkMNc+HxaTmDHbldZtRCREcLldI7NnQkFMyZlHK2r1QxiQLpTIEK0vI -IJyXeHOeJUROebZn/UI7UDKiSCvlaHMsJ4pnIAyLrtqFQ8w9rf3aljmYX52m6Rbc -df8fwbWtBCH8OPW5SEDTMDzvE1siAvYwRNxbeXHMrAypPg/DaATdXoKMObjJWRm1 -owIDAQAB StallionAppToken - spb_qLFBKtdR9TBZtsKPDqMXvFD_ebcs-Tdjyc7F4-dX7q + spb_ap_Ss_cRvqX-B6iMGxIxKaUqTn9K-RgSmf4ZNTPhx4zjd StallionProjectId 67210b6f3e19d894c6a1a4fb CFBundleDevelopmentRegion diff --git a/example/src/App.tsx b/example/src/App.tsx index 221da64..e3e9ab5 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,9 +1,17 @@ import * as React from 'react'; -import { StyleSheet, View, Button, Text, Alert } from 'react-native'; +import { + StyleSheet, + View, + Button, + Text, + Alert, + Modal, + SafeAreaView, +} from 'react-native'; import { withStallion, - useStallionModal, + StallionDevMenu, useStallionUpdate, addEventListener, restart, @@ -11,19 +19,20 @@ import { } from 'react-native-stallion'; const App: React.FC = () => { - const { showModal } = useStallionModal(); + const [isDevMenuVisible, setIsDevMenuVisible] = React.useState(false); const { isRestartRequired, newReleaseBundle } = useStallionUpdate(); - // console.log(isRestartRequired, 'isRestartRequired', newReleaseBundle); - React.useEffect(() => { if (isRestartRequired) { - Alert.alert('New Release installed', JSON.stringify(newReleaseBundle), [ - { - text: 'Restart', - onPress: restart, - }, - ]); + Alert.alert( + 'New Release installed', + JSON.stringify(newReleaseBundle), + [ + { text: 'Cancel', style: 'cancel' }, + { text: 'Restart', onPress: restart }, + ], + { cancelable: true } + ); } }, [isRestartRequired, newReleaseBundle]); @@ -37,9 +46,20 @@ const App: React.FC = () => { return ( Hello world -