Skip to content

Commit af4797f

Browse files
author
信翼
committed
更新android工程
1 parent adc3895 commit af4797f

File tree

6 files changed

+99
-201
lines changed

6 files changed

+99
-201
lines changed

android/app/build.gradle

Lines changed: 47 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,76 @@
11
apply plugin: "com.android.application"
22

3-
import com.android.build.OutputFile
4-
5-
/**
6-
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7-
* and bundleReleaseJsAndAssets).
8-
* These basically call `react-native bundle` with the correct arguments during the Android build
9-
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10-
* bundle directly from the development server. Below you can see all the possible configurations
11-
* and their defaults. If you decide to add a configuration block, make sure to add it before the
12-
* `apply from: "../../node_modules/react-native/react.gradle"` line.
13-
*
14-
* project.ext.react = [
15-
* // the name of the generated asset file containing your JS bundle
16-
* bundleAssetName: "index.android.bundle",
17-
*
18-
* // the entry file for bundle generation
19-
* entryFile: "index.android.js",
20-
*
21-
* // whether to bundle JS and assets in debug mode
22-
* bundleInDebug: false,
23-
*
24-
* // whether to bundle JS and assets in release mode
25-
* bundleInRelease: true,
26-
*
27-
* // whether to bundle JS and assets in another build variant (if configured).
28-
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29-
* // The configuration property can be in the following formats
30-
* // 'bundleIn${productFlavor}${buildType}'
31-
* // 'bundleIn${buildType}'
32-
* // bundleInFreeDebug: true,
33-
* // bundleInPaidRelease: true,
34-
* // bundleInBeta: true,
35-
*
36-
* // whether to disable dev mode in custom build variants (by default only disabled in release)
37-
* // for example: to disable dev mode in the staging build type (if configured)
38-
* devDisabledInStaging: true,
39-
* // The configuration property can be in the following formats
40-
* // 'devDisabledIn${productFlavor}${buildType}'
41-
* // 'devDisabledIn${buildType}'
42-
*
43-
* // the root of your project, i.e. where "package.json" lives
44-
* root: "../../",
45-
*
46-
* // where to put the JS bundle asset in debug mode
47-
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
48-
*
49-
* // where to put the JS bundle asset in release mode
50-
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
51-
*
52-
* // where to put drawable resources / React Native assets, e.g. the ones you use via
53-
* // require('./image.png')), in debug mode
54-
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
55-
*
56-
* // where to put drawable resources / React Native assets, e.g. the ones you use via
57-
* // require('./image.png')), in release mode
58-
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
59-
*
60-
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
61-
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
62-
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
63-
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
64-
* // for example, you might want to remove it from here.
65-
* inputExcludes: ["android/**", "ios/**"],
66-
*
67-
* // override which node gets called and with what additional arguments
68-
* nodeExecutableAndArgs: ["node"],
69-
*
70-
* // supply additional arguments to the packager
71-
* extraPackagerArgs: []
72-
* ]
73-
*/
74-
753
apply from: "../../node_modules/react-native/react.gradle"
764

