Skip to content

Commit f707498

Browse files
author
Kureev Alexey
committed
Update patch structure for legacy versions
1 parent 8450d97 commit f707498

File tree

8 files changed

+38
-62
lines changed

8 files changed

+38
-62
lines changed

src/android/patches/0.17/addPackagePatch.js

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function makeImportPatch(packageImportPath) {
2+
return {
3+
pattern: 'import android.app.Activity;',
4+
patch: '\n' + packageImportPath,
5+
};
6+
};

src/android/patches/0.17/makeMainActivityPatch.js

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = function makePackagePatch(packageInstance, params) {
2+
const processedInstance = packageInstance.replace(
3+
/\$\{(\w+)\}/g,
4+
(pattern, paramName) => params[paramName]
5+
? `this.getResources().getString(R.strings.${paramName})`
6+
: null
7+
);
8+
9+
return {
10+
pattern: '.addPackage(new MainReactPackage())',
11+
patch: `\n .addPackage(${processedInstance})`
12+
};
13+
};

src/android/patches/0.18/addPackagePatch.js

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function makeImportPatch(packageImportPath) {
2+
return {
3+
pattern: 'import com.facebook.react.ReactActivity;',
4+
patch: '\n' + packageImportPath,
5+
};
6+
};

src/android/patches/0.18/makeMainActivityPatch.js

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = function makePackagePatch(packageInstance, params) {
2+
const processedInstance = packageInstance.replace(
3+
/\$\{(\w+)\}/g,
4+
(pattern, paramName) => params[paramName]
5+
? `this.getResources().getString(R.strings.${paramName})`
6+
: null
7+
);
8+
9+
return {
10+
pattern: 'new MainReactPackage()',
11+
patch: ',\n ' + processedInstance,
12+
};
13+
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy