Skip to content

Commit

Permalink
Reconstruction project and detail optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
molihuan committed Dec 12, 2022
1 parent 6630b7d commit f2cad25
Show file tree
Hide file tree
Showing 339 changed files with 51,119 additions and 12,110 deletions.
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.

6 changes: 2 additions & 4 deletions .idea/gradle.xml

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

15 changes: 15 additions & 0 deletions .idea/jarRepositories.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/saveactions_settings.xml

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

1 change: 1 addition & 0 deletions AndroidUtilCode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions AndroidUtilCode/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 14
versionCode 1
versionName "1.31.1"
consumerProguardFiles 'proguard-rules.pro'
}

buildTypes {
release {
minifyEnabled false
consumerProguardFiles 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'androidx.appcompat:appcompat:1.2.0'
compileOnly 'com.google.android.material:material:1.0.0'
}
28 changes: 28 additions & 0 deletions AndroidUtilCode/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in G:\Android_IDE\ADT\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}
-dontwarn com.blankj.utilcode.**

-keepclassmembers class * {
@com.blankj.molihuan.utilcode.util.BusUtils$Bus <methods>;
}

-keep public class * extends com.blankj.molihuan.utilcode.util.ApiUtils$BaseApi
-keep,allowobfuscation @interface com.blankj.molihuan.utilcode.util.ApiUtils$Api
-keep @com.blankj.molihuan.utilcode.util.ApiUtils$Api class *

-keepattributes *Annotation*
48 changes: 48 additions & 0 deletions AndroidUtilCode/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blankj.molihuan.utilcode">

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

<application>

<activity
android:name="com.blankj.molihuan.utilcode.util.UtilsTransActivity4MainProcess"
android:exported="false"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/ActivityTranslucent"
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" />

<activity
android:name="com.blankj.molihuan.utilcode.util.UtilsTransActivity"
android:exported="false"
android:configChanges="orientation|keyboardHidden|screenSize"
android:multiprocess="true"
android:theme="@style/ActivityTranslucent"
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" />

<provider
android:name="com.blankj.molihuan.utilcode.util.UtilsFileProvider"
android:authorities="${applicationId}.utilcode.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/util_code_provider_paths" />
</provider>

<service
android:name="com.blankj.molihuan.utilcode.util.MessengerUtils$ServerService"
android:exported="false">
<intent-filter>
<action android:name="${applicationId}.messenger" />
</intent-filter>
</service>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.blankj.molihuan.utilcode.constant;

/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2018/06/13
* desc : constants of cache
* </pre>
*/
public interface CacheConstants {
int SEC = 1;
int MIN = 60;
int HOUR = 3600;
int DAY = 86400;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.blankj.molihuan.utilcode.constant;

import androidx.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2017/03/13
* desc : constants of memory
* </pre>
*/
public final class MemoryConstants {

public static final int BYTE = 1;
public static final int KB = 1024;
public static final int MB = 1048576;
public static final int GB = 1073741824;

@IntDef({BYTE, KB, MB, GB})
@Retention(RetentionPolicy.SOURCE)
public @interface Unit {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package com.blankj.molihuan.utilcode.constant;

import android.Manifest.permission;
import android.annotation.SuppressLint;
import android.os.Build;
import androidx.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;


/**
* <pre>
* author: Blankj
* blog : http://blankj.com
* time : 2017/12/29
* desc : constants of permission
* </pre>
*/
@SuppressLint("InlinedApi")
public final class PermissionConstants {

public static final String CALENDAR = "CALENDAR";
public static final String CAMERA = "CAMERA";
public static final String CONTACTS = "CONTACTS";
public static final String LOCATION = "LOCATION";
public static final String MICROPHONE = "MICROPHONE";
public static final String PHONE = "PHONE";
public static final String SENSORS = "SENSORS";
public static final String SMS = "SMS";
public static final String STORAGE = "STORAGE";
public static final String ACTIVITY_RECOGNITION = "ACTIVITY_RECOGNITION";

private static final String[] GROUP_CALENDAR = {
permission.READ_CALENDAR, permission.WRITE_CALENDAR
};
private static final String[] GROUP_CAMERA = {
permission.CAMERA
};
private static final String[] GROUP_CONTACTS = {
permission.READ_CONTACTS, permission.WRITE_CONTACTS, permission.GET_ACCOUNTS
};
private static final String[] GROUP_LOCATION = {
permission.ACCESS_FINE_LOCATION, permission.ACCESS_COARSE_LOCATION, permission.ACCESS_BACKGROUND_LOCATION
};
private static final String[] GROUP_MICROPHONE = {
permission.RECORD_AUDIO
};
private static final String[] GROUP_PHONE = {
permission.READ_PHONE_STATE, permission.READ_PHONE_NUMBERS, permission.CALL_PHONE,
permission.READ_CALL_LOG, permission.WRITE_CALL_LOG, permission.ADD_VOICEMAIL,
permission.USE_SIP, permission.PROCESS_OUTGOING_CALLS, permission.ANSWER_PHONE_CALLS
};
private static final String[] GROUP_PHONE_BELOW_O = {
permission.READ_PHONE_STATE, permission.READ_PHONE_NUMBERS, permission.CALL_PHONE,
permission.READ_CALL_LOG, permission.WRITE_CALL_LOG, permission.ADD_VOICEMAIL,
permission.USE_SIP, permission.PROCESS_OUTGOING_CALLS
};
private static final String[] GROUP_SENSORS = {
permission.BODY_SENSORS
};
private static final String[] GROUP_SMS = {
permission.SEND_SMS, permission.RECEIVE_SMS, permission.READ_SMS,
permission.RECEIVE_WAP_PUSH, permission.RECEIVE_MMS,
};
private static final String[] GROUP_STORAGE = {
permission.READ_EXTERNAL_STORAGE, permission.WRITE_EXTERNAL_STORAGE,
};
private static final String[] GROUP_ACTIVITY_RECOGNITION = {
permission.ACTIVITY_RECOGNITION,
};

@StringDef({CALENDAR, CAMERA, CONTACTS, LOCATION, MICROPHONE, PHONE, SENSORS, SMS, STORAGE,})
@Retention(RetentionPolicy.SOURCE)
public @interface PermissionGroup {
}

public static String[] getPermissions(@PermissionGroup final String permission) {
if (permission == null) return new String[0];
switch (permission) {
case CALENDAR:
return GROUP_CALENDAR;
case CAMERA:
return GROUP_CAMERA;
case CONTACTS:
return GROUP_CONTACTS;
case LOCATION:
return GROUP_LOCATION;
case MICROPHONE:
return GROUP_MICROPHONE;
case PHONE:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return GROUP_PHONE_BELOW_O;
} else {
return GROUP_PHONE;
}
case SENSORS:
return GROUP_SENSORS;
case SMS:
return GROUP_SMS;
case STORAGE:
return GROUP_STORAGE;
case ACTIVITY_RECOGNITION:
return GROUP_ACTIVITY_RECOGNITION;
}
return new String[]{permission};
}
}
Loading

0 comments on commit f2cad25

Please sign in to comment.