结构优化

serial
BlueMatthew 2 years ago
parent 7fe286ef7b
commit 4530a4ed8c

@ -78,6 +78,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.8.0'
implementation project(path: ':common')
// implementation 'androidx.camera:camera-video:1.2.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
@ -89,6 +90,7 @@ dependencies {
// implementation project(path: ':opencv')
implementation files('libs/devapi.aar')
// implementation group: 'io.netty', name: 'netty-all', version: '4.1.96.Final'
// implementation 'io.netty:netty-all:4.1.23.Final'
// implementation 'org.apache.logging.log4j:log4j-api:2.14.0'

@ -129,7 +129,7 @@
</receiver>
<receiver
android:name=".UpdateReceiver"
android:name="com.xypower.common.UpdateReceiver"
android:enabled="true"
android:exported="true" >
<intent-filter android:priority="90000">

@ -7,7 +7,6 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
@ -20,6 +19,7 @@ import android.text.TextUtils;
import android.util.Pair;
import com.dev.devapi.api.SysApi;
import com.xypower.common.FileDownloader;
import org.json.JSONObject;

@ -44,6 +44,7 @@ import android.widget.RemoteViews;
import android.widget.Toast;
import com.dev.devapi.api.SysApi;
import com.xypower.common.FileDownloader;
import java.io.File;
import java.lang.reflect.Method;

1
common/.gitignore vendored

@ -0,0 +1 @@
/build

@ -0,0 +1,36 @@
plugins {
id 'com.android.library'
}
android {
compileSdk 32
defaultConfig {
minSdk 25
targetSdk 32
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation files('libs/devapi.aar')
}

Binary file not shown.

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xypower.common">
</manifest>

@ -1,4 +1,4 @@
package com.xypower.mpapp;
package com.xypower.common;
import android.text.TextUtils;
import android.util.Log;
@ -15,7 +15,7 @@ import java.net.Socket;
import java.net.URL;
public class FileDownloader {
protected boolean download(String urlString, String filePath) {
public boolean download(String urlString, String filePath) {
File downloadFile = null;
if (TextUtils.isEmpty(urlString))
return false;

@ -0,0 +1,4 @@
package com.xypower.common;
public class MicroPhotoContext {
}

@ -1,4 +1,4 @@
package com.xypower.mpapp;
package com.xypower.common;
import android.content.BroadcastReceiver;
import android.content.Context;

@ -7,7 +7,7 @@ android {
defaultConfig {
applicationId "com.xypower.mpmaster"
minSdk 28
minSdk 25
targetSdk 32
versionCode 1
versionName "1.0"
@ -32,6 +32,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation project(path: ':common')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

@ -19,3 +19,4 @@ include ':mpmaster'
// include ':opencv'
// project(':opencv').projectDir = new File(opencvsdk + '/sdk')
include ':common'

Loading…
Cancel
Save