77-
/**
78-
* Set this to true to create two separate APKs instead of one:
79-
* - An APK that only works on ARM devices
80-
* - An APK that only works on x86 devices
81-
* The advantage is the size of the APK is reduced by about 4MB.
82-
* Upload all the APKs to the Play Store and people will download
83-
* the correct one based on the CPU architecture of their device.
84-
*/
85-
def enableSeparateBuildPerCPUArchitecture = false
86-
87-
/**
88-
* Run Proguard to shrink the Java bytecode in release builds.
89-
*/
90-
def enableProguardInReleaseBuilds = false
91-
925
android {
93-
compileSdkVersion 23
94-
buildToolsVersion "23.0.1"
6+
compileSdkVersion 30
957

968
defaultConfig {
97-
applicationId "com.umcomponent"
9+
applicationId "com.umeng.soexample"
9810
minSdkVersion 16
99-
targetSdkVersion 22
11+
targetSdkVersion 30
10012
versionCode 1
10113
versionName "1.0"
10214
ndk {
10315
abiFilters "armeabi-v7a", "x86"
10416
}
17+
manifestPlaceholders = [qqappid: "11111111111111111111"]
10518
}
106-
splits {
107-
abi {
108-
reset()
109-
enable enableSeparateBuildPerCPUArchitecture
110-
universalApk false // If true, also generate a universal APK
111-
include "armeabi-v7a", "x86"
19+
20+
signingConfigs {
21+
debug {
22+
storeFile file('debug.keystore')
23+
storePassword "android"
24+
keyAlias "androiddebugkey"
25+
keyPassword "android"
11226
}
11327
}
11428
buildTypes {
11529
release {
116-
minifyEnabled enableProguardInReleaseBuilds
117-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
30+
// 是否进行混淆
31+
minifyEnabled false
32+
proguardFiles 'proguard-rules.pro'
11833
}
119-
}
120-
// applicationVariants are e.g. debug, release
121-
applicationVariants.all { variant ->
122-
variant.outputs.each { output ->
123-
// For each separate APK per architecture, set a unique version code as described here:
124-
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
125-
def versionCodes = ["armeabi-v7a":1, "x86":2]
126-
def abi = output.getFilter(OutputFile.ABI)
127-
if (abi != null) { // null for the universal-debug, universal-release variants
128-
output.versionCodeOverride =
129-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
130-
}
34+
debug {
35+
// 是否进行混淆
36+
minifyEnabled false
37+
proguardFiles 'proguard-rules.pro'
13138
}
13239
}
13340
}
13441

13542
dependencies {
136-
compile fileTree(dir: "libs", include: ["*.jar"])
137-
compile "com.android.support:appcompat-v7:23.0.1"
138-
compile "com.facebook.react:react-native:+" // From node_modules
43+
api fileTree(include: ['*.jar'], dir: 'libs')
44+
api 'com.android.support:appcompat-v7:28.0.0'
45+
api 'com.facebook.react:react-native:+'
46+
// From node_modules
47+
//友盟基础库(必须)
48+
api 'com.umeng.umsdk:common:9.4.4'
49+
api 'com.umeng.umsdk:asms:1.4.1'
50+
51+
//友盟推送库
52+
api 'com.umeng.umsdk:push:6.4.4'
53+
//如果和支付宝sdk utdid冲突,可以集成支付宝无utdid版本,或者通过以下方式解决
54+
// api('com.umeng.umsdk:push:6.4.4') {
55+
// exclude group: 'com.umeng.umsdk', module: 'utdid'
56+
// }
57+
58+
//分享,登录
59+
implementation 'com.umeng.umsdk:share-core:7.1.6'
60+
implementation 'com.umeng.umsdk:share-board:7.1.6'
61+
implementation 'com.umeng.umsdk:share-qq:7.1.6'
62+
implementation 'com.umeng.umsdk:share-wx:7.1.6'
63+
implementation 'com.umeng.umsdk:share-sina:7.1.6'
64+
65+
//新浪微博官方SDK
66+
implementation fileTree(include: ['openDefault-10.10.0.aar'], dir:'libs')
67+
//QQ官方依赖库
68+
implementation 'com.tencent.tauth:qqopensdk:3.53.0'
69+
//微信官方依赖库
70+
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.9'
71+
13972
}
14073

141-
// Run this once to be able to run the application with BUCK
142-
// puts all compile dependencies into folder libs for BUCK to use
14374
task copyDownloadableDepsToLibs(type: Copy) {
14475
from configurations.compile
14576
into 'libs'
Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,54 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.umcomponent"
2+
package="com.umeng.soexample"
33
android:versionCode="1"
44
android:versionName="1.0">
5-
6-
<uses-permission android:name="android.permission.INTERNET" />
7-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
8-
9-
<uses-sdk
10-
android:minSdkVersion="16"
11-
android:targetSdkVersion="22" />
5+
<queries>
6+
<package android:name="com.tencent.mm" />
7+
<package android:name="com.tencent.mobileqq" />
8+
<package android:name="com.qzone" />
9+
<package android:name="com.sina.weibo" />
10+
</queries>
1211

1312
<application
14-
android:name=".MainApplication"
15-
android:allowBackup="true"
16-
android:label="@string/app_name"
17-
android:icon="@mipmap/ic_launcher"
18-
android:theme="@style/AppTheme">
19-
<activity
20-
android:name=".MainActivity"
13+
android:name=".MainApplication"
14+
android:allowBackup="true"
15+
android:icon="@mipmap/ic_launcher"
2116
android:label="@string/app_name"
22-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
23-
android:windowSoftInputMode="adjustResize">
24-
<intent-filter>
25-
<action android:name="android.intent.action.MAIN" />
26-
<category android:name="android.intent.category.LAUNCHER" />
27-
</intent-filter>
28-
</activity>
29-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
17+
android:theme="@style/AppTheme">
18+
<activity
19+
android:name=".MainActivity"
20+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
21+
android:label="@string/app_name"
22+
android:windowSoftInputMode="adjustResize">
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN" />
25+
<category android:name="android.intent.category.LAUNCHER" />
26+
</intent-filter>
27+
</activity>
28+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
29+
<activity
30+
android:name=".wxapi.WXEntryActivity"
31+
android:configChanges="keyboardHidden|orientation|screenSize"
32+
android:exported="true"
33+
android:screenOrientation="portrait"
34+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
35+
36+
<meta-data
37+
android:name="UMENG_APPKEY"
38+
android:value="561cae6ae0f55abd990035bf"></meta-data>
39+
3040
</application>
3141

42+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
43+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
44+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
45+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
46+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
47+
<uses-permission android:name="android.permission.INTERNET" />
48+
49+
<!-- renren sso Permission for Unit Test -->
50+
<!-- QQ、QQ空间所需权限 -->
51+
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
52+
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
53+
3254
</manifest>

android/app/src/main/java/com/umcomponent/MainActivity.java

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

android/app/src/main/java/com/umcomponent/MainApplication.java

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

android/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
buildscript {
44
repositories {
5+
google()
6+
mavenCentral()
57
jcenter()
68
}
79
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.3'
9-
10-
// NOTE: Do not place your application dependencies here; they belong
11-
// in the individual module build.gradle files
10+
classpath 'com.android.tools.build:gradle:4.2.2'
1211
}
1312
}
1413

1514
allprojects {
1615
repositories {
17-
mavenLocal()
16+
google()
17+
mavenCentral()
1818
jcenter()
1919
maven {
20-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2120
url "$rootDir/../node_modules/react-native/android"
2221
}
22+
mavenLocal()
2323
}
2424
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

0 commit comments

Comments
 (0)