├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── CommonUtils
├── .gitignore
├── CommonUtils.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── bobo
│ │ └── commonutils
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── bobo
│ │ └── commonutils
│ │ ├── deviceinfo
│ │ ├── CpuUtils.java
│ │ └── DeviceInfoUtils.java
│ │ ├── file
│ │ ├── AESHelper.java
│ │ ├── AesFileEncryptor.java
│ │ ├── EasyFileEncryptor.java
│ │ ├── FileEncryptor.java
│ │ ├── FileUtils.java
│ │ └── ImageVideoThumbnailUtils.java
│ │ ├── inferface
│ │ └── UpdateProgressInferface.java
│ │ └── utils
│ │ ├── ProxyUtil.java
│ │ └── RunCmdApi.java
│ └── res
│ └── values
│ └── strings.xml
├── DroidPlugin
├── .gitignore
├── AndroidManifest.xml
├── DroidPlugin.iml
├── LICENSE.txt
├── build.gradle
├── lib
│ └── layoutlib.jar
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-xxhdpi
│ │ ├── plugin_activity_loading.xml
│ │ └── plugin_activity_loading_bitmap.9.png
│ ├── values-v11
│ │ └── styles.xml
│ ├── values-v14
│ │ └── styles.xml
│ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ ├── android
│ └── app
│ │ └── IServiceConnection.aidl
│ └── com
│ └── morgoo
│ ├── droidplugin
│ ├── MyCrashHandler.java
│ ├── PluginApplication.java
│ ├── PluginHelper.java
│ ├── PluginManagerService.java
│ ├── PluginPatchManager.java
│ ├── PluginServiceProvider.java
│ ├── am
│ │ ├── BaseActivityManagerService.java
│ │ ├── MyActivityManagerService.java
│ │ ├── RunningActivities.java
│ │ ├── RunningProcessList.java
│ │ ├── ServiceStubMap.java
│ │ └── StaticProcessList.java
│ ├── core
│ │ ├── Env.java
│ │ ├── PluginClassLoader.java
│ │ ├── PluginDirHelper.java
│ │ └── PluginProcessManager.java
│ ├── hook
│ │ ├── BaseHookHandle.java
│ │ ├── Hook.java
│ │ ├── HookFactory.java
│ │ ├── HookedMethodHandler.java
│ │ ├── binder
│ │ │ ├── BinderHook.java
│ │ │ ├── IAppOpsServiceBinderHook.java
│ │ │ ├── IAudioServiceBinderHook.java
│ │ │ ├── IClipboardBinderHook.java
│ │ │ ├── IContentServiceBinderHook.java
│ │ │ ├── IDisplayManagerBinderHook.java
│ │ │ ├── IGraphicsStatsBinderHook.java
│ │ │ ├── IInputMethodManagerBinderHook.java
│ │ │ ├── ILocationManagerBinderHook.java
│ │ │ ├── IMediaRouterServiceBinderHook.java
│ │ │ ├── IMmsBinderHook.java
│ │ │ ├── IMountServiceBinderHook.java
│ │ │ ├── INotificationManagerBinderHook.java
│ │ │ ├── IPhoneSubInfoBinderHook.java
│ │ │ ├── ISearchManagerBinderHook.java
│ │ │ ├── ISessionManagerBinderHook.java
│ │ │ ├── ISmsBinderHook.java
│ │ │ ├── ISubBinderHook.java
│ │ │ ├── ITelephonyBinderHook.java
│ │ │ ├── ITelephonyRegistryBinderHook.java
│ │ │ ├── IWifiManagerBinderHook.java
│ │ │ ├── IWindowManagerBinderHook.java
│ │ │ ├── MyServiceManager.java
│ │ │ ├── ServiceManagerBinderHook.java
│ │ │ └── ServiceManagerCacheBinderHook.java
│ │ ├── handle
│ │ │ ├── IActivityManagerHookHandle.java
│ │ │ ├── IAppOpsServiceHookHandle.java
│ │ │ ├── IAudioServiceHookHandle.java
│ │ │ ├── IClipboardHookHandle.java
│ │ │ ├── IContentProviderInvokeHandle.java
│ │ │ ├── IContentServiceHandle.java
│ │ │ ├── IDisplayManagerHookHandle.java
│ │ │ ├── IGraphicsStatsHookHandle.java
│ │ │ ├── IInputMethodManagerHookHandle.java
│ │ │ ├── ILocationManagerHookHandle.java
│ │ │ ├── IMediaRouterServiceHookHandle.java
│ │ │ ├── IMmsHookHandle.java
│ │ │ ├── IMountServiceHookHandle.java
│ │ │ ├── INotificationManagerHookHandle.java
│ │ │ ├── IPackageManagerHookHandle.java
│ │ │ ├── IPhoneSubInfoHookHandle.java
│ │ │ ├── ISearchManagerHookHandle.java
│ │ │ ├── ISessionManagerHookHandle.java
│ │ │ ├── ISmsHookHandle.java
│ │ │ ├── ISubBinderHookHandle.java
│ │ │ ├── ITelephonyHookHandle.java
│ │ │ ├── ITelephonyRegistryHookHandle.java
│ │ │ ├── IWifiManagerHookHandle.java
│ │ │ ├── IWindowManagerHookHandle.java
│ │ │ ├── IWindowSessionInvokeHandle.java
│ │ │ ├── LibCoreHookHandle.java
│ │ │ ├── PluginCallback.java
│ │ │ ├── PluginInstrumentation.java
│ │ │ ├── ReplaceCallingPackageHookedMethodHandler.java
│ │ │ └── WebViewFactoryProviderHookHandle.java
│ │ ├── proxy
│ │ │ ├── IActivityManagerHook.java
│ │ │ ├── IContentProviderHook.java
│ │ │ ├── IPackageManagerHook.java
│ │ │ ├── IWindowSessionHook.java
│ │ │ ├── InstrumentationHook.java
│ │ │ ├── LibCoreHook.java
│ │ │ ├── PluginCallbackHook.java
│ │ │ ├── ProxyHook.java
│ │ │ └── WebViewFactoryProviderHook.java
│ │ └── xhook
│ │ │ └── SQLiteDatabaseHook.java
│ ├── pm
│ │ ├── IApplicationCallback.aidl
│ │ ├── IPackageDataObserver.aidl
│ │ ├── IPluginManager.aidl
│ │ ├── IPluginManagerImpl.java
│ │ ├── PluginManager.java
│ │ └── parser
│ │ │ ├── IntentMatcher.java
│ │ │ ├── PackageParser.java
│ │ │ ├── PackageParserApi15.java
│ │ │ ├── PackageParserApi16.java
│ │ │ ├── PackageParserApi20.java
│ │ │ ├── PackageParserApi21.java
│ │ │ ├── PackageParserApi22.java
│ │ │ ├── PackageParserApi22Preview1.java
│ │ │ └── PluginPackageParser.java
│ ├── reflect
│ │ ├── FieldUtils.java
│ │ ├── MemberUtils.java
│ │ ├── MethodUtils.java
│ │ ├── Utils.java
│ │ └── Validate.java
│ └── stub
│ │ ├── AbstractContentProviderStub.java
│ │ ├── AbstractServiceStub.java
│ │ ├── ActivityStub.java
│ │ ├── ContentProviderStub.java
│ │ ├── MyFakeIBinder.java
│ │ ├── ServcesManager.java
│ │ ├── ServiceStub.java
│ │ └── ShortcutProxyActivity.java
│ └── helper
│ ├── AttributeCache.java
│ ├── ComponentNameComparator.java
│ ├── Log.java
│ ├── MyProxy.java
│ ├── Utils.java
│ ├── compat
│ ├── ActivityManagerCompat.java
│ ├── ActivityManagerNativeCompat.java
│ ├── ActivityThreadCompat.java
│ ├── BuildCompat.java
│ ├── BundleCompat.java
│ ├── CompatibilityInfoCompat.java
│ ├── ContentProviderCompat.java
│ ├── ContentProviderHolderCompat.java
│ ├── IActivityManagerCompat.java
│ ├── IAppOpsServiceCompat.java
│ ├── IAudioServiceCompat.java
│ ├── IClipboardCompat.java
│ ├── IContentServiceCompat.java
│ ├── IDisplayManagerCompat.java
│ ├── IGraphicsStatsCompat.java
│ ├── IInputMethodManagerCompat.java
│ ├── ILocationManagerCompat.java
│ ├── IMediaRouterServiceCompat.java
│ ├── IMmsCompat.java
│ ├── IMountServiceCompat.java
│ ├── INotificationManagerCompat.java
│ ├── IPackageDataObserverCompat.java
│ ├── IPhoneSubInfoCompat.java
│ ├── ISearchManagerCompat.java
│ ├── ISessionManagerCompat.java
│ ├── ISmsCompat.java
│ ├── ISubCompat.java
│ ├── ITelephonyCompat.java
│ ├── ITelephonyRegistryCompat.java
│ ├── IWifiManagerCompat.java
│ ├── IWindowManagerCompat.java
│ ├── NativeLibraryHelperCompat.java
│ ├── PackageManagerCompat.java
│ ├── ParceledListSliceCompat.java
│ ├── ProcessCompat.java
│ ├── QueuedWorkCompat.java
│ ├── ServiceManagerCompat.java
│ ├── SingletonCompat.java
│ ├── SystemPropertiesCompat.java
│ ├── UserHandleCompat.java
│ ├── VMRuntimeCompat.java
│ └── WebViewFactoryCompat.java
│ └── utils
│ └── ProcessUtils.java
├── README.md
├── android-utils-api.iml
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── dynamic_libs
│ └── framework.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── utils
│ │ └── bobo
│ │ └── com
│ │ └── boboutils
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── aidl
│ ├── com
│ │ └── bobo
│ │ │ └── service
│ │ │ └── utils
│ │ │ └── IWakeupService.aidl
│ └── utils
│ │ └── bobo
│ │ └── com
│ │ └── boboutils
│ │ └── App
│ │ ├── overlay
│ │ └── IOverlayViewService.aidl
│ │ └── zombieservice
│ │ ├── IZombieServiceFirst.aidl
│ │ └── IZombieServiceSecond.aidl
│ ├── assets
│ ├── part_1.jpg
│ ├── part_10.jpg
│ ├── part_11.jpg
│ ├── part_12.jpg
│ ├── part_13.jpg
│ ├── part_14.jpg
│ ├── part_15.jpg
│ ├── part_16.jpg
│ ├── part_17.jpg
│ ├── part_18.jpg
│ ├── part_19.jpg
│ ├── part_2.jpg
│ ├── part_3.jpg
│ ├── part_4.jpg
│ ├── part_5.jpg
│ ├── part_6.jpg
│ ├── part_7.jpg
│ ├── part_8.jpg
│ ├── part_9.jpg
│ └── weixin_1280.apk
│ ├── java
│ ├── com
│ │ └── bobo
│ │ │ └── service
│ │ │ └── utils
│ │ │ ├── BindMultiAppServiceHelp.java
│ │ │ ├── BindWakeupServerServiceHelp.java
│ │ │ ├── NoMarketDialogHelp.java
│ │ │ ├── Sample.java
│ │ │ ├── SilentInstallHelp.java
│ │ │ └── WakeupServerService.java
│ ├── utils
│ │ └── bobo
│ │ │ └── com
│ │ │ └── boboutils
│ │ │ ├── App
│ │ │ ├── AppWidgetApiActivity.java
│ │ │ ├── AsyncTaskRunAlways.java
│ │ │ ├── CustomStatusBarImgBackgroundActivity.java
│ │ │ ├── DynamicViewPageActivity.java
│ │ │ ├── ForegroundService.java
│ │ │ ├── ForgegroundServiceActivity.java
│ │ │ ├── LocationActivity.java
│ │ │ ├── LocationService.java
│ │ │ ├── NotificationActivity.java
│ │ │ ├── NotificationWithChannelActivity.java
│ │ │ ├── QuickSetting
│ │ │ │ └── QuickSettingService.java
│ │ │ ├── RecyclerView
│ │ │ │ └── GridLayoutManagerActivity.java
│ │ │ ├── RequestOneLocationActivity.java
│ │ │ ├── ScreenPinningActivity.java
│ │ │ ├── SecretCodeReceiver.java
│ │ │ ├── ShowWhenLockActivity.java
│ │ │ ├── SystemOverlayActivity.java
│ │ │ ├── TempActivity.java
│ │ │ ├── TestService.java
│ │ │ ├── TestServiceActivity.java
│ │ │ ├── ToastActivity.java
│ │ │ ├── VibratorActivity.java
│ │ │ ├── WakeLockGetAndReleaseActivity.java
│ │ │ ├── WakeLockTestApi.java
│ │ │ ├── WebViewActivity.java
│ │ │ ├── appwidget
│ │ │ │ ├── CustomViewAppWidget.java
│ │ │ │ ├── CustomViewFileProvider.java
│ │ │ │ └── UpdateAppWidgetService.java
│ │ │ ├── audio
│ │ │ │ └── AudioRecordActivity.java
│ │ │ ├── call
│ │ │ │ ├── AudioRecorder8Dot0Service.java
│ │ │ │ ├── AudioRecorderService.java
│ │ │ │ ├── CallAudioRecord8Dot0Activity.java
│ │ │ │ ├── CallAudioRecordActivity.java
│ │ │ │ ├── PhoneCall8Dot0Receiver.java
│ │ │ │ └── PhoneCallReceiver.java
│ │ │ ├── customanim
│ │ │ │ ├── FloatingPelletsActivity.java
│ │ │ │ └── FloatingPelletsView.java
│ │ │ ├── customview
│ │ │ │ ├── CanvasLearnActivity.java
│ │ │ │ ├── CustomAccessibilityActivity.java
│ │ │ │ └── longdrawable
│ │ │ │ │ ├── BitmapArrayDrawable.java
│ │ │ │ │ ├── LongDrawableActivity.java
│ │ │ │ │ └── LongScreenshotScrollView.java
│ │ │ ├── overlay
│ │ │ │ ├── OverlayViewService.java
│ │ │ │ └── OverlayViewServiceHelp.java
│ │ │ ├── reflect
│ │ │ │ └── ReflectDemoActivity.java
│ │ │ └── zombieservice
│ │ │ │ ├── ZombieServiceFirst.java
│ │ │ │ ├── ZombieServiceSecond.java
│ │ │ │ └── ZombieServiceStartActivity.java
│ │ │ ├── CoordinatorLayoutDemoActivity.java
│ │ │ ├── DemosActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MultiApp
│ │ │ ├── BasicDeviceAdminReceiver.java
│ │ │ ├── BasicManagedProfileFragment.java
│ │ │ ├── EnableProfileActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MultiAppByDroidPluginActivity.java
│ │ │ └── SetupProfileFragment.java
│ │ │ ├── MyApp.java
│ │ │ ├── SimpleWebServerProxy.java
│ │ │ ├── accessibility
│ │ │ ├── AccessibilityListenerService.java
│ │ │ └── AccessibilityServiceActivity.java
│ │ │ ├── deviceinfo
│ │ │ ├── CupInfosActivity.java
│ │ │ ├── DeviceInfosActivity.java
│ │ │ └── ScreenInfoActivity.java
│ │ │ ├── file
│ │ │ ├── CommonFileListFragment.java
│ │ │ └── FileEncryptorActivity.java
│ │ │ ├── jobscheduler
│ │ │ ├── JobSchedulerAndThreadAndAsyncTask.java
│ │ │ └── TestJobService.java
│ │ │ └── service
│ │ │ └── MyTileService.java
│ └── vavi
│ │ ├── sound
│ │ └── pcm
│ │ │ └── resampling
│ │ │ └── ssrc
│ │ │ └── SSRC.java
│ │ └── util
│ │ ├── I0Bessel.java
│ │ └── SplitRadixFft.java
│ └── res
│ ├── drawable-hdpi
│ ├── document.png
│ ├── dpi_icon.png
│ └── folder.png
│ ├── drawable-mdpi
│ └── dpi_icon.png
│ ├── drawable-nodpi
│ └── example_appwidget_preview.png
│ ├── drawable-xhdpi
│ ├── check_on.png
│ ├── custom_status_bar_img.png
│ └── dpi_icon.png
│ ├── drawable-xxhdpi
│ ├── badge.png
│ └── dpi_icon.png
│ ├── drawable-xxxhdpi
│ └── dpi_icon.png
│ ├── drawable
│ ├── corrdinator_activity_header_gradient.xml
│ ├── ic_feedback.xml
│ ├── ic_info.xml
│ └── ic_launcher_badged.xml
│ ├── layout
│ ├── activity_app_cutom_accessibility.xml
│ ├── activity_app_foreground_service.xml
│ ├── activity_app_location.xml
│ ├── activity_app_long_drawable.xml
│ ├── activity_app_notificaion_with_channel.xml
│ ├── activity_app_request_one_location.xml
│ ├── activity_app_temp.xml
│ ├── activity_app_two_button.xml
│ ├── activity_app_vibrator.xml
│ ├── activity_app_wakelock_get_release.xml
│ ├── activity_app_webview.xml
│ ├── activity_app_widget_api.xml
│ ├── activity_audio_record.xml
│ ├── activity_coordinator_layout_demo.xml
│ ├── activity_cpu_infos.xml
│ ├── activity_custom_statusbar_img_bg.xml
│ ├── activity_dynamic_view_page.xml
│ ├── activity_floating_pellets.xml
│ ├── activity_grid_layout_manager.xml
│ ├── activity_jobscheduler_thread_asynctask.xml
│ ├── activity_main.xml
│ ├── activity_main_real.xml
│ ├── activity_notification.xml
│ ├── activity_screen_info.xml
│ ├── activity_screen_pinning.xml
│ ├── activity_setup.xml
│ ├── activity_show_when_lock.xml
│ ├── activity_simple_web_server_proxy.xml
│ ├── activity_text_view.xml
│ ├── common_file_list_item.xml
│ ├── custom_view_app_widget.xml
│ ├── fragment_activity.xml
│ ├── fragment_collection_object.xml
│ ├── fragment_common_file_list.xml
│ ├── fragment_main.xml
│ ├── fragment_setup_profile.xml
│ ├── system_overlay.xml
│ ├── text_row_item.xml
│ ├── toolbar_corrdinator_layout_header.xml
│ └── two_line_list_item_with_switch.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── values-v14
│ └── dimens.xml
│ ├── values-v21
│ └── styles.xml
│ ├── values-w820dp
│ └── dimens.xml
│ ├── values-zh-rcn
│ └── strings.xml
│ ├── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ ├── accessibility_listener_service.xml
│ ├── basic_device_admin_receiver.xml
│ ├── custom_view_app_widget_info.xml
│ ├── device_filter.xml
│ └── filepaths.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
├── simplewebserver
├── .gitignore
├── build.gradle
├── libs
│ ├── ant-zip.jar
│ ├── commons-io-2.4.jar
│ └── jangod-core.jar
├── proguard-rules.pro
├── simplewebserver.iml
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── bobo
│ │ └── simplewebserver
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── WebServer
│ │ │ ├── 403.html
│ │ │ ├── 404.html
│ │ │ ├── 503.html
│ │ │ ├── attachments
│ │ │ └── demo.apk
│ │ │ ├── hello.html
│ │ │ ├── index.html
│ │ │ ├── index.html.bak
│ │ │ └── readme.txt
│ ├── java
│ │ ├── org
│ │ │ └── join
│ │ │ │ └── ws
│ │ │ │ ├── Constants.java
│ │ │ │ ├── CrashHandler.java
│ │ │ │ ├── WSApplication.java
│ │ │ │ ├── receiver
│ │ │ │ ├── NetworkReceiver.java
│ │ │ │ ├── OnNetworkListener.java
│ │ │ │ ├── OnStorageListener.java
│ │ │ │ ├── OnWsListener.java
│ │ │ │ ├── StorageReceiver.java
│ │ │ │ └── WSReceiver.java
│ │ │ │ ├── serv
│ │ │ │ ├── GzipFilter.java
│ │ │ │ ├── TempCacheFilter.java
│ │ │ │ ├── UrlPattern.java
│ │ │ │ ├── WebServer.java
│ │ │ │ ├── WorkerThread.java
│ │ │ │ ├── entity
│ │ │ │ │ ├── GzipByteArrayEntity.java
│ │ │ │ │ ├── GzipEntity.java
│ │ │ │ │ └── GzipFileEntity.java
│ │ │ │ ├── req
│ │ │ │ │ ├── HttpDelHandler.java
│ │ │ │ │ ├── HttpDownHandler.java
│ │ │ │ │ ├── HttpFBHandler.java
│ │ │ │ │ ├── HttpProgressHandler.java
│ │ │ │ │ ├── HttpUpHandler.java
│ │ │ │ │ └── objs
│ │ │ │ │ │ └── FileRow.java
│ │ │ │ ├── support
│ │ │ │ │ ├── GzipUtil.java
│ │ │ │ │ ├── HttpGetParser.java
│ │ │ │ │ ├── HttpPostParser.java
│ │ │ │ │ ├── MIME.java
│ │ │ │ │ ├── MimeType.java
│ │ │ │ │ └── Progress.java
│ │ │ │ └── view
│ │ │ │ │ ├── BaseView.java
│ │ │ │ │ ├── FileView.java
│ │ │ │ │ ├── StringView.java
│ │ │ │ │ ├── TempHandler.java
│ │ │ │ │ ├── TempView.java
│ │ │ │ │ └── ViewFactory.java
│ │ │ │ ├── service
│ │ │ │ ├── WSService.java
│ │ │ │ └── WebService.java
│ │ │ │ ├── ui
│ │ │ │ ├── PreferActivity.java
│ │ │ │ ├── WSActivity.java
│ │ │ │ ├── WebServActivity.java
│ │ │ │ └── widget
│ │ │ │ │ ├── FileBrowser.java
│ │ │ │ │ └── ProgressBarPreference.java
│ │ │ │ └── util
│ │ │ │ ├── CommonUtil.java
│ │ │ │ └── CopyUtil.java
│ │ ├── temp
│ │ │ └── net
│ │ │ │ └── asfun
│ │ │ │ └── jangod
│ │ │ │ ├── lib
│ │ │ │ └── tag
│ │ │ │ │ ├── AbsResTag.java
│ │ │ │ │ ├── ResColorTag.java
│ │ │ │ │ ├── ResStrTag.java
│ │ │ │ │ └── UUIDTag.java
│ │ │ │ └── template
│ │ │ │ ├── LazyBindings.java
│ │ │ │ ├── Processor.java
│ │ │ │ └── TemplateEngine.java
│ │ └── upload
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── fileupload
│ │ │ ├── FileItem.java
│ │ │ ├── FileItemFactory.java
│ │ │ ├── FileItemHeaders.java
│ │ │ ├── FileItemHeadersSupport.java
│ │ │ ├── FileItemIterator.java
│ │ │ ├── FileItemStream.java
│ │ │ ├── FileUpload.java
│ │ │ ├── FileUploadBase.java
│ │ │ ├── FileUploadException.java
│ │ │ ├── InvalidFileNameException.java
│ │ │ ├── MultipartStream.java
│ │ │ ├── ParameterParser.java
│ │ │ ├── ProgressListener.java
│ │ │ ├── RequestContext.java
│ │ │ ├── UploadContext.java
│ │ │ ├── disk
│ │ │ ├── DiskFileItem.java
│ │ │ ├── DiskFileItemFactory.java
│ │ │ └── package-info.java
│ │ │ ├── httpserv
│ │ │ ├── HttpServFileUpload.java
│ │ │ └── HttpServRequestContext.java
│ │ │ ├── package-info.java
│ │ │ └── util
│ │ │ ├── Closeable.java
│ │ │ ├── FileItemHeadersImpl.java
│ │ │ ├── LimitedInputStream.java
│ │ │ ├── Streams.java
│ │ │ ├── mime
│ │ │ ├── Base64Decoder.java
│ │ │ ├── MimeUtility.java
│ │ │ ├── ParseException.java
│ │ │ ├── QuotedPrintableDecoder.java
│ │ │ └── package-info.java
│ │ │ └── package-info.java
│ └── res
│ │ ├── drawable-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_noti_running.png
│ │ ├── drawable-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_noti_running.png
│ │ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ │ ├── drawable
│ │ ├── btn_toggle.xml
│ │ ├── btn_toggle_off_normal.xml
│ │ ├── btn_toggle_off_pressed.xml
│ │ ├── btn_toggle_on_normal.xml
│ │ ├── btn_toggle_on_pressed.xml
│ │ ├── file_def.png
│ │ ├── folder_def.png
│ │ └── folder_parent.png
│ │ ├── layout
│ │ ├── capture.xml
│ │ ├── filebrowser.xml
│ │ ├── main.xml
│ │ ├── prefer_widget_checkbox.xml
│ │ ├── prefer_widget_edit.xml
│ │ └── prefer_widget_wait.xml
│ │ ├── menu
│ │ └── main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-zh-rCN
│ │ └── strings.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── ids.xml
│ │ ├── items.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── prefer.xml
│ └── test
│ └── java
│ └── com
│ └── bobo
│ └── simplewebserver
│ └── ExampleUnitTest.java
└── webrtcnoise
├── .gitignore
├── CMakeLists.txt
├── app.iml
├── build.gradle
├── proguard-rules.pro
├── src
├── androidTest
│ └── java
│ │ └── com
│ │ └── test
│ │ └── jni
│ │ └── ExampleInstrumentedTest.java
├── main
│ ├── AndroidManifest.xml
│ ├── cpp
│ │ ├── audio_ns.cpp
│ │ ├── audio_ns.h
│ │ ├── defines.h
│ │ ├── fft4g.cpp
│ │ ├── fft4g.h
│ │ ├── native-lib.cpp
│ │ ├── noise_suppression.cpp
│ │ ├── noise_suppression.h
│ │ ├── ns_core.cpp
│ │ ├── ns_core.h
│ │ ├── signal_processing_library.h
│ │ ├── spl_inl.h
│ │ ├── typedefs.h
│ │ └── windows_private.h
│ ├── java
│ │ └── com
│ │ │ └── test
│ │ │ └── jni
│ │ │ ├── AudioEncodeUtil.java
│ │ │ ├── MainActivity.java
│ │ │ └── WebrtcProcessor.java
│ └── res
│ │ ├── layout
│ │ └── activity_webrtc_noise_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ └── strings.xml
└── test
│ └── java
│ └── com
│ └── test
│ └── jni
│ └── ExampleUnitTest.java
└── webrtcnoise.iml
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CommonUtils/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/CommonUtils/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 23
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | }
24 |
--------------------------------------------------------------------------------
/CommonUtils/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Users\huangzb1\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/CommonUtils/src/androidTest/java/com/bobo/commonutils/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.bobo.commonutils;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/CommonUtils/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CommonUtils/src/main/java/com/bobo/commonutils/file/AesFileEncryptor.java:
--------------------------------------------------------------------------------
1 | package com.bobo.commonutils.file;
2 |
3 | import com.bobo.commonutils.inferface.UpdateProgressInferface;
4 |
5 |
6 | import javax.crypto.Cipher;
7 |
8 | /**
9 | * AES文件加密解密接口
10 | * Encrypt or decrypt file by AES (Advanced Encryption Standard)
11 | * @author zhenbohuang
12 | *
13 | */
14 | public class AesFileEncryptor implements FileEncryptor{
15 | AESHelper mAESHelper = new AESHelper();
16 | @Override
17 | public int encryptFile(String srcFile, String desFile,String key,UpdateProgressInferface progressInferface) {
18 | if(FileUtils.getFileType(srcFile)!=FileUtils.TYPE_FILE){
19 | return FAILED_INVALID_SOURCE_FILE;
20 | }
21 | //FileUtils.copyfile(new File(srcFile), new File(desFile), true);
22 | if(mAESHelper.AESCipher(Cipher.ENCRYPT_MODE, srcFile, desFile, key)){
23 | return SUCCEEDED;
24 | }
25 | return FAILED_UNKNOWN;
26 | }
27 |
28 | @Override
29 | public int decryptFile(String srcFile, String desFile,String key,UpdateProgressInferface progressInferface) {
30 | if(FileUtils.getFileType(srcFile)!=FileUtils.TYPE_FILE){
31 | return FAILED_INVALID_SOURCE_FILE;
32 | }
33 | //FileUtils.copyfile(new File(srcFile), new File(desFile), true);
34 | if(mAESHelper.AESCipher(Cipher.DECRYPT_MODE, srcFile, desFile, key)){
35 | return SUCCEEDED;
36 | }
37 | return FAILED_UNKNOWN;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/CommonUtils/src/main/java/com/bobo/commonutils/inferface/UpdateProgressInferface.java:
--------------------------------------------------------------------------------
1 | package com.bobo.commonutils.inferface;
2 |
3 |
4 | /**
5 | * 进度提醒相关接口
6 | * update progress inferface
7 | * @author zhenbohuang
8 | *
9 | */
10 | public interface UpdateProgressInferface {
11 | /**
12 | * @param percent: cur percent
13 | * @param object: custom object
14 | */
15 | public void progressUpdate(int percent, Object object);
16 | }
17 |
--------------------------------------------------------------------------------
/CommonUtils/src/main/java/com/bobo/commonutils/utils/RunCmdApi.java:
--------------------------------------------------------------------------------
1 | package com.bobo.commonutils.utils;
2 |
3 | import android.util.Log;
4 |
5 | import java.io.BufferedReader;
6 | import java.io.DataOutputStream;
7 | import java.io.InputStreamReader;
8 | import java.util.Vector;
9 |
10 | /**
11 | * Created by bobohuang(bobohuang!985@qq.com) on 2016/7/5.
12 | */
13 | public class RunCmdApi {
14 | private static final String TAG = "RunCmdApi";
15 | public static void execCmd(String cmd) {
16 | try {
17 | Log.i(TAG, "command = " + cmd);
18 | Runtime localException = Runtime.getRuntime();
19 | Process exec = localException.exec(cmd);
20 | exec.waitFor();
21 | } catch (Exception e) {
22 | Log.e(TAG, e.getMessage());
23 | }
24 | }
25 |
26 | public static Vector execCmdWithReturn(String cmd) {
27 | Vector result = new Vector();
28 | try {
29 | Log.d(TAG, "execCmdWithReturn:" + cmd);
30 | Process process = Runtime.getRuntime().exec(cmd);
31 | DataOutputStream outputStream = new DataOutputStream(process.getOutputStream());
32 | outputStream.writeBytes(cmd + ";exit\n");
33 | outputStream.flush();
34 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
35 | String line;
36 | while((line = bufferedReader.readLine()) != null) {
37 | result.add(line);
38 | }
39 | process.waitFor();
40 | } catch (Exception e) {
41 | Log.e(TAG, e.getMessage());
42 | }
43 | return result;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CommonUtils/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CommonUtils
3 |
4 |
--------------------------------------------------------------------------------
/DroidPlugin/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DroidPlugin/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | dependencies {
4 | provided fileTree(dir: 'lib', include: '*.jar')
5 | compile fileTree(dir: 'libs', include: '*.jar')
6 | }
7 |
8 | android {
9 | compileSdkVersion rootProject.ext.compileSdkVersion
10 | buildToolsVersion rootProject.ext.buildToolsVersion
11 | sourceSets {
12 | main {
13 | manifest.srcFile 'AndroidManifest.xml'
14 | java.srcDirs = ['src']
15 | resources.srcDirs = ['src']
16 | aidl.srcDirs = ['src']
17 | renderscript.srcDirs = ['src']
18 | res.srcDirs = ['res']
19 | assets.srcDirs = ['assets']
20 | jniLibs.srcDirs = ['libs']
21 | }
22 |
23 | debug.setRoot('build-types/debug')
24 | release.setRoot('build-types/release')
25 | }
26 |
27 | lintOptions {
28 | abortOnError false
29 | }
30 |
31 | defaultConfig{
32 |
33 | // 建议改为自己的 packageName + .droidplugin_stub ,防止跟其它本插件使用者冲突
34 | def authorityName = "com.morgoo.droidplugin_stub"
35 |
36 | buildConfigField "String", "AUTHORITY_NAME", "\"${authorityName}\""
37 | manifestPlaceholders = [
38 | authorityName:"${authorityName}",
39 | ]
40 | }
41 |
42 | buildToolsVersion '25.0.0'
43 | }
44 |
--------------------------------------------------------------------------------
/DroidPlugin/lib/layoutlib.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/DroidPlugin/lib/layoutlib.jar
--------------------------------------------------------------------------------
/DroidPlugin/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/DroidPlugin/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-21
15 |
--------------------------------------------------------------------------------
/DroidPlugin/res/drawable-xxhdpi/plugin_activity_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DroidPlugin/res/drawable-xxhdpi/plugin_activity_loading_bitmap.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/DroidPlugin/res/drawable-xxhdpi/plugin_activity_loading_bitmap.9.png
--------------------------------------------------------------------------------
/DroidPlugin/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
28 |
31 |
32 |
35 |
36 |
--------------------------------------------------------------------------------
/DroidPlugin/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
36 |
37 |
--------------------------------------------------------------------------------
/DroidPlugin/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 | 启动插件ing...
27 | 插件代理服务
28 | 插件代理服务
29 | 插件管理服务
30 |
31 |
--------------------------------------------------------------------------------
/DroidPlugin/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
29 |
30 |
33 |
34 |
--------------------------------------------------------------------------------
/DroidPlugin/src/android/app/IServiceConnection.aidl:
--------------------------------------------------------------------------------
1 | /* //device/java/android/android/app/IServiceConnection.aidl
2 | **
3 | ** Copyright 2007, The Android Open Source Project
4 | **
5 | ** Licensed under the Apache License, Version 2.0 (the "License");
6 | ** you may not use this file except in compliance with the License.
7 | ** You may obtain a copy of the License at
8 | **
9 | ** http://www.apache.org/licenses/LICENSE-2.0
10 | **
11 | ** Unless required by applicable law or agreed to in writing, software
12 | ** distributed under the License is distributed on an "AS IS" BASIS,
13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | ** See the License for the specific language governing permissions and
15 | ** limitations under the License.
16 | */
17 |
18 | package android.app;
19 |
20 | import android.content.ComponentName;
21 |
22 | /** @hide */
23 | oneway interface IServiceConnection {
24 | void connected(in ComponentName name, IBinder service);
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/droidplugin/PluginApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.droidplugin;
24 |
25 | import android.app.Application;
26 | import android.content.Context;
27 |
28 | /**
29 | * Created by Andy Zhang(zhangyong232@gmail.com) 2014/12/5.
30 | */
31 | public class PluginApplication extends Application {
32 |
33 | private static final String TAG = PluginApplication.class.getSimpleName();
34 |
35 | @Override
36 | public void onCreate() {
37 | super.onCreate();
38 | PluginHelper.getInstance().applicationOnCreate(getBaseContext());
39 | }
40 |
41 |
42 | @Override
43 | protected void attachBaseContext(Context base) {
44 | PluginHelper.getInstance().applicationAttachBaseContext(base);
45 | super.attachBaseContext(base);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/droidplugin/hook/handle/IDisplayManagerHookHandle.java:
--------------------------------------------------------------------------------
1 | package com.morgoo.droidplugin.hook.handle;
2 |
3 | import android.content.Context;
4 | import android.text.TextUtils;
5 |
6 | import com.morgoo.droidplugin.hook.BaseHookHandle;
7 | import com.morgoo.droidplugin.hook.HookedMethodHandler;
8 |
9 | import java.lang.reflect.Method;
10 |
11 | /**
12 | * IDisplayManagerHookHandle
13 | *
14 | * @author Liu Yichen
15 | * @date 16/6/13
16 | */
17 | public class IDisplayManagerHookHandle extends BaseHookHandle {
18 |
19 |
20 | public IDisplayManagerHookHandle(Context hostContext) {
21 | super(hostContext);
22 | }
23 |
24 | @Override
25 | protected void init() {
26 |
27 | sHookedMethodHandlers.put("createVirtualDisplay", new createVirtualDisplay(mHostContext));
28 | }
29 |
30 | private static class createVirtualDisplay extends HookedMethodHandler {
31 |
32 |
33 | public createVirtualDisplay(Context hostContext) {
34 | super(hostContext);
35 | }
36 |
37 | @Override
38 | protected boolean beforeInvoke(Object receiver, Method method, Object[] args) throws Throwable {
39 |
40 | final int pkgIndex = 2;
41 | if (args != null && args.length > 0 && args[pkgIndex] instanceof String) {
42 | String pkg = (String) args[pkgIndex];
43 | if (!TextUtils.equals(pkg, mHostContext.getPackageName())) {
44 | args[pkgIndex] = mHostContext.getPackageName();
45 | }
46 | }
47 | return super.beforeInvoke(receiver, method, args);
48 | }
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/droidplugin/hook/handle/ReplaceCallingPackageHookedMethodHandler.java:
--------------------------------------------------------------------------------
1 | package com.morgoo.droidplugin.hook.handle;
2 |
3 | import android.content.Context;
4 | import android.os.Build;
5 | import android.os.RemoteException;
6 |
7 | import com.morgoo.droidplugin.hook.HookedMethodHandler;
8 | import com.morgoo.droidplugin.pm.PluginManager;
9 |
10 | import java.lang.reflect.Method;
11 |
12 | class ReplaceCallingPackageHookedMethodHandler extends HookedMethodHandler {
13 |
14 | public ReplaceCallingPackageHookedMethodHandler(Context hostContext) {
15 | super(hostContext);
16 | }
17 |
18 | @Override
19 | protected boolean beforeInvoke(Object receiver, Method method, Object[] args) throws Throwable {
20 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
21 | if (args != null && args.length > 0) {
22 | for (int index = 0; index < args.length; index++) {
23 | if (args[index] != null && (args[index] instanceof String)) {
24 | String str = ((String) args[index]);
25 | if (isPackagePlugin(str)) {
26 | args[index] = mHostContext.getPackageName();
27 | }
28 | }
29 | }
30 | }
31 | }
32 | return super.beforeInvoke(receiver, method, args);
33 | }
34 |
35 | private static boolean isPackagePlugin(String packageName) throws RemoteException {
36 | return PluginManager.getInstance().isPluginPackage(packageName);
37 | }
38 | }
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/droidplugin/pm/IApplicationCallback.aidl:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 |
24 |
25 | package com.morgoo.droidplugin.pm;
26 |
27 | /**
28 | * API for package data change related callbacks from the Package Manager.
29 | * Some usage scenarios include deletion of cache directory, generate
30 | * statistics related to code, data, cache usage
31 | * {@hide}
32 | */
33 | interface IApplicationCallback {
34 | Bundle onCallback(in Bundle extra);
35 | }
36 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/droidplugin/pm/IPackageDataObserver.aidl:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.droidplugin.pm;
24 |
25 | /**
26 | * API for package data change related callbacks from the Package Manager.
27 | * Some usage scenarios include deletion of cache directory, generate
28 | * statistics related to code, data, cache usage
29 | */
30 | oneway interface IPackageDataObserver {
31 | void onRemoveCompleted(in String packageName, boolean succeeded);
32 | }
33 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/droidplugin/reflect/Validate.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.droidplugin.reflect;
24 |
25 | /**
26 | * Created by Andy Zhang(zhangyong232@gmail.com)ClassUtils on 2015/3/26.
27 | */
28 | class Validate {
29 |
30 | static void isTrue(final boolean expression, final String message, final Object... values) {
31 | if (expression == false) {
32 | throw new IllegalArgumentException(String.format(message, values));
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/ComponentNameComparator.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper;
24 |
25 | import android.content.ComponentName;
26 | import android.text.TextUtils;
27 |
28 | import java.util.Comparator;
29 |
30 | public class ComponentNameComparator implements Comparator {
31 |
32 | @Override
33 | public int compare(ComponentName lhs, ComponentName rhs) {
34 | if (lhs == null && rhs == null) {
35 | return 0;
36 | } else if (lhs != null && rhs == null) {
37 | return 1;
38 | } else if (lhs == null && rhs != null) {
39 | return -1;
40 | } else {
41 | if (TextUtils.equals(lhs.getPackageName(), rhs.getPackageName()) && TextUtils.equals(lhs.getShortClassName(), rhs.getShortClassName())) {
42 | return 0;
43 | } else {
44 | return lhs.compareTo(rhs);
45 | }
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/ActivityManagerCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | /**
26 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/4/13.
27 | */
28 | public class ActivityManagerCompat {
29 | public static final int INTENT_SENDER_SERVICE = 4;
30 |
31 | public static final int INTENT_SENDER_ACTIVITY = 2;
32 | }
33 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/ActivityManagerNativeCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | import com.morgoo.droidplugin.reflect.MethodUtils;
26 |
27 | import java.lang.reflect.InvocationTargetException;
28 |
29 | /**
30 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/5/1.
31 | */
32 | public class ActivityManagerNativeCompat {
33 |
34 | private static Class sClass;
35 |
36 | public static Class Class() throws ClassNotFoundException {
37 | if (sClass == null) {
38 | sClass = Class.forName("android.app.ActivityManagerNative");
39 | }
40 | return sClass;
41 | }
42 |
43 | public static Object getDefault() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
44 | return MethodUtils.invokeStaticMethod(Class(), "getDefault");
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/IActivityManagerCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | /**
26 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/5/1.
27 | */
28 | public class IActivityManagerCompat {
29 |
30 | private static Class sClass;
31 |
32 | public static Class Class() throws ClassNotFoundException {
33 | if (sClass == null) {
34 | sClass = Class.forName("android.app.IActivityManager");
35 | }
36 | return sClass;
37 | }
38 |
39 | public static boolean isIActivityManager(Object obj){
40 | if (obj == null) {
41 | return false;
42 | } else {
43 | try {
44 | Class clazz = Class();
45 | return clazz.isInstance(obj);
46 | } catch (ClassNotFoundException e) {
47 | return false;
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/IDisplayManagerCompat.java:
--------------------------------------------------------------------------------
1 | package com.morgoo.helper.compat;
2 |
3 | import android.os.IBinder;
4 |
5 | import com.morgoo.droidplugin.reflect.MethodUtils;
6 |
7 | import java.lang.reflect.InvocationTargetException;
8 |
9 | /**
10 | * IDisplayManagerCompat
11 | *
12 | * @author Liu Yichen
13 | * @date 16/6/13
14 | */
15 | public class IDisplayManagerCompat {
16 |
17 | private static Class sClass;
18 |
19 | public static Class Class() throws ClassNotFoundException {
20 | if (sClass == null) {
21 | sClass = Class.forName("android.hardware.display.IDisplayManager");
22 | }
23 | return sClass;
24 | }
25 |
26 | public static Object asInterface(IBinder binder) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
27 | Class clazz = Class.forName("android.hardware.display.IDisplayManager$Stub");
28 | return MethodUtils.invokeStaticMethod(clazz, "asInterface", binder);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/IPackageDataObserverCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | /**
26 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/5/4.
27 | */
28 | public class IPackageDataObserverCompat {
29 |
30 | private static Class sClass;
31 |
32 | public static Class Class() throws ClassNotFoundException {
33 | if (sClass == null) {
34 | sClass = Class.forName("android.content.pm.IPackageDataObserver");
35 | }
36 | return sClass;
37 | }
38 |
39 | public static boolean isIPackageDataObserver(Object obj) throws ClassNotFoundException {
40 | if (obj == null) {
41 | return false;
42 | } else {
43 | Class clazz = Class();
44 | return clazz.isInstance(obj);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/PackageManagerCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | /**
26 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/4/13.
27 | */
28 | public class PackageManagerCompat {
29 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1;
30 | public static final int DELETE_SUCCEEDED = 1;
31 | public static final int INSTALL_SUCCEEDED = 1;
32 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;
33 | public static final int INSTALL_FAILED_INVALID_APK = -2;
34 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002;
35 | public static final int INSTALL_FAILED_ALREADY_EXISTS = -1;
36 | public static final int INSTALL_FAILED_NOT_SUPPORT_ABI = -3;}
37 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/ParceledListSliceCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | /**
26 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/5/4.
27 | */
28 | public class ParceledListSliceCompat {
29 |
30 | private static Class sClass;
31 |
32 | public static Class Class() throws ClassNotFoundException {
33 | if (sClass == null) {
34 | sClass = Class.forName("android.content.pm.ParceledListSlice");
35 | }
36 | return sClass;
37 | }
38 |
39 | public static boolean isParceledListSlice(Object obj){
40 | if (obj == null) {
41 | return false;
42 | } else {
43 | try {
44 | Class clazz = Class();
45 | return clazz.isInstance(obj);
46 | } catch (ClassNotFoundException e) {
47 | return false;
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/QueuedWorkCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | import com.morgoo.droidplugin.reflect.MethodUtils;
26 |
27 | import java.lang.reflect.InvocationTargetException;
28 |
29 | /**
30 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/5/1.
31 | */
32 | public class QueuedWorkCompat {
33 |
34 | private static Class sClass;
35 |
36 | private static Class Class() throws ClassNotFoundException {
37 | if (sClass == null) {
38 | sClass = Class.forName("android.app.QueuedWork");
39 | }
40 | return sClass;
41 | }
42 |
43 | public static void waitToFinish() {
44 | try {
45 | MethodUtils.invokeStaticMethod(Class(), "waitToFinish");
46 | } catch (Exception e) {
47 | e.printStackTrace();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/DroidPlugin/src/com/morgoo/helper/compat/UserHandleCompat.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** DroidPlugin Project
3 | **
4 | ** Copyright(c) 2015 Andy Zhang
5 | **
6 | ** This file is part of DroidPlugin.
7 | **
8 | ** DroidPlugin is free software: you can redistribute it and/or
9 | ** modify it under the terms of the GNU Lesser General Public
10 | ** License as published by the Free Software Foundation, either
11 | ** version 3 of the License, or (at your option) any later version.
12 | **
13 | ** DroidPlugin is distributed in the hope that it will be useful,
14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | ** Lesser General Public License for more details.
17 | **
18 | ** You should have received a copy of the GNU Lesser General Public
19 | ** License along with DroidPlugin. If not, see
20 | **
21 | **/
22 |
23 | package com.morgoo.helper.compat;
24 |
25 | import android.os.UserHandle;
26 |
27 | import com.morgoo.droidplugin.reflect.MethodUtils;
28 |
29 | import java.lang.reflect.InvocationTargetException;
30 |
31 | /**
32 | * Created by Andy Zhang(zhangyong232@gmail.com) on 2015/4/13.
33 | */
34 | public class UserHandleCompat {
35 |
36 | // UserHandle.getCallingUserId()
37 | public static int getCallingUserId() {
38 | try {
39 | return (int) MethodUtils.invokeStaticMethod(UserHandle.class, "getCallingUserId");
40 | } catch (Exception e) {
41 | e.printStackTrace();
42 | }
43 | return 0;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # android-utils-api
2 | android上一些实用技巧、实用功能代码示例,不断更新中
3 | 1:如何使用Android原生接口,实现“应用双开”
4 | 2:Android如何实时监控CPU频率
5 | 所有内容会在博客和微信号上同步介绍,欢迎大家关注我的微信公众号:Android源代码
6 | 或者我的博客:
7 | [我的博客](http://blog.csdn.net/zhenbohuang)
8 |
--------------------------------------------------------------------------------
/android-utils-api.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "utils.bobo.com.boboutils"
9 | minSdkVersion 21
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(include: ['*.jar'], dir: 'libs')
24 | compile project(':CommonUtils')
25 | compile project(':simplewebserver')
26 | compile 'com.android.support.constraint:constraint-layout:1.1.3'
27 | provided files('dynamic_libs/framework.jar')
28 | compile 'com.android.support:appcompat-v7:23.4.0'
29 | compile 'com.android.support:design:23.4.0'
30 | compile 'com.android.support:recyclerview-v7:23.1.0'
31 | compile project(path: ':DroidPlugin')
32 | compile project(':webrtcnoise')
33 | }
34 | tasks.withType(JavaCompile) {
35 | doFirst {
36 | println "===========================================================";
37 | println options.bootClasspath;
38 |
39 | def provided = [];
40 | fileTree(dir: 'dynamic_libs', include: ['*.jar']).each {
41 | provided.add(it.getAbsolutePath());
42 | }
43 | options.bootClasspath.split(File.pathSeparator).each {
44 | provided.add(it);
45 | }
46 | options.bootClasspath = provided.join(File.pathSeparator)
47 |
48 | println options.bootClasspath;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/dynamic_libs/framework.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/dynamic_libs/framework.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Users\huangzb1\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/utils/bobo/com/boboutils/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/aidl/com/bobo/service/utils/IWakeupService.aidl:
--------------------------------------------------------------------------------
1 |
2 | package com.bobo.service.utils;
3 |
4 | // Declare any non-default types here with import statements
5 | interface IWakeupService {
6 | void log(String clientPackageName);
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/aidl/utils/bobo/com/boboutils/App/overlay/IOverlayViewService.aidl:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App.overlay;
2 |
3 | import android.os.Bundle;
4 |
5 | // Declare any non-default types here with import statements
6 | interface IOverlayViewService {
7 | void showOverlay(in Bundle param);
8 | }
9 |
--------------------------------------------------------------------------------
/app/src/main/aidl/utils/bobo/com/boboutils/App/zombieservice/IZombieServiceFirst.aidl:
--------------------------------------------------------------------------------
1 | // IZombieServiceFirst.aidl
2 | package utils.bobo.com.boboutils.App.zombieservice;
3 |
4 | // Declare any non-default types here with import statements
5 |
6 | interface IZombieServiceFirst {
7 | /**
8 | * Demonstrates some basic types that you can use as parameters
9 | * and return values in AIDL.
10 | */
11 | void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
12 | double aDouble, String aString);
13 | String getServiceName();
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/aidl/utils/bobo/com/boboutils/App/zombieservice/IZombieServiceSecond.aidl:
--------------------------------------------------------------------------------
1 | // IZombieServiceSecond.aidl
2 | package utils.bobo.com.boboutils.App.zombieservice;
3 |
4 | // Declare any non-default types here with import statements
5 |
6 | interface IZombieServiceSecond {
7 | /**
8 | * Demonstrates some basic types that you can use as parameters
9 | * and return values in AIDL.
10 | */
11 | void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
12 | double aDouble, String aString);
13 | String getServiceName();
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/assets/part_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_1.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_10.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_11.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_12.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_13.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_14.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_15.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_16.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_17.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_18.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_19.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_2.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_3.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_4.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_5.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_6.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_7.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_8.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/part_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/part_9.jpg
--------------------------------------------------------------------------------
/app/src/main/assets/weixin_1280.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/assets/weixin_1280.apk
--------------------------------------------------------------------------------
/app/src/main/java/com/bobo/service/utils/NoMarketDialogHelp.java:
--------------------------------------------------------------------------------
1 | package com.bobo.service.utils;
2 |
3 | import android.app.Activity;
4 | import android.app.AlertDialog;
5 | import android.content.DialogInterface;
6 | import android.content.Intent;
7 |
8 | /**
9 | * Created by bobohuang on 2018/12/25.
10 | */
11 |
12 | public class NoMarketDialogHelp {
13 | public static boolean showDialogIfNeed(final Activity activity){
14 | Intent intent = activity.getIntent();
15 | if (intent == null){
16 | return false;
17 | }
18 | boolean ifFromMarket = intent.getBooleanExtra("ifFromMarket",false);
19 | if(ifFromMarket) {
20 | return false;
21 | }
22 | AlertDialog.Builder builder = new AlertDialog.Builder(activity);
23 | builder.setCancelable(false);
24 | builder.setMessage("请使用“应用中心”下载安装应用");
25 | builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
26 | @Override
27 | public void onClick(DialogInterface dialog, int which) {
28 | activity.finish();
29 | }
30 | });
31 | builder.create().show();
32 | return true;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/bobo/service/utils/Sample.java:
--------------------------------------------------------------------------------
1 | package com.bobo.service.utils;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Created by bobohuang on 2018/10/27.
7 | */
8 |
9 | public class Sample {
10 | public void test(){
11 | Context context = null;
12 | BindMultiAppServiceHelp.bindService(context);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/bobo/service/utils/WakeupServerService.java:
--------------------------------------------------------------------------------
1 | package com.bobo.service.utils;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 | import android.util.Log;
7 |
8 | public class WakeupServerService extends Service {
9 | private static final String TAG = "WakeupServerService";
10 | public WakeupServerService() {
11 | }
12 |
13 | @Override
14 | public IBinder onBind(Intent intent) {
15 | return mIBinder;
16 | }
17 | private IBinder mIBinder = new IWakeupService.Stub() {
18 | @Override
19 | public void log(String clientPackageName){
20 | Log.e(TAG, clientPackageName+" bind " + WakeupServerService.this.getPackageName());
21 | }
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/AsyncTaskRunAlways.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.os.AsyncTask;
4 | import android.util.Log;
5 |
6 | /**
7 | * Created by huangzb1 on 2018/3/7.
8 | */
9 |
10 | public class AsyncTaskRunAlways extends AsyncTask {
11 | private static final String TAG = "AsyncTaskRunAlways";
12 | private String mTag;
13 | public AsyncTaskRunAlways(String tag){
14 | mTag = tag;
15 | }
16 | @Override
17 | protected Void doInBackground(Void... params) {
18 | int index = 1;
19 | while (!isCancelled()){
20 | Log.d(TAG, mTag+"; doInBackground; index="+index);
21 | try {
22 | Thread.sleep(1000);
23 | } catch (InterruptedException e) {
24 | e.printStackTrace();
25 | }
26 | index++;
27 | }
28 | return null;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/CustomStatusBarImgBackgroundActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.app.Activity;
4 | import android.app.Notification;
5 | import android.app.NotificationManager;
6 | import android.app.PendingIntent;
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.graphics.Color;
10 | import android.os.Build;
11 | import android.os.Bundle;
12 | import android.os.Handler;
13 | import android.support.v7.app.AppCompatActivity;
14 | import android.view.View;
15 | import android.widget.TextView;
16 |
17 | import utils.bobo.com.boboutils.R;
18 |
19 | public class CustomStatusBarImgBackgroundActivity extends Activity {
20 | private static final String TAG = "CustomStatusBarImgBackgroundActivity";
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | if (Build.VERSION.SDK_INT >= 21){
25 | View decorView = getWindow().getDecorView();
26 | decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
27 | getWindow().setStatusBarColor(Color.TRANSPARENT);
28 | }
29 | setContentView(R.layout.activity_custom_statusbar_img_bg);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/ForegroundService.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.app.Notification;
4 | import android.app.PendingIntent;
5 | import android.app.Service;
6 | import android.content.Intent;
7 | import android.os.IBinder;
8 |
9 | import utils.bobo.com.boboutils.R;
10 |
11 | public class ForegroundService extends Service {
12 | public ForegroundService() {
13 | }
14 |
15 | @Override
16 | public IBinder onBind(Intent intent) {
17 | // TODO: Return the communication channel to the service.
18 | throw new UnsupportedOperationException("Not yet implemented");
19 | }
20 | public void onCreate(){
21 | super.onCreate();
22 | }
23 | @Override
24 | public int onStartCommand(Intent intent, int flags,int startId) {
25 | Intent notificationIntent = new Intent(this, ForgegroundServiceActivity.class);
26 | PendingIntent contentIntent = PendingIntent.getActivity(this, 0,notificationIntent, 0);
27 | Notification.Builder builder = new Notification.Builder(this);
28 | builder.setContentTitle("ForegroundService");
29 | builder.setContentText("ForegroundService");
30 | builder.setContentIntent(contentIntent);
31 | builder.setSmallIcon(R.mipmap.ic_launcher);
32 |
33 | startForeground(1, builder.build());
34 |
35 | return Service.START_NOT_STICKY;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/QuickSetting/QuickSettingService.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App.QuickSetting;
2 |
3 | import android.annotation.TargetApi;
4 | import android.os.Build;
5 | import android.service.quicksettings.TileService;
6 | import android.util.Log;
7 |
8 | /**
9 | * Created by bobohuang on 2018/8/15.
10 | */
11 |
12 | @TargetApi(Build.VERSION_CODES.N)
13 | public class QuickSettingService extends TileService {
14 | private static final String TAG = "QuickSettingService";
15 | //当用户从Edit栏添加到快速设定中调用
16 | @Override
17 | public void onTileAdded() {
18 | Log.d(TAG, "onTileAdded");
19 | }
20 | //当用户从快速设定栏中移除的时候调用
21 | @Override
22 | public void onTileRemoved() {
23 | Log.d(TAG, "onTileRemoved");
24 | }
25 | // 点击的时候
26 | @Override
27 | public void onClick() {
28 | Log.d(TAG, "onClick");
29 | }
30 | // 打开下拉菜单的时候调用,当快速设置按钮并没有在编辑栏拖到设置栏中不会调用
31 | //在TleAdded之后会调用一次
32 | @Override
33 | public void onStartListening () {
34 | Log.d(TAG, "onStartListening");
35 | }
36 | // 关闭下拉菜单的时候调用,当快速设置按钮并没有在编辑栏拖到设置栏中不会调用
37 | // 在onTileRemoved移除之前也会调用移除
38 | @Override
39 | public void onStopListening () {
40 | Log.d(TAG, "onStopListening");
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/ScreenPinningActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.KeyEvent;
6 |
7 | import utils.bobo.com.boboutils.R;
8 |
9 | public class ScreenPinningActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_screen_pinning);
15 | }
16 | @Override
17 | public void onResume(){
18 | super.onResume();
19 | this.startLockTask();
20 | }
21 | @Override
22 | public boolean onKeyDown(int keyCode,KeyEvent event){
23 | if((keyCode==KeyEvent.KEYCODE_BACK)
24 | ||(keyCode == KeyEvent.KEYCODE_HOME))
25 | return true;//不执行父类点击事件
26 | return super.onKeyDown(keyCode, event);//继续执行父类其他点击事件
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/SecretCodeReceiver.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | import utils.bobo.com.boboutils.DemosActivity;
8 |
9 | public class SecretCodeReceiver extends BroadcastReceiver {
10 | public SecretCodeReceiver() {
11 | }
12 |
13 | @Override
14 | public void onReceive(Context context, Intent intent) {
15 | Intent activityIntent = new Intent(context, DemosActivity.class);
16 | activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
17 | context.startActivity(activityIntent);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/ShowWhenLockActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.WindowManager;
6 |
7 | import utils.bobo.com.boboutils.R;
8 |
9 | public class ShowWhenLockActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_show_when_lock);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/TestService.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 | import android.util.Log;
7 |
8 | public class TestService extends Service {
9 | public static AsyncTaskRunAlways sAsyncTaskRunAlways;
10 | private static final String TAG = "TestService";
11 | public static final String ACTION_START_ASYNC_TASK
12 | = "utils.bobo.com.boboutils.App.TestService.ACTION_START_ASYNC_TASK";
13 |
14 | public TestService() {
15 | }
16 |
17 | @Override
18 | public IBinder onBind(Intent intent) {
19 | // TODO: Return the communication channel to the service.
20 | throw new UnsupportedOperationException("Not yet implemented");
21 | }
22 |
23 | @Override
24 | public int onStartCommand(Intent intent, int flags, int startId) {
25 | if (intent != null) {
26 | String action = intent.getAction();
27 | Log.d(TAG, "onStartCommand action=" + action);
28 | if (ACTION_START_ASYNC_TASK.equals(action)) {
29 | if(sAsyncTaskRunAlways == null) {
30 | sAsyncTaskRunAlways = new AsyncTaskRunAlways(String.valueOf(System.currentTimeMillis()));
31 | sAsyncTaskRunAlways.execute();
32 | }
33 | }
34 | }
35 | return START_STICKY;
36 | }
37 | @Override
38 | public void onDestroy() {
39 | super.onDestroy();
40 | Log.d(TAG, "onDestroy");
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/TestServiceActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import utils.bobo.com.boboutils.R;
8 |
9 | public class TestServiceActivity extends Activity implements View.OnClickListener {
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.activity_app_two_button);
13 | this.findViewById(R.id.button1).setOnClickListener(this);
14 | findViewById(R.id.button2).setOnClickListener(this);
15 | }
16 |
17 | @Override
18 | public void onClick(View v) {
19 | switch (v.getId()) {
20 | case R.id.button1: {
21 | Intent intent = new Intent(this, TestService.class);
22 | intent.setAction(TestService.ACTION_START_ASYNC_TASK);
23 | this.startService(intent);
24 | break;
25 | }
26 | case R.id.button2: {
27 | Intent intent = new Intent(this, TestService.class);
28 | this.stopService(intent);
29 | if(TestService.sAsyncTaskRunAlways != null){
30 | TestService.sAsyncTaskRunAlways.cancel(true);
31 | TestService.sAsyncTaskRunAlways = null;
32 | }
33 | break;
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/WakeLockTestApi.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App;
2 |
3 | import android.content.Context;
4 | import android.os.PowerManager;
5 |
6 | /**
7 | * Created by bobohuang(bobohuang1985@qq.com) on 2016/10/31.
8 | */
9 | public class WakeLockTestApi {
10 | private static final String TAG = "WakeLockTestApi";
11 | private Context mContext;
12 | private PowerManager.WakeLock mCpuWakeLock;
13 | private PowerManager mPowerManager;
14 | private static WakeLockTestApi sApi;
15 | public synchronized static WakeLockTestApi getInstance(Context context){
16 | if(sApi == null){
17 | sApi = new WakeLockTestApi(context);
18 | }
19 | return sApi;
20 | }
21 | private WakeLockTestApi(Context context){
22 | mContext = context;
23 | mPowerManager = (PowerManager)mContext.getSystemService(Context.POWER_SERVICE);
24 | }
25 | public boolean isWakeLockExist(){
26 | if(mCpuWakeLock != null){
27 | return true;
28 | }
29 | return false;
30 | }
31 | public boolean getAWakeLock(){
32 | if(mCpuWakeLock != null){
33 | return true;
34 | }
35 | mCpuWakeLock = mPowerManager.newWakeLock(
36 | PowerManager.PARTIAL_WAKE_LOCK, TAG + "-cpu");
37 | mCpuWakeLock.acquire();
38 | return true;
39 | }
40 | public boolean releaseWakeLock(){
41 | if(mCpuWakeLock == null){
42 | return true;
43 | }
44 | mCpuWakeLock.release();
45 | mCpuWakeLock = null;
46 | return true;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/appwidget/CustomViewAppWidget.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App.appwidget;
2 |
3 | import android.appwidget.AppWidgetManager;
4 | import android.appwidget.AppWidgetProvider;
5 | import android.content.Context;
6 | import android.widget.RemoteViews;
7 |
8 | import utils.bobo.com.boboutils.R;
9 |
10 | /**
11 | * Implementation of App Widget functionality.
12 | */
13 | public class CustomViewAppWidget extends AppWidgetProvider {
14 |
15 | static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
16 | int appWidgetId) {
17 |
18 | CharSequence widgetText = context.getString(R.string.appwidget_text);
19 | // Construct the RemoteViews object
20 | RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.custom_view_app_widget);
21 | views.setTextViewText(R.id.appwidget_text, widgetText);
22 | // Instruct the widget manager to update the widget
23 | appWidgetManager.updateAppWidget(appWidgetId, views);
24 | }
25 |
26 | @Override
27 | public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
28 | UpdateAppWidgetService.startActionUpdateAppWidget(context);
29 | super.onUpdate(context, appWidgetManager, appWidgetIds);
30 | }
31 |
32 | @Override
33 | public void onEnabled(Context context) {
34 | // Enter relevant functionality for when the first widget is created
35 | }
36 |
37 | @Override
38 | public void onDisabled(Context context) {
39 | // Enter relevant functionality for when the last widget is disabled
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/call/CallAudioRecord8Dot0Activity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App.call;
2 |
3 | import android.app.Activity;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Intent;
6 | import android.content.IntentFilter;
7 | import android.os.Bundle;
8 | import android.os.Handler;
9 | import android.view.View;
10 |
11 | import utils.bobo.com.boboutils.R;
12 |
13 | public class CallAudioRecord8Dot0Activity extends Activity implements View.OnClickListener {
14 | private static final String TAG = "CallAudioRecordActivity";
15 | private BroadcastReceiver mBroadcastReceiver = new PhoneCall8Dot0Receiver();
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_app_two_button);
20 | this.findViewById(R.id.button1).setOnClickListener(this);
21 | findViewById(R.id.button2).setOnClickListener(this);
22 | IntentFilter filter = new IntentFilter(Intent.ACTION_NEW_OUTGOING_CALL);
23 | filter.addAction("android.intent.action.PHONE_STATE");
24 | this.registerReceiver(mBroadcastReceiver,filter);
25 | }
26 | @Override
27 | public void onDestroy(){
28 | super.onDestroy();
29 | this.unregisterReceiver(mBroadcastReceiver);
30 | }
31 | private Handler mHandler= new Handler();
32 | @Override
33 | public void onClick(View v) {
34 | switch(v.getId()){
35 | case R.id.button1: {
36 |
37 | break;
38 | }
39 | case R.id.button2:{
40 | break;
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/call/CallAudioRecordActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App.call;
2 |
3 | import android.app.Activity;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Intent;
6 | import android.content.IntentFilter;
7 | import android.os.Bundle;
8 | import android.os.Handler;
9 | import android.view.View;
10 |
11 | import utils.bobo.com.boboutils.R;
12 |
13 | public class CallAudioRecordActivity extends Activity implements View.OnClickListener {
14 | private static final String TAG = "CallAudioRecordActivity";
15 | private BroadcastReceiver mBroadcastReceiver = new PhoneCallReceiver();
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_app_two_button);
20 | this.findViewById(R.id.button1).setOnClickListener(this);
21 | findViewById(R.id.button2).setOnClickListener(this);
22 | IntentFilter filter = new IntentFilter(Intent.ACTION_NEW_OUTGOING_CALL);
23 | filter.addAction("android.intent.action.PHONE_STATE");
24 | this.registerReceiver(mBroadcastReceiver,filter);
25 | }
26 | @Override
27 | public void onDestroy(){
28 | super.onDestroy();
29 | this.unregisterReceiver(mBroadcastReceiver);
30 | }
31 | private Handler mHandler= new Handler();
32 | @Override
33 | public void onClick(View v) {
34 | switch(v.getId()){
35 | case R.id.button1: {
36 |
37 | break;
38 | }
39 | case R.id.button2:{
40 | break;
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/App/zombieservice/ZombieServiceStartActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.App.zombieservice;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | import utils.bobo.com.boboutils.R;
9 |
10 | /**
11 | * Created by huangzb1 on 2018/1/30.
12 | */
13 |
14 | public class ZombieServiceStartActivity extends Activity implements View.OnClickListener {
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_app_two_button);
18 | this.findViewById(R.id.button1).setOnClickListener(this);
19 | findViewById(R.id.button2).setOnClickListener(this);
20 | }
21 |
22 | @Override
23 | public void onClick(View v) {
24 | switch(v.getId()) {
25 | case R.id.button1: {
26 | Intent intent = new Intent(this, ZombieServiceFirst.class);
27 | this.startService(intent);
28 | break;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/MainActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils;
2 |
3 | import android.support.v7.app.ActionBarActivity;
4 | import android.os.Bundle;
5 | import android.view.Menu;
6 | import android.view.MenuItem;
7 |
8 |
9 | public class MainActivity extends ActionBarActivity {
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_main);
14 | }
15 |
16 | @Override
17 | public boolean onCreateOptionsMenu(Menu menu) {
18 | // Inflate the menu; this adds items to the action bar if it is present.
19 | getMenuInflater().inflate(R.menu.menu_main, menu);
20 | return true;
21 | }
22 |
23 | @Override
24 | public boolean onOptionsItemSelected(MenuItem item) {
25 | // Handle action bar item clicks here. The action bar will
26 | // automatically handle clicks on the Home/Up button, so long
27 | // as you specify a parent activity in AndroidManifest.xml.
28 | int id = item.getItemId();
29 |
30 | //noinspection SimplifiableIfStatement
31 | if (id == R.id.action_settings) {
32 | return true;
33 | }
34 |
35 | return super.onOptionsItemSelected(item);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/MyApp.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | import com.bobo.service.utils.BindWakeupServerServiceHelp;
7 | import com.morgoo.droidplugin.PluginHelper;
8 |
9 | import org.join.ws.WSApplication;
10 |
11 | /**
12 | * Created by bobohuang on 2018/3/25.
13 | */
14 |
15 | public class MyApp extends Application {
16 | @Override
17 |
18 | public void onCreate() {
19 | super.onCreate();
20 | WSApplication.getInstance().onCreate(this);
21 |
22 | PluginHelper.getInstance().applicationOnCreate(getBaseContext());
23 | BindWakeupServerServiceHelp.bindService(this);
24 | }
25 |
26 | @Override
27 | protected void attachBaseContext(Context base) {
28 |
29 | PluginHelper.getInstance().applicationAttachBaseContext(base);
30 |
31 | super.attachBaseContext(base);
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/SimpleWebServerProxy.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils;
2 |
3 | import android.Manifest;
4 | import android.app.Activity;
5 | import android.content.Intent;
6 | import android.content.pm.PackageManager;
7 | import android.os.Bundle;
8 | import android.support.annotation.NonNull;
9 | import android.support.v4.app.ActivityCompat;
10 | import android.support.v4.content.ContextCompat;
11 |
12 | import org.join.ws.ui.WSActivity;
13 |
14 | public class SimpleWebServerProxy extends Activity {
15 | private static final int REQUESTCODE_PERMISSION_STORAGE = 0;
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | ActivityCompat.requestPermissions(this, new String[]{
20 | Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE},
21 | REQUESTCODE_PERMISSION_STORAGE);
22 | setContentView(R.layout.activity_simple_web_server_proxy);
23 | }
24 | @Override
25 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
26 | @NonNull int[] grantResulits){
27 | if(REQUESTCODE_PERMISSION_STORAGE == requestCode){
28 | for(int result:grantResulits){
29 | if(result != PackageManager.PERMISSION_GRANTED){
30 | finish();
31 | return;
32 | }
33 | }
34 | Intent intent = new Intent(this,WSActivity.class);
35 | this.startActivity(intent);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/deviceinfo/ScreenInfoActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.deviceinfo;
2 |
3 | import android.app.Activity;
4 | import android.content.ContentUris;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.database.ContentObserver;
8 | import android.database.Cursor;
9 | import android.net.Uri;
10 | import android.os.Bundle;
11 | import android.os.Handler;
12 | import android.os.Vibrator;
13 | import android.provider.Telephony;
14 | import android.telephony.SmsManager;
15 | import android.util.Log;
16 | import android.view.View;
17 | import android.widget.TextView;
18 |
19 | import utils.bobo.com.boboutils.App.LocationService;
20 | import utils.bobo.com.boboutils.R;
21 |
22 | public class ScreenInfoActivity extends Activity{
23 | private static final String TAG = "ScreenInfoActivity";
24 | TextView mStatusTextView;
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_screen_info);
30 | View view = findViewById(R.id.infoll);
31 |
32 | TextView infoTextView = (TextView)findViewById(R.id.info);
33 | String infoText = "1dp = " + this.getResources().getDimension(R.dimen.dp_1);
34 | infoText += "; paddingEnd = " + infoTextView.getPaddingEnd() + "; paddingStart = " + infoTextView.getPaddingStart();
35 |
36 | infoText += "\r\n; parent paddingEnd = " + view.getPaddingEnd() + "; paddingStart = " + view.getPaddingStart();
37 | infoTextView.setText(infoText);
38 | }
39 | @Override
40 | public void onDestroy() {
41 | super.onDestroy();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/src/main/java/utils/bobo/com/boboutils/file/FileEncryptorActivity.java:
--------------------------------------------------------------------------------
1 | package utils.bobo.com.boboutils.file;
2 |
3 | import android.Manifest;
4 | import android.content.pm.PackageManager;
5 | import android.support.annotation.NonNull;
6 | import android.support.v4.app.ActivityCompat;
7 | import android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback;
8 | import android.support.v4.app.FragmentTransaction;
9 | import android.os.Bundle;
10 | import android.support.v4.app.Fragment;
11 | import android.support.v4.app.FragmentActivity;
12 |
13 | import utils.bobo.com.boboutils.R;
14 |
15 | public class FileEncryptorActivity extends FragmentActivity implements OnRequestPermissionsResultCallback {
16 | private static final int REQUESTCODE_PERMISSION_STORAGE = 0;
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.fragment_activity);
21 | initContent();
22 | }
23 | private void initContent() {
24 | Fragment fragment = CommonFileListFragment.newInstance();
25 | FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
26 | ft.replace(R.id.content, fragment);
27 | ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
28 | //ft.add(R.id.content, mStatusListFragment);
29 | ft.commit();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/document.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-hdpi/document.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/dpi_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-hdpi/dpi_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-hdpi/folder.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/dpi_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-mdpi/dpi_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/example_appwidget_preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-nodpi/example_appwidget_preview.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/check_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-xhdpi/check_on.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/custom_status_bar_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-xhdpi/custom_status_bar_img.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/dpi_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-xhdpi/dpi_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/badge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-xxhdpi/badge.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/dpi_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-xxhdpi/dpi_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/dpi_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/drawable-xxxhdpi/dpi_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corrdinator_activity_header_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_feedback.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_badged.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_cutom_accessibility.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_foreground_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_location.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_long_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
18 |
25 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_request_one_location.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
18 |
19 |
22 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_temp.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_two_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_vibrator.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
26 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_wakelock_get_release.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
15 |
20 |
25 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_app_widget_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_audio_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_cpu_infos.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_custom_statusbar_img_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_dynamic_view_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_floating_pellets.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_grid_layout_manager.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main_real.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_notification.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_screen_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
17 |
23 |
24 |
25 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_screen_pinning.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_show_when_lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_simple_web_server_proxy.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_text_view.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/common_file_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
14 |
24 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_view_app_widget.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
19 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
23 |
24 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_collection_object.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_common_file_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
26 |
27 |
28 |
29 |
35 |
36 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/system_overlay.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/text_row_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
4 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-v14/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 | 0dp
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 | >
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values-zh-rcn/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 文件加密demo
3 | JobScheduler、Thread、AsyncTask
4 | 上一级目录
5 | 外部存储器
6 | 内部存储器
7 | 内部存储器
8 | AES加密
9 | AES解密
10 | 快速加密
11 | 快速解密
12 |
13 | 设备通用信息
14 | 内核
15 | 手机标示
16 | 手机串号
17 | OS
18 | 屏幕信息
19 | MTD分区信息
20 | 分区挂载
21 | RAM内存信息
22 | ROM存储信息
23 | SD卡
24 | CPU信息
25 | 离线
26 | 屏幕固定
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #c0ffbd21
4 | #ff4ac0e0
5 | #ff3e8ddd
6 | #ff00a09b
7 | #ff007069
8 | #66000000
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
11 | 8dp
12 |
13 | 160dp
14 | 80dp
15 | 2dp
16 | 1dp
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
12 |
13 |
14 |
15 |
16 |
17 |
21 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/accessibility_listener_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/basic_device_admin_receiver.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/custom_view_app_widget_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/device_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/filepaths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
6 | jcenter()
7 | google()
8 | maven {
9 | url 'https://maven.google.com/'
10 | name 'Google'
11 | }
12 | }
13 | dependencies {
14 | classpath 'com.android.tools.build:gradle:3.3.2'
15 |
16 | // NOTE: Do not place your application dependencies here; they belong
17 | // in the individual module build.gradle files
18 | }
19 | }
20 |
21 | ext {
22 | compileSdkVersion = 25
23 | buildToolsVersion = "23.0.1"
24 | }
25 |
26 | allprojects {
27 | repositories {
28 | jcenter()
29 | maven {
30 | url 'https://maven.google.com/'
31 | name 'Google'
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Apr 26 14:46:28 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':CommonUtils', ':simplewebserver', ':DroidPlugin', ':webrtcnoise'
2 |
--------------------------------------------------------------------------------
/simplewebserver/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/simplewebserver/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 14
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | minSdkVersion 9
9 | targetSdkVersion 24
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | testCompile 'junit:junit:4.12'
24 | }
25 |
--------------------------------------------------------------------------------
/simplewebserver/libs/ant-zip.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/libs/ant-zip.jar
--------------------------------------------------------------------------------
/simplewebserver/libs/commons-io-2.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/libs/commons-io-2.4.jar
--------------------------------------------------------------------------------
/simplewebserver/libs/jangod-core.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/libs/jangod-core.jar
--------------------------------------------------------------------------------
/simplewebserver/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Users\huangzb1\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/simplewebserver/src/androidTest/java/com/bobo/simplewebserver/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.bobo.simplewebserver;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/403.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403
5 |
6 |
7 | Error 403, access denied.
8 |
9 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 404
5 |
6 |
7 | Error 404, file not found.
8 |
9 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/503.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 503
5 |
6 |
7 | Error 503, service unavailable.
8 |
9 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/attachments/demo.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/assets/WebServer/attachments/demo.apk
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Hello
5 |
6 |
7 | Hello world!
8 |
9 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
15 |
16 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/index.html.bak:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
15 |
16 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/assets/WebServer/readme.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/assets/WebServer/readme.txt
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/receiver/OnNetworkListener.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.receiver;
2 |
3 | public interface OnNetworkListener {
4 |
5 | /**
6 | * @brief 网络连接了
7 | * @param isWifi 是否Wifi连接
8 | */
9 | void onConnected(boolean isWifi);
10 |
11 | /**
12 | * @brief 网络断开了
13 | */
14 | void onDisconnected();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/receiver/OnStorageListener.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.receiver;
2 |
3 | public interface OnStorageListener {
4 |
5 | /**
6 | * 挂载
7 | */
8 | void onMounted();
9 |
10 | /**
11 | * 未挂载
12 | */
13 | void onUnmounted();
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/receiver/OnWsListener.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.receiver;
2 |
3 | public interface OnWsListener {
4 |
5 | /**
6 | * 服务可用
7 | */
8 | void onServAvailable();
9 |
10 | /**
11 | * 服务不可用
12 | */
13 | void onServUnavailable();
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/GzipFilter.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv;
2 |
3 | import java.io.File;
4 | import java.util.Arrays;
5 | import java.util.HashSet;
6 | import java.util.Set;
7 |
8 | import org.join.ws.util.CommonUtil;
9 |
10 | /**
11 | * Gzip压缩过滤器
12 | * @author join
13 | */
14 | public class GzipFilter {
15 |
16 | /** Gzip压缩过滤集 */
17 | private static final Set gzipSet;
18 |
19 | static {
20 | gzipSet = new HashSet();
21 | addGzipExtension("htm");
22 | addGzipExtension("html");
23 | addGzipExtension("js");
24 | addGzipExtension("css");
25 | }
26 |
27 | public static void addGzipExtension(String extension) {
28 | gzipSet.add(extension);
29 | }
30 |
31 | public static void addGzipExtensions(String... extensions) {
32 | gzipSet.addAll(Arrays.asList(extensions));
33 | }
34 |
35 | public static boolean isGzipExtension(String extension) {
36 | return gzipSet.contains(extension);
37 | }
38 |
39 | public static boolean isGzipFile(File file) {
40 | return gzipSet.contains(CommonUtil.getSingleton().getExtension(file));
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/TempCacheFilter.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv;
2 |
3 | import java.util.Arrays;
4 | import java.util.HashSet;
5 | import java.util.Set;
6 |
7 | /**
8 | * 模板缓存过滤器
9 | * @author join
10 | */
11 | public class TempCacheFilter {
12 |
13 | /** 缓存过滤集 */
14 | private static final Set cacheSet;
15 |
16 | static {
17 | cacheSet = new HashSet();
18 | }
19 |
20 | public static void addCacheTemp(String tempFile) {
21 | cacheSet.add(tempFile);
22 | }
23 |
24 | public static void addCacheTemps(String... tempFiles) {
25 | cacheSet.addAll(Arrays.asList(tempFiles));
26 | }
27 |
28 | public static boolean isCacheTemp(String tempFile) {
29 | return cacheSet.contains(tempFile);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/UrlPattern.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv;
2 |
3 | public class UrlPattern {
4 |
5 | /** 浏览,默认 */
6 | public static final String BROWSE = "*";
7 |
8 | /** 下载 */
9 | public static final String DOWNLOAD = "/dodownload";
10 | /** 删除 */
11 | public static final String DELETE = "/dodelete";
12 | /** 上传 */
13 | public static final String UPLOAD = "/doupload";
14 | /** 进度 */
15 | public static final String PROGRESS = "/doprogress";
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/entity/GzipByteArrayEntity.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.entity;
2 |
3 | import java.io.ByteArrayInputStream;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import java.io.OutputStream;
7 | import java.util.zip.GZIPOutputStream;
8 |
9 | /**
10 | * Gzip字节数组实体
11 | * @author Join
12 | */
13 | public class GzipByteArrayEntity extends GzipEntity {
14 |
15 | protected final byte[] byteArray;
16 | protected final boolean isGzipByteArray;
17 |
18 | /**
19 | * Gzip字节数组实体构造函数
20 | * @param byteArray 字节数组
21 | * @param isGzipByteArray 是否是Gzip压缩过的字节数组
22 | */
23 | public GzipByteArrayEntity(byte[] byteArray, boolean isGzipByteArray) {
24 | super();
25 | if (byteArray == null) {
26 | throw new IllegalArgumentException("byteArray may not be null");
27 | }
28 | this.byteArray = byteArray;
29 | this.isGzipByteArray = isGzipByteArray;
30 | }
31 |
32 | @Override
33 | public long getContentLength() {
34 | return isGzipByteArray ? byteArray.length : -1;
35 | }
36 |
37 | @Override
38 | public void writeTo(OutputStream outstream) throws IOException {
39 | if (outstream == null) {
40 | throw new IllegalArgumentException("Output stream may not be null");
41 | }
42 | InputStream instream = new ByteArrayInputStream(this.byteArray);
43 | if (!isGzipByteArray) {
44 | outstream = new GZIPOutputStream(outstream);
45 | }
46 | try {
47 | copy(instream, outstream);
48 | } finally {
49 | instream.close();
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/entity/GzipFileEntity.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.entity;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 | import java.io.OutputStream;
8 | import java.util.zip.GZIPOutputStream;
9 |
10 | /**
11 | * Gzip文件实体
12 | * @author Join
13 | */
14 | public class GzipFileEntity extends GzipEntity {
15 |
16 | protected final File file;
17 | protected final boolean isGzipFile;
18 |
19 | /**
20 | * Gzip文件实体构造函数
21 | * @param file 文件
22 | * @param contentType 类型
23 | * @param isGzipFile 是否是Gzip压缩过的文件
24 | */
25 | public GzipFileEntity(final File file, String contentType, boolean isGzipFile) {
26 | super();
27 | if (file == null) {
28 | throw new IllegalArgumentException("File may not be null");
29 | }
30 | this.file = file;
31 | this.isGzipFile = isGzipFile;
32 | setContentType(contentType);
33 | }
34 |
35 | @Override
36 | public long getContentLength() {
37 | return isGzipFile ? this.file.length() : -1;
38 | }
39 |
40 | @Override
41 | public void writeTo(OutputStream outstream) throws IOException {
42 | if (outstream == null) {
43 | throw new IllegalArgumentException("Output stream may not be null");
44 | }
45 | InputStream instream = new FileInputStream(this.file);
46 | if (!isGzipFile) {
47 | outstream = new GZIPOutputStream(outstream);
48 | }
49 | try {
50 | copy(instream, outstream);
51 | } finally {
52 | instream.close();
53 | }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/req/HttpProgressHandler.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.req;
2 |
3 | import java.io.IOException;
4 | import java.util.Map;
5 |
6 | import org.apache.http.HttpException;
7 | import org.apache.http.HttpRequest;
8 | import org.apache.http.HttpResponse;
9 | import org.apache.http.HttpStatus;
10 | import org.apache.http.entity.StringEntity;
11 | import org.apache.http.protocol.HttpContext;
12 | import org.apache.http.protocol.HttpRequestHandler;
13 | import org.join.ws.Constants.Config;
14 | import org.join.ws.serv.support.HttpPostParser;
15 | import org.join.ws.serv.support.Progress;
16 |
17 | import android.util.Log;
18 |
19 | public class HttpProgressHandler implements HttpRequestHandler {
20 |
21 | static final String TAG = "HttpProgressHandler";
22 | static final boolean DEBUG = false || Config.DEV_MODE;
23 |
24 | public HttpProgressHandler() {
25 | }
26 |
27 | @Override
28 | public void handle(HttpRequest request, HttpResponse response, HttpContext context)
29 | throws HttpException, IOException {
30 | HttpPostParser parser = new HttpPostParser();
31 | Map params = parser.parse(request);
32 | String id = params.get("id");
33 | if (id == null) {
34 | response.setStatusCode(HttpStatus.SC_BAD_REQUEST);
35 | return;
36 | }
37 | String progress = Progress.get(id) + "";
38 | if (DEBUG)
39 | Log.d(TAG, id + ": " + progress);
40 | response.setEntity(new StringEntity(progress, Config.ENCODING));
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/req/objs/FileRow.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.req.objs;
2 |
3 | /**
4 | * @brief 渲染的行信息
5 | * @note not obfuscated in this package
6 | * @author join
7 | */
8 | public class FileRow {
9 |
10 | public String clazz;
11 | public String name;
12 | public String link;
13 | public String size;
14 | public String time;
15 |
16 | public boolean can_browse = false;
17 | public boolean can_download = false;
18 | public boolean can_delete = false;
19 | public boolean can_upload = false;
20 |
21 | public FileRow() {
22 | }
23 |
24 | public FileRow(String clazz, String name, String link, String size) {
25 | this.clazz = clazz;
26 | this.name = name;
27 | this.link = link;
28 | this.size = size;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/support/HttpGetParser.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.support;
2 |
3 | import java.io.IOException;
4 | import java.util.Map;
5 |
6 | import org.apache.commons.fileupload.ParameterParser;
7 | import org.apache.http.HttpRequest;
8 |
9 | /**
10 | * @brief Get参数既简单解析
11 | * @author Join
12 | */
13 | public class HttpGetParser {
14 |
15 | private static final String GET_METHOD = "GET";
16 |
17 | public static boolean isGetMethod(HttpRequest request) {
18 | String method = request.getRequestLine().getMethod();
19 | return GET_METHOD.equalsIgnoreCase(method);
20 | }
21 |
22 | /**
23 | * @brief 解析请求的get信息
24 | * @param request Http请求
25 | * @return 名称与值的Map集合
26 | * @throws IOException
27 | * @warning 需保证是post请求且不是multipart的。
28 | */
29 | public Map parse(HttpRequest request) {
30 | ParameterParser parser = new ParameterParser();
31 | parser.setLowerCaseNames(true);
32 | return parser.parse(getContent(request), '&');
33 | }
34 |
35 | public String getContent(HttpRequest request) {
36 | String uri = request.getRequestLine().getUri();
37 | int index = uri.indexOf('?');
38 | return index == -1 || index + 1 >= uri.length() ? null : uri.substring(index + 1);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/support/HttpPostParser.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.support;
2 |
3 | import java.io.IOException;
4 | import java.util.Map;
5 |
6 | import org.apache.commons.fileupload.ParameterParser;
7 | import org.apache.http.HttpEntity;
8 | import org.apache.http.HttpEntityEnclosingRequest;
9 | import org.apache.http.HttpRequest;
10 | import org.apache.http.util.EntityUtils;
11 |
12 | /**
13 | * @brief Post参数既简单解析
14 | * @author Join
15 | */
16 | public class HttpPostParser {
17 |
18 | private static final String POST_METHOD = "POST";
19 |
20 | public static boolean isPostMethod(HttpRequest request) {
21 | String method = request.getRequestLine().getMethod();
22 | return POST_METHOD.equalsIgnoreCase(method);
23 | }
24 |
25 | /**
26 | * @brief 解析请求的post信息
27 | * @param request Http请求
28 | * @return 名称与值的Map集合
29 | * @throws IOException
30 | * @warning 需保证是post请求且不是multipart的。
31 | */
32 | public Map parse(HttpRequest request) throws IOException {
33 | ParameterParser parser = new ParameterParser();
34 | parser.setLowerCaseNames(true);
35 | return parser.parse(getContent(request), '&');
36 | }
37 |
38 | public String getContent(HttpRequest request) throws IOException {
39 | HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
40 | return EntityUtils.toString(entity);
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/support/MimeType.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.support;
2 |
3 | import java.io.File;
4 | import java.lang.reflect.Method;
5 |
6 | import android.webkit.MimeTypeMap;
7 |
8 | /**
9 | * @deprecated see {@link MIME}
10 | * @brief 获取文件的MIME类型
11 | * @author join
12 | */
13 | public class MimeType {
14 |
15 | private static MimeTypeMap sMimeTypeMap;
16 |
17 | static {
18 | sMimeTypeMap = MimeTypeMap.getSingleton();
19 | loadEntry(sMimeTypeMap, "application/x-javascript", "js");
20 | }
21 |
22 | /** 反射调用其loadEntry方法 */
23 | private static void loadEntry(MimeTypeMap mimeTypeMap, String mimeType, String extension) {
24 | Class extends MimeTypeMap> cls = mimeTypeMap.getClass();
25 | try {
26 | Method method = cls.getDeclaredMethod("loadEntry", String.class, String.class);
27 | method.setAccessible(true);
28 | method.invoke(mimeTypeMap, new Object[] { mimeType, extension });
29 | } catch (Exception e) {
30 | }
31 | }
32 |
33 | /**
34 | * 获得某文件的MIME类型
35 | * @param file 文件
36 | * @return MIME类型,可能为null。
37 | */
38 | public static String getFromFile(File file) {
39 | String ext = getExtension(file);
40 | return ext.endsWith("") ? null : sMimeTypeMap.getMimeTypeFromExtension(ext);
41 | }
42 |
43 | /**
44 | * 获取文件后缀名,不带`.`
45 | * @param file 文件
46 | * @return 文件后缀
47 | */
48 | private static String getExtension(File file) {
49 | String name = file.getName();
50 | int i = name.lastIndexOf('.');
51 | int p = Math.max(name.lastIndexOf('/'), name.lastIndexOf('\\'));
52 | return i > p ? name.substring(i + 1) : "";
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/support/Progress.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.support;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | /**
7 | * 进度缓存类
8 | * @author Join
9 | */
10 | public class Progress {
11 |
12 | private static Map progressMap = new HashMap();
13 |
14 | public static void update(String id, int progress) {
15 | progressMap.put(id, progress);
16 | if (progress == 100) {
17 | progressMap.remove(id);
18 | }
19 | }
20 |
21 | public static int get(String id) {
22 | Integer p = progressMap.get(id);
23 | return p == null ? -1 : p;
24 | }
25 |
26 | public static void clear() {
27 | progressMap.clear();
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/view/BaseView.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.view;
2 |
3 | import java.io.IOException;
4 |
5 | import org.apache.http.HttpEntity;
6 | import org.apache.http.HttpRequest;
7 |
8 | /**
9 | * 视图渲染基类
10 | * @author join
11 | *
12 | * @param 内容类型
13 | * @param 参数类型
14 | */
15 | public abstract class BaseView {
16 |
17 | /**
18 | * 渲染内容为Http实体
19 | * @param request Http请求
20 | * @param content 输入内容
21 | * @return Http实体
22 | * @throws IOException
23 | */
24 | public HttpEntity render(HttpRequest request, T content) throws IOException {
25 | return this.render(request, content, null);
26 | }
27 |
28 | /**
29 | * 渲染内容为Http实体
30 | * @param request Http请求
31 | * @param content 输入内容
32 | * @param argument 输入参数
33 | * @return Http实体
34 | * @throws IOException
35 | */
36 | public abstract HttpEntity render(HttpRequest request, T content, A args) throws IOException;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/view/StringView.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.view;
2 |
3 | import java.io.IOException;
4 |
5 | import org.apache.http.HttpEntity;
6 | import org.apache.http.HttpRequest;
7 | import org.apache.http.entity.StringEntity;
8 | import org.join.ws.Constants.Config;
9 |
10 | /**
11 | * 字符串视图渲染
12 | * @author join
13 | */
14 | public class StringView extends BaseView {
15 |
16 | /**
17 | * @details 默认charset为{@link Config#ENCODING}
18 | * @param args 字符串格式化参数
19 | * @see BaseView#render(Object, Object)
20 | */
21 | @Override
22 | public HttpEntity render(HttpRequest request, String content, Object[] args) throws IOException {
23 | if (args != null) {
24 | content = String.format(content, args);
25 | }
26 | return new StringEntity(content, Config.ENCODING);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/serv/view/TempHandler.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.serv.view;
2 |
3 | import java.io.IOException;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 |
7 | import net.asfun.jangod.template.TemplateEngine;
8 |
9 | import org.join.ws.Constants.Config;
10 |
11 | /**
12 | * @brief 模板处理器
13 | * @author join
14 | */
15 | public class TempHandler {
16 |
17 | /* package */ static final TemplateEngine engine;
18 |
19 | static {
20 | engine = new TemplateEngine();
21 | /* 设定模板目录 */
22 | engine.getConfiguration().setWorkspace(Config.SERV_TEMP_DIR);
23 | /* 设定全局变量 */
24 | Map globalBindings = new HashMap();
25 | globalBindings.put("SERV_ROOT_DIR", Config.SERV_ROOT_DIR);
26 | engine.setEngineBindings(globalBindings);
27 | }
28 |
29 | /**
30 | * 渲染模板,获得html
31 | */
32 | public static String render(String tempFile, Map data) throws IOException {
33 | return engine.process(tempFile, data);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/org/join/ws/ui/widget/ProgressBarPreference.java:
--------------------------------------------------------------------------------
1 | package org.join.ws.ui.widget;
2 |
3 | import org.join.web.serv.R;
4 |
5 | import android.content.Context;
6 | import android.preference.Preference;
7 | import android.util.AttributeSet;
8 | import android.view.View;
9 | import android.widget.ProgressBar;
10 |
11 | public class ProgressBarPreference extends Preference {
12 |
13 | private ProgressBar mProgressBar;
14 |
15 | public ProgressBarPreference(Context context, AttributeSet attrs, int defStyle) {
16 | super(context, attrs, defStyle);
17 | }
18 |
19 | public ProgressBarPreference(Context context, AttributeSet attrs) {
20 | this(context, attrs, 0);
21 | }
22 |
23 | public ProgressBarPreference(Context context) {
24 | this(context, null);
25 | }
26 |
27 | @Override
28 | protected void onBindView(View view) {
29 | super.onBindView(view);
30 | mProgressBar = (ProgressBar) view.findViewById(R.id.progressBar);
31 | if (mProgressBar != null) {
32 | mProgressBar.setVisibility(View.INVISIBLE);
33 | }
34 | }
35 |
36 | public ProgressBar getProgressBar() {
37 | return mProgressBar;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/temp/net/asfun/jangod/lib/tag/AbsResTag.java:
--------------------------------------------------------------------------------
1 | package net.asfun.jangod.lib.tag;
2 |
3 | import android.app.Application;
4 |
5 | import net.asfun.jangod.interpret.InterpretException;
6 | import net.asfun.jangod.interpret.JangodInterpreter;
7 | import net.asfun.jangod.lib.Tag;
8 | import net.asfun.jangod.tree.NodeList;
9 | import net.asfun.jangod.util.HelperStringTokenizer;
10 |
11 | import org.join.ws.WSApplication;
12 |
13 | /**
14 | * {% resTag 'strName' %}
15 | * {% resTag var_strName %}
16 | * @author join
17 | */
18 | public abstract class AbsResTag implements Tag {
19 |
20 | protected Application app = WSApplication.getApp();
21 | protected String pkgName = app.getPackageName();
22 |
23 | @Override
24 | public String interpreter(NodeList carries, String helpers, JangodInterpreter interpreter)
25 | throws InterpretException {
26 | String[] helper = new HelperStringTokenizer(helpers).allTokens();
27 | if (helper.length != 1) {
28 | throw new InterpretException("Tag '" + getName() + "' expects 1 helper >>> "
29 | + helper.length);
30 | }
31 | String strName = interpreter.resolveString(helper[0]);
32 | return getValue(strName);
33 | }
34 |
35 | public abstract String getValue(String name);
36 |
37 | protected int getIdentifier(String name, String defType) {
38 | return app.getResources().getIdentifier(name, defType, pkgName);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/temp/net/asfun/jangod/lib/tag/ResColorTag.java:
--------------------------------------------------------------------------------
1 | package net.asfun.jangod.lib.tag;
2 |
3 | /**
4 | * {% rcolor 'strName' %}
5 | * {% rcolor var_strName %}
6 | * @author join
7 | */
8 | public class ResColorTag extends AbsResTag {
9 |
10 | final String TAGNAME = "rcolor";
11 |
12 | @Override
13 | public String getEndTagName() {
14 | return null;
15 | }
16 |
17 | @Override
18 | public String getName() {
19 | return TAGNAME;
20 | }
21 |
22 | @Override
23 | public String getValue(String name) {
24 | int id = getIdentifier(name, "color");
25 | return (String) app.getResources().getText(id);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/temp/net/asfun/jangod/lib/tag/ResStrTag.java:
--------------------------------------------------------------------------------
1 | package net.asfun.jangod.lib.tag;
2 |
3 | /**
4 | * {% rstr 'strName' %}
5 | * {% rstr var_strName %}
6 | * @author join
7 | */
8 | public class ResStrTag extends AbsResTag {
9 |
10 | final String TAGNAME = "rstr";
11 |
12 | @Override
13 | public String getEndTagName() {
14 | return null;
15 | }
16 |
17 | @Override
18 | public String getName() {
19 | return TAGNAME;
20 | }
21 |
22 | @Override
23 | public String getValue(String name) {
24 | int id = getIdentifier(name, "string");
25 | return app.getString(id);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/temp/net/asfun/jangod/lib/tag/UUIDTag.java:
--------------------------------------------------------------------------------
1 | package net.asfun.jangod.lib.tag;
2 |
3 | import java.util.UUID;
4 |
5 | import net.asfun.jangod.interpret.InterpretException;
6 | import net.asfun.jangod.interpret.JangodInterpreter;
7 | import net.asfun.jangod.lib.Tag;
8 | import net.asfun.jangod.tree.NodeList;
9 |
10 | /**
11 | * {% uuid %}
12 | * @author join
13 | */
14 | public class UUIDTag implements Tag {
15 |
16 | final String TAGNAME = "uuid";
17 |
18 | @Override
19 | public String getEndTagName() {
20 | return null;
21 | }
22 |
23 | @Override
24 | public String getName() {
25 | return TAGNAME;
26 | }
27 |
28 | @Override
29 | public String interpreter(NodeList carries, String helpers, JangodInterpreter interpreter)
30 | throws InterpretException {
31 | return UUID.randomUUID().toString();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/upload/org/apache/commons/fileupload/ProgressListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.fileupload;
18 |
19 | /**
20 | * The {@link ProgressListener} may be used to display a progress bar
21 | * or do stuff like that.
22 | *
23 | * @version $Id: ProgressListener.java 1454691 2013-03-09 12:15:54Z simonetripodi $
24 | */
25 | public interface ProgressListener {
26 |
27 | /**
28 | * Updates the listeners status information.
29 | *
30 | * @param pBytesRead The total number of bytes, which have been read
31 | * so far.
32 | * @param pContentLength The total number of bytes, which are being
33 | * read. May be -1, if this number is unknown.
34 | * @param pItems The number of the field, which is currently being
35 | * read. (0 = no item so far, 1 = first item is being read, ...)
36 | */
37 | void update(long pBytesRead, long pContentLength, int pItems);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/upload/org/apache/commons/fileupload/UploadContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.fileupload;
18 |
19 | /**
20 | * Enhanced access to the request information needed for file uploads,
21 | * which fixes the Content Length data access in {@link RequestContext}.
22 | *
23 | * The reason of introducing this new interface is just for backward compatibility
24 | * and it might vanish for a refactored 2.x version moving the new method into
25 | * RequestContext again.
26 | *
27 | * @since 1.3
28 | */
29 | public interface UploadContext extends RequestContext {
30 |
31 | /**
32 | * Retrieve the content length of the request.
33 | *
34 | * @return The content length of the request.
35 | * @since 1.3
36 | */
37 | long contentLength();
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/upload/org/apache/commons/fileupload/util/Closeable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.fileupload.util;
18 |
19 | import java.io.IOException;
20 |
21 | /**
22 | * Interface of an object, which may be closed.
23 | *
24 | * @version $Id: Closeable.java 1454691 2013-03-09 12:15:54Z simonetripodi $
25 | */
26 | public interface Closeable {
27 |
28 | /**
29 | * Closes the object.
30 | *
31 | * @throws IOException An I/O error occurred.
32 | */
33 | void close() throws IOException;
34 |
35 | /**
36 | * Returns, whether the object is already closed.
37 | *
38 | * @return True, if the object is closed, otherwise false.
39 | * @throws IOException An I/O error occurred.
40 | */
41 | boolean isClosed() throws IOException;
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/upload/org/apache/commons/fileupload/util/mime/ParseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.fileupload.util.mime;
18 |
19 | /**
20 | * @since 1.3
21 | */
22 | final class ParseException extends Exception {
23 |
24 | /**
25 | * The UID to use when serializing this instance.
26 | */
27 | private static final long serialVersionUID = 5355281266579392077L;
28 |
29 | /**
30 | * Constructs a new exception with the specified detail message.
31 | *
32 | * @param message the detail message.
33 | */
34 | public ParseException(String message) {
35 | super(message);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/upload/org/apache/commons/fileupload/util/mime/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * MIME decoder implementation, imported and retailed from
20 | * Apache Geronimo .
21 | */
22 | package org.apache.commons.fileupload.util.mime;
23 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/java/upload/org/apache/commons/fileupload/util/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * This package contains various IO related utility classes
20 | * or methods, which are basically reusable and not necessarily
21 | * restricted to the scope of a file upload.
22 | */
23 | package org.apache.commons.fileupload.util;
24 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable-hdpi/ic_noti_running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable-hdpi/ic_noti_running.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable-mdpi/ic_noti_running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable-mdpi/ic_noti_running.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/btn_toggle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/btn_toggle_off_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 | -
13 |
14 |
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/btn_toggle_off_pressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 | -
13 |
14 |
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/btn_toggle_on_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 | -
13 |
14 |
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/btn_toggle_on_pressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 | -
13 |
14 |
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/file_def.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable/file_def.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/folder_def.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable/folder_def.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/drawable/folder_parent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/drawable/folder_parent.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/layout/capture.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
16 |
24 |
25 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/layout/filebrowser.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
21 |
22 |
28 |
29 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/layout/prefer_widget_checkbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/layout/prefer_widget_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/layout/prefer_widget_wait.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/simplewebserver/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #c0ffbd21
5 | #b0000000
6 | #ffcc0000
7 | #60000000
8 |
9 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/values/items.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/simplewebserver/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
15 |
16 |
--------------------------------------------------------------------------------
/simplewebserver/src/test/java/com/bobo/simplewebserver/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.bobo.simplewebserver;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/webrtcnoise/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /.externalNativeBuild
3 |
--------------------------------------------------------------------------------
/webrtcnoise/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | cmake_minimum_required(VERSION 2.8)
5 |
6 | project(webrtc)
7 |
8 | #notice the "recycling" of CMAKE_C_FLAGS
9 | #this is necessary to pick up android flags
10 | set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic" )
11 |
12 | include_directories(${PROJECT_SOURCE_DIR}/include)
13 |
14 | add_definitions(-DFIXED_POINT -DUSE_KISS_FFT -DHAVE_CONFIG_H)
15 |
16 | add_library(webrtc SHARED
17 |
18 | src/main/cpp/native-lib.cpp
19 |
20 | src/main/cpp/audio_ns.cpp
21 | src/main/cpp/fft4g.cpp
22 | src/main/cpp/noise_suppression.cpp
23 | src/main/cpp/ns_core.cpp
24 |
25 | )
26 |
27 | target_link_libraries(webrtc log m)
--------------------------------------------------------------------------------
/webrtcnoise/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 | defaultConfig {
7 | minSdkVersion 21
8 | targetSdkVersion 24
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | externalNativeBuild {
13 | cmake {
14 | cppFlags ""
15 | }
16 | }
17 |
18 | ndk {
19 | //限定32位本地库
20 | abiFilters "armeabi-v7a"
21 | }
22 | }
23 | buildTypes {
24 | release {
25 | minifyEnabled false
26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 | externalNativeBuild {
30 | cmake {
31 | path "CMakeLists.txt"
32 | }
33 | }
34 | }
35 |
36 | dependencies {
37 | compile fileTree(dir: 'libs', include: ['*.jar'])
38 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
39 | exclude group: 'com.android.support', module: 'support-annotations'
40 | })
41 | compile 'com.android.support:appcompat-v7:24.2.1'
42 | testCompile 'junit:junit:4.12'
43 | }
44 |
--------------------------------------------------------------------------------
/webrtcnoise/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/hesong/Downloads/android-sdk-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/webrtcnoise/src/androidTest/java/com/test/jni/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.test.jni;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.test.jni", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/cpp/audio_ns.cpp:
--------------------------------------------------------------------------------
1 | #include "audio_ns.h"
2 | #include "noise_suppression.h"
3 |
4 | #include
5 |
6 | int audio_ns_init(int sample_rate){
7 |
8 | NsHandle* NS_instance;
9 | int ret;
10 | if ((ret = WebRtcNs_Create(&NS_instance) )) {
11 | printf("WebRtcNs_Create failed with error code = %d", ret);
12 | return ret;
13 | }
14 | if ((ret = WebRtcNs_Init(NS_instance, sample_rate) )) {
15 | printf("WebRtcNs_Init failed with error code = %d", ret);
16 | return ret;
17 | }
18 |
19 | if ( ( ret = WebRtcNs_set_policy(NS_instance, 2) ) ){
20 | printf("WebRtcNs_set_policy failed with error code = %d", ret);
21 | return ret;
22 | }
23 |
24 | return (int)NS_instance;
25 | }
26 |
27 |
28 | int audio_ns_process(int ns_handle , short *src_audio_data ,short *dest_audio_data){
29 | //get handle
30 | NsHandle* NS_instance = (NsHandle* )ns_handle;
31 |
32 | //noise suppression
33 | if(
34 | WebRtcNs_Process(NS_instance ,src_audio_data ,NULL ,dest_audio_data , NULL) ||
35 | WebRtcNs_Process(NS_instance ,&src_audio_data[80] ,NULL ,&dest_audio_data[80] , NULL) ){
36 | printf("WebRtcNs_Process failed with error code = " );
37 | return -1;
38 | }
39 |
40 | return 0;
41 | }
42 |
43 |
44 | void audio_ns_destroy(int ns_handle){
45 | WebRtcNs_Free((NsHandle *) ns_handle);
46 | }
--------------------------------------------------------------------------------
/webrtcnoise/src/main/cpp/audio_ns.h:
--------------------------------------------------------------------------------
1 | #ifndef _AUDIO_NS_H_
2 | #define _AUDIO_NS_H_
3 |
4 | int audio_ns_init(int sample_rate);
5 |
6 |
7 | int audio_ns_process(int ns_handle , short *src_audio_data ,short *dest_audio_data);
8 |
9 |
10 | void audio_ns_destroy(int ns_handle);
11 |
12 | #endif
--------------------------------------------------------------------------------
/webrtcnoise/src/main/cpp/fft4g.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 | *
4 | * Use of this source code is governed by a BSD-style license
5 | * that can be found in the LICENSE file in the root of the source
6 | * tree. An additional intellectual property rights grant can be found
7 | * in the file PATENTS. All contributing project authors may
8 | * be found in the AUTHORS file in the root of the source tree.
9 | */
10 |
11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_FFT4G_H_
12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_UTILITY_FFT4G_H_
13 |
14 | void WebRtc_rdft(int, int, float *, int *, float *);
15 | void WebRtc_cdft(int, int, float *, int *, float *);
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/cpp/native-lib.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "audio_ns.h"
3 | #include "noise_suppression.h"
4 |
5 |
6 | extern "C" {
7 |
8 | NsHandle* handle = NULL;
9 |
10 |
11 | void innerProcess(short in_sample[], short out_sample[], int length){
12 |
13 | int curPosition = 0;
14 |
15 | while(curPosition < length){
16 |
17 | audio_ns_process((int) handle, in_sample + curPosition, out_sample + curPosition);
18 |
19 | curPosition += 160;
20 |
21 | }
22 |
23 | }
24 |
25 | JNIEXPORT jboolean JNICALL
26 | Java_com_test_jni_WebrtcProcessor_init(JNIEnv *env, jobject instance, jint sample_rate) {
27 |
28 | handle = (NsHandle *) audio_ns_init(sample_rate);
29 |
30 | return false;
31 | }
32 |
33 | JNIEXPORT jboolean JNICALL
34 | Java_com_test_jni_WebrtcProcessor_processNoise(JNIEnv *env, jobject instance, jshortArray sample) {
35 |
36 | if(!handle)
37 | return false;
38 |
39 | jsize length = env->GetArrayLength(sample);
40 |
41 | jshort *sam = env->GetShortArrayElements(sample, 0);
42 |
43 | short in_sample[length];
44 | for(int i=0; iReleaseShortArrayElements(sample, sam, 0);
51 |
52 | return true;
53 | }
54 |
55 | JNIEXPORT void JNICALL
56 | Java_com_test_jni_WebrtcProcessor_release(JNIEnv *env, jobject instance) {
57 |
58 | if(handle){
59 | audio_ns_destroy((int) handle);
60 | }
61 |
62 |
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/layout/activity_webrtc_noise_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
16 |
22 |
23 |
24 |
30 |
31 |
32 |
36 |
37 |
38 |
46 |
47 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/webrtcnoise/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/webrtcnoise/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/webrtcnoise/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/webrtcnoise/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bobohuang1985/android-utils-api/cfcd450d637678a3b9dea082b82b7d2c4b046817/webrtcnoise/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/webrtcnoise/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | WebrtcNoise
3 |
4 |
--------------------------------------------------------------------------------
/webrtcnoise/src/test/java/com/test/jni/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.test.jni;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------