提交 28f24faf 编写于 作者: B Blankj

see 02/22 log

上级 275a44b0
* `21/02/22` [add] Fix ToastUtils rtl bug. Publish v1.30.6.
* `20/11/16` [add] Add ImageUtils#save2Album support param of dirName.
* `20/11/13` [add] Fix MessengerUtils ANR. Add NetworkUtils#getWifiScanResult, [add|remove]OnWifiChangedConsumer. Publish v1.30.5.
* `20/10/29` [add] Fix MessengerUtils startService IllegalStateException. Publish v1.30.4.
* `20/10/28` [add] Fix BusUtils ConcurrentModificationException. Publish v1.30.3.
......
......@@ -14,8 +14,8 @@ class Config {
static compileSdkVersion = 29
static minSdkVersion = 14
static targetSdkVersion = 29
static versionCode = 1_030_005
static versionName = '1.30.5'// E.g. 1.9.72 => 1,009,072
static versionCode = 1_030_006
static versionName = '1.30.6'// E.g. 1.9.72 => 1,009,072
// lib version
static gradlePluginVersion = '3.5.0'
......
......@@ -7,6 +7,7 @@
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
......
......@@ -47,10 +47,10 @@ class MainActivity : CommonActivity() {
super.initView(savedInstanceState, contentView)
setCommonItems(mainRv, CollectionUtils.newArrayList<CommonItem<*>>(
CommonItemClick(R.string.core_util, true) {
ApiUtils.getApi(UtilCodeApi::class.java).startUtilCodeActivity(this)
ApiUtils.getApi(UtilCodeApi::class.java)?.startUtilCodeActivity(this)
},
CommonItemClick(R.string.sub_util, true) {
ApiUtils.getApi(SubUtilApi::class.java).startSubUtilActivity(this)
ApiUtils.getApi(SubUtilApi::class.java)?.startSubUtilActivity(this)
}
))
......
......@@ -35,10 +35,10 @@ class ApiActivity : CommonActivity() {
override fun bindItems(): MutableList<CommonItem<*>> {
return CollectionUtils.newArrayList(
CommonItemClick(R.string.api_invoke_with_params) {
ApiUtils.getApi(OtherModuleApi::class.java).invokeWithParams(OtherModuleApi.ApiBean("params"))
ApiUtils.getApi(OtherModuleApi::class.java)?.invokeWithParams(OtherModuleApi.ApiBean("params"))
},
CommonItemClick(R.string.api_invoke_with_return_value) {
ToastUtils.showShort(ApiUtils.getApi(OtherModuleApi::class.java).invokeWithReturnValue().name)
ToastUtils.showShort(ApiUtils.getApi(OtherModuleApi::class.java)?.invokeWithReturnValue()?.name)
}
);
}
......
......@@ -3,8 +3,6 @@ package com.blankj.utilcode.pkg.feature.clean
import android.content.Context
import android.content.Intent
import com.blankj.common.activity.CommonActivity
import com.blankj.common.activity.CommonActivityItemsView
import com.blankj.common.activity.CommonActivityTitleView
import com.blankj.common.item.CommonItem
import com.blankj.common.item.CommonItemClick
import com.blankj.utilcode.pkg.R
......@@ -54,6 +52,11 @@ class CleanActivity : CommonActivity() {
showSnackbar(CleanUtils.cleanExternalCache(), externalCacheDir?.absolutePath)
})
}
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
add(CommonItemClick(R.string.clean_app_user_data) {
CleanUtils.cleanAppUserData()
})
}
}
}
......
......@@ -10,8 +10,7 @@ import com.blankj.common.item.CommonItemClick
import com.blankj.common.item.CommonItemTitle
import com.blankj.utilcode.pkg.R
import com.blankj.utilcode.pkg.helper.DialogHelper
import com.blankj.utilcode.util.CollectionUtils
import com.blankj.utilcode.util.KeyboardUtils
import com.blankj.utilcode.util.*
import kotlinx.android.synthetic.main.keyboard_activity.*
/**
......
......@@ -60,6 +60,9 @@ class LanguageActivity : CommonActivity() {
CommonItemClick(R.string.language_apply_english) {
LanguageUtils.applyLanguage(Locale.ENGLISH, isRelaunchApp())
},
CommonItemClick(R.string.language_apply_arabic) {
LanguageUtils.applyLanguage(Locale("ar"), isRelaunchApp())
},
CommonItemClick(R.string.language_apply_system) {
LanguageUtils.applySystemLanguage(isRelaunchApp())
}
......
......@@ -54,8 +54,8 @@ class PhoneActivity : CommonActivity() {
CommonItemTitle("getSimOperatorName", PhoneUtils.getSimOperatorName()),
CommonItemTitle("getSimOperatorByMnc", PhoneUtils.getSimOperatorByMnc()),
CommonItemClick(R.string.phone_dial) { PhoneUtils.dial("10000") },
CommonItemClick(R.string.phone_call) { PhoneUtils.call("10000") },
CommonItemClick(R.string.phone_dial) { PhoneUtils.dial("*10000#haha") },
CommonItemClick(R.string.phone_call) { PhoneUtils.call("*10000#haha") },
CommonItemClick(R.string.phone_send_sms) { PhoneUtils.sendSms("10000", "sendSms") }
)
}
......
......@@ -79,6 +79,9 @@ class ToastActivity : CommonActivity() {
CommonItemClick(R.string.toast_show_middle) {
ToastUtils.make().setGravity(Gravity.CENTER, 0, 0).show(R.string.toast_middle)
},
CommonItemClick(R.string.toast_show_top) {
ToastUtils.make().setGravity(Gravity.TOP or Gravity.CENTER_HORIZONTAL, 0, 0).show(R.string.toast_top)
},
CommonItemClick(R.string.toast_show_custom_view) {
Thread(Runnable { CustomToast.showLong(R.string.toast_custom_view) }).start()
},
......
......@@ -6,6 +6,7 @@
<string name="language_apply_simple_chinese">Apply Simple Chinese</string>
<string name="language_apply_american">Apply American</string>
<string name="language_apply_english">Apply English</string>
<string name="language_apply_arabic">Apply Arabic</string>
<string name="language_apply_system">Apply System</string>
</resources>
\ No newline at end of file
......@@ -6,6 +6,7 @@
<string name="language_apply_simple_chinese">设置简体中文</string>
<string name="language_apply_american">设置美语</string>
<string name="language_apply_english">设置英语</string>
<string name="language_apply_arabic">设置阿拉伯语</string>
<string name="language_apply_system">设置系统语言</string>
</resources>
\ No newline at end of file
......@@ -141,6 +141,7 @@
<string name="clean_internal_databases">Clean Internal Databases</string>
<string name="clean_internal_sp">Clean Internal SP</string>
<string name="clean_external_cache">Clean External Cache</string>
<string name="clean_app_user_data">cleanAppUserData</string>
<!--Click 相关-->
<string name="click_view_scale_default">Click View Scale Default</string>
......@@ -233,6 +234,7 @@
<string name="language_apply_simple_chinese">Apply Simple Chinese</string>
<string name="language_apply_american">Apply American</string>
<string name="language_apply_english">Apply English</string>
<string name="language_apply_arabic">Apply Arabic</string>
<string name="language_apply_system">Apply System</string>
<!--Log 相关-->
......@@ -341,6 +343,7 @@
<string name="toast_show_custom_view">Show Custom View</string>
<string name="toast_custom_view">Custom View</string>
<string name="toast_show_middle">Show Middle</string>
<string name="toast_show_top">Show Top</string>
<string name="toast_cancel">Cancel</string>
<string name="toast_show_toast_dialog">Show Toast Dialog</string>
<string name="toast_show_toast_when_start_activity">Show Toast When Start Activity</string>
......@@ -351,6 +354,7 @@
<string name="toast_custom_bg">Custom Bg</string>
<string name="toast_span">Spannable String</string>
<string name="toast_middle">Middle</string>
<string name="toast_top">Top</string>
<!--UiMessage 相关-->
<string name="uiMessage_add_listener_id">Add Listener Id</string>
......
......@@ -89,7 +89,7 @@ public abstract class BaseFragment extends Fragment
} else {
ft.show(this);
}
ft.commitAllowingStateLoss();
ft.commitNowAllowingStateLoss();
}
Bundle bundle = getArguments();
initData(bundle);
......
package com.blankj.subutil.util;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Build;
import android.os.PowerManager;
import android.support.annotation.IntDef;
import android.support.annotation.RequiresApi;
import com.blankj.utilcode.util.ThreadUtils;
import com.blankj.utilcode.util.Utils;
......@@ -37,6 +39,32 @@ public final class BatteryUtils {
int FULL = BatteryManager.BATTERY_STATUS_FULL;
}
/**
* Return whether the app is on the device's power whitelist.
*
* @return {@code true}: yes<br>{@code false}: no
*/
@RequiresApi(api = Build.VERSION_CODES.M)
public static boolean isIgnoringBatteryOptimizations() {
return isIgnoringBatteryOptimizations(Utils.getApp().getPackageName());
}
/**
* Return whether the app is on the device's power whitelist.
*
* @return {@code true}: yes<br>{@code false}: no
*/
@RequiresApi(api = Build.VERSION_CODES.M)
public static boolean isIgnoringBatteryOptimizations(String pkgName) {
try {
PowerManager pm = (PowerManager) Utils.getApp().getSystemService(Context.POWER_SERVICE);
//noinspection ConstantConditions
return pm.isIgnoringBatteryOptimizations(pkgName);
} catch (Exception e) {
return true;
}
}
/**
* Register the status of battery changed listener.
*
......
......@@ -2,10 +2,10 @@
Gradle:
```groovy
implementation 'com.blankj:utilcode:1.30.5'
implementation 'com.blankj:utilcode:1.30.6'
// if u use AndroidX, use the following
implementation 'com.blankj:utilcodex:1.30.5'
implementation 'com.blankj:utilcodex:1.30.6'
```
......
......@@ -2,10 +2,10 @@
Gradle:
```groovy
implementation 'com.blankj:utilcode:1.30.5'
implementation 'com.blankj:utilcode:1.30.6'
// if u use AndroidX, use the following
implementation 'com.blankj:utilcodex:1.30.5'
implementation 'com.blankj:utilcodex:1.30.6'
```
......
......@@ -16,13 +16,14 @@ public final class RegexConstants {
public static final String REGEX_MOBILE_SIMPLE = "^[1]\\d{10}$";
/**
* Regex of exact mobile.
* <p>china mobile: 134(0-8), 135, 136, 137, 138, 139, 147, 150, 151, 152, 157, 158, 159, 165, 172, 178, 182, 183, 184, 187, 188, 198</p>
* <p>china unicom: 130, 131, 132, 145, 155, 156, 166, 167, 171, 175, 176, 185, 186</p>
* <p>china telecom: 133, 153, 162, 173, 177, 180, 181, 189, 199, 191</p>
* <p>china mobile: 134(0-8), 135, 136, 137, 138, 139, 147, 150, 151, 152, 157, 158, 159, 165, 172, 178, 182, 183, 184, 187, 188, 195, 197, 198</p>
* <p>china unicom: 130, 131, 132, 145, 155, 156, 166, 167, 175, 176, 185, 186, 196</p>
* <p>china telecom: 133, 149, 153, 162, 173, 177, 180, 181, 189, 190, 191, 199</p>
* <p>china broadcasting: 192</p>
* <p>global star: 1349</p>
* <p>virtual operator: 170</p>
* <p>virtual operator: 170, 171</p>
*/
public static final String REGEX_MOBILE_EXACT = "^((13[0-9])|(14[57])|(15[0-35-9])|(16[2567])|(17[01235-8])|(18[0-9])|(19[189]))\\d{8}$";
public static final String REGEX_MOBILE_EXACT = "^((13[0-9])|(14[579])|(15[0-35-9])|(16[2567])|(17[0-35-8])|(18[0-9])|(19[0-35-9]))\\d{8}$";
/**
* Regex of telephone number.
*/
......
......@@ -44,7 +44,7 @@ public final class ActivityUtils {
*
* @param callbacks The callbacks.
*/
public static void addActivityLifecycleCallbacks(final Utils.ActivityLifecycleCallbacks callbacks) {
public static void addActivityLifecycleCallbacks(@Nullable final Utils.ActivityLifecycleCallbacks callbacks) {
UtilsBridge.addActivityLifecycleCallbacks(callbacks);
}
......@@ -54,8 +54,8 @@ public final class ActivityUtils {
* @param activity The activity.
* @param callbacks The callbacks.
*/
public static void addActivityLifecycleCallbacks(final Activity activity,
final Utils.ActivityLifecycleCallbacks callbacks) {
public static void addActivityLifecycleCallbacks(@Nullable final Activity activity,
@Nullable final Utils.ActivityLifecycleCallbacks callbacks) {
UtilsBridge.addActivityLifecycleCallbacks(activity, callbacks);
}
......@@ -64,7 +64,7 @@ public final class ActivityUtils {
*
* @param callbacks The callbacks.
*/
public static void removeActivityLifecycleCallbacks(final Utils.ActivityLifecycleCallbacks callbacks) {
public static void removeActivityLifecycleCallbacks(@Nullable final Utils.ActivityLifecycleCallbacks callbacks) {
UtilsBridge.removeActivityLifecycleCallbacks(callbacks);
}
......@@ -73,7 +73,7 @@ public final class ActivityUtils {
*
* @param activity The activity.
*/
public static void removeActivityLifecycleCallbacks(final Activity activity) {
public static void removeActivityLifecycleCallbacks(@Nullable final Activity activity) {
UtilsBridge.removeActivityLifecycleCallbacks(activity);
}
......@@ -83,8 +83,8 @@ public final class ActivityUtils {
* @param activity The activity.
* @param callbacks The callbacks.
*/
public static void removeActivityLifecycleCallbacks(final Activity activity,
final Utils.ActivityLifecycleCallbacks callbacks) {
public static void removeActivityLifecycleCallbacks(@Nullable final Activity activity,
@Nullable final Utils.ActivityLifecycleCallbacks callbacks) {
UtilsBridge.removeActivityLifecycleCallbacks(activity, callbacks);
}
......@@ -94,13 +94,15 @@ public final class ActivityUtils {
* @param context The context.
* @return the activity by context.
*/
public static Activity getActivityByContext(Context context) {
@Nullable
public static Activity getActivityByContext(@NonNull Context context) {
Activity activity = getActivityByContextInner(context);
if (!isActivityAlive(activity)) return null;
return activity;
}
private static Activity getActivityByContextInner(Context context) {
@Nullable
private static Activity getActivityByContextInner(@Nullable Context context) {
if (context == null) return null;
List<Context> list = new ArrayList<>();
while (context instanceof ContextWrapper) {
......@@ -122,7 +124,8 @@ public final class ActivityUtils {
return null;
}
private static Activity getActivityFromDecorContext(Context context) {
@Nullable
private static Activity getActivityFromDecorContext(@Nullable Context context) {
if (context == null) return null;
if (context.getClass().getName().equals("com.android.internal.policy.DecorContext")) {
try {
......@@ -1906,6 +1909,7 @@ public final class ActivityUtils {
* @param activity The activity.
* @return the icon of activity
*/
@Nullable
public static Drawable getActivityIcon(@NonNull final Activity activity) {
return getActivityIcon(activity.getComponentName());
}
......@@ -1916,6 +1920,7 @@ public final class ActivityUtils {
* @param clz The activity class.
* @return the icon of activity
*/
@Nullable
public static Drawable getActivityIcon(@NonNull final Class<? extends Activity> clz) {
return getActivityIcon(new ComponentName(Utils.getApp(), clz));
}
......@@ -1926,6 +1931,7 @@ public final class ActivityUtils {
* @param activityName The name of activity.
* @return the icon of activity
*/
@Nullable
public static Drawable getActivityIcon(@NonNull final ComponentName activityName) {
PackageManager pm = Utils.getApp().getPackageManager();
try {
......@@ -1942,6 +1948,7 @@ public final class ActivityUtils {
* @param activity The activity.
* @return the logo of activity
*/
@Nullable
public static Drawable getActivityLogo(@NonNull final Activity activity) {
return getActivityLogo(activity.getComponentName());
}
......@@ -1952,6 +1959,7 @@ public final class ActivityUtils {
* @param clz The activity class.
* @return the logo of activity
*/
@Nullable
public static Drawable getActivityLogo(@NonNull final Class<? extends Activity> clz) {
return getActivityLogo(new ComponentName(Utils.getApp(), clz));
}
......@@ -1962,6 +1970,7 @@ public final class ActivityUtils {
* @param activityName The name of activity.
* @return the logo of activity
*/
@Nullable
public static Drawable getActivityLogo(@NonNull final ComponentName activityName) {
PackageManager pm = Utils.getApp().getPackageManager();
try {
......
package com.blankj.utilcode.util;
import android.content.res.Resources;
import android.support.annotation.NonNull;
import android.util.DisplayMetrics;
import java.lang.reflect.Field;
......@@ -26,7 +27,8 @@ public final class AdaptScreenUtils {
/**
* Adapt for the horizontal screen, and call it in {@link android.app.Activity#getResources()}.
*/
public static Resources adaptWidth(final Resources resources, final int designWidth) {
@NonNull
public static Resources adaptWidth(@NonNull final Resources resources, final int designWidth) {
float newXdpi = (resources.getDisplayMetrics().widthPixels * 72f) / designWidth;
applyDisplayMetrics(resources, newXdpi);
return resources;
......@@ -35,14 +37,16 @@ public final class AdaptScreenUtils {
/**
* Adapt for the vertical screen, and call it in {@link android.app.Activity#getResources()}.
*/
public static Resources adaptHeight(final Resources resources, final int designHeight) {
@NonNull
public static Resources adaptHeight(@NonNull final Resources resources, final int designHeight) {
return adaptHeight(resources, designHeight, false);
}
/**
* Adapt for the vertical screen, and call it in {@link android.app.Activity#getResources()}.
*/
public static Resources adaptHeight(final Resources resources, final int designHeight, final boolean includeNavBar) {
@NonNull
public static Resources adaptHeight(@NonNull final Resources resources, final int designHeight, final boolean includeNavBar) {
float screenHeight = (resources.getDisplayMetrics().heightPixels
+ (includeNavBar ? getNavBarHeight(resources) : 0)) * 72f;
float newXdpi = screenHeight / designHeight;
......@@ -50,7 +54,7 @@ public final class AdaptScreenUtils {
return resources;
}
private static int getNavBarHeight(final Resources resources) {
private static int getNavBarHeight(@NonNull final Resources resources) {
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId != 0) {
return resources.getDimensionPixelSize(resourceId);
......@@ -63,7 +67,8 @@ public final class AdaptScreenUtils {
* @param resources The resources.
* @return the resource
*/
public static Resources closeAdapt(final Resources resources) {
@NonNull
public static Resources closeAdapt(@NonNull final Resources resources) {
float newXdpi = Resources.getSystem().getDisplayMetrics().density * 72f;
applyDisplayMetrics(resources, newXdpi);
return resources;
......@@ -91,7 +96,7 @@ public final class AdaptScreenUtils {
return (int) (pxValue * 72 / metrics.xdpi + 0.5);
}
private static void applyDisplayMetrics(final Resources resources, final float newXdpi) {
private static void applyDisplayMetrics(@NonNull final Resources resources, final float newXdpi) {
resources.getDisplayMetrics().xdpi = newXdpi;
Utils.getApp().getResources().getDisplayMetrics().xdpi = newXdpi;
applyOtherDisplayMetrics(resources, newXdpi);
......
package com.blankj.utilcode.util;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import java.lang.annotation.ElementType;
......@@ -47,14 +48,17 @@ public final class ApiUtils {
* @param <T> The type.
* @return the api
*/
@Nullable
public static <T extends BaseApi> T getApi(@NonNull final Class<T> apiClass) {
return getInstance().getApiInner(apiClass);
}
public static void register(Class<? extends BaseApi> implClass) {
public static void register(@Nullable Class<? extends BaseApi> implClass) {
if (implClass == null) return;
getInstance().registerImpl(implClass);
}
@NonNull
public static String toString_() {
return getInstance().toString();
}
......
......@@ -13,6 +13,7 @@ import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import java.io.File;
......@@ -143,8 +144,14 @@ public final class AppUtils {
*/
public static boolean isAppDebug(final String packageName) {
if (UtilsBridge.isSpace(packageName)) return false;
ApplicationInfo ai = Utils.getApp().getApplicationInfo();
return ai != null && (ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
try {
PackageManager pm = Utils.getApp().getPackageManager();
ApplicationInfo ai = pm.getApplicationInfo(packageName, 0);
return (ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return false;
}
}
/**
......@@ -167,7 +174,7 @@ public final class AppUtils {
try {
PackageManager pm = Utils.getApp().getPackageManager();
ApplicationInfo ai = pm.getApplicationInfo(packageName, 0);
return ai != null && (ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
return (ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return false;
......@@ -203,8 +210,6 @@ public final class AppUtils {
*/
public static boolean isAppRunning(final String pkgName) {
if (UtilsBridge.isSpace(pkgName)) return false;
ApplicationInfo ai = Utils.getApp().getApplicationInfo();
int uid = ai.uid;
ActivityManager am = (ActivityManager) Utils.getApp().getSystemService(Context.ACTIVITY_SERVICE);
if (am != null) {
List<ActivityManager.RunningTaskInfo> taskInfo = am.getRunningTasks(Integer.MAX_VALUE);
......@@ -220,7 +225,7 @@ public final class AppUtils {
List<ActivityManager.RunningServiceInfo> serviceInfo = am.getRunningServices(Integer.MAX_VALUE);
if (serviceInfo != null && serviceInfo.size() > 0) {
for (ActivityManager.RunningServiceInfo aInfo : serviceInfo) {
if (uid == aInfo.uid) {
if (pkgName.equals(aInfo.service.getPackageName())) {
return true;
}
}
......@@ -328,6 +333,7 @@ public final class AppUtils {
*
* @return the application's icon
*/
@Nullable
public static Drawable getAppIcon() {
return getAppIcon(Utils.getApp().getPackageName());
}
......@@ -338,6 +344,7 @@ public final class AppUtils {
* @param packageName The name of the package.
* @return the application's icon
*/
@Nullable
public static Drawable getAppIcon(final String packageName) {
if (UtilsBridge.isSpace(packageName)) return null;
try {
......@@ -382,6 +389,7 @@ public final class AppUtils {
*
* @return the application's package name
*/
@NonNull
public static String getAppPackageName() {
return Utils.getApp().getPackageName();
}
......@@ -391,6 +399,7 @@ public final class AppUtils {
*
* @return the application's name
*/
@NonNull
public static String getAppName() {
return getAppName(Utils.getApp().getPackageName());
}
......@@ -401,12 +410,13 @@ public final class AppUtils {
* @param packageName The name of the package.
* @return the application's name
*/
@NonNull
public static String getAppName(final String packageName) {
if (UtilsBridge.isSpace(packageName)) return "";
try {
PackageManager pm = Utils.getApp().getPackageManager();
PackageInfo pi = pm.getPackageInfo(packageName, 0);
return pi == null ? null : pi.applicationInfo.loadLabel(pm).toString();
return pi == null ? "" : pi.applicationInfo.loadLabel(pm).toString();
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return "";
......@@ -418,6 +428,7 @@ public final class AppUtils {
*
* @return the application's path
*/
@NonNull
public static String getAppPath() {
return getAppPath(Utils.getApp().getPackageName());
}
......@@ -428,12 +439,13 @@ public final class AppUtils {
* @param packageName The name of the package.
* @return the application's path
*/
@NonNull
public static String getAppPath(final String packageName) {
if (UtilsBridge.isSpace(packageName)) return