Skip to content

Commit 9d87355

Browse files
committed
chore: revert android changes
1 parent e1047a2 commit 9d87355

File tree

7 files changed

+15
-69
lines changed

7 files changed

+15
-69
lines changed

android/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ def safeExtGet(prop, fallback) {
4040
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
4141
}
4242

43-
def isNewArchitectureEnabled() {
44-
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
45-
}
46-
4743
android {
4844
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
4945
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
@@ -52,7 +48,6 @@ android {
5248
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
5349
versionCode 1
5450
versionName "1.0"
55-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
5651
}
5752
lintOptions {
5853
abortOnError false

android/src/main/java/com/reactnativelauncharguments/LaunchArgumentsModule.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
public class LaunchArgumentsModule extends ReactContextBaseJavaModule {
2222

23-
public static final String NAME = "LaunchArguments";
24-
2523
private static final long ACTIVITY_WAIT_INTERVAL = 100L;
2624
private static final int ACTIVITY_WAIT_TRIES = 200;
2725

@@ -34,7 +32,7 @@ public class LaunchArgumentsModule extends ReactContextBaseJavaModule {
3432
@NonNull
3533
@Override
3634
public String getName() {
37-
return NAME;
35+
return "LaunchArguments";
3836
}
3937

4038
@Nullable
Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,23 @@
11
package com.reactnativelauncharguments;
22

3-
import com.facebook.react.BaseReactPackage;
3+
import com.facebook.react.ReactPackage;
44
import com.facebook.react.bridge.NativeModule;
55
import com.facebook.react.bridge.ReactApplicationContext;
6-
import com.facebook.react.module.model.ReactModuleInfo;
7-
import com.facebook.react.module.model.ReactModuleInfoProvider;
8-
import com.facebook.react.TurboReactPackage;
6+
import com.facebook.react.uimanager.ViewManager;
97

10-
import java.util.HashMap;
11-
import java.util.Map;
8+
import java.util.Collections;
9+
import java.util.List;
1210

13-
import javax.annotation.Nonnull;
14-
import javax.annotation.Nullable;
15-
16-
public class LaunchArgumentsPackage extends TurboReactPackage {
17-
18-
@Nullable
11+
public class LaunchArgumentsPackage implements ReactPackage {
12+
1913
@Override
20-
public NativeModule getModule(String name, @Nonnull ReactApplicationContext reactContext) {
21-
if (name.equals(LaunchArgumentsModule.NAME)) {
22-
return new LaunchArgumentsModule(reactContext);
23-
} else {
24-
return null;
25-
}
14+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
15+
return Collections.emptyList();
2616
}
2717

2818
@Override
29-
public ReactModuleInfoProvider getReactModuleInfoProvider() {
30-
return () -> {
31-
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
32-
boolean isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
33-
moduleInfos.put(
34-
LaunchArgumentsModule.NAME,
35-
new ReactModuleInfo(
36-
LaunchArgumentsModule.NAME,
37-
LaunchArgumentsModule.NAME,
38-
false, // canOverrideExistingModule
39-
false, // needsEagerInit
40-
true, // hasConstants
41-
false, // isCxxModule
42-
isTurboModule // isTurboModule
43-
));
44-
return moduleInfos;
45-
};
19+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
20+
final NativeModule nativeModule = new LaunchArgumentsModule(reactContext);
21+
return Collections.singletonList(nativeModule);
4622
}
4723
}

src/NativeLaunchArguments.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ const LINKING_ERROR =
66
"- You rebuilt the app after installing the package\n" +
77
"- You are not using Expo managed workflow\n";
88

9-
const isTurboModuleEnabled = global.__turboModuleProxy != null;
10-
11-
const LaunchArgumentsModule = isTurboModuleEnabled
12-
? require('./NativeLaunchArguments').default
13-
: NativeModules.LaunchArguments
9+
const LaunchArgumentsModule = NativeModules.LaunchArguments
1410
? NativeModules.LaunchArguments
1511
: new Proxy(
1612
{},
@@ -39,11 +35,7 @@ export const LaunchArguments: LaunchArgumentsType = {
3935

4036
parsed = {};
4137

42-
const constants = isTurboModuleEnabled
43-
? LaunchArgumentsModule.getConstants()
44-
: LaunchArgumentsModule;
45-
46-
const raw = constants.value as RawMap;
38+
const raw = LaunchArgumentsModule.value as RawMap;
4739

4840
for (const k in raw) {
4941
const rawValue = raw[k];

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"strict": true,
2323
"target": "esnext"
2424
},
25-
"include": ["src", "typings/global.d.ts"]
25+
"include": ["src"]
2626
}

typings/global.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)