Skip to content

Commit

Permalink
Feat:Hide startup icon
Browse files Browse the repository at this point in the history
  • Loading branch information
icespite committed Dec 31, 2021
1 parent b594461 commit caff3ea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
/captures
.externalNativeBuild
.cxx

app/release/
16 changes: 15 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
apply plugin: 'com.android.application'

def releaseTime() {
return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
Expand All @@ -9,7 +13,7 @@ android {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
versionName "1.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -20,6 +24,16 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

applicationVariants.all { variant ->
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = "WXHook_v${defaultConfig.versionName}_${variant.name}_${releaseTime()}.apk"
outputFileName = fileName
}
}
}
}

dependencies {
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.icespite.wxhook">

<application
Expand All @@ -24,8 +25,12 @@

<activity android:name="com.icespite.wxhook.MainActivity">
<intent-filter>
<!-- 隐藏启动图标 -->
<data
android:host="MainActivity"
android:scheme="com.icespite.wxhook"
tools:ignore="AppLinkUrlError" />
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down

0 comments on commit caff3ea

Please sign in to comment.