Skip to content

Commit

Permalink
添加一些功能
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu2002s committed Jul 31, 2023
1 parent e596e57 commit 4dc5fb9
Show file tree
Hide file tree
Showing 102 changed files with 4,460 additions and 709 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
.cxx
local.properties
/app/build.gradle
/app/src/main/java/com/lanzou/split/service
/app/src/main/java/com/lanzou/split/service/UploadService.java
141 changes: 141 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed 6f7539561443bba8fcaf4fe74ae9a03.jpg
Binary file not shown.
Binary file removed 9b44cc730cf66bff9790af91108e020.jpg
Binary file not shown.
33 changes: 32 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<queries>
<intent>
<action android:name="android.intent.action.MAIN"/>
</intent>
</queries>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<application
android:name=".LanzouApplication"
android:allowBackup="true"
Expand All @@ -30,6 +38,10 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

<meta-data android:name="com.lanzou.split.LanzouGlideModule"
android:value="AppGlideModule"/>

<activity
android:name=".MainActivity"
android:exported="true">
Expand Down Expand Up @@ -58,6 +70,25 @@
android:label="下载信息"/>
<activity android:name=".ui.resolve.ResolveFileActivity"
android:label="解析文件"/>
<activity android:name=".ui.selector.FileSelectorActivity"
android:label="上传文件" />

<activity android:name=".ui.upload.ExternalUploadActivity"
android:label="上传文件"
android:launchMode="singleTask"
android:exported="true"
android:parentActivityName=".MainActivity">
<intent-filter
tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="*/*"/>
</intent-filter>
</activity>

<activity android:name=".ui.selector.PhoneFileActivity"/>

<service android:name=".service.DownloadService" />
<service android:name=".service.UploadService" />
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/assets/litepal.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<litepal>
<dbname value="lanzou" />
<version value="1" />
<version value="2" />
<list>
<mapping class="com.lanzou.split.data.User"/>
<mapping class="com.lanzou.split.data.Download"/>
<mapping class="com.lanzou.split.data.Upload"/>
</list>
</litepal>
6 changes: 6 additions & 0 deletions app/src/main/java/com/lanzou/split/LanzouApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
import android.app.Application;
import android.content.Context;

import com.google.android.material.color.DynamicColors;

import org.litepal.LitePal;

import ando.file.core.FileOperator;

public class LanzouApplication extends Application {

@SuppressLint("StaticFieldLeak")
Expand All @@ -20,6 +24,8 @@ public class LanzouApplication extends Application {
public void onCreate() {
super.onCreate();
context = this;
DynamicColors.applyToActivitiesIfAvailable(this);
LitePal.initialize(this);
FileOperator.INSTANCE.init(this, false);
}
}
37 changes: 37 additions & 0 deletions app/src/main/java/com/lanzou/split/LanzouGlideModule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.lanzou.split;

import android.content.Context;
import android.util.Log;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.module.AppGlideModule;
import com.lanzou.split.data.FileInfo;
import com.lanzou.split.utils.ApkLoaderFactory;

import java.io.InputStream;

@GlideModule
public class LanzouGlideModule extends AppGlideModule {
@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
super.applyOptions(context, builder);
Log.d("jdy", "applyOptions");
}

@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
// super.registerComponents(context, glide, registry);
Log.d("jdy", "register");
registry.prepend(FileInfo.class, InputStream.class, new ApkLoaderFactory(context));
}

@Override
public boolean isManifestParsingEnabled() {
return false;
}
}
Loading

0 comments on commit 4dc5fb9

Please sign in to comment.