Skip to content

Commit 41dbb4d

Browse files
committed
init project
0 parents  commit 41dbb4d

1,163 files changed

Lines changed: 87146 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/android.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Android CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v3
13+
- name: Set up JDK 11
14+
uses: actions/setup-java@v3
15+
with:
16+
distribution: 'adopt'
17+
java-version: '11'
18+
- name: Build with Gradle
19+
run: ./gradlew assembleDebug lintVitalRelease
20+
- name: Upload artifact
21+
uses: actions/upload-artifact@v3
22+
with:
23+
name: FileManager-debug.apk
24+
path: app/build/outputs/apk/debug/FileManager-debug.apk
25+
retention-days: 10

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/android/proguard-rules.pro
2+
/local.properties
3+
/.idea/
4+
# Default ignored files
5+
/shelf/
6+
/workspace.xml
7+
# Gradle files
8+
/.gradle
9+
10+
build/
11+
# release apk
12+
release/
13+
14+
# Local configuration file (sdk path, etc)
15+
local.properties
16+
17+
# Log/OS Files
18+
*.log
19+
20+
# Android Studio generated files and folders
21+
captures/
22+
.externalNativeBuild/
23+
.cxx/
24+
*.apk
25+
output.json
26+
27+
# IntelliJ
28+
*.iml
29+
.idea/
30+
misc.xml
31+
deploymentTargetDropDown.xml
32+
render.experimental.xml
33+
34+
# Keystore files
35+
*.keystore
36+
37+
# Google Services (e.g. APIs or Firebase)
38+
google-services.json
39+
40+
# Android Profiling
41+
*.hprof
42+
/android/project.properties
43+
/android/ic_launcher-web.png

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# FileManager
2+
[![Android CI 状态](https://github.com/HpBoss/FileManager/workflows/Android%20CI/badge.svg)](https://github.com/zhanghai/MaterialFiles/actions) [![GitHub 发行版](https://img.shields.io/github/v/release/HpBoss/FileManager)](https://github.com/zhanghai/MaterialFiles/releases) [![许可证](https://img.shields.io/github/license/HpBoss/FileManager?color=blue)](LICENSE)
3+
4+
File Manager for DuerOS
5+
6+
## 预览
7+
8+
<img src="art/left_drawer.png" alt="left_drawer" style="zoom:33%;" /><img src="art/main_page.png" alt="main_page" style="zoom:33%;" /><img src="art/list_layout.png" alt="list_layout" style="zoom:33%;" /><img src="art/more_operate.png" alt="more_operate" style="zoom:33%;" /><img src="art/recent.png" alt="recent" style="zoom:33%;" /><img src="art/search.png" alt="search" style="zoom:33%;" />
9+
10+
11+
12+
## 许可证
13+
14+
Copyright (C) 2023 HpBoss
15+
16+
This program is free software: you can redistribute it and/or modify
17+
it under the terms of the GNU General Public License as published by
18+
the Free Software Foundation, either version 3 of the License, or
19+
(at your option) any later version.
20+
21+
This program is distributed in the hope that it will be useful,
22+
but WITHOUT ANY WARRANTY; without even the implied warranty of
23+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24+
GNU General Public License for more details.
25+
26+
You should have received a copy of the GNU General Public License
27+
along with this program. If not, see <https://www.gnu.org/licenses/>.

app/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.cxx/
2+
/.externalNativeBuild/
3+
/build/
4+
/out/
5+
/schemas/

app/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
project(MaterialFiles C)
4+
5+
add_library(hiddenapi SHARED src/main/jni/hiddenapi.c)
6+
7+
find_library(LOG_LIBRARY log)
8+
add_library(syscalls SHARED src/main/jni/syscalls.c)
9+
target_link_libraries(syscalls ${LOG_LIBRARY})

app/build.gradle

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-kapt'
4+
kapt {
5+
correctErrorTypes = true
6+
}
7+
apply plugin: 'kotlin-parcelize'
8+
9+
buildscript {
10+
repositories {
11+
google()
12+
mavenCentral()
13+
}
14+
}
15+
16+
android {
17+
namespace 'com.baidu.duer.files'
18+
compileSdkVersion 33
19+
ndkVersion '25.1.8937393'
20+
buildToolsVersion '33.0.0'
21+
sourceSets {
22+
main.jniLibs.srcDirs = ['libs']
23+
}
24+
defaultConfig {
25+
applicationId 'com.baidu.duer.filemanager'
26+
minSdkVersion 26
27+
// Not supporting notification runtime permission yet.
28+
// noinspection OldTargetApi
29+
targetSdkVersion 32
30+
versionCode VERSION_CODE as int
31+
versionName VERSION_NAME as String
32+
resValue 'string', 'app_version', versionName + ' (' + versionCode + ')'
33+
buildConfigField 'String', 'FILE_PROVIDIER_AUTHORITY', 'APPLICATION_ID + ".file_provider"'
34+
buildConfigField 'String', 'URI_PROVIDIER_AUTHORITY', 'APPLICATION_ID + ".uri_provider"'
35+
resValue 'string', 'app_provider_authority', applicationId + '.app_provider'
36+
resValue 'string', 'file_provider_authority', applicationId + '.file_provider'
37+
resValue 'string', 'uri_provider_authority', applicationId + '.uri_provider'
38+
39+
javaCompileOptions {
40+
annotationProcessorOptions {
41+
arguments = ["room.schemaLocation":
42+
"$projectDir/schemas".toString()]
43+
}
44+
}
45+
46+
// FileManager Apk主进程CrabKey
47+
buildConfigField "String", "crab_key", "\"eafe1624018ec5a8\""
48+
}
49+
applicationVariants.all { variant ->
50+
variant.outputs.all { output ->
51+
if (variant.buildType.name == 'release' || variant.buildType.name == 'debug') {
52+
def fileName = "FileManager_${variant.buildType.name}_${VERSION_NAME}.apk"
53+
outputFileName = fileName
54+
}
55+
}
56+
}
57+
buildFeatures {
58+
viewBinding true
59+
}
60+
compileOptions {
61+
sourceCompatibility JavaVersion.VERSION_1_8
62+
targetCompatibility JavaVersion.VERSION_1_8
63+
}
64+
externalNativeBuild {
65+
cmake {
66+
path 'CMakeLists.txt'
67+
}
68+
}
69+
dataBinding {
70+
enabled = true
71+
}
72+
buildTypes {
73+
release {
74+
minifyEnabled true
75+
shrinkResources true
76+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
77+
// 因为APK会在Jenkins平台签v2签名(Sin_Apps_v2)因此工程中不配置签名
78+
}
79+
}
80+
packagingOptions {
81+
resources {
82+
excludes += ['META-INF/DEPENDENCIES']
83+
}
84+
}
85+
lint {
86+
warning 'InvalidPackage', 'MissingTranslation'
87+
}
88+
}
89+
90+
repositories {
91+
maven {
92+
url 'https://jitpack.io'
93+
}
94+
}
95+
96+
dependencies {
97+
98+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
99+
implementation fileTree(dir: 'libs', include: ['*.jar'])
100+
101+
// kotlinx-coroutines-android depends on kotlin-stdlib-jdk8
102+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
103+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$KOTLINX_COROUTINES_VERSION"
104+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLINX_COROUTINES_VERSION"
105+
106+
implementation 'androidx.appcompat:appcompat:1.5.1'
107+
implementation 'androidx.core:core-ktx:1.9.0'
108+
implementation 'androidx.exifinterface:exifinterface:1.3.5'
109+
implementation 'androidx.fragment:fragment-ktx:1.5.5'
110+
111+
implementation "androidx.lifecycle:lifecycle-common-java8:$ANDROIDX_LIFECYCLE_VERSION"
112+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$ANDROIDX_LIFECYCLE_VERSION"
113+
implementation "androidx.lifecycle:lifecycle-process:$ANDROIDX_LIFECYCLE_VERSION"
114+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$ANDROIDX_LIFECYCLE_VERSION"
115+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$ANDROIDX_LIFECYCLE_VERSION"
116+
implementation 'androidx.preference:preference-ktx:1.2.0'
117+
implementation 'androidx.recyclerview:recyclerview:1.2.1'
118+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
119+
implementation 'com.google.android.material:material:1.7.0'
120+
121+
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
122+
releaseImplementation 'com.github.mypplication:stetho-noop:1.1'
123+
implementation 'com.github.topjohnwu.libsu:service:5.0.3'
124+
implementation 'com.caverock:androidsvg-aar:1.4'
125+
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
126+
implementation 'com.drakeet.drawer:drawer:1.0.3'
127+
debugImplementation 'com.facebook.stetho:stetho:1.6.0'
128+
implementation 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:1.0.0'
129+
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'
130+
implementation('com.hierynomus:smbj:0.11.5') {
131+
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
132+
}
133+
implementation('com.hierynomus:sshj:0.32.0') {
134+
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
135+
}
136+
implementation 'com.jakewharton.threetenabp:threetenabp:1.4.0'
137+
implementation 'com.leinardi.android:speed-dial:3.1.1'
138+
implementation('com.rapid7.client:dcerpc:0.12.0') {
139+
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
140+
}
141+
implementation 'org.bouncycastle:bcprov-jdk15to18:1.70'
142+
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
143+
implementation 'com.takisoft.preferencex:preferencex:1.1.0'
144+
implementation 'commons-net:commons-net:3.8.0'
145+
146+
implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0'
147+
148+
implementation 'dev.chrisbanes:insetter-ktx:0.3.1'
149+
implementation 'dev.rikka.rikkax.preference:simplemenu-preference:1.0.3'
150+
implementation 'dev.rikka.shizuku:api:12.0.0'
151+
implementation 'eu.agno3.jcifs:jcifs-ng:2.1.6'
152+
def coil_version = '2.2.2'
153+
implementation "io.coil-kt:coil:$coil_version"
154+
implementation "io.coil-kt:coil-gif:$coil_version"
155+
implementation "io.coil-kt:coil-svg:$coil_version"
156+
implementation "io.coil-kt:coil-video:$coil_version"
157+
implementation 'me.zhanghai.android.appiconloader:appiconloader:1.5.0'
158+
implementation 'me.zhanghai.android.fastscroll:library:1.1.8'
159+
implementation 'me.zhanghai.android.foregroundcompat:library:1.0.2'
160+
implementation 'me.zhanghai.android.libselinux:library:2.1.0'
161+
implementation 'me.zhanghai.android.retrofile:library:1.1.1'
162+
implementation 'me.zhanghai.android.systemuihelper:library:1.0.0'
163+
implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.4'
164+
implementation 'org.apache.commons:commons-compress:1.20'
165+
// Optional dependency of Commons Compress for 7Z LZMA.
166+
implementation 'org.tukaani:xz:1.9'
167+
implementation 'org.apache.ftpserver:ftpserver-core:1.2.0'
168+
implementation('org.apache.mina:mina-core') {
169+
version {
170+
strictly '2.1.3'
171+
}
172+
}
173+
implementation "io.reactivex.rxjava3:rxjava:3.1.6"
174+
implementation 'com.github.junrar:junrar:7.4.1'
175+
176+
implementation("androidx.room:room-runtime:$ROOM_VERSION")
177+
annotationProcessor("androidx.room:room-compiler:$ROOM_VERSION")
178+
kapt("androidx.room:room-compiler:$ROOM_VERSION")
179+
implementation "androidx.room:room-ktx:$ROOM_VERSION"
180+
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5'
181+
implementation 'io.github.scwang90:refresh-header-classics:2.0.5'
182+
implementation 'com.github.penfeizhou.android.animation:awebp:2.24.0'
183+
implementation 'io.github.jeremyliao:live-event-bus-x:1.8.0'
184+
}

app/proguard-rules.pro

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
22+
23+
# Native methods
24+
# https://www.guardsquare.com/en/products/proguard/manual/examples#native
25+
-keepclasseswithmembernames,includedescriptorclasses class * {
26+
native <methods>;
27+
}
28+
29+
# App
30+
-keep class com.baidu.duer.files.** implements androidx.appcompat.view.CollapsibleActionView { *; }
31+
-keep class com.baidu.duer.files.provider.common.ByteString { *; }
32+
-keep class com.baidu.duer.files.provider.linux.syscall.** { *; }
33+
-keepnames class * extends java.lang.Exception
34+
# For Class.getEnumConstants()
35+
-keepclassmembers enum * {
36+
public static **[] values();
37+
}
38+
-keepnames class com.baidu.duer.files.** implements android.os.Parcelable
39+
40+
# Apache Commons Compress
41+
-dontwarn org.apache.commons.compress.compressors.**
42+
-dontwarn org.apache.commons.compress.archivers.**
43+
# com.baidu.duer.files.provider.archive.archiver.ArchiveWriter.sTarArchiveEntryLinkFlagsField
44+
-keepclassmembers class org.apache.commons.compress.archivers.tar.TarArchiveEntry {
45+
byte linkFlag;
46+
}
47+
48+
# Apache FtpServer
49+
-keepclassmembers class * implements org.apache.mina.core.service.IoProcessor {
50+
public <init>(java.util.concurrent.ExecutorService);
51+
public <init>(java.util.concurrent.Executor);
52+
public <init>();
53+
}
54+
55+
# Bouncy Castle
56+
-keep class org.bouncycastle.jcajce.provider.** { *; }
57+
-keep class org.bouncycastle.jce.provider.** { *; }
58+
59+
# Stetho No-op
60+
# This library includes the no-op for stetho-okhttp3 which requires okhttp3, but we never used it.
61+
-dontwarn com.facebook.stetho.okhttp3.StethoInterceptor
62+
63+
# LiveEventBus
64+
-dontwarn com.jeremyliao.liveeventbus.**
65+
-keep class com.jeremyliao.liveeventbus.** { *; }
66+
-keep class androidx.lifecycle.** { *; }
67+
-keep class androidx.arch.core.** { *; }

0 commit comments

Comments
 (0)