Skip to content

Commit bec6e4d

Browse files
AronAron
authored andcommitted
feat: 修复安卓微信入口配置问题
1 parent c63f8ea commit bec6e4d

File tree

10 files changed

+180
-194
lines changed

10 files changed

+180
-194
lines changed
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
7+
8+
<queries>
9+
<package android:name="com.tencent.mm" />
10+
</queries>
11+
312
<application>
413
<activity
514
android:name=".wxapi.WXEntryActivity"
615
android:exported="true"
716
android:label="@string/app_name"
817
android:launchMode="singleTask"
918
android:theme="@android:style/Theme.Translucent.NoTitleBar"
19+
android:taskAffinity="${applicationId}"
1020
/>
11-
<activity
12-
android:name=".wxapi.WXPayEntryActivity"
21+
22+
<activity-alias
23+
android:name="${applicationId}.wxapi.WXEntryActivity"
1324
android:exported="true"
14-
android:label="@string/app_name"
15-
android:launchMode="singleTask"
16-
android:theme="@android:style/Theme.Translucent.NoTitleBar"
17-
/>
25+
android:launchMode="singleTop"
26+
android:targetActivity="expo.modules.wechat.wxapi.WXEntryActivity"
27+
android:taskAffinity="${applicationId}"
28+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
29+
30+
<activity-alias
31+
android:name="${applicationId}.wxapi.WXPayEntryActivity"
32+
android:exported="true"
33+
android:launchMode="singleInstance"
34+
android:targetActivity="expo.modules.wechat.wxapi.WXEntryActivity"
35+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
1836
</application>
1937
</manifest>

android/src/main/java/expo/modules/wechat/wxapi/WXPayEntryActivity.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
2-
<uses-permission android:name="android.permission.INTERNET"/>
3-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
4-
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
<uses-permission android:name="android.permission.VIBRATE"/>
7-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
8-
<queries>
9-
<intent>
10-
<action android:name="android.intent.action.VIEW"/>
11-
<category android:name="android.intent.category.BROWSABLE"/>
12-
<data android:scheme="https"/>
13-
</intent>
14-
</queries>
15-
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
16-
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
17-
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
18-
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
19-
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN"/>
22-
<category android:name="android.intent.category.LAUNCHER"/>
23-
</intent-filter>
24-
</activity>
25-
<activity android:name=".wxapi.WXEntryActivity" android:launchMode="singleTask" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="@string/app_name" android:taskAffinity="expo.modules.wechat.example"/>
26-
<activity android:name=".wxapi.WXPayEntryActivity" android:launchMode="singleTask" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="@string/app_name" android:taskAffinity="expo.modules.wechat.example"/>
27-
</application>
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
7+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
8+
<uses-permission android:name="android.permission.VIBRATE" />
9+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10+
11+
<queries>
12+
<intent>
13+
<action android:name="android.intent.action.VIEW" />
14+
<category android:name="android.intent.category.BROWSABLE" />
15+
<data android:scheme="https" />
16+
</intent>
17+
</queries>
18+
<application
19+
android:name=".MainApplication"
20+
android:allowBackup="true"
21+
android:icon="@mipmap/ic_launcher"
22+
android:label="@string/app_name"
23+
android:roundIcon="@mipmap/ic_launcher_round"
24+
android:supportsRtl="true"
25+
android:theme="@style/AppTheme">
26+
<meta-data
27+
android:name="expo.modules.updates.ENABLED"
28+
android:value="false" />
29+
<meta-data
30+
android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH"
31+
android:value="ALWAYS" />
32+
<meta-data
33+
android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS"
34+
android:value="0" />
35+
36+
<activity
37+
android:name=".MainActivity"
38+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode"
39+
android:exported="true"
40+
android:launchMode="singleTask"
41+
android:screenOrientation="portrait"
42+
android:theme="@style/Theme.App.SplashScreen"
43+
android:windowSoftInputMode="adjustResize">
44+
<intent-filter>
45+
<action android:name="android.intent.action.MAIN" />
46+
<category android:name="android.intent.category.LAUNCHER" />
47+
</intent-filter>
48+
</activity>
49+
</application>
2850
</manifest>

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ allprojects {
2626
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2727
url(reactNativeAndroidDir)
2828
}
29-
maven { url 'https://maven.aliyun.com/repository/public/' }
29+
3030
google()
3131
mavenCentral()
3232
maven { url 'https://www.jitpack.io' }

example/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,5 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true
5555
# Use legacy packaging to compress native libraries in the resulting APK.
5656
expo.useLegacyPackaging=false
5757

58-
59-
systemProp.http.protocols=TLSv1.2,TLSv1.3
6058
# Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin
6159
expo.edgeToEdgeEnabled=true

example/android/gradlew.bat

Lines changed: 94 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ PODS:
6868
- ReactCommon/turbomodule/bridging
6969
- ReactCommon/turbomodule/core
7070
- Yoga
71-
- ExpoWechat (0.1.5):
71+
- ExpoWechat (0.1.7):
7272
- ExpoModulesCore
73-
- WechatOpenSDK-XCFramework
73+
- WechatOpenSDK-XCFramework (~> 2.0.5)
7474
- fast_float (6.1.4)
7575
- FBLazyVector (0.79.2)
7676
- fmt (11.0.2)
@@ -1992,7 +1992,7 @@ SPEC CHECKSUMS:
19921992
ExpoImagePicker: 0963da31800c906e01c03e25d7c849f16ebf02a2
19931993
ExpoKeepAwake: bf0811570c8da182bfb879169437d4de298376e7
19941994
ExpoModulesCore: 5d37821c36f3781dcd0ea9a393800c90eaa6259d
1995-
ExpoWechat: 70e054472be3444fe3218aa7dc47d7418c5e6885
1995+
ExpoWechat: 1a80f3e6b6982a6eeb7f6fcf1e605075632582f7
19961996
fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6
19971997
FBLazyVector: 84b955f7b4da8b895faf5946f73748267347c975
19981998
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "expo-wechat",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "React Native expo package for Wechat Open SDK.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

0 commit comments

Comments
 (0)