forked from nnjun/BlackDex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request CodingGay#1 from wukaicheng/main
新UI
- Loading branch information
Showing
48 changed files
with
1,269 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
app/src/androidTest/java/top/niunaijun/blackdex/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/top/niunaijun/blackdex/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package top.niunaijun.blackdex | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("top.niunaijun.blackdex", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package top.niunaijun.blackdex | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import top.niunaijun.blackbox.BlackDexCore | ||
import top.niunaijun.blackbox.app.configuration.ClientConfiguration | ||
import top.niunaijun.blackdex.data.BlackDexConfiguration | ||
|
||
/** | ||
* | ||
* @Description: | ||
* @Author: wukaicheng | ||
* @CreateDate: 2021/5/23 14:00 | ||
*/ | ||
class App : Application() { | ||
|
||
override fun attachBaseContext(base: Context?) { | ||
super.attachBaseContext(base) | ||
BlackDexCore.get().doAttachBaseContext(base,BlackDexConfiguration(base!!)) | ||
} | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
BlackDexCore.get().doCreate() | ||
} | ||
} |
45 changes: 0 additions & 45 deletions
45
app/src/main/java/top/niunaijun/blackdex/MainActivity.java
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
app/src/main/java/top/niunaijun/blackdex/data/BlackDexConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package top.niunaijun.blackdex.data | ||
|
||
import android.content.Context | ||
import top.niunaijun.blackbox.app.configuration.ClientConfiguration | ||
import top.niunaijun.blackbox.utils.FileUtils | ||
import top.niunaijun.blackbox.utils.compat.BuildCompat | ||
import java.io.File | ||
|
||
/** | ||
* | ||
* @Description: 启动配置文件 | ||
* @Author: wukaicheng | ||
* @CreateDate: 2021/5/23 14:04 | ||
*/ | ||
class BlackDexConfiguration(private val context: Context) : ClientConfiguration() { | ||
|
||
companion object { | ||
fun getDexDumpDir(context: Context): String { | ||
return if (BuildCompat.isR()) { | ||
val dump = File(context.externalCacheDir?.parentFile?.parentFile?.parentFile?.parentFile, "Download/dexDump") | ||
FileUtils.mkdirs(dump) | ||
dump.absolutePath | ||
} else { | ||
val dump = File(context.externalCacheDir?.parentFile, "dump") | ||
FileUtils.mkdirs(dump) | ||
dump.absolutePath | ||
} | ||
} | ||
} | ||
|
||
private val dir = getDexDumpDir(context) | ||
|
||
override fun getHostPackageName(): String { | ||
return context.packageName | ||
} | ||
|
||
override fun getDexDumpDir(): String { | ||
return dir | ||
} | ||
|
||
} |
Oops, something went wrong.