diff --git a/.gitignore b/.gitignore index 812ec5ac..5894ebc9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,32 @@ /.project /lint.xml /project.properties + +.gradle/ +**/build/ + +.idea/ +*.iml +*.ipr +*.iws + +local.properties + +captures/ +.externalNativeBuild/ +.cxx/ + +*.apk +*.ap_ +*.aab + +*.dex +*.class + +out/ + +*.log +*.hprof + +.DS_Store +Thumbs.db diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..e0f15db2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic" +} \ No newline at end of file diff --git a/AGENT.md b/AGENT.md new file mode 100644 index 00000000..e1034b10 --- /dev/null +++ b/AGENT.md @@ -0,0 +1,17 @@ +# AGENT.md + +This document provides context and instructions for AI agents working on this project. + +## Project Background +This project is a fork of the original CyanogenMod / LineageOS File Manager, which was "frozen" for over 10 years. It has been recently revived and modified to support modern requirements and specific integration features for the **BSLauncher** ecosystem. + +## Key Modifications +- **Modern SDK targeting**: Updated to target Android SDK 33. +- **BSLauncher Integration**: Added support for mode cycling and deep integration with the BSLauncher application. +- **Intent Features**: Enhanced intent handling, including automatic home directory setting when navigating to specific folders via `resource/folder` intents. +- **Legacy Storage Support**: Maintained compatibility with legacy storage modes where necessary. + +## Development Guidelines +- Always refer to `INTENTS.md` for information on supported URI schemes and intent extras. +- Use `CHANGELOG.md` to track new features and version bumps. +- Maintain compatibility with both legacy (AOSP-like) environments and modern Android versions (up to SDK 33). diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 85d5be9d..0ee21b3e 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -21,7 +21,7 @@ - + @@ -34,8 +34,7 @@ - - + @@ -44,10 +43,10 @@ - + android:label="@string/app_name" + android:exported="false"> - + + + + - @@ -114,6 +117,13 @@ + + + + + + + + android:configChanges="orientation|keyboardHidden|screenSize" + android:exported="true"> @@ -230,11 +241,13 @@ - + - + diff --git a/CALUDE.md b/CALUDE.md new file mode 100644 index 00000000..a25f627e --- /dev/null +++ b/CALUDE.md @@ -0,0 +1,17 @@ +# CALUDE.md + +This document serves as a guide for AI assistants (specifically Claude) working on the File Manager project. + +## Project Context +The **LineageOS File Manager (Volo Fork)** is an updated version of a legacy file manager that remained unchanged for over a decade. The current maintainers have unfrozen the project to implement mission-critical features for modern Android devices and auxiliary launchers. + +## Architecture & Integration +- **Package Name**: `com.cyanogenmod.filemanager` (subject to change in specific builds). +- **Core Strategy**: Enhance the existing stable platform with new intent-based controls. +- **Key Files**: + - `AndroidManifest.xml`: Watch for intent-filter updates. + - `src/com/cyanogenmod/filemanager/activities/NavigationActivity.java`: Core navigation logic. + - `INTENTS.md`: Source of truth for external command interfaces. + +## Modification History +Refer to the `README.md` and `CHANGELOG.md` for details on the "unfreezing" process and the transition from a 10-year freeze to active development. diff --git a/CHANGELOG.md b/CHANGELOG.md index 514cdf3f..3d7cc211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ -LineageOS File Manager -======================== +Version 3.5.1 +------------- +* Automatically set home folder when opening directory via intent with "resource/folder" type. +* Bump version to 3.5.1. + +Version 3.0.1 +------------- +* Initial forked version for BSLauncher. +* Integration with BSLauncher mode cycling. Version 2.0.0 ------------- diff --git a/INTENTS.md b/INTENTS.md new file mode 100644 index 00000000..dc3c86dd --- /dev/null +++ b/INTENTS.md @@ -0,0 +1,104 @@ +# CMFileManager Intents Documentation + +This document describes the Intent Actions supported by the CMFileManager application. + +## 1. Open a Folder +To open a specific directory in the file manager. + +**Action:** `android.intent.action.VIEW` + +**Supported Schemes:** `file://`, `folder://`, `directory://` + +**MIME Type:** `resource/folder` + +**Data URI:** `file:///absolute/path/to/directory` + +**Example (ADB):** +```bash +# Open using file scheme +adb shell am start -a android.intent.action.VIEW -d "file:///sdcard/Download" -n com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity + +# Open using folder scheme (Will automatically set /sdcard/Download as Home) +adb shell am start -a android.intent.action.VIEW -d "folder:///sdcard/Download" -t "resource/folder" -n com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity +``` + +> **Note:** When opening a folder with MIME type `resource/folder`, the application will automatically save that directory as the new "Home" directory. + +**Alternative (using Extras):** +* **Extra Key:** `extra_navigate_to` (String) + * **Value:** `/absolute/path/to/directory` +* **Extra Key:** `extra_add_to_history` (Boolean) + * **Default:** `true` + * **Description:** Whether to add this navigation to the history list. + +--- + +## 2. Set Home Directory +To change the default "Home" directory of the application via intent. This will persist in the application settings. + +**Action:** `${applicationId}.ACTION_SET_HOME` +*(e.g., `com.cyanogenmod.filemanager.ACTION_SET_HOME` or `com.cyanogenmod.filemanager.dev.ACTION_SET_HOME` for debug build)* + +**Supported Schemes:** `file://`, `folder://`, `directory://` + +**Data URI:** `file:///absolute/path/to/new/home` + +**Example (ADB):** +```bash +adb shell am start -a com.cyanogenmod.filemanager.dev.ACTION_SET_HOME -d "file:///sdcard/Music" -n com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity +``` + +**Alternative (using Extra):** +* **Extra Key:** `extra_navigate_to` (String) + * **Value:** `/absolute/path/to/new/home` + +--- + +## 3. Pick a File +To select a file and return its URI to the calling application. + +**Action:** `android.intent.action.GET_CONTENT` or `android.intent.action.PICK` + +**MIME Type:** `*/*` (or specific mime type) + +**Category:** `android.intent.category.OPENABLE` + +**Example (ADB):** +```bash +adb shell am start -a android.intent.action.GET_CONTENT -t "*/*" -n com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.PickerActivity +``` + +--- + +## 4. Pick a Folder +To select a directory and return its path to the calling application. + +**Action:** `com.android.fileexplorer.action.DIR_SEL` + +**Example (ADB):** +```bash +adb shell am start -a com.android.fileexplorer.action.DIR_SEL -n com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.PickerActivity +``` + +**Return Extra:** +* `def_file_manager_result_dir` (String): The absolute path of the selected folder. + +--- + +## 5. Search +To initiate a search within a directory. + +**Action:** `android.intent.action.SEARCH` + +**Extras:** +* **Extra Key:** `query` (String) + * **Value:** The search term. +* **Extra Key:** `app_data` (Bundle) + * **Content:** Can contain application-specific data. + +--- + +## 6. Other Internal Actions +* `${applicationId}.ACTION_START_INDEX`: Starts indexing service. +* `${applicationId}.ACTION_START_CLEANUP`: Starts cache cleanup service. + diff --git a/README.md b/README.md index d3146ec4..8fa3f458 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,59 @@ LineageOS File Manager A file manager for AOSP, focused on rooted devices and specially designed for the LineageOS Project. +## Project Status & History + +This project (the "Volo" fork) represents a revival of the classic CyanogenMod/LineageOS File Manager. After more than **10 years of freeze**, the codebase has been modified and updated to address modern requirements and new features. + +Key updates since the "unfreeze": +- Integration with the **BSLauncher** ecosystem. +- Enhanced **Intent Support** for automated navigation and folder handling. +- Modernized build system and SDK targeting (up to Android 13 / SDK 33). +- Critical bug fixes and feature enhancements to support specialized use cases. + + +## Requirements + +- Java 17 +- Android SDK with platform API 33 installed (compileSdkVersion is 33) + +## Building + +### Command line (Windows) + +Debug APK: + +``` +./gradlew.bat assembleDebug +``` + +Release APK: + +``` +./gradlew.bat assembleRelease +``` + +APK outputs: + +- `build/outputs/apk/debug/` +- `build/outputs/apk/release/` + +### Android Studio + +- Open the project folder. +- Let Gradle sync. +- Use the `debug` or `release` build variant. + +## Documentation + +- [Intents Documentation](INTENTS.md) - Details on supported Intent actions and parameters. + +## Notes + +- minSdkVersion: 23 +- targetSdkVersion: 33 +- This app requests legacy external storage behavior via `android:requestLegacyExternalStorage="true"`. + This source was released under the terms of [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license. diff --git a/android_packages_apps_CMFileManager_volo.code-workspace b/android_packages_apps_CMFileManager_volo.code-workspace new file mode 100644 index 00000000..876a1499 --- /dev/null +++ b/android_packages_apps_CMFileManager_volo.code-workspace @@ -0,0 +1,8 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..090dfc1c --- /dev/null +++ b/build.gradle @@ -0,0 +1,103 @@ +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:8.2.0' + } +} + +// Apply Android application plugin +apply plugin: 'com.android.application' + +// Repositories for dependencies +repositories { + google() + mavenCentral() +} + +android { + namespace "com.cyanogenmod.filemanager" + compileSdkVersion 33 + buildFeatures { + buildConfig true + } + defaultConfig { + applicationId "com.babysharks.filemanager" + // minSdkVersion handled by flavors + targetSdkVersion 33 + versionCode 106 + versionName "3.5.1" + multiDexEnabled true + } + flavorDimensions "compatibility" + productFlavors { + legacy { + dimension "compatibility" + minSdkVersion 19 + versionNameSuffix "-legacy" + } + standard { + dimension "compatibility" + minSdkVersion 23 + } + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags' + } + debug { + applicationIdSuffix ".dev" + } + } + sourceSets { + main { + java.srcDirs = ['src', 'libs/android-syntax-highlight/src', 'libs/color-picker-view/src'] + res.srcDirs = ['res'] + manifest.srcFile 'AndroidManifest.xml' + assets.srcDirs = ['assets'] + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation "androidx.appcompat:appcompat:1.6.1" + implementation "androidx.core:core-ktx:1.10.1" + implementation "androidx.annotation:annotation:1.7.1" + implementation "androidx.activity:activity:1.7.2" + implementation "com.google.android.material:material:1.9.0" + implementation "com.googlecode.juniversalchardet:juniversalchardet:1.0.3" + implementation "androidx.multidex:multidex:2.0.1" + // Include local jars from libs directory + implementation('de.schlichtherle.truezip:truezip-file:7.7.10') { + exclude group: 'org.jetbrains.kotlin' + } + implementation('de.schlichtherle.truezip:truezip-driver-file:7.7.10') { + exclude group: 'org.jetbrains.kotlin' + } + implementation('de.schlichtherle.truezip:truezip-driver-zip:7.7.10') { + exclude group: 'org.jetbrains.kotlin' + } + implementation('de.schlichtherle.truezip:truezip-swing:7.7.10') { + exclude group: 'org.jetbrains.kotlin' + } + implementation('de.schlichtherle.truezip:truezip-driver-tzp:7.7.10') { + exclude group: 'org.jetbrains.kotlin' + } + implementation fileTree(dir: 'libs', include: ['*.jar']) +} + +configurations.all { + resolutionStrategy { + force 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10' + force 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10' + force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10' + force 'androidx.activity:activity:1.7.2' + } +} diff --git a/build_error.txt b/build_error.txt new file mode 100644 index 00000000..0ad08f28 --- /dev/null +++ b/build_error.txt @@ -0,0 +1,156 @@ +> Task :preBuild UP-TO-DATE +> Task :preLegacyDebugBuild UP-TO-DATE +> Task :mergeLegacyDebugNativeDebugMetadata NO-SOURCE +> Task :javaPreCompileLegacyDebug UP-TO-DATE +> Task :checkLegacyDebugAarMetadata UP-TO-DATE +> Task :generateLegacyDebugResValues UP-TO-DATE +> Task :mapLegacyDebugSourceSetPaths UP-TO-DATE +> Task :generateLegacyDebugResources UP-TO-DATE +> Task :mergeLegacyDebugResources UP-TO-DATE +> Task :createLegacyDebugCompatibleScreenManifests UP-TO-DATE +> Task :extractDeepLinksLegacyDebug UP-TO-DATE +> Task :processLegacyDebugMainManifest UP-TO-DATE +> Task :processLegacyDebugManifest UP-TO-DATE +> Task :processLegacyDebugManifestForPackage UP-TO-DATE +> Task :processLegacyDebugResources UP-TO-DATE + +> Task :compileLegacyDebugJavaWithJavac FAILED +warning: [options] source value 8 is obsolete and will be removed in a future release +warning: [options] target value 8 is obsolete and will be removed in a future release +warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:245: error: cannot find symbol + public final static String INTENT_THEME_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:239: error: cannot find symbol + public final static String INTENT_SETTING_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:257: error: cannot find symbol + public final static String INTENT_FILE_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\BookmarksContentProvider.java:54: error: cannot find symbol + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:251: error: cannot find symbol + public final static String INTENT_MOUNT_STATUS_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\RecentSearchesContentProvider.java:29: error: cannot find symbol + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\MimeTypeIndexProvider.java:47: error: cannot find symbol + private static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ".providers.index"; + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\secure\SecureCacheCleanupService.java:43: error: cannot find symbol + private static final String ACTION_START = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\SecureResourceProvider.java:57: error: cannot find symbol + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\service\MimeTypeIndexService.java:47: error: cannot find symbol + public static final String ACTION_START_INDEX = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager +Note: Some input files use or override a deprecated API. +Note: Recompile with -Xlint:deprecation for details. +Note: Some input files use unchecked or unsafe operations. +Note: Recompile with -Xlint:unchecked for details. +10 errors +3 warnings + +[Incubating] Problems report is available at: file:///C:/Users/tiaz/Desktop/android_packages_apps_CMFileManager_volo/build/reports/problems/problems-report.html + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':compileLegacyDebugJavaWithJavac'. +> Compilation failed; see the compiler output below. + warning: [options] source value 8 is obsolete and will be removed in a future release + warning: [options] target value 8 is obsolete and will be removed in a future release + warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:245: error: cannot find symbol + public final static String INTENT_THEME_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:239: error: cannot find symbol + public final static String INTENT_SETTING_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:257: error: cannot find symbol + public final static String INTENT_FILE_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\BookmarksContentProvider.java:54: error: cannot find symbol + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\preferences\FileManagerSettings.java:251: error: cannot find symbol + public final static String INTENT_MOUNT_STATUS_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\RecentSearchesContentProvider.java:29: error: cannot find symbol + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\MimeTypeIndexProvider.java:47: error: cannot find symbol + private static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ".providers.index"; + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\secure\SecureCacheCleanupService.java:43: error: cannot find symbol + private static final String ACTION_START = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\providers\SecureResourceProvider.java:57: error: cannot find symbol + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\service\MimeTypeIndexService.java:47: error: cannot find symbol + public static final String ACTION_START_INDEX = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ^ + symbol: class BuildConfig + location: package com.cyanogenmod.filemanager + Note: Some input files use or override a deprecated API. + Note: Recompile with -Xlint:deprecation for details. + Note: Some input files use unchecked or unsafe operations. + Note: Recompile with -Xlint:unchecked for details. + 10 errors + 3 warnings + +* Try: +> Check your code and dependencies to fix the compilation error(s) +> Run with --scan to get full insights. + +Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. + +You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. + +For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. + +BUILD FAILED in 1s +12 actionable tasks: 1 executed, 11 up-to-date diff --git a/build_output.txt b/build_output.txt new file mode 100644 index 00000000..1f77aeea --- /dev/null +++ b/build_output.txt @@ -0,0 +1,135 @@ +> Task :preBuild UP-TO-DATE +> Task :preLegacyDebugBuild UP-TO-DATE +> Task :mergeLegacyDebugNativeDebugMetadata NO-SOURCE +> Task :javaPreCompileLegacyDebug UP-TO-DATE +> Task :checkLegacyDebugAarMetadata UP-TO-DATE +> Task :generateLegacyDebugResValues UP-TO-DATE +> Task :mapLegacyDebugSourceSetPaths UP-TO-DATE +> Task :generateLegacyDebugResources UP-TO-DATE +> Task :mergeLegacyDebugResources UP-TO-DATE +> Task :createLegacyDebugCompatibleScreenManifests UP-TO-DATE +> Task :extractDeepLinksLegacyDebug UP-TO-DATE +> Task :processLegacyDebugMainManifest UP-TO-DATE +> Task :processLegacyDebugManifest UP-TO-DATE +> Task :processLegacyDebugManifestForPackage UP-TO-DATE +> Task :processLegacyDebugResources UP-TO-DATE + +> Task :compileLegacyDebugJavaWithJavac +warning: [options] source value 8 is obsolete and will be removed in a future release +warning: [options] target value 8 is obsolete and will be removed in a future release +warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. +Note: Some input files use or override a deprecated API. +Note: Recompile with -Xlint:deprecation for details. +Note: Some input files use unchecked or unsafe operations. +Note: Recompile with -Xlint:unchecked for details. +3 warnings + +> Task :mergeLegacyDebugShaders UP-TO-DATE +> Task :compileLegacyDebugShaders NO-SOURCE +> Task :generateLegacyDebugAssets UP-TO-DATE +> Task :mergeLegacyDebugAssets UP-TO-DATE +> Task :compressLegacyDebugAssets UP-TO-DATE +> Task :checkLegacyDebugDuplicateClasses UP-TO-DATE +> Task :dexBuilderLegacyDebug +> Task :desugarLegacyDebugFileDependencies UP-TO-DATE +> Task :processLegacyDebugJavaRes NO-SOURCE +> Task :mergeLegacyDebugJavaResource UP-TO-DATE +> Task :mergeLegacyDebugJniLibFolders UP-TO-DATE +> Task :mergeLegacyDebugNativeLibs NO-SOURCE +> Task :stripLegacyDebugDebugSymbols NO-SOURCE +> Task :validateSigningLegacyDebug UP-TO-DATE +> Task :writeLegacyDebugAppMetadata UP-TO-DATE +> Task :writeLegacyDebugSigningConfigVersions UP-TO-DATE + +> Task :mergeExtDexLegacyDebug FAILED +ERROR: D8: Cannot fit requested classes in a single dex file (# methods: 80620 > 65536) +com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: +The number of method references in a .dex file cannot exceed 64K. +Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html + at com.android.builder.dexing.D8DexArchiveMerger.getMergingExceptionToRethrow(D8DexArchiveMerger.java:159) + at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:147) + at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:891) + at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:835) + at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74) + at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63) + at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66) + at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62) + at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100) + at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62) + at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44) + at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41) + at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:210) + at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:205) + at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:67) + at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:60) + at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:167) + at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:60) + at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:54) + at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41) + at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59) + at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174) + at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) + at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:194) + at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:127) + at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:169) + at org.gradle.internal.Factories$1.create(Factories.java:31) + at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:263) + at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:127) + at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:132) + at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164) + at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:133) + at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) + at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) + at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) + at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48) + at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) + at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) + at java.base/java.lang.Thread.run(Thread.java:1583) +Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null + at Version.fakeStackEntry(Version_8.2.33.java:0) + at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5) + at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82) + at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32) + at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31) + at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2) + at com.android.tools.r8.D8.run(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:11) + at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:145) + ... 37 more +Caused by: com.android.tools.r8.utils.b: Cannot fit requested classes in a single dex file (# methods: 80620 > 65536) + at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21) + at com.android.tools.r8.dex.o0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:29) + at com.android.tools.r8.dex.k.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:70) + at com.android.tools.r8.dex.k.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:182) + at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:146) + at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:1) + at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28) + ... 40 more + + +[Incubating] Problems report is available at: file:///C:/Users/tiaz/Desktop/android_packages_apps_CMFileManager_volo/build/reports/problems/problems-report.html + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':mergeExtDexLegacyDebug'. +> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate + > There was a failure while executing work items + > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction + > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: + The number of method references in a .dex file cannot exceed 64K. + Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html + +* Try: +> Run with --stacktrace option to get the stack trace. +> Run with --info or --debug option to get more log output. +> Run with --scan to get full insights. +> Get more help at https://help.gradle.org. + +Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. + +You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. + +For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. + +BUILD FAILED in 8s +24 actionable tasks: 3 executed, 21 up-to-date diff --git a/build_output_150.txt b/build_output_150.txt new file mode 100644 index 00000000..1c62bae5 --- /dev/null +++ b/build_output_150.txt @@ -0,0 +1,67 @@ +> Task :preBuild UP-TO-DATE +> Task :preStandardDebugBuild UP-TO-DATE +> Task :mergeStandardDebugNativeDebugMetadata NO-SOURCE +> Task :generateStandardDebugBuildConfig UP-TO-DATE +> Task :javaPreCompileStandardDebug UP-TO-DATE +> Task :checkStandardDebugAarMetadata UP-TO-DATE +> Task :generateStandardDebugResValues UP-TO-DATE +> Task :mapStandardDebugSourceSetPaths UP-TO-DATE +> Task :generateStandardDebugResources UP-TO-DATE +> Task :mergeStandardDebugResources UP-TO-DATE +> Task :createStandardDebugCompatibleScreenManifests UP-TO-DATE +> Task :extractDeepLinksStandardDebug UP-TO-DATE +> Task :processStandardDebugMainManifest UP-TO-DATE +> Task :processStandardDebugManifest UP-TO-DATE +> Task :processStandardDebugManifestForPackage UP-TO-DATE +> Task :processStandardDebugResources UP-TO-DATE + +> Task :compileStandardDebugJavaWithJavac FAILED +warning: [options] source value 8 is obsolete and will be removed in a future release +warning: [options] target value 8 is obsolete and will be removed in a future release +warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. +C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\activities\NavigationActivity.java:2049: error: cannot find symbol + DialogHelper.showToast(this, getString(R.string.toast_settings_saved), Toast.LENGTH_SHORT); + ^ + symbol: variable toast_settings_saved + location: class string +Note: Some input files use or override a deprecated API. +Note: Recompile with -Xlint:deprecation for details. +Note: C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\activities\SearchActivity.java uses unchecked or unsafe operations. +Note: Recompile with -Xlint:unchecked for details. +1 error +3 warnings + +[Incubating] Problems report is available at: file:///C:/Users/tiaz/Desktop/android_packages_apps_CMFileManager_volo/build/reports/problems/problems-report.html + +FAILURE: Build failed with an exception. + +* What went wrong: +Execution failed for task ':compileStandardDebugJavaWithJavac'. +> Compilation failed; see the compiler output below. + warning: [options] source value 8 is obsolete and will be removed in a future release + warning: [options] target value 8 is obsolete and will be removed in a future release + warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. + C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\activities\NavigationActivity.java:2049: error: cannot find symbol + DialogHelper.showToast(this, getString(R.string.toast_settings_saved), Toast.LENGTH_SHORT); + ^ + symbol: variable toast_settings_saved + location: class string + Note: Some input files use or override a deprecated API. + Note: Recompile with -Xlint:deprecation for details. + Note: C:\Users\tiaz\Desktop\android_packages_apps_CMFileManager_volo\src\com\cyanogenmod\filemanager\activities\SearchActivity.java uses unchecked or unsafe operations. + Note: Recompile with -Xlint:unchecked for details. + 1 error + 3 warnings + +* Try: +> Check your code and dependencies to fix the compilation error(s) +> Run with --scan to get full insights. + +Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. + +You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. + +For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. + +BUILD FAILED in 1s +13 actionable tasks: 1 executed, 12 up-to-date diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..77f1a8d7 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +android.useAndroidX=true +android.enableJetifier=true + +android.nonFinalResIds=false +android.nonTransitiveRClass=false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..9bbc975c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..37f853b1 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 00000000..faf93008 --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..9d21a218 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/logcat_dump.txt b/logcat_dump.txt new file mode 100644 index 00000000..e2fa7abe --- /dev/null +++ b/logcat_dump.txt @@ -0,0 +1,612 @@ +--------- beginning of main +01-16 01:46:41.203 1596 3316 D OpenGLRenderer: Swap behavior 1 +01-16 01:46:41.203 1596 3316 I EGL_adreno: eglCreateContext request GLES major-version=2 +01-16 01:46:41.225 1596 3316 D EGL_adreno: eglCreateContext: 0x7fff428d2860: maj 3 min 1 rcv 4 +01-16 01:46:41.227 1596 3316 D EGL_adreno: eglMakeCurrent: 0x7fff428d2860: ver 3 1 (tinfo 0x7fff429bfee0) +01-16 01:46:41.229 1596 3316 D HostConnection: ExtendedRCEncoderContext GL_VERSION return OpenGL ES 3.1 v1.46 +01-16 01:46:41.230 1596 3316 E eglCodecCommon: glUtilsParamSize: unknow param 0x00008c29 +01-16 01:46:41.230 1596 3316 W GLESv2_enc: no support GL_NUM_PROGRAM_BINARY_FORMATS +01-16 01:46:41.231 1461 1518 W SurfaceFlinger: Attempting to set client state on removed layer: Dim Layer for - Task=10#0 +01-16 01:46:41.231 1461 1518 W SurfaceFlinger: Attempting to destroy on removed layer: Dim Layer for - Task=10#0 +01-16 01:46:41.235 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +--------- beginning of system +01-16 01:46:41.268 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:41.273 18112 18112 E WindowManager: +01-16 01:46:41.273 18112 18112 E WindowManager: android.view.WindowLeaked: Activity com.cyanogenmod.filemanager.activities.NavigationActivity has leaked window DecorView@1ab23b9[NavigationActivity] that was originally added here +01-16 01:46:41.273 18112 18112 E WindowManager: at android.view.ViewRootImpl.(ViewRootImpl.java:511) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.Dialog.show(Dialog.java:329) +01-16 01:46:41.273 18112 18112 E WindowManager: at com.cyanogenmod.filemanager.util.DialogHelper.delegateDialogShow(DialogHelper.java:611) +01-16 01:46:41.273 18112 18112 E WindowManager: at com.cyanogenmod.filemanager.activities.NavigationActivity.showWelcomeMsg(NavigationActivity.java:902) +01-16 01:46:41.273 18112 18112 E WindowManager: at com.cyanogenmod.filemanager.activities.NavigationActivity.finishOnCreate(NavigationActivity.java:671) +01-16 01:46:41.273 18112 18112 E WindowManager: at com.cyanogenmod.filemanager.activities.NavigationActivity.onRequestPermissionsResult(NavigationActivity.java:529) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7620) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.Activity.dispatchActivityResult(Activity.java:7470) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.ActivityThread.deliverResults(ActivityThread.java:4401) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.ActivityThread.handleSendResult(ActivityThread.java:4450) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:106) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.os.Looper.loop(Looper.java:193) +01-16 01:46:41.273 18112 18112 E WindowManager: at android.app.ActivityThread.main(ActivityThread.java:6840) +01-16 01:46:41.273 18112 18112 E WindowManager: at java.lang.reflect.Method.invoke(Native Method) +01-16 01:46:41.273 18112 18112 E WindowManager: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) +01-16 01:46:41.273 18112 18112 E WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860) +01-16 01:46:41.279 1461 1518 W SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{5985978 token=Token{36c1adb ActivityRecord{50847ea u0 com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity t10}}}#0 +01-16 01:46:41.289 1461 1461 W SurfaceFlinger: couldn't log to binary event log: overflow. +01-16 01:46:41.289 1461 1461 I chatty : uid=1000(system) /system/bin/surfaceflinger identical 1 line +01-16 01:46:41.289 1461 1461 W SurfaceFlinger: couldn't log to binary event log: overflow. +01-16 01:46:41.294 1596 16953 W WindowManager: Failed looking up window callers=com.android.server.wm.WindowManagerService.windowForClientLocked:5541 com.android.server.wm.WindowManagerService.relayoutWindow:1894 com.android.server.wm.Session.relayout:244 +01-16 01:46:41.297 1596 16953 W WindowManager: Failed looking up window callers=com.android.server.wm.WindowManagerService.windowForClientLocked:5541 com.android.server.wm.WindowManagerService.removeWindow:1662 com.android.server.wm.Session.remove:226 +01-16 01:46:42.712 18112 18178 D ProfileInstaller: Installing profile for com.cyanogenmod.filemanager.dev +01-16 01:46:43.471 1596 1604 W System : A resource failed to call close. +01-16 01:46:43.472 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 32 lines +01-16 01:46:43.472 1596 1604 W System : A resource failed to call close. +01-16 01:46:44.013 1458 1458 I ldinit : type=1400 audit(0.0:1279): avc: denied { read } for name="partitions" dev="proc" ino=4026532050 scontext=u:r:ldinit:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1 +01-16 01:46:44.013 1458 1458 I ldinit : type=1400 audit(0.0:1279): avc: denied { open } for path="/proc/partitions" dev="proc" ino=4026532050 scontext=u:r:ldinit:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1 +01-16 01:46:44.013 1458 1458 W ldinit : type=1300 audit(0.0:1279): arch=c000003e syscall=257 success=yes exit=6 a0=ffffff9c a1=7ffff7c22ae5 a2=0 a3=0 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/ldinit" subj=u:r:ldinit:s0 key=(null) +01-16 01:46:44.013 1339 1339 W auditd : type=1327 audit(0.0:1279): proctitle="/system/bin/ldinit" +01-16 01:46:44.013 1339 1339 W auditd : type=1320 audit(0.0:1279): +01-16 01:46:44.474 1596 1867 W NotificationService: Toast already killed. pkg=com.cyanogenmod.filemanager.dev callback=android.app.ITransientNotification$Stub$Proxy@b076dcd +01-16 01:46:44.481 1461 1517 W SurfaceFlinger: Attempting to set client state on removed layer: Surface(name=7e4d0ca Toast)/@0xb105f70 - animation-leash#0 +01-16 01:46:44.481 1461 1517 W SurfaceFlinger: Attempting to destroy on removed layer: Surface(name=7e4d0ca Toast)/@0xb105f70 - animation-leash#0 +01-16 01:46:44.483 1461 1517 W SurfaceFlinger: Attempting to destroy on removed layer: 7e4d0ca Toast#0 +01-16 01:46:46.901 1596 1867 I ActivityManager: START u0 {cmp=com.bslauncher.launcher/com.bslauncher.settings.SettingsActivity} from uid 10062 +01-16 01:46:46.920 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:44 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:46.921 1456 1456 I VibratorService: turn vibrator off +01-16 01:46:46.921 1596 1867 W VibratorService: Failed to perform effect (5) +01-16 01:46:46.921 1456 1456 I VibratorService: turn vibrator on timeout_ms=1 +01-16 01:46:46.921 1456 1456 I VibratorService: Setting amplitude to: 3596 +01-16 01:46:46.923 2360 2360 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@69b4e3f +01-16 01:46:46.943 1456 1456 I VibratorService: turn vibrator on timeout_ms=21 +01-16 01:46:46.943 1456 1456 I VibratorService: Setting amplitude to: 3596 +01-16 01:46:46.959 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:46.965 1456 1456 I VibratorService: turn vibrator off +01-16 01:46:47.002 2360 2554 E EGL_adreno: tid 2554: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:46:47.002 2360 2554 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff4b1ee880, error=EGL_BAD_MATCH +01-16 01:46:47.029 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:46:47.039 2183 18118 D AdvertisingIdClient: AdvertisingIdClient already created. +01-16 01:46:47.040 2183 18118 I AdvertisingIdClient: shouldSendLog 10126918 +01-16 01:46:47.040 2183 18118 I AdvertisingIdClient: GetInfoInternal elapse 1ms +01-16 01:46:47.067 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:69 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:47.081 2059 18183 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:46:47.130 2059 18072 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:46:47.145 1753 1835 I HostConnection: HostConnection::HostConnection: pid=1753, tid=1835, this=0x7fff6a7afb60 +01-16 01:46:47.146 1753 1835 I : fastpipe: Connect success +01-16 01:46:47.146 1753 1835 D HostConnection: HostRPC::connect sucess: app=com.android.systemui, pid=1753, tid=1835, this=0x7fff4adb7140 +01-16 01:46:47.146 1753 1835 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:com.android.systemui +01-16 01:46:41.496 1454 1454 W sensors@1.0-ser: type=1300 audit(0.0:1278): arch=c000003e syscall=16 success=yes exit=0 a0=7 a1=80046865 a2=7ffff6c0f000 a3=7ffff7427288 items=0 ppid=1 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=4294967295 exe="/system/vendor/bin/hw/android.hardware.sensors@1.0-service" subj=u:r:hal_sensors_default:s0 key=(null) +01-16 01:46:41.496 1339 1339 W auditd : type=1327 audit(0.0:1278): proctitle="/vendor/bin/hw/android.hardware.sensors@1.0-service" +01-16 01:46:41.496 1339 1339 W auditd : type=1320 audit(0.0:1278): +01-16 01:46:47.432 2360 2360 W ViewRootImpl[LauncherActivity]: Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=262.0, y[0]=419.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=10667512, downTime=10666566, deviceId=3, source=0x1002 } +01-16 01:46:47.432 2360 2360 I chatty : uid=10062(com.bslauncher.launcher) identical 1 line +01-16 01:46:47.432 2360 2360 W ViewRootImpl[LauncherActivity]: Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=262.0, y[0]=419.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=10667512, downTime=10666566, deviceId=3, source=0x1002 } +01-16 01:46:48.192 1596 1604 W System : A resource failed to call close. +01-16 01:46:48.193 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 29 lines +01-16 01:46:48.193 1596 1604 W System : A resource failed to call close. +01-16 01:46:48.351 1596 1867 I ActivityManager: START u0 {flg=0x10000000 cmp=com.bslauncher.launcher/com.bslauncher.settings.AppsActivity} from uid 10062 +01-16 01:46:48.358 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:44 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:48.365 2360 2360 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@e727525 +01-16 01:46:48.383 2360 2360 I DefaultDispatch: type=1400 audit(0.0:1281): avc: denied { search } for name="Browser" dev="sda2" ino=4030 scontext=u:r:untrusted_app:s0:c62,c256,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=1 +01-16 01:46:48.383 2360 2360 I DefaultDispatch: type=1400 audit(0.0:1281): avc: denied { read } for name="Browser.apk" dev="sda2" ino=4031 scontext=u:r:untrusted_app:s0:c62,c256,c512,c768 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=1 +01-16 01:46:48.389 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:48.393 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:46:48.393 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:46:48.405 2059 18183 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:46:48.436 2360 2554 E EGL_adreno: tid 2554: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:46:48.436 2360 2554 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff4b1b0a00, error=EGL_BAD_MATCH +01-16 01:46:48.436 2059 18091 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:46:48.441 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:46:48.451 2360 2554 I chatty : uid=10062(com.bslauncher.launcher) RenderThread identical 1 line +01-16 01:46:48.457 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:69 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:48.481 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:46:48.482 2360 2554 D OpenGLRenderer: endAllActiveAnimators on 0x7fff489ce700 (RippleDrawable) with handle 0x7fff6c0bd860 +01-16 01:46:48.504 2360 2360 W StaticLayout: maxLineHeight should not be -1. maxLines:1 lineCount:1 +01-16 01:46:48.515 2360 2360 I chatty : uid=10062(com.bslauncher.launcher) identical 6 lines +01-16 01:46:48.515 2360 2360 W StaticLayout: maxLineHeight should not be -1. maxLines:1 lineCount:1 +01-16 01:46:48.526 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:46:49.451 1596 16953 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=io.github.huskydg.magisk cmp=io.github.huskydg.magisk/com.topjohnwu.magisk.ui.MainActivity} from uid 10062 +01-16 01:46:49.460 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:44 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:49.490 1596 1613 I ActivityManager: Start proc 18186:io.github.huskydg.magisk/u0a55 for activity io.github.huskydg.magisk/com.topjohnwu.magisk.ui.MainActivity +01-16 01:46:49.496 1596 1596 I android.anim: type=1400 audit(0.0:1282): avc: denied { ioctl } for path="/dev/fastpipe" dev="tmpfs" ino=178 ioctlcmd=6869 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 +01-16 01:46:49.496 18186 18186 I .huskydg.magisk: type=1400 audit(0.0:1283): avc: denied { open } for path="/data/local/cfg-hdnnn/app_device" dev="sdb2" ino=133502 scontext=u:r:untrusted_app:s0:c55,c256,c512,c768 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=1 +01-16 01:46:49.496 18186 18186 W .huskydg.magisk: type=1300 audit(0.0:1283): arch=c000003e syscall=257 success=yes exit=11 a0=ffffff9c a1=7fffffffcb50 a2=0 a3=0 items=0 ppid=1428 auid=4294967295 uid=10055 gid=10055 euid=10055 suid=10055 fsuid=10055 egid=10055 sgid=10055 fsgid=10055 tty=(none) ses=4294967295 exe="/system/bin/app_process64" subj=u:r:untrusted_app:s0:c55,c256,c512,c768 key=(null) +01-16 01:46:49.496 1339 1339 W auditd : type=1327 audit(0.0:1283): proctitle="io.github.huskydg.magisk" +01-16 01:46:49.496 1339 1339 W auditd : type=1320 audit(0.0:1283): +01-16 01:46:49.496 18186 18186 I Zygote : seccomp disabled by setenforce 0 +01-16 01:46:49.497 18186 18186 D nativebridge: call UnloadNativeBridge! state=1 +01-16 01:46:49.501 2059 18183 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:46:49.552 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:49.568 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:46:49.568 2360 2554 D OpenGLRenderer: endAllActiveAnimators on 0x7fff43b3ba00 (RippleDrawable) with handle 0x7fff440ea320 +01-16 01:46:49.622 1596 1604 W System : A resource failed to call close. +01-16 01:46:49.623 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 30 lines +01-16 01:46:49.623 1596 1604 W System : A resource failed to call close. +01-16 01:46:49.650 18186 18216 D ProfileInstaller: Skipping profile installation for io.github.huskydg.magisk +01-16 01:46:49.654 18214 18214 I appproc : app_process main with argv: /system/bin --nice-name=io.github.huskydg.magisk:root:0 com.topjohnwu.superuser.internal.RootServerMain io.github.huskydg.magisk/a.ZP 10055 start +01-16 01:46:49.654 18214 18214 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<< +01-16 01:46:49.657 18214 18214 E cutils-trace: Error opening trace file: No such file or directory (2) +01-16 01:46:49.665 18186 18186 D AppCompatDelegate: Checking for metadata for AppLocalesMetadataHolderService : Service not found +01-16 01:46:49.674 18214 18214 V libnb : enter native_bridge2_isCompatibleWith 3 +01-16 01:46:49.678 18186 18186 I AppCompatDelegate: The Activity's LayoutInflater already has a Factory installed so we can not install AppCompat's +01-16 01:46:49.685 18214 18214 I libnb : Found /system/lib64/libhoudini.so version 3 +01-16 01:46:49.708 18214 18214 D nativebridge: PreInitializeNativeBridge name=io.github.huskydg.magisk:root:0 instruction_set=x86_64 +01-16 01:46:49.708 18214 18214 W nativebridge: Failed to bind-mount /system/lib64/x86_64/cpuinfo as /proc/cpuinfo: No such file or directory +01-16 01:46:49.708 18214 18214 D nativebridge: call UnloadNativeBridge! state=2 +01-16 01:46:49.713 18186 18186 D OpenGLRenderer: Skia GL Pipeline +01-16 01:46:49.713 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:49.730 18214 18214 D AndroidRuntime: Calling main entry com.topjohnwu.superuser.internal.RootServerMain +01-16 01:46:49.754 18186 18298 I HostConnection: HostConnection::HostConnection: pid=18186, tid=18298, this=0x7fff6a7aff80 +01-16 01:46:49.754 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:69 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:49.755 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:69 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:49.755 18186 18298 I : fastpipe: Connect success +01-16 01:46:49.755 18186 18298 D HostConnection: HostRPC::connect sucess: app=io.github.huskydg.magisk, pid=18186, tid=18298, this=0x7fff68de9ac0 +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.ncsoft.lineagen gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.vng.thiennhaiminhnguyetdaovng gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.proximabeta.tdm.kr gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.proximabeta.tdm.kr.cloud gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.proximabeta.tdm.kr.onestore gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.tencent.tmgp.wuxia gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.qqsy.gundam.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.qqsy.gundam gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.gravity.cute.tw.testand gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.cayenne.gvl gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.netmarble.tskgb gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.longe.racehmt gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.gvi.robegins.aos gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.studiocodedragon.projectss gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.jingxiu.hygd gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.playwith.nsealm.tw.googl gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.playwith.sealm.kr.googl gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.gravity.cute.tw.and gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.forgefun.redcovenant gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.silkroad.mb gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.vortexgravity.bealive.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.com2usholdings.soulstrike.android.google.global.normal gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.cobby.lonelysurvivor gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.cmge.ltqrc gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.cmge.ltqrc.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.seasun.jxqy0.jsgf.xsj gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.seasun.jxqy0.huawei gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.mobigame.tt12 gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.kaneten.client.and gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.playwith.rohan2.kr gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.linecorp.LGATF gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.atknsyl.weaponmaster gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.blizzard.diablo.immortal gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.netease.dfjssea gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.netease.dfjsjp gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.netease.dfjskr gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! jp.co.applibot.chiikawapocketgl gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! jp.co.applibot.chiikawapocket gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.kakaogames.pcr gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.kakaogames.eversoul gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.kakaogames.eversouljp gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.ntrance.dkr.and gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.zlongame.eversoul gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.Chillgaming.oneState gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.activision.callofduty.shooter gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.garena.game.codm gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.vng.codmvn gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.VIIBYTE.RivalisAcademiaNexus gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.qjsjqy.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.dragonli.projectsnow gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.netmarble.kofafk gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.greenmushroom.boomblitz.gp gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.hermes.p6gameos gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.crystal.usad gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.jingxiu.yanwu gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.playhardlab.heroes gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.topgamestudio.americanblocksnipersurvival.jf gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! vng.games.gs1.phongthan.mobile.com gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.userjoy.szm gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.netease.yzs gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.korea.tamamonkr.google gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.huanxi.datulong gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.com2us.legendsummoner.android.google.global.normal gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.metek.atm2 gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.huiqi.mrby gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.tencent.wlfz gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.yh.hunter4.firstformal gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.phonecoolgame.sanguo gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.epidgames.trickcalrevive gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.tanle.sycq gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.youzu.djlw gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.happyelements.rxr gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.tencent.zd gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.leisure.tw gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! aos.playpark.ygc gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.zhuyue.dungeon4 gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.sunking.as3d gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.ncsoft.bsh gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.zengame.hlmjhdj gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.zengame.zjscmj gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.leduo.zjscmj gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.tencent.tmgp.scmjxzddnew gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.drivezone.car.race.game gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.game.sgzzqtxsy gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.leduo.ttmjdjb gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.hygame.mhxy.tw.gp gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.hxen.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.leduo.ttmjdjb.p234 gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.kt.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! gg.maxion.knt.and gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.wwjd.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.uwocn.aos gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.joycrit.wac.and.ru.ld gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.hx.interactive gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.chinesegamer.xqj gl +01-16 01:46:49.755 18186 18298 E HostConnection: /data/local/cfg-hdnnn/gl_force format error! com.joycrit.wac.and.apac.ld gl +01-16 01:46:49.755 18186 18298 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:io.github.huskydg.magisk +01-16 01:46:49.756 18186 18298 I : fastpipe: Connect success +01-16 01:46:49.756 18186 18298 D HostConnection: recv ProcessPuidReply name=io.github.huskydg.magisk puid=19 g_u64CapsFlag=1d +01-16 01:46:49.757 18186 18298 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 +01-16 01:46:49.757 18186 18298 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 +01-16 01:46:49.757 18186 18298 I OpenGLRenderer: Initialized EGL, version 1.4 +01-16 01:46:49.757 18186 18298 D OpenGLRenderer: Swap behavior 1 +01-16 01:46:49.757 18186 18298 I EGL_adreno: eglCreateContext request GLES major-version=2 +01-16 01:46:49.766 18186 18186 D Sj : onServiceConnected +01-16 01:46:49.781 18186 18298 D EGL_adreno: eglCreateContext: 0x7fff6a644880: maj 3 min 1 rcv 4 +01-16 01:46:49.783 18186 18298 D EGL_adreno: eglMakeCurrent: 0x7fff6a644880: ver 3 1 (tinfo 0x7fff729a1c80) +01-16 01:46:49.786 18186 18298 D HostConnection: ExtendedRCEncoderContext GL_VERSION return OpenGL ES 3.1 v1.46 +01-16 01:46:49.787 18186 18298 E eglCodecCommon: glUtilsParamSize: unknow param 0x00008c29 +01-16 01:46:49.787 18186 18298 W GLESv2_enc: no support GL_NUM_PROGRAM_BINARY_FORMATS +01-16 01:46:49.791 18186 18298 D vndksupport: Loading /vendor/lib64/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace. +01-16 01:46:49.792 18186 18298 D vndksupport: Loading /vendor/lib64/hw/gralloc.default.so from current namespace instead of sphal namespace. +01-16 01:46:49.793 18186 18298 E EGL_adreno: tid 18298: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:46:49.793 18186 18298 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff68de8300, error=EGL_BAD_MATCH +01-16 01:46:49.883 18186 18216 D NetworkSecurityConfig: No Network Security Config specified, using platform default +01-16 01:46:49.887 18186 18216 W .huskydg.magis: Unknown chunk type '200'. +01-16 01:46:49.887 18186 18216 I chatty : uid=10055(io.github.huskydg.magisk) DefaultDispatch identical 1 line +01-16 01:46:49.888 18186 18216 W .huskydg.magis: Unknown chunk type '200'. +01-16 01:46:49.889 18186 18216 I .huskydg.magis: The ClassLoaderContext is a special shared library. +01-16 01:46:49.890 18186 18216 I chatty : uid=10055(io.github.huskydg.magisk) DefaultDispatch identical 1 line +01-16 01:46:49.891 18186 18216 I .huskydg.magis: The ClassLoaderContext is a special shared library. +01-16 01:46:49.919 2059 2059 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.presencemanager.service.START dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentApiService } +01-16 01:46:49.919 2059 2059 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.presencemanager.service.INTERNAL_IDENTITY dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentApiService } +01-16 01:46:49.943 18186 18216 V NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 329 native methods... +01-16 01:46:49.952 18186 19066 E GoogleApiManager: Failed to get service from broker. +01-16 01:46:49.952 18186 19066 E GoogleApiManager: java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.Parcel.createException(Parcel.java:1950) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.Parcel.readException(Parcel.java:1918) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.Parcel.readException(Parcel.java:1868) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at bbnk.a(:com.google.android.gms@254730017@25.47.30 (100800-833691957):36) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at bbll.z(:com.google.android.gms@254730017@25.47.30 (100800-833691957):150) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at baro.run(:com.google.android.gms@254730017@25.47.30 (100800-833691957):42) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.Handler.handleCallback(Handler.java:873) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.Handler.dispatchMessage(Handler.java:99) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at cnat.lW(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at cnat.dispatchMessage(:com.google.android.gms@254730017@25.47.30 (100800-833691957):5) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.Looper.loop(Looper.java:193) +01-16 01:46:49.952 18186 19066 E GoogleApiManager: at android.os.HandlerThread.run(HandlerThread.java:65) +01-16 01:46:49.953 18186 19066 W GoogleApiManager: Not showing notification since connectionResult is not user-facing: ConnectionResult{statusCode=DEVELOPER_ERROR, resolution=null, message=null, clientMethodKey=null} +01-16 01:46:49.953 18186 19065 W FlagRegistrar: Failed to register com.google.android.gms.providerinstaller#io.github.huskydg.magisk +01-16 01:46:49.953 18186 19065 W FlagRegistrar: etjl: 17: 17: API: Phenotype.API is not available on this device. Connection failed with: ConnectionResult{statusCode=DEVELOPER_ERROR, resolution=null, message=null, clientMethodKey=null} +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at etjn.a(:com.google.android.gms@254730017@25.47.30 (100800-833691957):13) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at fokc.d(:com.google.android.gms@254730017@25.47.30 (100800-833691957):3) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at foke.run(:com.google.android.gms@254730017@25.47.30 (100800-833691957):130) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at foml.execute(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at fokm.f(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at fokm.m(:com.google.android.gms@254730017@25.47.30 (100800-833691957):99) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at fokm.r(:com.google.android.gms@254730017@25.47.30 (100800-833691957):17) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at emgh.hA(:com.google.android.gms@254730017@25.47.30 (100800-833691957):35) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at ebxk.run(:com.google.android.gms@254730017@25.47.30 (100800-833691957):12) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at foml.execute(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at ebxl.b(:com.google.android.gms@254730017@25.47.30 (100800-833691957):18) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at ebya.b(:com.google.android.gms@254730017@25.47.30 (100800-833691957):36) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at ebyc.d(:com.google.android.gms@254730017@25.47.30 (100800-833691957):25) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at baox.c(:com.google.android.gms@254730017@25.47.30 (100800-833691957):9) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at barm.q(:com.google.android.gms@254730017@25.47.30 (100800-833691957):48) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at barm.d(:com.google.android.gms@254730017@25.47.30 (100800-833691957):10) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at barm.g(:com.google.android.gms@254730017@25.47.30 (100800-833691957):185) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at barm.onConnectionFailed(:com.google.android.gms@254730017@25.47.30 (100800-833691957):2) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at baro.run(:com.google.android.gms@254730017@25.47.30 (100800-833691957):70) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at android.os.Handler.handleCallback(Handler.java:873) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at android.os.Handler.dispatchMessage(Handler.java:99) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at cnat.lW(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at cnat.dispatchMessage(:com.google.android.gms@254730017@25.47.30 (100800-833691957):5) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at android.os.Looper.loop(Looper.java:193) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at android.os.HandlerThread.run(HandlerThread.java:65) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: Caused by: bane: 17: API: Phenotype.API is not available on this device. Connection failed with: ConnectionResult{statusCode=DEVELOPER_ERROR, resolution=null, message=null, clientMethodKey=null} +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at bbkx.a(:com.google.android.gms@254730017@25.47.30 (100800-833691957):15) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at bapa.a(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: at baox.c(:com.google.android.gms@254730017@25.47.30 (100800-833691957):5) +01-16 01:46:49.953 18186 19065 W FlagRegistrar: ... 11 more +01-16 01:46:49.955 18186 18216 I ProviderInstaller: Installed default security provider GmsCore_OpenSSL +01-16 01:46:50.075 18186 18298 D EGL_adreno: eglMakeCurrent: 0x7fff6a644880: ver 3 1 (tinfo 0x7fff729a1c80) +01-16 01:46:50.117 1596 3316 I HostConnection: HostConnection::~HostConnection, pid=1596, tid=3316, this=0x7fff411902a0, m_stream=0x7fff4285cc00 +01-16 01:46:50.117 1596 3316 I : fastpipe: close connect +01-16 01:46:50.120 1596 1604 W System : A resource failed to call close. +01-16 01:46:50.120 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 34 lines +01-16 01:46:50.120 1596 1604 W System : A resource failed to call close. +01-16 01:46:50.120 1596 1610 I ActivityManager: Displayed io.github.huskydg.magisk/com.topjohnwu.magisk.ui.MainActivity: +663ms +01-16 01:46:50.135 1461 1923 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen io.github.huskydg.magisk#0 +01-16 01:46:50.135 1461 1923 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen io.github.huskydg.magisk#0 +01-16 01:46:50.336 18186 18186 E VT : a.XK: HTTP 404 +01-16 01:46:50.336 18186 18186 E VT : at a.Px.w(SourceFile:133) +01-16 01:46:50.336 18186 18186 E VT : at a.EV.h(SourceFile:9) +01-16 01:46:50.336 18186 18186 E VT : at a.Ky.run(SourceFile:57) +01-16 01:46:50.336 18186 18186 E VT : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) +01-16 01:46:50.336 18186 18186 E VT : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) +01-16 01:46:50.336 18186 18186 E VT : at java.lang.Thread.run(Thread.java:764) +01-16 01:46:51.499 2360 18111 I FA : Application backgrounded at: timestamp_millis: 1768528009492 +01-16 01:46:54.453 1596 1618 D AutofillManagerService: Close system dialogs +01-16 01:46:54.454 1753 1753 V StatusBar: mStatusBarWindow: com.android.systemui.statusbar.phone.StatusBarWindowView{2abe487 V.ED..... ........ 0,0-1600,36} canPanelBeCollapsed(): false +01-16 01:46:54.455 1753 1753 I vol.Events: writeEvent dismiss_dialog volume_controller +01-16 01:46:54.455 1596 1681 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.bslauncher.launcher/com.bslauncher.LauncherActivity (has extras)} from uid 1000 +01-16 01:46:54.463 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:44 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:54.472 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:54.483 2235 2235 I chatty : uid=1000(system) com.android.coreservice identical 1 line +01-16 01:46:54.487 2360 2360 D BSLauncher: bindTopSlots called +01-16 01:46:54.489 2360 2360 D BSLauncher: topSlot6 listener being set... +01-16 01:46:54.490 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:54.506 1753 1753 I Binder:1753_8: type=1400 audit(0.0:1293): avc: denied { read write } for name="fastpipe" dev="tmpfs" ino=178 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 +01-16 01:46:54.506 1753 1753 I Binder:1753_8: type=1400 audit(0.0:1293): avc: denied { open } for path="/dev/fastpipe" dev="tmpfs" ino=178 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 +01-16 01:46:54.506 1753 1753 W Binder:1753_8: type=1300 audit(0.0:1293): arch=c000003e syscall=257 success=yes exit=98 a0=ffffff9c a1=7ffff73cecaa a2=2 a3=0 items=0 ppid=1428 auid=4294967295 uid=10013 gid=10013 euid=10013 suid=10013 fsuid=10013 egid=10013 sgid=10013 fsgid=10013 tty=(none) ses=4294967295 exe="/system/bin/app_process64" subj=u:r:platform_app:s0:c512,c768 key=(null) +01-16 01:46:54.506 1339 1339 W auditd : type=1327 audit(0.0:1293): proctitle="com.android.systemui" +01-16 01:46:54.506 1339 1339 W auditd : type=1320 audit(0.0:1293): +01-16 01:46:54.509 1753 16960 I HostConnection: HostConnection::HostConnection: pid=1753, tid=16960, this=0x7fff6c045fc0 +01-16 01:46:54.510 1753 16960 I : fastpipe: Connect success +01-16 01:46:54.510 1753 16960 D HostConnection: HostRPC::connect sucess: app=com.android.systemui, pid=1753, tid=16960, this=0x7fff4b0e1000 +01-16 01:46:54.510 1753 16960 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:com.android.systemui +01-16 01:46:54.515 2360 2554 E EGL_adreno: tid 2554: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:46:54.515 2360 2554 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff4b1b0a00, error=EGL_BAD_MATCH +01-16 01:46:54.518 1596 3316 I HostConnection: HostConnection::HostConnection: pid=1596, tid=3316, this=0x7fff411902a0 +01-16 01:46:54.519 1596 3316 I : fastpipe: Connect success +01-16 01:46:54.523 1596 3316 D HostConnection: HostRPC::connect sucess: app=system_server, pid=1596, tid=3316, this=0x7fff4285cc00 +01-16 01:46:54.523 18186 18298 D EGL_adreno: eglMakeCurrent: 0x7fff6a644880: ver 3 1 (tinfo 0x7fff729a1c80) +01-16 01:46:54.523 1596 3316 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:system_server +01-16 01:46:54.524 1753 1811 I HostConnection: HostConnection::HostConnection: pid=1753, tid=1811, this=0x7fff729a7720 +01-16 01:46:54.525 1753 1811 I : fastpipe: Connect success +01-16 01:46:54.525 1753 1811 D HostConnection: HostRPC::connect sucess: app=com.android.systemui, pid=1753, tid=1811, this=0x7fff487173c0 +01-16 01:46:54.525 1753 1811 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:com.android.systemui +01-16 01:46:54.527 1596 3316 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 +01-16 01:46:54.527 1596 3316 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 +01-16 01:46:54.527 1596 3316 I OpenGLRenderer: Initialized EGL, version 1.4 +01-16 01:46:54.527 1596 3316 D OpenGLRenderer: Swap behavior 1 +01-16 01:46:54.527 1596 3316 I EGL_adreno: eglCreateContext request GLES major-version=2 +01-16 01:46:54.547 1596 3316 D EGL_adreno: eglCreateContext: 0x7fff428d2860: maj 3 min 1 rcv 4 +01-16 01:46:54.551 1596 3316 D EGL_adreno: eglMakeCurrent: 0x7fff428d2860: ver 3 1 (tinfo 0x7fff429bfee0) +01-16 01:46:54.554 1596 3316 D HostConnection: ExtendedRCEncoderContext GL_VERSION return OpenGL ES 3.1 v1.46 +01-16 01:46:54.555 1596 3316 E eglCodecCommon: glUtilsParamSize: unknow param 0x00008c29 +01-16 01:46:54.555 1596 3316 W GLESv2_enc: no support GL_NUM_PROGRAM_BINARY_FORMATS +01-16 01:46:54.558 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:69 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:54.571 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:69 android.app.ActivityThread.handleReceiver:3424 +01-16 01:46:54.573 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:46:54.616 1596 3316 I HostConnection: HostConnection::~HostConnection, pid=1596, tid=3316, this=0x7fff411902a0, m_stream=0x7fff4285cc00 +01-16 01:46:54.617 1596 3316 I : fastpipe: close connect +01-16 01:46:54.621 1461 1517 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen com.bslauncher.launcher#0 +01-16 01:46:54.621 1461 1517 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen com.bslauncher.launcher#0 +01-16 01:46:54.697 2059 18091 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:46:54.727 1596 1604 W System : A resource failed to call close. +01-16 01:46:54.728 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 36 lines +01-16 01:46:54.728 1596 1604 W System : A resource failed to call close. +01-16 01:46:55.474 1596 1596 W WindowManager: removeWindowToken: Attempted to remove non-existing token: android.os.Binder@c8306be +01-16 01:46:59.943 18186 19066 E GoogleApiManager: Failed to get service from broker. +01-16 01:46:59.943 18186 19066 E GoogleApiManager: java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.Parcel.createException(Parcel.java:1950) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.Parcel.readException(Parcel.java:1918) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.Parcel.readException(Parcel.java:1868) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at bbnk.a(:com.google.android.gms@254730017@25.47.30 (100800-833691957):36) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at bbll.z(:com.google.android.gms@254730017@25.47.30 (100800-833691957):150) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at baro.run(:com.google.android.gms@254730017@25.47.30 (100800-833691957):42) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.Handler.handleCallback(Handler.java:873) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.Handler.dispatchMessage(Handler.java:99) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at cnat.lW(:com.google.android.gms@254730017@25.47.30 (100800-833691957):1) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at cnat.dispatchMessage(:com.google.android.gms@254730017@25.47.30 (100800-833691957):5) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.Looper.loop(Looper.java:193) +01-16 01:46:59.943 18186 19066 E GoogleApiManager: at android.os.HandlerThread.run(HandlerThread.java:65) +01-16 01:46:59.943 18186 19066 W GoogleApiManager: Not showing notification since connectionResult is not user-facing: ConnectionResult{statusCode=DEVELOPER_ERROR, resolution=null, message=null, clientMethodKey=null} +01-16 01:47:00.016 1448 1526 D hwcomposer: hw_composer sent 84 syncs in 60s +01-16 01:47:00.030 1448 1448 I HwBinder:1448_1: type=1400 audit(0.0:1297): avc: denied { ioctl } for path="/dev/fastpipe" dev="tmpfs" ino=178 ioctlcmd=6867 scontext=u:r:hal_graphics_composer_default:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 +01-16 01:47:00.030 1448 1448 W HwBinder:1448_1: type=1300 audit(0.0:1297): arch=c000003e syscall=16 success=yes exit=0 a0=11 a1=80046867 a2=7ffff521e040 a3=0 items=0 ppid=1 auid=4294967295 uid=1000 gid=1003 euid=1000 suid=1000 fsuid=1000 egid=1003 sgid=1003 fsgid=1003 tty=(none) ses=4294967295 exe="/system/vendor/bin/hw/android.hardware.graphics.composer@2.1-service" subj=u:r:hal_graphics_composer_default:s0 key=(null) +01-16 01:47:00.030 1339 1339 W auditd : type=1327 audit(0.0:1297): proctitle="/vendor/bin/hw/android.hardware.graphics.composer@2.1-service" +01-16 01:47:00.030 1339 1339 W auditd : type=1320 audit(0.0:1297): +01-16 01:47:02.803 1477 1477 I storaged: type=1400 audit(0.0:1298): avc: denied { call } for scontext=u:r:storaged:s0 tcontext=u:r:init:s0 tclass=binder permissive=1 +01-16 01:47:02.803 1477 1477 W storaged: type=1300 audit(0.0:1298): arch=c000003e syscall=16 success=yes exit=0 a0=4 a1=c0306201 a2=7ffff739be40 a3=7ffff6e27288 items=0 ppid=1 auid=4294967295 uid=0 gid=1032 euid=0 suid=0 fsuid=0 egid=1032 sgid=1032 fsgid=1032 tty=(none) ses=4294967295 exe="/system/bin/storaged" subj=u:r:storaged:s0 key=(null) +01-16 01:47:02.803 1339 1339 W auditd : type=1327 audit(0.0:1298): proctitle="/system/bin/storaged" +01-16 01:47:02.803 1339 1339 W auditd : type=1320 audit(0.0:1298): +01-16 01:47:02.804 1477 1541 E storaged: getDiskStats failed with result NOT_SUPPORTED and size 0 +01-16 01:47:04.016 1458 1458 I ldinit : type=1400 audit(0.0:1299): avc: denied { read } for name="partitions" dev="proc" ino=4026532050 scontext=u:r:ldinit:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1 +01-16 01:47:04.016 1458 1458 I ldinit : type=1400 audit(0.0:1299): avc: denied { open } for path="/proc/partitions" dev="proc" ino=4026532050 scontext=u:r:ldinit:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1 +01-16 01:47:04.016 1458 1458 W ldinit : type=1300 audit(0.0:1299): arch=c000003e syscall=257 success=yes exit=6 a0=ffffff9c a1=7ffff7c22ae5 a2=0 a3=0 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/ldinit" subj=u:r:ldinit:s0 key=(null) +01-16 01:47:04.016 1339 1339 W auditd : type=1327 audit(0.0:1299): proctitle="/system/bin/ldinit" +01-16 01:47:04.016 1339 1339 W auditd : type=1320 audit(0.0:1299): +01-16 01:47:04.016 1458 1458 I ldinit : type=1400 audit(0.0:1300): avc: denied { getattr } for path="/proc/partitions" dev="proc" ino=4026532050 scontext=u:r:ldinit:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1 +01-16 01:47:04.016 1458 1458 W ldinit : type=1300 audit(0.0:1300): arch=c000003e syscall=5 success=yes exit=0 a0=6 a1=7ffff6100a10 a2=7ffff7214018 a3=0 items=0 ppid=1 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 exe="/system/bin/ldinit" subj=u:r:ldinit:s0 key=(null) +01-16 01:47:04.661 2183 2183 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms } +01-16 01:47:04.662 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:04.662 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:04.662 1596 2878 I ActivityManager: Killing 2249:com.google.process.gapps/u0a16 (adj 906): empty for 3230s +01-16 01:47:04.663 1596 1614 W libprocessgroup: kill(-2249, 9) failed: No such process +01-16 01:47:04.668 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:04.668 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:04.679 1428 1428 I Zygote : Process 2249 exited due to signal (9) +01-16 01:47:04.771 1596 1614 W libprocessgroup: kill(-2249, 9) failed: No such process +01-16 01:47:04.771 1596 1614 I libprocessgroup: Successfully killed process cgroup uid 10016 pid 2249 in 108ms +01-16 01:47:09.816 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:09.816 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:14.878 1596 2878 E memtrack: Couldn't load memtrack module +01-16 01:47:14.879 1596 2878 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:17.044 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:17.044 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:17.052 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:17.052 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:18.814 2183 2183 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.common.BIND_SHARED_PREFS pkg=com.google.android.gms } +01-16 01:47:25.193 1449 1449 I health@2.0-serv: type=1400 audit(0.0:1301): avc: denied { read } for scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=netlink_kobject_uevent_socket permissive=1 +01-16 01:47:25.193 1449 1449 W health@2.0-serv: type=1300 audit(0.0:1301): arch=c000003e syscall=47 success=yes exit=193 a0=8 a1=7fffffffdf48 a2=0 a3=ffffffff items=0 ppid=1 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=4294967295 exe="/system/vendor/bin/hw/android.hardware.health@2.0-service.default" subj=u:r:init:s0 key=(null) +01-16 01:47:25.193 1339 1339 W auditd : type=1327 audit(0.0:1301): proctitle="/vendor/bin/hw/android.hardware.health@2.0-service.default" +01-16 01:47:25.193 1339 1339 W auditd : type=1320 audit(0.0:1301): +01-16 01:47:28.262 1596 1604 W System : A resource failed to call close. +01-16 01:47:28.262 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 28 lines +01-16 01:47:28.262 1596 1604 W System : A resource failed to call close. +01-16 01:47:44.160 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:44.160 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:44.168 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:44.168 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:44.174 1596 1610 E memtrack: Couldn't load memtrack module +01-16 01:47:44.174 1596 1610 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:47:49.029 1596 16953 I ActivityManager: START u0 {flg=0x10000000 cmp=com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity} from uid 2000 +01-16 01:47:49.042 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:44 android.app.ActivityThread.handleReceiver:3424 +01-16 01:47:49.043 1461 1461 I surfaceflinger: type=1400 audit(0.0:1302): avc: denied { ioctl } for path="/dev/fastpipe" dev="tmpfs" ino=178 ioctlcmd=6867 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 +01-16 01:47:49.043 1461 1461 W surfaceflinger: type=1300 audit(0.0:1302): arch=c000003e syscall=16 success=yes exit=0 a0=b a1=80046867 a2=7ffff602c130 a3=a items=0 ppid=1 auid=4294967295 uid=1000 gid=1003 euid=1000 suid=1000 fsuid=1000 egid=1003 sgid=1003 fsgid=1003 tty=(none) ses=4294967295 exe="/system/bin/surfaceflinger" subj=u:r:surfaceflinger:s0 key=(null) +01-16 01:47:49.043 1339 1339 W auditd : type=1327 audit(0.0:1302): proctitle="/system/bin/surfaceflinger" +01-16 01:47:49.043 1339 1339 W auditd : type=1320 audit(0.0:1302): +01-16 01:47:49.044 18112 18112 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@824dc3d +01-16 01:47:49.063 1447 1447 I HwBinder:1447_2: type=1400 audit(0.0:1303): avc: denied { ioctl } for path="/dev/fastpipe" dev="tmpfs" ino=178 ioctlcmd=6869 scontext=u:r:hal_graphics_allocator_default:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1 +01-16 01:47:49.063 1447 1447 W HwBinder:1447_2: type=1300 audit(0.0:1303): arch=c000003e syscall=16 success=yes exit=0 a0=9 a1=80046869 a2=7ffff722c160 a3=1 items=0 ppid=1 auid=4294967295 uid=1000 gid=1003 euid=1000 suid=1000 fsuid=1000 egid=1003 sgid=1003 fsgid=1003 tty=(none) ses=4294967295 exe="/system/vendor/bin/hw/android.hardware.graphics.allocator@2.0-service" subj=u:r:hal_graphics_allocator_default:s0 key=(null) +01-16 01:47:49.082 2183 2183 D BoundBrokerSvc: onBind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms } +01-16 01:47:49.082 2183 2183 D BoundBrokerSvc: Loading bound service for intent: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms } +01-16 01:47:49.112 2183 19100 D AdvertisingIdClient: AdvertisingIdClient already created. +01-16 01:47:49.112 2183 19100 D AdvertisingIdClient: AdvertisingIdClient is not bounded. Starting to bind it... +01-16 01:47:49.150 18112 19101 W ContentProvider: Normalized content://com.cyanogenmod.filemanager.dev.providers.bookmarks//bookmarks to content://com.cyanogenmod.filemanager.dev.providers.bookmarks/bookmarks to avoid possible security issues +01-16 01:47:49.155 2183 19100 D AdvertisingIdClient: AdvertisingIdClient is bounded +01-16 01:47:49.166 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:47:49.167 18112 19102 W ContentProvider: Normalized content://com.cyanogenmod.filemanager.dev.providers.bookmarks//history to content://com.cyanogenmod.filemanager.dev.providers.bookmarks/history to avoid possible security issues +01-16 01:47:49.168 2183 19100 I AdvertisingIdClient: shouldSendLog 10126918 +01-16 01:47:49.168 2183 19100 I AdvertisingIdClient: GetInfoInternal elapse 56ms +01-16 01:47:49.229 2059 19104 I NetworkScheduler: (REDACTED) Error inserting %s +01-16 01:47:49.237 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:47:49.283 1596 1604 W System : A resource failed to call close. +01-16 01:47:49.283 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 30 lines +01-16 01:47:49.283 1596 1604 W System : A resource failed to call close. +01-16 01:47:49.368 18112 18138 E EGL_adreno: tid 18138: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:47:49.368 18112 18138 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff4e5ab800, error=EGL_BAD_MATCH +01-16 01:47:49.368 1447 1565 D gralloc_default: gralloc_alloc: Creating ashmem region of size 5763072, ignore more log... +01-16 01:47:49.391 1461 1923 D SurfaceFlinger: duplicate layer name: changing com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity to com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity#1 +01-16 01:47:49.396 18112 18138 E EGL_adreno: tid 18138: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:47:49.396 18112 18138 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff68df8f80, error=EGL_BAD_MATCH +01-16 01:47:49.401 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.404 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.410 1596 1610 I ActivityManager: Displayed com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity: +377ms +01-16 01:47:49.421 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.422 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.422 1461 1517 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen com.cyanogenmod.filemanager.dev#0 +01-16 01:47:49.422 1461 1517 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen com.cyanogenmod.filemanager.dev#0 +01-16 01:47:49.435 1461 1517 D SurfaceFlinger: duplicate layer name: changing com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity to com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity#2 +01-16 01:47:49.439 18112 18138 E EGL_adreno: tid 18138: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:47:49.439 18112 18138 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff68df8400, error=EGL_BAD_MATCH +01-16 01:47:49.442 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.444 18112 18138 I chatty : uid=10057(com.cyanogenmod.filemanager.dev) RenderThread identical 1 line +01-16 01:47:49.453 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.455 18112 18112 E NavigationView: Unable to gain the required privileges to function. +01-16 01:47:49.455 18112 18112 E NavigationView: com.cyanogenmod.filemanager.console.ConsoleAllocException: Console allocation error. +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.shell.ShellConsole.alloc(ShellConsole.java:420) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.ConsoleBuilder.createNonPrivilegedConsole(ConsoleBuilder.java:297) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.ConsoleBuilder.createDefaultConsole(ConsoleBuilder.java:252) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.ConsoleBuilder.createDefaultConsole(ConsoleBuilder.java:213) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.ConsoleBuilder.getConsole(ConsoleBuilder.java:97) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.ConsoleBuilder.getConsole(ConsoleBuilder.java:72) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.util.CommandHelper.ensureConsoleForFile(CommandHelper.java:2168) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.util.CommandHelper.listFiles(CommandHelper.java:779) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.ui.widgets.NavigationView$NavigationTask.doInBackground(NavigationView.java:281) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.ui.widgets.NavigationView$NavigationTask.doInBackground(NavigationView.java:214) +01-16 01:47:49.455 18112 18112 E NavigationView: at android.os.AsyncTask$2.call(AsyncTask.java:333) +01-16 01:47:49.455 18112 18112 E NavigationView: at java.util.concurrent.FutureTask.run(FutureTask.java:266) +01-16 01:47:49.455 18112 18112 E NavigationView: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) +01-16 01:47:49.455 18112 18112 E NavigationView: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) +01-16 01:47:49.455 18112 18112 E NavigationView: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) +01-16 01:47:49.455 18112 18112 E NavigationView: at java.lang.Thread.run(Thread.java:764) +01-16 01:47:49.455 18112 18112 E NavigationView: Caused by: java.lang.IndexOutOfBoundsException: 2 +01-16 01:47:49.455 18112 18112 E NavigationView: at android.content.res.XmlBlock$Parser.getAttributeValue(XmlBlock.java:212) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.commands.shell.Command.getStartCodeCommandInfo(Command.java:300) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.shell.ShellConsole.syncExecute(ShellConsole.java:631) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.shell.ShellConsole.execute(ShellConsole.java:541) +01-16 01:47:49.455 18112 18112 E NavigationView: at com.cyanogenmod.filemanager.console.shell.ShellConsole.alloc(ShellConsole.java:380) +01-16 01:47:49.455 18112 18112 E NavigationView: ... 15 more +01-16 01:47:49.457 18112 18112 W System.err: java.lang.Exception: Toast callstack! strTip=Unable to gain the required privileges to function. +01-16 01:47:49.457 18112 18112 W System.err: at android.widget.Toast.show(Toast.java:143) +01-16 01:47:49.458 18112 18112 W System.err: at com.cyanogenmod.filemanager.util.DialogHelper.showToast(DialogHelper.java:627) +01-16 01:47:49.458 18112 18112 W System.err: at com.cyanogenmod.filemanager.util.DialogHelper.showToast(DialogHelper.java:638) +01-16 01:47:49.458 18112 18112 W System.err: at com.cyanogenmod.filemanager.ui.widgets.NavigationView$NavigationTask$2.run(NavigationView.java:298) +01-16 01:47:49.458 18112 18112 W System.err: at android.os.Handler.handleCallback(Handler.java:873) +01-16 01:47:49.458 18112 18112 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99) +01-16 01:47:49.458 18112 18112 W System.err: at android.os.Looper.loop(Looper.java:193) +01-16 01:47:49.458 18112 18112 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6840) +01-16 01:47:49.458 18112 18112 W System.err: at java.lang.reflect.Method.invoke(Native Method) +01-16 01:47:49.458 18112 18112 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) +01-16 01:47:49.458 18112 18112 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860) +01-16 01:47:49.468 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.469 18112 18138 I chatty : uid=10057(com.cyanogenmod.filemanager.dev) RenderThread identical 1 line +01-16 01:47:49.470 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.485 1596 2878 I HostConnection: HostConnection::HostConnection: pid=1596, tid=2878, this=0x7fff39b689c0 +01-16 01:47:49.485 1596 2878 I : fastpipe: Connect success +01-16 01:47:49.486 1596 2878 D HostConnection: HostRPC::connect sucess: app=system_server, pid=1596, tid=2878, this=0x7fff41e715c0 +01-16 01:47:49.486 1596 2878 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:system_server +01-16 01:47:49.489 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.492 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.499 1461 1461 W SurfaceFlinger: couldn't log to binary event log: overflow. +01-16 01:47:49.499 1461 1518 W SurfaceFlinger: Attempting to set client state on removed layer: Dim Layer for - Task=12#0 +01-16 01:47:49.499 1461 1518 W SurfaceFlinger: Attempting to destroy on removed layer: Dim Layer for - Task=12#0 +01-16 01:47:49.503 1596 3316 I HostConnection: HostConnection::HostConnection: pid=1596, tid=3316, this=0x7fff411902a0 +01-16 01:47:49.503 1596 3316 I : fastpipe: Connect success +01-16 01:47:49.503 1596 3316 D HostConnection: HostRPC::connect sucess: app=system_server, pid=1596, tid=3316, this=0x7fff4285cc00 +01-16 01:47:49.504 1596 3316 D HostConnection: queryAndSetGLESMaxVersion select gles-version: 3.1 hostGLVersion:46 process:system_server +01-16 01:47:49.504 1596 3316 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 +01-16 01:47:49.504 1596 3316 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 +01-16 01:47:49.504 1596 3316 I OpenGLRenderer: Initialized EGL, version 1.4 +01-16 01:47:49.504 1596 3316 D OpenGLRenderer: Swap behavior 1 +01-16 01:47:49.504 1596 3316 I EGL_adreno: eglCreateContext request GLES major-version=2 +01-16 01:47:49.515 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:44 android.app.ActivityThread.handleReceiver:3424 +01-16 01:47:49.516 2360 2360 D BSLauncher: bindTopSlots called +01-16 01:47:49.526 1596 3316 D EGL_adreno: eglCreateContext: 0x7fff428d2860: maj 3 min 1 rcv 4 +01-16 01:47:49.528 2360 2360 D BSLauncher: topSlot6 listener being set... +01-16 01:47:49.530 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:47:49.532 2360 2554 E EGL_adreno: tid 2554: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:47:49.532 2360 2554 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff4b1b0a00, error=EGL_BAD_MATCH +01-16 01:47:49.533 1596 3316 D EGL_adreno: eglMakeCurrent: 0x7fff428d2860: ver 3 1 (tinfo 0x7fff429bfee0) +01-16 01:47:49.533 18112 18138 E EGL_adreno: tid 18138: eglSurfaceAttrib(1350): error 0x3009 (EGL_BAD_MATCH) +01-16 01:47:49.533 18112 18138 W OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fff68df8400, error=EGL_BAD_MATCH +01-16 01:47:49.538 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.540 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1020 android.content.ContextWrapper.sendBroadcast:449 com.android.coreservice.TabManager.notifyClosing:364 com.android.coreservice.TabManager.updateInner:191 com.android.coreservice.TabManager.onUpdate:226 +01-16 01:47:49.540 2235 2235 I CoreService: notifyClosing notify tab closed taskPackageName:com.cyanogenmod.filemanager.dev +01-16 01:47:49.542 1596 3316 D HostConnection: ExtendedRCEncoderContext GL_VERSION return OpenGL ES 3.1 v1.46 +01-16 01:47:49.543 1596 3316 E eglCodecCommon: glUtilsParamSize: unknow param 0x00008c29 +01-16 01:47:49.543 1596 3316 W GLESv2_enc: no support GL_NUM_PROGRAM_BINARY_FORMATS +01-16 01:47:49.549 2360 2554 D EGL_adreno: eglMakeCurrent: 0x7fff6c133700: ver 3 1 (tinfo 0x7fff6c1468e0) +01-16 01:47:49.563 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:49.599 1461 1461 W SurfaceFlinger: couldn't log to binary event log: overflow. +01-16 01:47:49.618 2235 2235 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1531 android.content.ContextWrapper.startService:664 android.content.ContextWrapper.startService:664 com.android.coreservice.CoreBroadcastReceiver.onReceive:53 android.app.ActivityThread.handleReceiver:3424 +01-16 01:47:49.624 1461 1518 W SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{9a9a89d token=Token{9a44b74 ActivityRecord{a60e747 u0 com.cyanogenmod.filemanager.dev/com.cyanogenmod.filemanager.activities.NavigationActivity t12}}}#0 +01-16 01:47:49.632 1461 1461 W SurfaceFlinger: couldn't log to binary event log: overflow. +01-16 01:47:49.672 1596 1604 W System : A resource failed to call close. +01-16 01:47:49.677 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 41 lines +01-16 01:47:49.677 1596 1604 W System : A resource failed to call close. +01-16 01:47:52.964 18112 18138 D EGL_adreno: eglMakeCurrent: 0x7fff6c050620: ver 3 1 (tinfo 0x7fff6c00de40) +01-16 01:47:52.965 1461 1518 D SurfaceFlinger: duplicate layer name: changing Surface(name=78dd093 Toast)/@0x64ef28a - animation-leash to Surface(name=78dd093 Toast)/@0x64ef28a - animation-leash#1 +01-16 01:47:52.966 1596 16953 W NotificationService: Toast already killed. pkg=com.cyanogenmod.filemanager.dev callback=android.app.ITransientNotification$Stub$Proxy@2a6a7a9 +01-16 01:47:53.032 1461 1518 W SurfaceFlinger: Attempting to destroy on removed layer: 78dd093 Toast#0 +01-16 01:47:59.538 2183 2183 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.measurement.START pkg=com.google.android.gms } +01-16 01:48:00.016 1448 1526 D hwcomposer: hw_composer sent 24 syncs in 60s +01-16 01:48:02.803 1477 1477 I storaged: type=1400 audit(0.0:1310): avc: denied { call } for scontext=u:r:storaged:s0 tcontext=u:r:init:s0 tclass=binder permissive=1 +01-16 01:48:02.803 1477 1477 W storaged: type=1300 audit(0.0:1310): arch=c000003e syscall=16 success=yes exit=0 a0=4 a1=c0306201 a2=7ffff739be40 a3=7ffff6e27288 items=0 ppid=1 auid=4294967295 uid=0 gid=1032 euid=0 suid=0 fsuid=0 egid=1032 sgid=1032 fsgid=1032 tty=(none) ses=4294967295 exe="/system/bin/storaged" subj=u:r:storaged:s0 key=(null) +01-16 01:48:02.803 1339 1339 W auditd : type=1327 audit(0.0:1310): proctitle="/system/bin/storaged" +01-16 01:48:02.803 1339 1339 W auditd : type=1320 audit(0.0:1310): +01-16 01:48:02.805 1477 1541 E storaged: getDiskStats failed with result NOT_SUPPORTED and size 0 +01-16 01:48:03.966 1596 1596 W WindowManager: removeWindowToken: Attempted to remove non-existing token: android.os.Binder@5486bf7 +01-16 01:48:12.553 1449 1449 I health@2.0-serv: type=1400 audit(0.0:1311): avc: denied { read } for scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=netlink_kobject_uevent_socket permissive=1 +01-16 01:48:12.553 1449 1449 W health@2.0-serv: type=1300 audit(0.0:1311): arch=c000003e syscall=47 success=yes exit=193 a0=8 a1=7fffffffdf48 a2=0 a3=ffffffff items=0 ppid=1 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=4294967295 exe="/system/vendor/bin/hw/android.hardware.health@2.0-service.default" subj=u:r:init:s0 key=(null) +01-16 01:48:12.553 1339 1339 W auditd : type=1327 audit(0.0:1311): proctitle="/vendor/bin/hw/android.hardware.health@2.0-service.default" +01-16 01:48:12.553 1339 1339 W auditd : type=1320 audit(0.0:1311): +01-16 01:48:14.925 1596 16953 E memtrack: Couldn't load memtrack module +01-16 01:48:14.926 1596 16953 W android.os.Debug: failed to get memory consumption info: -1 +01-16 01:48:28.344 1596 1604 W System : A resource failed to call close. +01-16 01:48:28.345 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 28 lines +01-16 01:48:28.345 1596 1604 W System : A resource failed to call close. +01-16 01:48:32.248 2059 18091 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_HB_ALARM type: 2 triggerAtMillis: 10832332] +01-16 01:48:32.249 2059 18091 W WakeLock: GCM_HB_ALARM release without a matched acquire! [CONTEXT service_id=259 ] +01-16 01:48:32.286 2059 17878 V NativeCrypto: Read error: ssl=0x7fff6c0665c8: I/O error during system call, Connection reset by peer +01-16 01:48:32.308 2059 18091 V NativeCrypto: SSL shutdown failed: ssl=0x7fff6c0665c8: I/O error during system call, Broken pipe +01-16 01:48:32.308 2059 18091 W WakeLock: GCM_HB_ALARM release without a matched acquire! [CONTEXT service_id=259 ] +01-16 01:48:32.308 2059 18091 W WakeLock: GCM_HB_ALARM counter does not exist +01-16 01:48:32.404 2059 17878 I NetworkManagementSocketTagger: tagSocketFd(-1, 1031, -1) failed with errno-9 +01-16 01:48:32.527 2059 18091 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_HB_ALARM type: 2 triggerAtMillis: 10952611] +01-16 01:48:32.573 2059 18091 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_HB_ALARM type: 2 triggerAtMillis: 10952657] +01-16 01:48:32.630 2059 18091 I AlarmManager: setExactAndAllowWhileIdle [name: GCM_HB_ALARM type: 2 triggerAtMillis: 10952713] +01-16 01:48:32.648 1596 1604 W System : A resource failed to call close. +01-16 01:48:32.648 1596 1604 I chatty : uid=1000(system) FinalizerDaemon identical 36 lines +01-16 01:48:32.648 1596 1604 W System : A resource failed to call close. +01-16 01:48:33.238 2059 2059 D BoundBrokerSvc: onRebind: Intent { act=com.google.android.gms.libs.gmscorelogger.service.START dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentDirectBootAwareApiService } diff --git a/res/drawable/ic_launcher_bs_red.xml b/res/drawable/ic_launcher_bs_red.xml new file mode 100644 index 00000000..8da9cf50 --- /dev/null +++ b/res/drawable/ic_launcher_bs_red.xml @@ -0,0 +1,16 @@ + + + + + + diff --git a/res/layout/navigation.xml b/res/layout/navigation.xml index 49d7c7b4..d1d2470d 100644 --- a/res/layout/navigation.xml +++ b/res/layout/navigation.xml @@ -15,8 +15,8 @@ limitations under the License. --> - @@ -78,4 +78,4 @@ - + diff --git a/res/layout/picker.xml b/res/layout/picker.xml index f9ce1b7e..5da44ba7 100644 --- a/res/layout/picker.xml +++ b/res/layout/picker.xml @@ -16,7 +16,7 @@ + xmlns:filemanager="http://schemas.android.com/apk/res-auto"> - File Manager + BSFilemanager A LineageOS file manager diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..e69de29b diff --git a/src/com/cyanogenmod/filemanager/FileManagerApplication.java b/src/com/cyanogenmod/filemanager/FileManagerApplication.java index e3c88d6c..5cc0c466 100644 --- a/src/com/cyanogenmod/filemanager/FileManagerApplication.java +++ b/src/com/cyanogenmod/filemanager/FileManagerApplication.java @@ -54,6 +54,7 @@ /** * A class that wraps the information of the application (constants, * identifiers, statics variables, ...). + * * @hide */ public final class FileManagerApplication extends Application { @@ -67,11 +68,12 @@ public final class FileManagerApplication extends Application { /** * A constant that contains the main process name. + * * @hide */ public static final String MAIN_PROCESS = "com.cyanogenmod.filemanager"; //$NON-NLS-1$ - //Static resources + // Static resources private static FileManagerApplication sApp; private static ConsoleHolder sBackgroundConsole; @@ -87,16 +89,17 @@ public void onReceive(Context context, Intent intent) { FileManagerSettings.INTENT_SETTING_CHANGED) == 0) { // The settings has changed - String key = - intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY); + String key = intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY); if (key != null && - key.compareTo(FileManagerSettings.SETTINGS_SHOW_TRACES.getId()) == 0) { + key.compareTo(FileManagerSettings.SETTINGS_SHOW_TRACES.getId()) == 0) { // The debug traces setting has changed. Notify to consoles Console c = null; try { c = getBackgroundConsole(); - } catch (Exception e) {/**NON BLOCK**/} + } catch (Exception e) { + /** NON BLOCK **/ + } if (c != null) { c.reloadTrace(); } @@ -105,20 +108,23 @@ public void onReceive(Context context, Intent intent) { if (c != null) { c.reloadTrace(); } - } catch (Throwable _throw) {/**NON BLOCK**/} + } catch (Throwable _throw) { + /** NON BLOCK **/ + } } } } } }; - // A broadcast receiver for detect the install/uninstall of apps (for themes, AIDs, ...) + // A broadcast receiver for detect the install/uninstall of apps (for themes, + // AIDs, ...) private final BroadcastReceiver mUninstallReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent != null) { if (intent.getAction().compareTo(Intent.ACTION_PACKAGE_REMOVED) == 0 || - intent.getAction().compareTo(Intent.ACTION_PACKAGE_FULLY_REMOVED) == 0) { + intent.getAction().compareTo(Intent.ACTION_PACKAGE_FULLY_REMOVED) == 0) { // Check that the remove package is not the current theme if (intent.getData() != null) { // --- AIDs @@ -138,8 +144,7 @@ public void onReceive(Context context, Intent intent) { if (currentTheme.getPackage().compareTo(apkPackage) == 0) { // The apk that contains the current theme was remove, change // to default theme - String composedId = - (String)FileManagerSettings.SETTINGS_THEME.getDefaultValue(); + String composedId = (String) FileManagerSettings.SETTINGS_THEME.getDefaultValue(); ThemeManager.setCurrentTheme(getApplicationContext(), composedId); try { Preferences.savePreference( @@ -150,8 +155,7 @@ public void onReceive(Context context, Intent intent) { // Notify the changes to activities try { - Intent broadcastIntent = - new Intent(FileManagerSettings.INTENT_THEME_CHANGED); + Intent broadcastIntent = new Intent(FileManagerSettings.INTENT_THEME_CHANGED); broadcastIntent.putExtra( FileManagerSettings.EXTRA_THEME_ID, composedId); sendBroadcast(broadcastIntent); @@ -168,6 +172,17 @@ public void onReceive(Context context, Intent intent) { } }; + /** + * {@inheritDoc} + */ + /** + * {@inheritDoc} + */ + @Override + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + androidx.multidex.MultiDex.install(this); + } /** * {@inheritDoc} @@ -180,17 +195,17 @@ public void onCreate() { init(); register(); - // Kick off usage by mime type indexing for external storage; most likely use case for + // Kick off usage by mime type indexing for external storage; most likely use + // case for // file manager File externalStorage = Environment.getExternalStorageDirectory(); MimeTypeIndexService.indexFileRoot(this, externalStorage.getAbsolutePath()); MimeTypeIndexService.indexFileRoot(this, Environment.getRootDirectory().getAbsolutePath()); StorageVolume[] storageVolumes = StorageHelper.getStorageVolumes(this, true); for (StorageVolume storageVolume : storageVolumes) { - MimeTypeIndexService.indexFileRoot(this, storageVolume.getPath()); + MimeTypeIndexService.indexFileRoot(this, StorageHelper.getStorageVolumePath(storageVolume)); } - // Schedule in case not scheduled (i.e. never booted with this app on device SecureCacheCleanupService.scheduleCleanup(getApplicationContext()); @@ -207,22 +222,22 @@ public void onTerminate() { try { unregisterReceiver(this.mNotificationReceiver); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } try { unregisterReceiver(this.mUninstallReceiver); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } try { destroyBackgroundConsole(); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } try { ConsoleBuilder.destroyConsole(); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } super.onTerminate(); } @@ -248,7 +263,7 @@ private void register() { * Method that initializes the application. */ private void init() { - //Save the static application reference + // Save the static application reference sApp = this; // Read the system properties @@ -265,21 +280,20 @@ private void init() { // Check optional commands loadOptionalCommands(); - //Sets the default preferences if no value is set yet + // Sets the default preferences if no value is set yet Preferences.loadDefaults(); // Read AIDs AIDHelper.getAIDs(getApplicationContext(), true); // Allocate the default and current themes - String defaultValue = ((String)FileManagerSettings. - SETTINGS_THEME.getDefaultValue()); + String defaultValue = ((String) FileManagerSettings.SETTINGS_THEME.getDefaultValue()); String value = Preferences.getSharedPreferences().getString( FileManagerSettings.SETTINGS_THEME.getId(), defaultValue); ThemeManager.getDefaultTheme(getApplicationContext()); if (!ThemeManager.setCurrentTheme(getApplicationContext(), value)) { - //The current theme was not found. Mark the default setting as default theme + // The current theme was not found. Mark the default setting as default theme ThemeManager.setCurrentTheme(getApplicationContext(), defaultValue); try { Preferences.savePreference( @@ -292,12 +306,12 @@ private void init() { Theme theme = ThemeManager.getCurrentTheme(getApplicationContext()); theme.setBaseTheme(getApplicationContext(), false); - //Create a console for background tasks. Register the virtual console prior to + // Create a console for background tasks. Register the virtual console prior to // the real console so mount point can be listed properly VirtualMountPointConsole.registerVirtualConsoles(getApplicationContext()); allocBackgroundConsole(getApplicationContext()); - //Force the load of mime types + // Force the load of mime types try { MimeTypeHelper.loadMimeTypes(getApplicationContext()); } catch (Exception e) { @@ -372,8 +386,8 @@ public static String getSystemProperty(String property) { */ public static Console getBackgroundConsole() { if (sBackgroundConsole == null || - sBackgroundConsole.getConsole() == null || - !sBackgroundConsole.getConsole().isActive()) { + sBackgroundConsole.getConsole() == null || + !sBackgroundConsole.getConsole().isActive()) { allocBackgroundConsole(getInstance().getApplicationContext()); } @@ -387,7 +401,7 @@ public static void destroyBackgroundConsole() { try { sBackgroundConsole.dispose(); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } } @@ -404,20 +418,19 @@ private static synchronized void allocBackgroundConsole(Context ctx) { sBackgroundConsole = null; } - //Create a console for background tasks + // Create a console for background tasks if (ConsoleBuilder.isPrivileged()) { - sBackgroundConsole = - new ConsoleHolder( - ConsoleBuilder.createPrivilegedConsole(ctx)); + sBackgroundConsole = new ConsoleHolder( + ConsoleBuilder.createPrivilegedConsole(ctx)); } else { - sBackgroundConsole = - new ConsoleHolder( - ConsoleBuilder.createNonPrivilegedConsole(ctx)); + sBackgroundConsole = new ConsoleHolder( + ConsoleBuilder.createNonPrivilegedConsole(ctx)); } } catch (Exception e) { Log.e(TAG, - "Background console creation failed. " + //$NON-NLS-1$ - "This probably will cause a force close.", e); //$NON-NLS-1$ + "Background console creation failed. " + //$NON-NLS-1$ + "This probably will cause a force close.", //$NON-NLS-1$ + e); } } @@ -429,25 +442,28 @@ private static synchronized void allocBackgroundConsole(Context ctx) { public static void changeBackgroundConsoleToPriviligedConsole() throws ConsoleAllocException { if (sBackgroundConsole == null || - !(sBackgroundConsole.getConsole() instanceof PrivilegedConsole)) { + !(sBackgroundConsole.getConsole() instanceof PrivilegedConsole)) { try { if (sBackgroundConsole != null) { sBackgroundConsole.dispose(); } - } catch (Throwable ex) {/**NON BLOCK**/} + } catch (Throwable ex) { + /** NON BLOCK **/ + } // Change the privileged console try { - sBackgroundConsole = - new ConsoleHolder( - ConsoleBuilder.createPrivilegedConsole( - getInstance().getApplicationContext())); + sBackgroundConsole = new ConsoleHolder( + ConsoleBuilder.createPrivilegedConsole( + getInstance().getApplicationContext())); } catch (Exception e) { try { if (sBackgroundConsole != null) { sBackgroundConsole.dispose(); } - } catch (Throwable ex) {/**NON BLOCK**/} + } catch (Throwable ex) { + /** NON BLOCK **/ + } sBackgroundConsole = null; throw new ConsoleAllocException( "Failed to alloc background console", e); //$NON-NLS-1$ @@ -464,12 +480,10 @@ public static AccessMode getAccessMode() { if (!sHasShellCommands) { return AccessMode.SAFE; } - String defaultValue = - ((ObjectStringIdentifier)FileManagerSettings. - SETTINGS_ACCESS_MODE.getDefaultValue()).getId(); + String defaultValue = ((ObjectStringIdentifier) FileManagerSettings.SETTINGS_ACCESS_MODE.getDefaultValue()) + .getId(); String id = FileManagerSettings.SETTINGS_ACCESS_MODE.getId(); - AccessMode mode = - AccessMode.fromId(Preferences.getSharedPreferences().getString(id, defaultValue)); + AccessMode mode = AccessMode.fromId(Preferences.getSharedPreferences().getString(id, defaultValue)); return mode; } @@ -477,8 +491,7 @@ public static boolean isRestrictSecondaryUsersAccess(Context context) { String value = Preferences.getWorldReadableProperties( context, FileManagerSettings.SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS.getId()); if (value == null) { - value = String.valueOf(FileManagerSettings.SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS. - getDefaultValue()); + value = String.valueOf(FileManagerSettings.SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS.getDefaultValue()); } return Boolean.parseBoolean(value); } @@ -513,8 +526,7 @@ public static boolean checkRestrictSecondaryUsersAccess(Context context, boolean */ private static void readSystemProperties() { try { - String propsFile = - getInstance().getApplicationContext().getString(R.string.system_props_file); + String propsFile = getInstance().getApplicationContext().getString(R.string.system_props_file); Properties props = new Properties(); props.load(new FileInputStream(new File(propsFile))); sSystemProperties = props; @@ -535,13 +547,14 @@ private boolean areShellCommandsPresent() { String[] commands = shellCommands.split(","); //$NON-NLS-1$ int cc = commands.length; if (cc == 0) { - //??? + // ??? Log.w(TAG, "No shell commands."); //$NON-NLS-1$ return false; } for (int i = 0; i < cc; i++) { String c = commands[i].trim(); - if (c.length() == 0) continue; + if (c.length() == 0) + continue; File cmd = new File(c); if (!cmd.exists() || !cmd.isFile()) { Log.w(TAG, @@ -603,8 +616,9 @@ private void loadOptionalCommands() { for (int i = 0; i < cc; i++) { String c = commands[i].trim(); String key = c.substring(0, c.indexOf("=")).trim(); //$NON-NLS-1$ - c = c.substring(c.indexOf("=")+1).trim(); //$NON-NLS-1$ - if (c.length() == 0) continue; + c = c.substring(c.indexOf("=") + 1).trim(); //$NON-NLS-1$ + if (c.length() == 0) + continue; File cmd = new File(c); Boolean found = Boolean.valueOf(cmd.exists() && cmd.isFile()); sOptionalCommandsMap.put(key, found); diff --git a/src/com/cyanogenmod/filemanager/activities/EditorActivity.java b/src/com/cyanogenmod/filemanager/activities/EditorActivity.java index 7436fd6b..4678ef5f 100644 --- a/src/com/cyanogenmod/filemanager/activities/EditorActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/EditorActivity.java @@ -55,7 +55,7 @@ import android.widget.TextView.BufferType; import android.widget.Toast; -import com.android.internal.util.HexDump; +import com.cyanogenmod.filemanager.util.HexDump; import com.cyanogenmod.filemanager.R; import com.cyanogenmod.filemanager.activities.preferences.EditorPreferenceFragment; import com.cyanogenmod.filemanager.activities.preferences.EditorSHColorSchemePreferenceFragment; diff --git a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java index 8e32f5cb..100d3309 100755 --- a/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/NavigationActivity.java @@ -46,8 +46,8 @@ import android.os.Parcelable; import android.os.storage.StorageVolume; import android.provider.Settings; -import android.support.v4.app.ActionBarDrawerToggle; -import android.support.v4.widget.DrawerLayout; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.drawerlayout.widget.DrawerLayout; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; @@ -71,7 +71,7 @@ import android.widget.Toolbar; import android.widget.ArrayAdapter; -import com.android.internal.util.XmlUtils; +import com.cyanogenmod.filemanager.util.XmlUtils; import com.cyanogenmod.filemanager.FileManagerApplication; import com.cyanogenmod.filemanager.R; import com.cyanogenmod.filemanager.activities.preferences.SettingsPreferences; @@ -125,7 +125,7 @@ import com.cyanogenmod.filemanager.util.MimeTypeHelper.MimeTypeCategory; import com.cyanogenmod.filemanager.util.MountPointHelper; import com.cyanogenmod.filemanager.util.StorageHelper; -import com.cyngn.uicommon.view.Snackbar; +import com.google.android.material.snackbar.Snackbar; import java.io.File; import java.io.FileNotFoundException; @@ -141,18 +141,23 @@ /** * The main navigation activity. This activity is the center of the application. * From this the user can navigate, search, make actions.
- * This activity is singleTop, so when it is displayed no other activities exists in + * This activity is singleTop, so when it is displayed no other activities + * exists in * the stack.
- * This cause an issue with the saved instance of this class, because if another activity - * is displayed, and the process is killed, NavigationActivity is started and the saved + * This cause an issue with the saved instance of this class, because if another + * activity + * is displayed, and the process is killed, NavigationActivity is started and + * the saved * instance gets corrupted.
- * For this reason the methods {link {@link Activity#onSaveInstanceState(Bundle)} and - * {@link Activity#onRestoreInstanceState(Bundle)} are not implemented, and every time + * For this reason the methods {link + * {@link Activity#onSaveInstanceState(Bundle)} and + * {@link Activity#onRestoreInstanceState(Bundle)} are not implemented, and + * every time * the app is killed, is restarted from his initial state. */ public class NavigationActivity extends Activity - implements OnHistoryListener, OnRequestRefreshListener, - OnNavigationRequestMenuListener, OnNavigationSelectionChangedListener { + implements OnHistoryListener, OnRequestRefreshListener, + OnNavigationRequestMenuListener, OnNavigationSelectionChangedListener { private static final String TAG = "NavigationActivity"; //$NON-NLS-1$ @@ -177,33 +182,28 @@ public class NavigationActivity extends Activity /** * Constant for extra information about selected search entry. */ - public static final String EXTRA_SEARCH_ENTRY_SELECTION = - "extra_search_entry_selection"; //$NON-NLS-1$ + public static final String EXTRA_SEARCH_ENTRY_SELECTION = "extra_search_entry_selection"; //$NON-NLS-1$ /** * Constant for extra information about last search data. */ - public static final String EXTRA_SEARCH_LAST_SEARCH_DATA = - "extra_search_last_search_data"; //$NON-NLS-1$ + public static final String EXTRA_SEARCH_LAST_SEARCH_DATA = "extra_search_last_search_data"; //$NON-NLS-1$ /** * Constant for extra information for request a navigation to the passed path. */ - public static final String EXTRA_NAVIGATE_TO = - "extra_navigate_to"; //$NON-NLS-1$ + public static final String EXTRA_NAVIGATE_TO = "extra_navigate_to"; //$NON-NLS-1$ /** * Constant for extra information for request to add navigation to the history */ - public static final String EXTRA_ADD_TO_HISTORY = - "extra_add_to_history"; //$NON-NLS-1$ + public static final String EXTRA_ADD_TO_HISTORY = "extra_add_to_history"; //$NON-NLS-1$ // The timeout needed to reset the exit status for back button // After this time user need to tap 2 times the back button to // exit, and the toast is shown again after the first tap. private static final int RELEASE_EXIT_CHECK_TIMEOUT = 3500; - private Toolbar mToolBar; private SearchView mSearchView; private NavigationCustomTitleView mCustomTitleView; @@ -220,55 +220,45 @@ public void onReceive(Context context, Intent intent) { String key = intent.getStringExtra(FileManagerSettings.EXTRA_SETTING_CHANGED_KEY); if (key != null) { // Disk usage warning level - if (key.compareTo(FileManagerSettings. - SETTINGS_DISK_USAGE_WARNING_LEVEL.getId()) == 0) { + if (key.compareTo(FileManagerSettings.SETTINGS_DISK_USAGE_WARNING_LEVEL.getId()) == 0) { // Set the free disk space warning level of the breadcrumb widget Breadcrumb breadcrumb = getCurrentNavigationView().getBreadcrumb(); String fds = Preferences.getSharedPreferences().getString( FileManagerSettings.SETTINGS_DISK_USAGE_WARNING_LEVEL.getId(), - (String)FileManagerSettings. - SETTINGS_DISK_USAGE_WARNING_LEVEL.getDefaultValue()); + (String) FileManagerSettings.SETTINGS_DISK_USAGE_WARNING_LEVEL.getDefaultValue()); breadcrumb.setFreeDiskSpaceWarningLevel(Integer.parseInt(fds)); breadcrumb.updateMountPointInfo(); return; } // Case sensitive sort - if (key.compareTo(FileManagerSettings. - SETTINGS_CASE_SENSITIVE_SORT.getId()) == 0) { + if (key.compareTo(FileManagerSettings.SETTINGS_CASE_SENSITIVE_SORT.getId()) == 0) { getCurrentNavigationView().refresh(); return; } // Display thumbs - if (key.compareTo(FileManagerSettings. - SETTINGS_DISPLAY_THUMBS.getId()) == 0) { + if (key.compareTo(FileManagerSettings.SETTINGS_DISPLAY_THUMBS.getId()) == 0) { // Clean the icon cache applying the current theme applyTheme(); return; } // Use flinger - if (key.compareTo(FileManagerSettings. - SETTINGS_USE_FLINGER.getId()) == 0) { - boolean useFlinger = - Preferences.getSharedPreferences().getBoolean( - FileManagerSettings.SETTINGS_USE_FLINGER.getId(), - ((Boolean)FileManagerSettings. - SETTINGS_USE_FLINGER. - getDefaultValue()).booleanValue()); + if (key.compareTo(FileManagerSettings.SETTINGS_USE_FLINGER.getId()) == 0) { + boolean useFlinger = Preferences.getSharedPreferences().getBoolean( + FileManagerSettings.SETTINGS_USE_FLINGER.getId(), + ((Boolean) FileManagerSettings.SETTINGS_USE_FLINGER.getDefaultValue()) + .booleanValue()); getCurrentNavigationView().setUseFlinger(useFlinger); return; } // Access mode - if (key.compareTo(FileManagerSettings. - SETTINGS_ACCESS_MODE.getId()) == 0) { + if (key.compareTo(FileManagerSettings.SETTINGS_ACCESS_MODE.getId()) == 0) { // Is it necessary to create or exit of the ChRooted? - boolean chRooted = - FileManagerApplication. - getAccessMode().compareTo(AccessMode.SAFE) == 0; + boolean chRooted = FileManagerApplication.getAccessMode().compareTo(AccessMode.SAFE) == 0; if (chRooted != NavigationActivity.this.mChRooted) { if (chRooted) { createChRooted(); @@ -279,8 +269,7 @@ public void onReceive(Context context, Intent intent) { } // Restricted access - if (key.compareTo(FileManagerSettings. - SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS.getId()) == 0) { + if (key.compareTo(FileManagerSettings.SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS.getId()) == 0) { if (AndroidHelper.isSecondaryUser(context)) { try { Preferences.savePreference( @@ -295,8 +284,7 @@ public void onReceive(Context context, Intent intent) { } // Filetime format mode - if (key.compareTo(FileManagerSettings. - SETTINGS_FILETIME_FORMAT_MODE.getId()) == 0) { + if (key.compareTo(FileManagerSettings.SETTINGS_FILETIME_FORMAT_MODE.getId()) == 0) { // Refresh the data synchronized (FileHelper.DATETIME_SYNC) { FileHelper.sReloadDateTimeFormats = true; @@ -308,8 +296,7 @@ public void onReceive(Context context, Intent intent) { } else if (intent.getAction().compareTo( FileManagerSettings.INTENT_FILE_CHANGED) == 0) { // Retrieve the file that was changed - String file = - intent.getStringExtra(FileManagerSettings.EXTRA_FILE_CHANGED_KEY); + String file = intent.getStringExtra(FileManagerSettings.EXTRA_FILE_CHANGED_KEY); try { FileSystemObject fso = CommandHelper.getFileInfo(context, file, null); if (fso != null) { @@ -324,9 +311,9 @@ public void onReceive(Context context, Intent intent) { applyTheme(); } else if (intent.getAction().compareTo(Intent.ACTION_TIME_CHANGED) == 0 || - intent.getAction().compareTo(Intent.ACTION_DATE_CHANGED) == 0 || - intent.getAction().compareTo(Intent.ACTION_TIMEZONE_CHANGED) == 0 || - intent.getAction().compareTo(Intent.ACTION_LOCALE_CHANGED) == 0) { + intent.getAction().compareTo(Intent.ACTION_DATE_CHANGED) == 0 || + intent.getAction().compareTo(Intent.ACTION_TIMEZONE_CHANGED) == 0 || + intent.getAction().compareTo(Intent.ACTION_LOCALE_CHANGED) == 0) { // Refresh the data synchronized (FileHelper.DATETIME_SYNC) { FileHelper.sReloadDateTimeFormats = true; @@ -334,8 +321,8 @@ public void onReceive(Context context, Intent intent) { } } else if (intent.getAction().compareTo( FileManagerSettings.INTENT_MOUNT_STATUS_CHANGED) == 0 || - intent.getAction().equals(Intent.ACTION_MEDIA_MOUNTED) || - intent.getAction().equals(Intent.ACTION_MEDIA_UNMOUNTED)) { + intent.getAction().equals(Intent.ACTION_MEDIA_MOUNTED) || + intent.getAction().equals(Intent.ACTION_MEDIA_UNMOUNTED)) { MountPointHelper.refreshMountPoints( FileManagerApplication.getBackgroundConsole()); onRequestBookmarksRefresh(); @@ -422,8 +409,7 @@ public void onClick(View v) { /** * @hide */ - static Map EASY_MODE_ICONS = new - HashMap(); + static Map EASY_MODE_ICONS = new HashMap(); /** * @hide @@ -512,6 +498,7 @@ public void onClick(View view) { private AsyncTask mHistoryTask; private static final int REQUEST_CODE_STORAGE_PERMS = 321; + private boolean hasPermissions() { int res = checkCallingOrSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE); return (res == PackageManager.PERMISSION_GRANTED); @@ -549,31 +536,33 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, final ViewGroup viewGroup = (ViewGroup) ((ViewGroup) this .findViewById(android.R.id.content)).getChildAt(0); if (viewGroup != null) { - Snackbar snackbar = Snackbar.make(viewGroup, text, - Snackbar.LENGTH_INDEFINITE, 3); + com.google.android.material.snackbar.Snackbar snackbar = com.google.android.material.snackbar.Snackbar + .make(viewGroup, text, + com.google.android.material.snackbar.Snackbar.LENGTH_INDEFINITE); snackbar.setAction(android.R.string.ok, new OnClickListener() { @Override public void onClick(View v) { - requestNecessaryPermissions(); + snackbar.dismiss(); } }); snackbar.show(); } } else { - StringBuilder builder = new StringBuilder(getString(R.string - .storage_permissions_denied)); + StringBuilder builder = new StringBuilder(getString(R.string.storage_permissions_denied)); builder.append("\n\n"); builder.append(getString(R.string.storage_permissions_explanation)); final ViewGroup viewGroup = (ViewGroup) ((ViewGroup) this .findViewById(android.R.id.content)).getChildAt(0); if (viewGroup != null) { - Snackbar snackbar = Snackbar.make(viewGroup, builder.toString(), - Snackbar.LENGTH_INDEFINITE, 7); + com.google.android.material.snackbar.Snackbar snackbar = com.google.android.material.snackbar.Snackbar + .make(viewGroup, builder.toString(), + com.google.android.material.snackbar.Snackbar.LENGTH_INDEFINITE); snackbar.setAction(R.string.snackbar_settings, new OnClickListener() { @Override public void onClick(View v) { - startInstalledAppDetailsActivity(NavigationActivity.this); - finish(); + snackbar.dismiss(); + startActivity(new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, + Uri.fromParts("package", getPackageName(), null))); //$NON-NLS-1$ } }); snackbar.show(); @@ -619,22 +608,21 @@ private void finishOnCreate() { newFilter.addDataScheme(ContentResolver.SCHEME_FILE); registerReceiver(mNotificationReceiver, newFilter); - //the input manager service + // the input manager service mImm = (InputMethodManager) this.getSystemService( Context.INPUT_METHOD_SERVICE); - //Initialize nfc adapter + // Initialize nfc adapter NfcAdapter mNfcAdapter = NfcAdapter.getDefaultAdapter(this); if (mNfcAdapter != null) { mNfcAdapter.setBeamPushUrisCallback(new NfcAdapter.CreateBeamUrisCallback() { @Override public Uri[] createBeamUris(NfcEvent event) { - List selectedFiles = - getCurrentNavigationView().getSelectedFiles(); + List selectedFiles = getCurrentNavigationView().getSelectedFiles(); if (selectedFiles.size() > 0) { List fileUri = new ArrayList(); for (FileSystemObject f : selectedFiles) { - //Beam ignores folders and system files + // Beam ignores folders and system files if (!FileHelper.isDirectory(f) && !FileHelper.isSystemFile(f)) { fileUri.add(Uri.fromFile(new File(f.getFullPath()))); } @@ -648,10 +636,10 @@ public Uri[] createBeamUris(NfcEvent event) { }, this); } - //Initialize activity + // Initialize activity init(); - //Navigation views + // Navigation views initNavigationViews(); // As we're using a Toolbar, we should retrieve it and set it @@ -659,7 +647,7 @@ public Uri[] createBeamUris(NfcEvent event) { mToolBar = (Toolbar) findViewById(R.id.material_toolbar); setActionBar(mToolBar); - //Initialize action bars + // Initialize action bars initTitleActionBar(); initStatusActionBar(); initSelectionBar(); @@ -689,32 +677,25 @@ public void run() { // Initialize console initConsole(); - //Initialize navigation + // Initialize navigation int cc = NavigationActivity.this.mNavigationViews.length; for (int i = 0; i < cc; i++) { initNavigation(i, false, getIntent()); } - //Check the intent action + // Check the intent action checkIntent(getIntent()); } }); - MIME_TYPE_LOCALIZED_NAMES = MimeTypeCategory.getFriendlyLocalizedNames(NavigationActivity - .this); + MIME_TYPE_LOCALIZED_NAMES = MimeTypeCategory.getFriendlyLocalizedNames(NavigationActivity.this); - EASY_MODE_ICONS.put(MimeTypeCategory.NONE, getResources().getDrawable(R.drawable - .ic_em_all)); - EASY_MODE_ICONS.put(MimeTypeCategory.IMAGE, getResources().getDrawable(R.drawable - .ic_em_image)); - EASY_MODE_ICONS.put(MimeTypeCategory.VIDEO, getResources().getDrawable(R.drawable - .ic_em_video)); - EASY_MODE_ICONS.put(MimeTypeCategory.AUDIO, getResources().getDrawable(R.drawable - .ic_em_music)); - EASY_MODE_ICONS.put(MimeTypeCategory.DOCUMENT, getResources().getDrawable(R.drawable - .ic_em_document)); - EASY_MODE_ICONS.put(MimeTypeCategory.APP, getResources().getDrawable(R.drawable - .ic_em_application)); + EASY_MODE_ICONS.put(MimeTypeCategory.NONE, getResources().getDrawable(R.drawable.ic_em_all)); + EASY_MODE_ICONS.put(MimeTypeCategory.IMAGE, getResources().getDrawable(R.drawable.ic_em_image)); + EASY_MODE_ICONS.put(MimeTypeCategory.VIDEO, getResources().getDrawable(R.drawable.ic_em_video)); + EASY_MODE_ICONS.put(MimeTypeCategory.AUDIO, getResources().getDrawable(R.drawable.ic_em_music)); + EASY_MODE_ICONS.put(MimeTypeCategory.DOCUMENT, getResources().getDrawable(R.drawable.ic_em_document)); + EASY_MODE_ICONS.put(MimeTypeCategory.APP, getResources().getDrawable(R.drawable.ic_em_application)); } @@ -728,14 +709,14 @@ protected void onCreate(Bundle state) { Log.d(TAG, "NavigationActivity.onCreate"); //$NON-NLS-1$ } - // Set the theme before setContentView + // Set the theme before setContentView Theme theme = ThemeManager.getCurrentTheme(this); theme.setBaseThemeNoActionBar(this); - //Set the main layout of the activity + // Set the main layout of the activity setContentView(R.layout.navigation); - //Save state + // Save state super.onCreate(state); if (!hasPermissions()) { @@ -789,18 +770,26 @@ protected void onPostCreate(Bundle savedInstanceState) { */ @Override protected void onNewIntent(Intent intent) { + setIntent(intent); + + // If we differ from the search action, we probably want to navigate. + // Reset the search flag so initNavigation accepts the request. + if (Intent.ACTION_VIEW.equals(intent.getAction()) || intent.hasExtra(EXTRA_NAVIGATE_TO)) { + mDisplayingSearchResults = false; + } + // If no directory specified, restore current directory final String navigateTo = intent.getStringExtra(EXTRA_NAVIGATE_TO); - final boolean restore = TextUtils.isEmpty(navigateTo); + final boolean restore = TextUtils.isEmpty(navigateTo) && intent.getData() == null; - //Initialize navigation + // Initialize navigation if (!hasPermissions()) { requestNecessaryPermissions(); } else { initNavigation(this.mCurrentNavigationView, restore, intent); } - //Check the intent action + // Check the intent action checkIntent(intent); } @@ -812,7 +801,7 @@ public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (hasPermissions()) { onLayoutChanged(); - if (mDrawerToggle != null ) { + if (mDrawerToggle != null) { mDrawerToggle.onConfigurationChanged(newConfig); } } @@ -831,7 +820,7 @@ public void onConfigurationChanged(Configuration newConfig) { @Override public boolean onOptionsItemSelected(MenuItem item) { if (mDrawerToggle.onOptionsItemSelected(item)) { - return true; + return true; } if (mNeedsEasyMode) { @@ -863,11 +852,11 @@ protected void onDestroy() { try { unregisterReceiver(this.mNotificationReceiver); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } recycle(); - //All destroy. Continue + // All destroy. Continue super.onDestroy(); } @@ -887,7 +876,8 @@ public NavigationView getCurrentNavigationView() { * @return NavigationView The current navigation view */ public NavigationView getNavigationView(int viewId) { - if (this.mNavigationViews == null) return null; + if (this.mNavigationViews == null) + return null; return this.mNavigationViews[viewId]; } @@ -907,9 +897,9 @@ private void init() { private void showWelcomeMsg() { boolean firstUse = Preferences.getSharedPreferences().getBoolean( FileManagerSettings.SETTINGS_FIRST_USE.getId(), - ((Boolean)FileManagerSettings.SETTINGS_FIRST_USE.getDefaultValue()).booleanValue()); + ((Boolean) FileManagerSettings.SETTINGS_FIRST_USE.getDefaultValue()).booleanValue()); - //Display the welcome message? + // Display the welcome message? if (firstUse && FileManagerApplication.hasShellCommands()) { // open navigation drawer to show user that it exists mDrawerLayout.openDrawer(Gravity.START); @@ -923,7 +913,9 @@ private void showWelcomeMsg() { try { Preferences.savePreference( FileManagerSettings.SETTINGS_FIRST_USE, Boolean.FALSE, true); - } catch (Exception e) {/**NON BLOCK**/} + } catch (Exception e) { + /** NON BLOCK **/ + } } } @@ -931,13 +923,13 @@ private void showWelcomeMsg() { * Method that initializes the titlebar of the activity. */ private void initTitleActionBar() { - //Inflate the view and associate breadcrumb + // Inflate the view and associate breadcrumb View titleLayout = getLayoutInflater().inflate( R.layout.navigation_view_customtitle, null, false); - NavigationCustomTitleView title = - (NavigationCustomTitleView)titleLayout.findViewById(R.id.navigation_title_flipper); + NavigationCustomTitleView title = (NavigationCustomTitleView) titleLayout + .findViewById(R.id.navigation_title_flipper); title.setOnHistoryListener(this); - Breadcrumb breadcrumb = (Breadcrumb)title.findViewById(R.id.breadcrumb_view); + Breadcrumb breadcrumb = (Breadcrumb) title.findViewById(R.id.breadcrumb_view); int cc = this.mNavigationViews.length; for (int i = 0; i < cc; i++) { this.mNavigationViews[i].setBreadcrumb(breadcrumb); @@ -950,10 +942,10 @@ private void initTitleActionBar() { // Set the free disk space warning level of the breadcrumb widget String fds = Preferences.getSharedPreferences().getString( FileManagerSettings.SETTINGS_DISK_USAGE_WARNING_LEVEL.getId(), - (String)FileManagerSettings.SETTINGS_DISK_USAGE_WARNING_LEVEL.getDefaultValue()); + (String) FileManagerSettings.SETTINGS_DISK_USAGE_WARNING_LEVEL.getDefaultValue()); breadcrumb.setFreeDiskSpaceWarningLevel(Integer.parseInt(fds)); - //Configure the action bar options + // Configure the action bar options getActionBar().setBackgroundDrawable( getResources().getDrawable(R.drawable.bg_material_titlebar)); mToolBar.addView(titleLayout); @@ -963,24 +955,24 @@ private void initTitleActionBar() { * Method that initializes the statusbar of the activity. */ private void initStatusActionBar() { - //Performs a width calculation of buttons. Buttons exceeds the width - //of the action bar should be hidden - //This application not use android ActionBar because the application - //make uses of the title and bottom areas, and wants to force to show - //the overflow button (without care of physical buttons) - this.mActionBar = (ViewGroup)findViewById(R.id.navigation_actionbar); + // Performs a width calculation of buttons. Buttons exceeds the width + // of the action bar should be hidden + // This application not use android ActionBar because the application + // make uses of the title and bottom areas, and wants to force to show + // the overflow button (without care of physical buttons) + this.mActionBar = (ViewGroup) findViewById(R.id.navigation_actionbar); this.mActionBar.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @Override public void onLayoutChange( View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { - //Get the width of the action bar + // Get the width of the action bar int w = v.getMeasuredWidth(); - //Wake through children calculation his dimensions - int bw = (int)getResources().getDimension(R.dimen.default_buttom_width); + // Wake through children calculation his dimensions + int bw = (int) getResources().getDimension(R.dimen.default_buttom_width); int cw = 0; - final ViewGroup abView = ((ViewGroup)v); + final ViewGroup abView = ((ViewGroup) v); int cc = abView.getChildCount(); for (int i = 0; i < cc; i++) { View child = abView.getChildAt(i); @@ -1004,7 +996,7 @@ public void onLayoutChange( * Method that initializes the selectionbar of the activity. */ private void initSelectionBar() { - this.mSelectionBar = (SelectionView)findViewById(R.id.navigation_selectionbar); + this.mSelectionBar = (SelectionView) findViewById(R.id.navigation_selectionbar); } /** @@ -1012,7 +1004,7 @@ private void initSelectionBar() { */ private void initDrawer() { mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); - //Set our status bar color + // Set our status bar color mDrawerLayout.setStatusBarBackgroundColor(R.color.material_palette_blue_primary_dark); mDrawer = (ViewGroup) findViewById(R.id.drawer); mDrawerBookmarks = (LinearLayout) findViewById(R.id.bookmarks_list); @@ -1040,7 +1032,6 @@ private void initDrawer() { // Set the navigation drawer "hamburger" icon mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, - R.drawable.ic_material_light_navigation_drawer, R.string.drawer_open, R.string.drawer_close) { /** Called when a drawer has settled in a completely closed state. */ @@ -1063,7 +1054,7 @@ public void onDrawerOpened(View drawerView) { /*** * Method that do something when the DrawerLayout opened. */ - private void onDrawerLayoutOpened(View drawerView){ + private void onDrawerLayoutOpened(View drawerView) { if (mSearchView != null && mSearchView.getVisibility() == View.VISIBLE) { closeSearch(); hideSoftInput(drawerView); @@ -1073,8 +1064,8 @@ private void onDrawerLayoutOpened(View drawerView){ /** * Method that hide the software when the software showing. * - * */ - private void hideSoftInput(View view){ + */ + private void hideSoftInput(View view) { if (mImm != null) { mImm.hideSoftInputFromWindow(view.getWindowToken(), 0); } @@ -1207,8 +1198,7 @@ private void addBookmarkToDrawer(Bookmark bookmark) { action = iconholder.getDrawable("ic_edit_home_bookmark_drawable"); //$NON-NLS-1$ actionCd = getApplicationContext().getString( R.string.bookmarks_button_config_cd); - } - else if (bookmark.mType.compareTo(BOOKMARK_TYPE.USER_DEFINED) == 0) { + } else if (bookmark.mType.compareTo(BOOKMARK_TYPE.USER_DEFINED) == 0) { action = iconholder.getDrawable("ic_close_drawable"); //$NON-NLS-1$ actionCd = getApplicationContext().getString( R.string.bookmarks_button_remove_bookmark_cd); @@ -1282,8 +1272,7 @@ public void onClick(View v) { performShowBackArrow(!mDrawerToggle.isDrawerIndicatorEnabled()); getCurrentNavigationView().open(fso); mDrawerLayout.closeDrawer(Gravity.START); - } - else { + } else { // The bookmark does not exist, delete the user-defined // bookmark try { @@ -1292,12 +1281,10 @@ public void onClick(View v) { // reset bookmarks list to default initBookmarks(); - } - catch (Exception ex) { + } catch (Exception ex) { } } - } - catch (Exception e) { // Capture the exception + } catch (Exception e) { // Capture the exception ExceptionUtil .translateException(NavigationActivity.this, e); if (e instanceof NoSuchFileOrDirectory @@ -1310,8 +1297,7 @@ public void onClick(View v) { // reset bookmarks list to default initBookmarks(); - } - catch (Exception ex) { + } catch (Exception ex) { } } return; @@ -1344,8 +1330,7 @@ protected Boolean doInBackground(Void... params) { mBookmarks = loadBookmarks(); return Boolean.TRUE; - } - catch (Exception e) { + } catch (Exception e) { this.mCause = e; return Boolean.FALSE; } @@ -1364,8 +1349,7 @@ protected void onPostExecute(Boolean result) { for (Bookmark bookmark : mBookmarks) { addBookmarkToDrawer(bookmark); } - } - else { + } else { if (this.mCause != null) { ExceptionUtil.translateException( NavigationActivity.this, this.mCause); @@ -1401,8 +1385,7 @@ protected Boolean doInBackground(Void... params) { try { loadHistory(); return Boolean.TRUE; - } - catch (Exception e) { + } catch (Exception e) { this.mCause = e; return Boolean.FALSE; } @@ -1506,16 +1489,14 @@ private List loadFilesystemBookmarks() { try { name = getString(parser.getAttributeResourceValue( R.styleable.Bookmark_name, 0)); - } - catch (Exception e) { + } catch (Exception e) { /** NON BLOCK **/ } try { directory = getString(parser .getAttributeResourceValue( R.styleable.Bookmark_directory, 0)); - } - catch (Exception e) { + } catch (Exception e) { /** NON BLOCK **/ } if (directory == null) { @@ -1533,12 +1514,10 @@ private List loadFilesystemBookmarks() { // Return the bookmarks return bookmarks; - } - finally { + } finally { parser.close(); } - } - catch (Throwable ex) { + } catch (Throwable ex) { Log.e(TAG, "Load filesystem bookmarks failed", ex); //$NON-NLS-1$ } @@ -1560,13 +1539,13 @@ private List loadSdStorageBookmarks() { // Recovery sdcards from storage manager StorageVolume[] volumes = StorageHelper .getStorageVolumes(getApplication(), true); - for (StorageVolume volume: volumes) { + for (StorageVolume volume : volumes) { if (volume != null) { String mountedState = volume.getState(); - String path = volume.getPath(); + String path = StorageHelper.getStorageVolumePath(volume); if (!Environment.MEDIA_MOUNTED.equalsIgnoreCase(mountedState) && !Environment.MEDIA_MOUNTED_READ_ONLY.equalsIgnoreCase(mountedState)) { - Log.w(TAG, "Ignoring '" + path + "' with state of '"+ mountedState + "'"); + Log.w(TAG, "Ignoring '" + path + "' with state of '" + mountedState + "'"); continue; } if (!TextUtils.isEmpty(path)) { @@ -1586,8 +1565,7 @@ private List loadSdStorageBookmarks() { // Return the bookmarks return bookmarks; - } - catch (Throwable ex) { + } catch (Throwable ex) { Log.e(TAG, "Load filesystem bookmarks failed", ex); //$NON-NLS-1$ } @@ -1638,17 +1616,14 @@ private List loadUserBookmarks() { continue; } bookmarks.add(bm); - } - while (cursor.moveToNext()); + } while (cursor.moveToNext()); } - } - finally { + } finally { try { if (cursor != null) { cursor.close(); } - } - catch (Exception e) { + } catch (Exception e) { /** NON BLOCK **/ } } @@ -1656,8 +1631,7 @@ private List loadUserBookmarks() { // Remove bookmarks from virtual storage if the filesystem is not mount int c = bookmarks.size() - 1; for (int i = c; i >= 0; i--) { - VirtualMountPointConsole vc = - VirtualMountPointConsole.getVirtualConsoleForPath(bookmarks.get(i).mPath); + VirtualMountPointConsole vc = VirtualMountPointConsole.getVirtualConsoleForPath(bookmarks.get(i).mPath); if (vc != null && !vc.isMounted()) { bookmarks.remove(i); } @@ -1753,19 +1727,19 @@ private boolean shouldAddHistory(HistoryNavigable historyItem) { * Method that initializes the navigation views of the activity */ private void initNavigationViews() { - //Get the navigation views (wishlist: multiple view; for now only one view) + // Get the navigation views (wishlist: multiple view; for now only one view) this.mNavigationViews = new NavigationView[1]; this.mCurrentNavigationView = 0; - //- 0 - this.mNavigationViews[0] = (NavigationView)findViewById(R.id.navigation_view); + // - 0 + this.mNavigationViews[0] = (NavigationView) findViewById(R.id.navigation_view); this.mNavigationViews[0].setId(0); this.mEasyModeListView = (ListView) findViewById(R.id.lv_easy_mode); - mEasyModeAdapter = new ArrayAdapter(this, R.layout - .navigation_view_simple_item) { + mEasyModeAdapter = new ArrayAdapter(this, R.layout.navigation_view_simple_item) { @Override public View getView(int position, View convertView, ViewGroup parent) { - convertView = (convertView == null) ?getLayoutInflater().inflate(R.layout - .navigation_view_simple_item, parent, false) : convertView; + convertView = (convertView == null) + ? getLayoutInflater().inflate(R.layout.navigation_view_simple_item, parent, false) + : convertView; MimeTypeCategory item = getItem(position); String typeTitle = MIME_TYPE_LOCALIZED_NAMES[item.ordinal()]; TextView typeTitleTV = (TextView) convertView @@ -1793,7 +1767,8 @@ private void onClicked(int position) { intent.putExtra(SearchManager.QUERY, "*"); // Use wild-card '*' if (position == 0) { - // the user has selected all items, they want to see their folders so let's do that. + // the user has selected all items, they want to see their folders so let's do + // that. performHideEasyMode(); performShowBackArrow(true); return; @@ -1802,7 +1777,8 @@ private void onClicked(int position) { ArrayList searchCategories = new ArrayList(); MimeTypeCategory selectedCategory = EASY_MODE_LIST.get(position); searchCategories.add(selectedCategory); - // a one off case where we implicitly want to also search for TEXT mimetypes when the + // a one off case where we implicitly want to also search for TEXT mimetypes + // when the // DOCUMENTS category is selected if (selectedCategory == MimeTypeCategory.DOCUMENT) { searchCategories.add(MimeTypeCategory.TEXT); @@ -1815,10 +1791,11 @@ private void onClicked(int position) { /** * Method that initialize the console + * * @hide */ void initConsole() { - //Create the default console (from the preferences) + // Create the default console (from the preferences) try { Console console = ConsoleBuilder.getConsole(NavigationActivity.this); if (console == null) { @@ -1826,7 +1803,7 @@ void initConsole() { } } catch (Throwable ex) { if (!NavigationActivity.this.mChRooted) { - //Show exception and exit + // Show exception and exit Log.e(TAG, getString(R.string.msgs_cant_create_console), ex); // We don't have any console // Show exception and exit @@ -1848,9 +1825,9 @@ void initConsole() { /** * Method that initializes the navigation. * - * @param viewId The navigation view identifier where apply the navigation + * @param viewId The navigation view identifier where apply the navigation * @param restore Initialize from a restore info - * @param intent The current intent + * @param intent The current intent * @hide */ void initNavigation(final int viewId, final boolean restore, final Intent intent) { @@ -1862,7 +1839,7 @@ void initNavigation(final int viewId, final boolean restore, final Intent intent this.mHandler.post(new Runnable() { @Override public void run() { - //Is necessary navigate? + // Is necessary navigate? applyInitialDir(navigationView, intent); } }); @@ -1872,16 +1849,14 @@ public void run() { * Method that applies the user-defined initial directory * * @param navigationView The navigation view - * @param intent The current intent + * @param intent The current intent * @hide */ void applyInitialDir(final NavigationView navigationView, final Intent intent) { - //Load the user-defined initial directory - String initialDir = - Preferences.getSharedPreferences().getString( - FileManagerSettings.SETTINGS_INITIAL_DIR.getId(), - (String)FileManagerSettings. - SETTINGS_INITIAL_DIR.getDefaultValue()); + // Load the user-defined initial directory + String initialDir = Preferences.getSharedPreferences().getString( + FileManagerSettings.SETTINGS_INITIAL_DIR.getId(), + (String) FileManagerSettings.SETTINGS_INITIAL_DIR.getDefaultValue()); // Check if request navigation to directory (use as default), and // ensure chrooted and absolute path @@ -1897,6 +1872,15 @@ void applyInitialDir(final NavigationView navigationView, final Intent intent) { File path = new File(data.getPath()); if (path.isDirectory()) { initialDir = path.getAbsolutePath(); + + // Automatically set as home if it's a resource/folder + if ("resource/folder".equals(intent.getType())) { + try { + Preferences.savePreference(FileManagerSettings.SETTINGS_INITIAL_DIR, initialDir, true); + } catch (Exception ex) { + Log.e(TAG, "Failed to auto-save home directory", ex); + } + } } } } @@ -1904,7 +1888,8 @@ void applyInitialDir(final NavigationView navigationView, final Intent intent) { // Add to history final boolean addToHistory = intent.getBooleanExtra(EXTRA_ADD_TO_HISTORY, true); - // We cannot navigate to a secure console if it is unmounted. So go to root in that case + // We cannot navigate to a secure console if it is unmounted. So go to root in + // that case VirtualConsole vc = VirtualMountPointConsole.getVirtualConsoleForPath(initialDir); if (vc != null && vc instanceof SecureConsole && !((SecureConsole) vc).isMounted()) { initialDir = FileHelper.ROOT_DIRECTORY; @@ -1913,19 +1898,18 @@ void applyInitialDir(final NavigationView navigationView, final Intent intent) { if (this.mChRooted) { // Initial directory is the first external sdcard (sdcard, emmc, usb, ...) if (!StorageHelper.isPathInStorageVolume(initialDir)) { - StorageVolume[] volumes = - StorageHelper.getStorageVolumes(this, false); + StorageVolume[] volumes = StorageHelper.getStorageVolumes(this, false); if (volumes != null && volumes.length > 0) { - initialDir = volumes[0].getPath(); + initialDir = StorageHelper.getStorageVolumePath(volumes[0]); int count = volumes.length; for (int i = 0; i < count; i++) { StorageVolume volume = volumes[i]; if (Environment.MEDIA_MOUNTED.equalsIgnoreCase(volume.getState())) { - initialDir = volume.getPath(); + initialDir = StorageHelper.getStorageVolumePath(volume); break; } } - //Ensure that initial directory is an absolute directory + // Ensure that initial directory is an absolute directory initialDir = FileHelper.getAbsPath(initialDir); } else { // Show exception and exit @@ -1937,7 +1921,7 @@ void applyInitialDir(final NavigationView navigationView, final Intent intent) { } } } else { - //Ensure that initial directory is an absolute directory + // Ensure that initial directory is an absolute directory final String userInitialDir = initialDir; initialDir = FileHelper.getAbsPath(initialDir); final String absInitialDir = initialDir; @@ -1950,23 +1934,25 @@ void applyInitialDir(final NavigationView navigationView, final Intent intent) { } catch (InsufficientPermissionsException ipex) { ExceptionUtil.translateException( this, ipex, false, true, new OnRelaunchCommandResult() { - @Override - public void onSuccess() { - navigationView.changeCurrentDir(absInitialDir, addToHistory); - } - @Override - public void onFailed(Throwable cause) { - showInitialInvalidDirectoryMsg(userInitialDir); - navigationView.changeCurrentDir(FileHelper.ROOT_DIRECTORY, - addToHistory); - } - @Override - public void onCancelled() { - showInitialInvalidDirectoryMsg(userInitialDir); - navigationView.changeCurrentDir(FileHelper.ROOT_DIRECTORY, - addToHistory); - } - }); + @Override + public void onSuccess() { + navigationView.changeCurrentDir(absInitialDir, addToHistory); + } + + @Override + public void onFailed(Throwable cause) { + showInitialInvalidDirectoryMsg(userInitialDir); + navigationView.changeCurrentDir(FileHelper.ROOT_DIRECTORY, + addToHistory); + } + + @Override + public void onCancelled() { + showInitialInvalidDirectoryMsg(userInitialDir); + navigationView.changeCurrentDir(FileHelper.ROOT_DIRECTORY, + addToHistory); + } + }); // Asynchronous mode return; @@ -1986,8 +1972,8 @@ public void onCancelled() { } boolean needsEasyMode = false; - if (mSdBookmarks != null ) { - for (Bookmark bookmark :mSdBookmarks) { + if (mSdBookmarks != null) { + for (Bookmark bookmark : mSdBookmarks) { if (bookmark.mPath.equalsIgnoreCase(initialDir)) { needsEasyMode = true; break; @@ -2031,28 +2017,28 @@ void showInitialInvalidDirectoryMsg(String initialDir) { * @hide */ void checkIntent(Intent intent) { - //Search action + // Search action if (Intent.ACTION_SEARCH.equals(intent.getAction())) { Intent searchIntent = new Intent(this, SearchActivity.class); searchIntent.setAction(Intent.ACTION_SEARCH); - //- SearchActivity.EXTRA_SEARCH_DIRECTORY + // - SearchActivity.EXTRA_SEARCH_DIRECTORY searchIntent.putExtra( SearchActivity.EXTRA_SEARCH_DIRECTORY, getCurrentNavigationView().getCurrentDir()); - //- SearchManager.APP_DATA + // - SearchManager.APP_DATA if (intent.getBundleExtra(SearchManager.APP_DATA) != null) { Bundle bundle = new Bundle(); bundle.putAll(intent.getBundleExtra(SearchManager.APP_DATA)); searchIntent.putExtra(SearchManager.APP_DATA, bundle); } - //-- SearchManager.QUERY + // -- SearchManager.QUERY String query = intent.getStringExtra(SearchManager.QUERY); if (query != null) { searchIntent.putExtra(SearchManager.QUERY, query); } - //- android.speech.RecognizerIntent.EXTRA_RESULTS - ArrayList extraResults = - intent.getStringArrayListExtra(android.speech.RecognizerIntent.EXTRA_RESULTS); + // - android.speech.RecognizerIntent.EXTRA_RESULTS + ArrayList extraResults = intent + .getStringArrayListExtra(android.speech.RecognizerIntent.EXTRA_RESULTS); if (extraResults != null) { searchIntent.putStringArrayListExtra( android.speech.RecognizerIntent.EXTRA_RESULTS, extraResults); @@ -2060,6 +2046,34 @@ void checkIntent(Intent intent) { startActivityForResult(searchIntent, INTENT_REQUEST_SEARCH); return; } + + // Set home directory action + if (FileManagerSettings.INTENT_SET_HOME.equals(intent.getAction())) { + String path = null; + Uri data = intent.getData(); + if (data != null) { + path = data.getPath(); + } + if (path == null) { + path = intent.getStringExtra(EXTRA_NAVIGATE_TO); + } + + if (path != null) { + File f = new File(path); + if (f.exists() && f.isDirectory()) { + try { + Preferences.savePreference(FileManagerSettings.SETTINGS_INITIAL_DIR, f.getAbsolutePath(), true); + DialogHelper.showToast(this, "Home directory saved", Toast.LENGTH_SHORT); + } catch (Exception ex) { + DialogHelper.showToast(this, "Failed to save home directory", Toast.LENGTH_SHORT); + Log.e(TAG, "Failed to save home directory", ex); + } + } else { + DialogHelper.showToast(this, "Directory does not exist", Toast.LENGTH_SHORT); + } + } + return; + } } /** @@ -2109,71 +2123,71 @@ public void onBackPressed() { */ public void onActionBarItemClick(View view) { switch (view.getId()) { - //###################### - //Navigation Custom Title - //###################### + // ###################### + // Navigation Custom Title + // ###################### case R.id.ab_configuration: - //Show navigation view configuration toolbar + // Show navigation view configuration toolbar getCurrentNavigationView().getCustomTitle().showConfigurationView(); break; case R.id.ab_close: - //Hide navigation view configuration toolbar + // Hide navigation view configuration toolbar getCurrentNavigationView().getCustomTitle().hideConfigurationView(); break; - //###################### - //Breadcrumb Actions - //###################### + // ###################### + // Breadcrumb Actions + // ###################### case R.id.ab_filesystem_info: - //Show information of the filesystem + // Show information of the filesystem MountPoint mp = getCurrentNavigationView().getBreadcrumb().getMountPointInfo(); DiskUsage du = getCurrentNavigationView().getBreadcrumb().getDiskUsageInfo(); showMountPointInfo(mp, du); break; - //###################### - //Navigation view options - //###################### + // ###################### + // Navigation view options + // ###################### case R.id.ab_sort_mode: showSettingsPopUp(view, Arrays.asList( - new FileManagerSettings[]{ - FileManagerSettings.SETTINGS_SORT_MODE})); + new FileManagerSettings[] { + FileManagerSettings.SETTINGS_SORT_MODE })); break; case R.id.ab_layout_mode: showSettingsPopUp(view, Arrays.asList( - new FileManagerSettings[]{ - FileManagerSettings.SETTINGS_LAYOUT_MODE})); + new FileManagerSettings[] { + FileManagerSettings.SETTINGS_LAYOUT_MODE })); break; case R.id.ab_view_options: // If we are in ChRooted mode, then don't show non-secure items if (this.mChRooted) { showSettingsPopUp(view, - Arrays.asList(new FileManagerSettings[]{ - FileManagerSettings.SETTINGS_SHOW_DIRS_FIRST})); + Arrays.asList(new FileManagerSettings[] { + FileManagerSettings.SETTINGS_SHOW_DIRS_FIRST })); } else { showSettingsPopUp(view, - Arrays.asList(new FileManagerSettings[]{ + Arrays.asList(new FileManagerSettings[] { FileManagerSettings.SETTINGS_SHOW_DIRS_FIRST, FileManagerSettings.SETTINGS_SHOW_HIDDEN, FileManagerSettings.SETTINGS_SHOW_SYSTEM, - FileManagerSettings.SETTINGS_SHOW_SYMLINKS})); + FileManagerSettings.SETTINGS_SHOW_SYMLINKS })); } break; - //###################### - //Selection Actions - //###################### + // ###################### + // Selection Actions + // ###################### case R.id.ab_selection_done: - //Show information of the filesystem + // Show information of the filesystem getCurrentNavigationView().onDeselectAll(); break; - //###################### - //Action Bar buttons - //###################### + // ###################### + // Action Bar buttons + // ###################### case R.id.ab_actions: openActionsDialog(getCurrentNavigationView().getCurrentDir(), true); @@ -2205,25 +2219,23 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case INTENT_REQUEST_SEARCH: if (resultCode == RESULT_OK) { - //Change directory? + // Change directory? Bundle bundle = data.getExtras(); if (bundle != null) { FileSystemObject fso = (FileSystemObject) bundle.getSerializable( EXTRA_SEARCH_ENTRY_SELECTION); - SearchInfoParcelable searchInfo = - bundle.getParcelable(EXTRA_SEARCH_LAST_SEARCH_DATA); + SearchInfoParcelable searchInfo = bundle.getParcelable(EXTRA_SEARCH_LAST_SEARCH_DATA); if (fso != null) { - //Goto to new directory + // Goto to new directory getCurrentNavigationView().open(fso, searchInfo); performHideEasyMode(); mDisplayingSearchResults = true; } } } else if (resultCode == RESULT_CANCELED) { - SearchInfoParcelable searchInfo = - data.getParcelableExtra(EXTRA_SEARCH_LAST_SEARCH_DATA); + SearchInfoParcelable searchInfo = data.getParcelableExtra(EXTRA_SEARCH_LAST_SEARCH_DATA); if (searchInfo != null && searchInfo.isSuccessNavigation()) { - //Navigate to previous history + // Navigate to previous history back(); } else { // I don't know is the search view was changed, so try to do a refresh @@ -2247,7 +2259,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { */ @Override public void onNewHistory(HistoryNavigable navigable) { - //Recollect information about current status + // Recollect information about current status History history = new History(this.mHistory.size(), navigable); this.mHistory.add(history); if (!shouldAddHistory(navigable)) { @@ -2274,7 +2286,7 @@ public void onCheckHistory() { public void onRequestRefresh(Object o, boolean clearSelection) { if (o instanceof FileSystemObject) { // Refresh only the item - this.getCurrentNavigationView().refresh((FileSystemObject)o); + this.getCurrentNavigationView().refresh((FileSystemObject) o); } else if (o == null) { // Refresh all getCurrentNavigationView().refresh(); @@ -2304,10 +2316,10 @@ public void onRequestBookmarksRefresh() { public void onRequestRemove(Object o, boolean clearSelection) { if (o instanceof FileSystemObject) { // Remove from view - this.getCurrentNavigationView().removeItem((FileSystemObject)o); + this.getCurrentNavigationView().removeItem((FileSystemObject) o); - //Remove from history - removeFromHistory((FileSystemObject)o); + // Remove from history + removeFromHistory((FileSystemObject) o); } else { onRequestRefresh(null, clearSelection); } @@ -2325,7 +2337,7 @@ public void onNavigateTo(Object o) { } @Override - public void onCancel(){ + public void onCancel() { // nop } @@ -2347,34 +2359,34 @@ public void onRequestMenu(NavigationView navView, FileSystemObject item) { } /** - * Method that shows a popup with a menu associated a {@link FileManagerSettings}. + * Method that shows a popup with a menu associated a + * {@link FileManagerSettings}. * - * @param anchor The action button that was pressed + * @param anchor The action button that was pressed * @param settings The array of settings associated with the action button */ private void showSettingsPopUp(View anchor, List settings) { - //Create the adapter + // Create the adapter final MenuSettingsAdapter adapter = new MenuSettingsAdapter(this, settings); - //Create a show the popup menu + // Create a show the popup menu mPopupWindow = DialogHelper.createListPopupWindow(this, adapter, anchor); mPopupWindow.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View v, int position, long id) { - FileManagerSettings setting = - ((MenuSettingsAdapter)parent.getAdapter()).getSetting(position); - final int value = ((MenuSettingsAdapter)parent.getAdapter()).getId(position); + FileManagerSettings setting = ((MenuSettingsAdapter) parent.getAdapter()).getSetting(position); + final int value = ((MenuSettingsAdapter) parent.getAdapter()).getId(position); mPopupWindow.dismiss(); mPopupWindow = null; try { if (setting.compareTo(FileManagerSettings.SETTINGS_LAYOUT_MODE) == 0) { - //Need to change the layout + // Need to change the layout getCurrentNavigationView().changeViewMode( NavigationLayoutMode.fromId(value)); } else { - //Save and refresh + // Save and refresh if (setting.getDefaultValue() instanceof Enum) { - //Enumeration + // Enumeration Preferences.savePreference(setting, new ObjectIdentifier() { @Override public int getId() { @@ -2382,12 +2394,10 @@ public int getId() { } }, false); } else { - //Boolean - boolean newval = - Preferences.getSharedPreferences(). - getBoolean( - setting.getId(), - ((Boolean)setting.getDefaultValue()).booleanValue()); + // Boolean + boolean newval = Preferences.getSharedPreferences().getBoolean( + setting.getId(), + ((Boolean) setting.getDefaultValue()).booleanValue()); Preferences.savePreference(setting, Boolean.valueOf(!newval), false); } getCurrentNavigationView().refresh(); @@ -2427,24 +2437,23 @@ public void onDismiss() { * @param du The disk usage of the mount point */ private void showMountPointInfo(MountPoint mp, DiskUsage du) { - //Has mount point info? + // Has mount point info? if (mp == null) { - //There is no information - AlertDialog alert = - DialogHelper.createWarningDialog( - this, - R.string.filesystem_info_warning_title, - R.string.filesystem_info_warning_msg); + // There is no information + AlertDialog alert = DialogHelper.createWarningDialog( + this, + R.string.filesystem_info_warning_title, + R.string.filesystem_info_warning_msg); DialogHelper.delegateDialogShow(this, alert); return; } - //Show a the filesystem info dialog + // Show a the filesystem info dialog FilesystemInfoDialog dialog = new FilesystemInfoDialog(this, mp, du); dialog.setOnMountListener(new OnMountListener() { @Override public void onRemount(MountPoint mountPoint) { - //Update the statistics of breadcrumb, only if mount point is the same + // Update the statistics of breadcrumb, only if mount point is the same Breadcrumb breadcrumb = getCurrentNavigationView().getBreadcrumb(); if (breadcrumb.getMountPointInfo().compareTo(mountPoint) == 0) { breadcrumb.updateMountPointInfo(); @@ -2469,20 +2478,21 @@ public void onRemount(MountPoint mountPoint) { */ private boolean checkBackAction() { // We need a basic structure to check this - if (getCurrentNavigationView() == null) return false; + if (getCurrentNavigationView() == null) + return false; if (mSearchView.getVisibility() == View.VISIBLE) { closeSearch(); } - //Check if the configuration view is showing. In this case back - //action must be "close configuration" + // Check if the configuration view is showing. In this case back + // action must be "close configuration" if (getCurrentNavigationView().getCustomTitle().isConfigurationViewShowing()) { getCurrentNavigationView().getCustomTitle().restoreView(); return true; } - //Do back operation over the navigation history + // Do back operation over the navigation history boolean flag = this.mExitFlag; this.mExitFlag = !back(); @@ -2490,11 +2500,11 @@ private boolean checkBackAction() { // Retrieve if the exit status timeout has expired long now = System.currentTimeMillis(); boolean timeout = (this.mExitBackTimeout == -1 || - (now - this.mExitBackTimeout) > RELEASE_EXIT_CHECK_TIMEOUT); + (now - this.mExitBackTimeout) > RELEASE_EXIT_CHECK_TIMEOUT); - //Check if there no history and if the user was advised in the last back action + // Check if there no history and if the user was advised in the last back action if (this.mExitFlag && (this.mExitFlag != flag || timeout)) { - //Communicate the user that the next time the application will be closed + // Communicate the user that the next time the application will be closed this.mExitBackTimeout = System.currentTimeMillis(); DialogHelper.showToast(this, R.string.msgs_push_again_to_exit, Toast.LENGTH_SHORT); if (mNeedsEasyMode) { @@ -2504,7 +2514,7 @@ private boolean checkBackAction() { } } - //Back action not applied + // Back action not applied return !this.mExitFlag; } @@ -2535,14 +2545,14 @@ private void clearHistory() { /** * Method that navigates to the passed history reference. * - * @param history The history reference + * @param history The history reference * @param isFromSavedHistory Whether this is called by saved history item * @return boolean A problem occurs while navigate */ public synchronized boolean navigateToHistory( History history, boolean isFromSavedHistory) { try { - //Gets the history + // Gets the history final History realHistory; if (isFromSavedHistory) { realHistory = mHistorySaved.get(history.getPosition()); @@ -2550,11 +2560,10 @@ public synchronized boolean navigateToHistory( realHistory = mHistory.get(history.getPosition()); } - //Navigate to item. Check what kind of history is + // Navigate to item. Check what kind of history is if (realHistory.getItem() instanceof NavigationViewInfoParcelable) { - //Navigation - NavigationViewInfoParcelable info = - (NavigationViewInfoParcelable)realHistory.getItem(); + // Navigation + NavigationViewInfoParcelable info = (NavigationViewInfoParcelable) realHistory.getItem(); int viewId = info.getId(); NavigationView view = getNavigationView(viewId); // Selected items must not be restored from on history navigation @@ -2564,11 +2573,11 @@ public synchronized boolean navigateToHistory( } } else if (realHistory.getItem() instanceof SearchInfoParcelable) { - //Search (open search with the search results) - SearchInfoParcelable info = (SearchInfoParcelable)realHistory.getItem(); + // Search (open search with the search results) + SearchInfoParcelable info = (SearchInfoParcelable) realHistory.getItem(); Intent searchIntent = new Intent(this, SearchActivity.class); searchIntent.setAction(SearchActivity.ACTION_RESTORE); - searchIntent.putExtra(SearchActivity.EXTRA_SEARCH_RESTORE, (Parcelable)info); + searchIntent.putExtra(SearchActivity.EXTRA_SEARCH_RESTORE, (Parcelable) info); startActivityForResult(searchIntent, INTENT_REQUEST_SEARCH); } else if (realHistory.getItem() instanceof HistoryItem) { final String path = realHistory.getItem().getDescription(); @@ -2582,11 +2591,11 @@ public synchronized boolean navigateToHistory( mDrawerLayout.closeDrawer(Gravity.START); } } else { - //The type is unknown + // The type is unknown throw new IllegalArgumentException("Unknown history type"); //$NON-NLS-1$ } - //Remove the old history + // Remove the old history int cc = realHistory.getPosition(); for (int i = this.mHistory.size() - 1; i >= cc; i--) { this.mHistory.remove(i); @@ -2596,9 +2605,8 @@ public synchronized boolean navigateToHistory( mDrawerHistoryEmpty.setVisibility(View.VISIBLE); } - //Navigate - final boolean clearHistory = - mHistoryTab.isSelected() && mHistorySaved.size() > 0; + // Navigate + final boolean clearHistory = mHistoryTab.isSelected() && mHistorySaved.size() > 0; mClearHistory.setVisibility(clearHistory ? View.VISIBLE : View.GONE); return true; @@ -2607,7 +2615,8 @@ public synchronized boolean navigateToHistory( Log.e(TAG, String.format("Failed to navigate to history %d: %s", //$NON-NLS-1$ Integer.valueOf(history.getPosition()), - history.getItem().getTitle()), ex); + history.getItem().getTitle()), + ex); } else { Log.e(TAG, String.format("Failed to navigate to history: null", ex)); //$NON-NLS-1$ @@ -2621,7 +2630,7 @@ public void run() { } }); - //Not change directory + // Not change directory return false; } } @@ -2637,7 +2646,7 @@ public boolean back() { History h = this.mHistory.get(this.mHistory.size() - 1); if (h.getItem() instanceof NavigationViewInfoParcelable) { // Verify that the path exists - String path = ((NavigationViewInfoParcelable)h.getItem()).getCurrentDir(); + String path = ((NavigationViewInfoParcelable) h.getItem()).getCurrentDir(); try { FileSystemObject info = CommandHelper.getFileInfo(this, path, null); @@ -2654,12 +2663,12 @@ public boolean back() { } } - //Navigate to history + // Navigate to history if (this.mHistory.size() > 0) { return navigateToHistory(mHistory.get(mHistory.size() - 1), false); } - //Nothing to apply + // Nothing to apply mClearHistory.setVisibility(View.GONE); return false; } @@ -2689,12 +2698,14 @@ private void openActionsDialog(String path, boolean global) { /** * Method that opens the actions dialog * - * @param item The path or the {@link FileSystemObject} + * @param item The path or the {@link FileSystemObject} * @param global If the menu to display is the one with global actions */ private void openActionsDialog(FileSystemObject item, boolean global) { - // We used to refresh the item reference here, but the access to the SecureConsole is synchronized, - // which can/will cause on ANR in certain scenarios. We don't care if it doesn't exist anymore really + // We used to refresh the item reference here, but the access to the + // SecureConsole is synchronized, + // which can/will cause on ANR in certain scenarios. We don't care if it doesn't + // exist anymore really // For this to work, SecureConsole NEEDS to be refactored. // Show the dialog @@ -2741,7 +2752,7 @@ void openSettings() { private void removeFromHistory(FileSystemObject fso) { if (this.mHistory != null) { int cc = this.mHistory.size() - 1; - for (int i = cc; i >= 0 ; i--) { + for (int i = cc; i >= 0; i--) { History history = this.mHistory.get(i); if (history.getItem() instanceof NavigationViewInfoParcelable) { String p0 = fso.getFullPath(); @@ -2763,7 +2774,7 @@ private void removeFromHistory(FileSystemObject fso) { */ private void updateHistoryPositions() { int cc = this.mHistory.size() - 1; - for (int i = 0; i <= cc ; i++) { + for (int i = 0; i <= cc; i++) { History history = this.mHistory.get(i); history.setPosition(i + 1); } @@ -2771,12 +2782,12 @@ private void updateHistoryPositions() { /** * Method that ask the user to change the access mode prior to crash. + * * @hide */ void askOrExit() { - //Show a dialog asking the user - AlertDialog dialog = - DialogHelper.createYesNoDialog( + // Show a dialog asking the user + AlertDialog dialog = DialogHelper.createYesNoDialog( this, R.string.msgs_change_to_prompt_access_mode_title, R.string.msgs_change_to_prompt_access_mode_msg, @@ -2813,18 +2824,21 @@ public void onClick(DialogInterface alertDialog, int which) { exit(); } } - }); + }); DialogHelper.delegateDialogShow(this, dialog); } /** - * Method that creates a ChRooted environment, protecting the user to break anything in + * Method that creates a ChRooted environment, protecting the user to break + * anything in * the device + * * @hide */ void createChRooted() { // If we are in a ChRooted mode, then do nothing - if (this.mChRooted) return; + if (this.mChRooted) + return; this.mChRooted = true; int cc = this.mNavigationViews.length; @@ -2844,11 +2858,13 @@ void createChRooted() { /** * Method that exits from a ChRooted + * * @hide */ void exitChRooted() { // If we aren't in a ChRooted mode, then do nothing - if (!this.mChRooted) return; + if (!this.mChRooted) + return; this.mChRooted = false; int cc = this.mNavigationViews.length; @@ -2859,6 +2875,7 @@ void exitChRooted() { /** * Method called when a controlled exit is required + * * @hide */ void exit() { @@ -2876,17 +2893,18 @@ private void recycle() { try { FileManagerApplication.destroyBackgroundConsole(); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } try { ConsoleBuilder.destroyConsole(); } catch (Throwable ex) { - /**NON BLOCK**/ + /** NON BLOCK **/ } } /** - * Method that reconfigures the layout for better fit in portrait and landscape modes + * Method that reconfigures the layout for better fit in portrait and landscape + * modes */ private void onLayoutChanged() { Theme theme = ThemeManager.getCurrentTheme(this); @@ -2894,7 +2912,8 @@ private void onLayoutChanged() { // Apply only when the orientation was changed int orientation = getResources().getConfiguration().orientation; - if (this.mOrientation == orientation) return; + if (this.mOrientation == orientation) + return; this.mOrientation = orientation; // imitate a closed drawer while layout is rebuilt to avoid NullPointerException @@ -2904,14 +2923,14 @@ private void onLayoutChanged() { if (this.mOrientation == Configuration.ORIENTATION_LANDSCAPE) { // Landscape mode - ViewGroup statusBar = (ViewGroup)findViewById(R.id.navigation_statusbar); + ViewGroup statusBar = (ViewGroup) findViewById(R.id.navigation_statusbar); if (statusBar.getParent() != null) { ViewGroup parent = (ViewGroup) statusBar.getParent(); parent.removeView(statusBar); } // Calculate the action button size (all the buttons must fit in the title bar) - int bw = (int)getResources().getDimension(R.dimen.default_buttom_width); + int bw = (int) getResources().getDimension(R.dimen.default_buttom_width); int abw = this.mActionBar.getChildCount() * bw; int rbw = 0; int cc = statusBar.getChildCount(); @@ -2925,11 +2944,10 @@ private void onLayoutChanged() { int w = abw + rbw - bw; // Add to the new location - ViewGroup newParent = (ViewGroup)findViewById(R.id.navigation_title_landscape_holder); - LinearLayout.LayoutParams params = - new LinearLayout.LayoutParams( - w, - ViewGroup.LayoutParams.MATCH_PARENT); + ViewGroup newParent = (ViewGroup) findViewById(R.id.navigation_title_landscape_holder); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( + w, + ViewGroup.LayoutParams.MATCH_PARENT); statusBar.setLayoutParams(params); newParent.addView(statusBar); @@ -2942,19 +2960,18 @@ private void onLayoutChanged() { } else { // Portrait mode - ViewGroup statusBar = (ViewGroup)findViewById(R.id.navigation_statusbar); + ViewGroup statusBar = (ViewGroup) findViewById(R.id.navigation_statusbar); if (statusBar.getParent() != null) { ViewGroup parent = (ViewGroup) statusBar.getParent(); parent.removeView(statusBar); } // Add to the new location - ViewGroup newParent = (ViewGroup)findViewById( + ViewGroup newParent = (ViewGroup) findViewById( R.id.navigation_statusbar_portrait_holder); - LinearLayout.LayoutParams params = - new LinearLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT); statusBar.setLayoutParams(params); newParent.addView(statusBar); @@ -2972,18 +2989,17 @@ private void onLayoutChanged() { } /** - * Method that removes all the history items that refers to virtual unmounted filesystems + * Method that removes all the history items that refers to virtual unmounted + * filesystems */ private void removeUnmountedHistory() { int cc = mHistory.size() - 1; for (int i = cc; i >= 0; i--) { History history = mHistory.get(i); if (history.getItem() instanceof NavigationViewInfoParcelable) { - NavigationViewInfoParcelable navigableInfo = - ((NavigationViewInfoParcelable) history.getItem()); - VirtualMountPointConsole vc = - VirtualMountPointConsole.getVirtualConsoleForPath( - navigableInfo.getCurrentDir()); + NavigationViewInfoParcelable navigableInfo = ((NavigationViewInfoParcelable) history.getItem()); + VirtualMountPointConsole vc = VirtualMountPointConsole.getVirtualConsoleForPath( + navigableInfo.getCurrentDir()); if (vc != null && !vc.isMounted()) { mHistory.remove(i); mDrawerHistory.removeViewAt(mDrawerHistory.getChildCount() - i - 1); @@ -2996,7 +3012,8 @@ private void removeUnmountedHistory() { } /** - * Method that removes all the selection items that refers to virtual unmounted filesystems + * Method that removes all the selection items that refers to virtual unmounted + * filesystems */ private void removeUnmountedSelection() { for (NavigationView view : mNavigationViews) { @@ -3007,6 +3024,7 @@ private void removeUnmountedSelection() { /** * Method that applies the current theme to the activity + * * @hide */ void applyTheme() { @@ -3021,11 +3039,11 @@ void applyTheme() { mDrawerLayout.closeDrawer(Gravity.START); } - //- Layout + // - Layout View v = findViewById(R.id.navigation_layout); theme.setBackgroundDrawable(this, v, "background_drawable"); //$NON-NLS-1$ - //- ActionBar + // - ActionBar theme.setTitlebarDrawable(this, getActionBar(), "titlebar_drawable"); //$NON-NLS-1$ // Hackery to theme search view @@ -3056,7 +3074,7 @@ void applyTheme() { mCustomTitleView = (NavigationCustomTitleView) findViewById(R.id.navigation_title_flipper); mCustomTitleView.setVisibility(View.VISIBLE); - //- StatusBar + // - StatusBar v = findViewById(R.id.navigation_statusbar); if (orientation == Configuration.ORIENTATION_LANDSCAPE) { theme.setBackgroundDrawable(this, v, "titlebar_drawable"); //$NON-NLS-1$ @@ -3064,46 +3082,46 @@ void applyTheme() { theme.setBackgroundDrawable(this, v, "statusbar_drawable"); //$NON-NLS-1$ } v = findViewById(R.id.ab_overflow); - theme.setImageDrawable(this, (ImageView)v, "ab_overflow_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_overflow_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_actions); - theme.setImageDrawable(this, (ImageView)v, "ab_actions_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_actions_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_search); - theme.setImageDrawable(this, (ImageView)v, "ab_search_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_search_drawable"); //$NON-NLS-1$ - //- Expanders + // - Expanders v = findViewById(R.id.ab_configuration); - theme.setImageDrawable(this, (ImageView)v, "expander_open_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "expander_open_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_close); - theme.setImageDrawable(this, (ImageView)v, "expander_close_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "expander_close_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_sort_mode); - theme.setImageDrawable(this, (ImageView)v, "ab_sort_mode_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_sort_mode_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_layout_mode); - theme.setImageDrawable(this, (ImageView)v, "ab_layout_mode_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_layout_mode_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_view_options); - theme.setImageDrawable(this, (ImageView)v, "ab_view_options_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_view_options_drawable"); //$NON-NLS-1$ - //- SelectionBar + // - SelectionBar v = findViewById(R.id.navigation_selectionbar); theme.setBackgroundDrawable(this, v, "selectionbar_drawable"); //$NON-NLS-1$ v = findViewById(R.id.ab_selection_done); - theme.setImageDrawable(this, (ImageView)v, "ab_selection_done_drawable"); //$NON-NLS-1$ + theme.setImageDrawable(this, (ImageView) v, "ab_selection_done_drawable"); //$NON-NLS-1$ v = findViewById(R.id.navigation_status_selection_label); - theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$ + theme.setTextColor(this, (TextView) v, "text_color"); //$NON-NLS-1$ // - Navigation drawer v = findViewById(R.id.history_empty); - theme.setTextColor(this, (TextView)v, "text_color"); //$NON-NLS-1$ + theme.setTextColor(this, (TextView) v, "text_color"); //$NON-NLS-1$ - for (int i=0; i parent, View v, int position, long id) { popup.dismiss(); if (volumes != null) { PickerActivity.this. - mNavigationView.changeCurrentDir(volumes[position].getPath()); + mNavigationView.changeCurrentDir(StorageHelper.getStorageVolumePath(volumes[position])); } } }); diff --git a/src/com/cyanogenmod/filemanager/activities/SearchActivity.java b/src/com/cyanogenmod/filemanager/activities/SearchActivity.java index a5d9cc4a..a6df81a2 100755 --- a/src/com/cyanogenmod/filemanager/activities/SearchActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/SearchActivity.java @@ -1497,7 +1497,7 @@ protected List doInBackground(MimeTypeCategory... params) { @Override protected void onPostExecute(List results) { - if (!isResumed()) { + if (SearchActivity.this.isFinishing() || SearchActivity.this.isDestroyed()) { return; } mAdapterList.clear(); diff --git a/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java b/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java index 79d7c011..837f68f7 100644 --- a/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java +++ b/src/com/cyanogenmod/filemanager/adapters/SimpleMenuListAdapter.java @@ -27,7 +27,7 @@ import android.widget.ImageView; import android.widget.TextView; -import com.android.internal.view.menu.MenuBuilder; +import androidx.appcompat.view.menu.MenuBuilder; import com.cyanogenmod.filemanager.R; import com.cyanogenmod.filemanager.ui.ThemeManager; import com.cyanogenmod.filemanager.ui.ThemeManager.Theme; diff --git a/src/com/cyanogenmod/filemanager/commands/java/ChecksumCommand.java b/src/com/cyanogenmod/filemanager/commands/java/ChecksumCommand.java index ffd04f1c..2159028f 100644 --- a/src/com/cyanogenmod/filemanager/commands/java/ChecksumCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/java/ChecksumCommand.java @@ -18,7 +18,7 @@ import android.util.Log; -import com.android.internal.util.HexDump; +import com.cyanogenmod.filemanager.util.HexDump; import com.cyanogenmod.filemanager.commands.AsyncResultListener; import com.cyanogenmod.filemanager.commands.ChecksumExecutable; import com.cyanogenmod.filemanager.console.ExecutionException; diff --git a/src/com/cyanogenmod/filemanager/commands/secure/ChecksumCommand.java b/src/com/cyanogenmod/filemanager/commands/secure/ChecksumCommand.java index 39e623bb..6a1f12d0 100644 --- a/src/com/cyanogenmod/filemanager/commands/secure/ChecksumCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/secure/ChecksumCommand.java @@ -18,7 +18,7 @@ import android.util.Log; -import com.android.internal.util.HexDump; +import com.cyanogenmod.filemanager.util.HexDump; import com.cyanogenmod.filemanager.commands.AsyncResultListener; import com.cyanogenmod.filemanager.commands.ChecksumExecutable; import com.cyanogenmod.filemanager.console.ExecutionException; diff --git a/src/com/cyanogenmod/filemanager/commands/shell/Command.java b/src/com/cyanogenmod/filemanager/commands/shell/Command.java index cf9a9f5c..0b7cfb99 100644 --- a/src/com/cyanogenmod/filemanager/commands/shell/Command.java +++ b/src/com/cyanogenmod/filemanager/commands/shell/Command.java @@ -19,7 +19,7 @@ import android.content.res.Resources; import android.content.res.XmlResourceParser; -import com.android.internal.util.XmlUtils; +import com.cyanogenmod.filemanager.util.XmlUtils; import com.cyanogenmod.filemanager.FileManagerApplication; import com.cyanogenmod.filemanager.R; import com.cyanogenmod.filemanager.console.CommandNotFoundException; @@ -51,8 +51,8 @@ public abstract class Command { private final String mId; private String mCmd; - private String mArgs; // The real arguments - private final Object[] mCmdArgs; //The arguments to be formatted + private String mArgs; // The real arguments + private final Object[] mCmdArgs; // The arguments to be formatted private static String sStartCodeCmd; private static String sExitCodeCmd; @@ -62,10 +62,12 @@ public abstract class Command { /** * @Constructor of Command * - * @param id The resource identifier of the command - * @param args Arguments of the command (will be formatted with the arguments from - * the command definition) - * @throws InvalidCommandDefinitionException If the command has an invalid definition + * @param id The resource identifier of the command + * @param args Arguments of the command (will be formatted with the arguments + * from + * the command definition) + * @throws InvalidCommandDefinitionException If the command has an invalid + * definition */ public Command(String id, String... args) throws InvalidCommandDefinitionException { this(id, true, args); @@ -74,32 +76,33 @@ public Command(String id, String... args) throws InvalidCommandDefinitionExcepti /** * @Constructor of Command * - * @param id The resource identifier of the command + * @param id The resource identifier of the command * @param prepare Indicates if the argument must be prepared - * @param args Arguments of the command (will be formatted with the arguments from - * the command definition) - * @throws InvalidCommandDefinitionException If the command has an invalid definition + * @param args Arguments of the command (will be formatted with the arguments + * from + * the command definition) + * @throws InvalidCommandDefinitionException If the command has an invalid + * definition */ public Command(String id, boolean prepare, String... args) throws InvalidCommandDefinitionException { super(); this.mId = id; - //Convert and quote arguments + // Convert and quote arguments this.mCmdArgs = new Object[args.length]; int cc = args.length; for (int i = 0; i < cc; i++) { - //Quote the arguments? + // Quote the arguments? if (prepare) { - this.mCmdArgs[i] = - "\"" + ShellHelper.prepareArgument(args[i]) //$NON-NLS-1$ + this.mCmdArgs[i] = "\"" + ShellHelper.prepareArgument(args[i]) //$NON-NLS-1$ + "\""; //$NON-NLS-1$ } else { this.mCmdArgs[i] = ShellHelper.prepareArgument(args[i]); } } - //Load the command info + // Load the command info getCommandInfo(FileManagerApplication.getInstance().getResources()); // Get the current trace value @@ -111,7 +114,7 @@ public Command(String id, boolean prepare, String... args) * [@] expression in the commandArgs attribute of the * command xml definition file. * - * @param args The expanded arguments + * @param args The expanded arguments * @param prepare Indicates if the argument must be prepared */ protected void addExpandedArguments(String[] args, boolean prepare) { @@ -122,7 +125,7 @@ protected void addExpandedArguments(String[] args, boolean prepare) { int cc = args.length; StringBuffer sb = new StringBuffer(); for (int i = 0; i < cc; i++) { - //Quote the arguments? + // Quote the arguments? if (prepare) { sb = sb.append("\"" + //$NON-NLS-1$ ShellHelper.prepareArgument(args[i]) + "\""); //$NON-NLS-1$ @@ -135,7 +138,7 @@ protected void addExpandedArguments(String[] args, boolean prepare) { // Replace the expanded argument String start = this.mArgs.substring(0, pos); - String end = this.mArgs.substring(pos+EXPANDED_ARGS.length()); + String end = this.mArgs.substring(pos + EXPANDED_ARGS.length()); this.mArgs = start + sb.toString() + end; } } @@ -155,16 +158,18 @@ public boolean isTrace() { public final void reloadTrace() { this.mTrace = Preferences.getSharedPreferences().getBoolean( FileManagerSettings.SETTINGS_SHOW_TRACES.getId(), - ((Boolean)FileManagerSettings.SETTINGS_SHOW_TRACES.getDefaultValue()).booleanValue()); + ((Boolean) FileManagerSettings.SETTINGS_SHOW_TRACES.getDefaultValue()).booleanValue()); } /** * Method that checks if the result code of the execution was successfully. * * @param exitCode Program exit code - * @throws InsufficientPermissionsException If an operation requires elevated permissions - * @throws CommandNotFoundException If the command was not found - * @throws ExecutionException If the operation returns a invalid exit code + * @throws InsufficientPermissionsException If an operation requires elevated + * permissions + * @throws CommandNotFoundException If the command was not found + * @throws ExecutionException If the operation returns a invalid + * exit code * @hide */ public abstract void checkExitCode(int exitCode) @@ -210,15 +215,16 @@ public String getArguments() { * inflate the internal variables. * * @param resources The application resource manager - * @throws InvalidCommandDefinitionException If the command has an invalid definition + * @throws InvalidCommandDefinitionException If the command has an invalid + * definition */ private void getCommandInfo(Resources resources) throws InvalidCommandDefinitionException { - //Read the command list xml file + // Read the command list xml file XmlResourceParser parser = resources.getXml(R.xml.command_list); try { - //Find the root element + // Find the root element XmlUtils.beginDocument(parser, TAG_COMMAND_LIST); while (true) { XmlUtils.nextElement(parser); @@ -228,12 +234,10 @@ private void getCommandInfo(Resources resources) throws InvalidCommandDefinition } if (TAG_COMMAND.equals(element)) { - CharSequence id = parser.getAttributeValue(R.styleable.Command_commandId); + CharSequence id = parser.getAttributeValue(null, "commandId"); if (id != null && id.toString().compareTo(this.mId) == 0) { - CharSequence path = - parser.getAttributeValue(R.styleable.Command_commandPath); - CharSequence args = - parser.getAttributeValue(R.styleable.Command_commandArgs); + CharSequence path = parser.getAttributeValue(null, "commandPath"); + CharSequence args = parser.getAttributeValue(null, "commandArgs"); if (path == null) { throw new InvalidCommandDefinitionException( this.mId + ": path is null"); //$NON-NLS-1$ @@ -243,10 +247,10 @@ private void getCommandInfo(Resources resources) throws InvalidCommandDefinition this.mId + ": args is null"); //$NON-NLS-1$ } - //Save paths + // Save paths this.mCmd = path.toString(); this.mArgs = args.toString(); - //Format the arguments of the process with the command arguments + // Format the arguments of the process with the command arguments if (this.mArgs != null && this.mArgs.length() > 0 && this.mCmdArgs != null && this.mCmdArgs.length > 0) { this.mArgs = String.format(this.mArgs, this.mCmdArgs); @@ -264,7 +268,7 @@ private void getCommandInfo(Resources resources) throws InvalidCommandDefinition parser.close(); } - //Command not found + // Command not found throw new InvalidCommandDefinitionException(this.mId); } @@ -273,21 +277,22 @@ private void getCommandInfo(Resources resources) throws InvalidCommandDefinition * * @param resources The application resource manager * @return String The exit code command info - * @throws InvalidCommandDefinitionException If the command is not present or has an - * invalid definition + * @throws InvalidCommandDefinitionException If the command is not present or + * has an + * invalid definition */ public static synchronized String getStartCodeCommandInfo( Resources resources) throws InvalidCommandDefinitionException { - //Singleton + // Singleton if (sStartCodeCmd != null) { return new String(sStartCodeCmd); } - //Read the command list xml file + // Read the command list xml file XmlResourceParser parser = resources.getXml(R.xml.command_list); try { - //Find the root element + // Find the root element XmlUtils.beginDocument(parser, TAG_COMMAND_LIST); while (true) { XmlUtils.nextElement(parser); @@ -297,13 +302,13 @@ public static synchronized String getStartCodeCommandInfo( } if (TAG_STARTCODE.equals(element)) { - CharSequence path = parser.getAttributeValue(R.styleable.Command_commandPath); + CharSequence path = parser.getAttributeValue(null, "commandPath"); if (path == null) { throw new InvalidCommandDefinitionException( TAG_STARTCODE + ": path is null"); //$NON-NLS-1$ } - //Save paths + // Save paths sStartCodeCmd = path.toString(); return new String(sStartCodeCmd); } @@ -316,7 +321,7 @@ public static synchronized String getStartCodeCommandInfo( parser.close(); } - //Command not found + // Command not found throw new InvalidCommandDefinitionException(TAG_STARTCODE); } @@ -325,21 +330,22 @@ public static synchronized String getStartCodeCommandInfo( * * @param resources The application resource manager * @return String The exit code command info - * @throws InvalidCommandDefinitionException If the command is not present or has an - * invalid definition + * @throws InvalidCommandDefinitionException If the command is not present or + * has an + * invalid definition */ public static synchronized String getExitCodeCommandInfo( Resources resources) throws InvalidCommandDefinitionException { - //Singleton + // Singleton if (sExitCodeCmd != null) { return new String(sExitCodeCmd); } - //Read the command list xml file + // Read the command list xml file XmlResourceParser parser = resources.getXml(R.xml.command_list); try { - //Find the root element + // Find the root element XmlUtils.beginDocument(parser, TAG_COMMAND_LIST); while (true) { XmlUtils.nextElement(parser); @@ -349,13 +355,13 @@ public static synchronized String getExitCodeCommandInfo( } if (TAG_EXITCODE.equals(element)) { - CharSequence path = parser.getAttributeValue(R.styleable.Command_commandPath); + CharSequence path = parser.getAttributeValue(null, "commandPath"); if (path == null) { throw new InvalidCommandDefinitionException( TAG_EXITCODE + ": path is null"); //$NON-NLS-1$ } - //Save paths + // Save paths sExitCodeCmd = path.toString(); return new String(sExitCodeCmd); } @@ -368,7 +374,7 @@ public static synchronized String getExitCodeCommandInfo( parser.close(); } - //Command not found + // Command not found throw new InvalidCommandDefinitionException(TAG_EXITCODE); } } diff --git a/src/com/cyanogenmod/filemanager/console/secure/SecureConsole.java b/src/com/cyanogenmod/filemanager/console/secure/SecureConsole.java index 2b81084c..e509e50e 100644 --- a/src/com/cyanogenmod/filemanager/console/secure/SecureConsole.java +++ b/src/com/cyanogenmod/filemanager/console/secure/SecureConsole.java @@ -22,7 +22,6 @@ import android.os.AsyncTask; import android.os.Handler; import android.os.Message; -import android.os.UserHandle; import android.os.Handler.Callback; import android.util.Log; import android.widget.Toast; @@ -49,6 +48,7 @@ import com.cyanogenmod.filemanager.model.MountPoint; import com.cyanogenmod.filemanager.preferences.FileManagerSettings; import com.cyanogenmod.filemanager.preferences.Preferences; +import com.cyanogenmod.filemanager.util.AndroidHelper; import com.cyanogenmod.filemanager.util.DialogHelper; import com.cyanogenmod.filemanager.util.ExceptionUtil; import com.cyanogenmod.filemanager.util.FileHelper; @@ -57,7 +57,8 @@ import de.schlichtherle.truezip.file.TArchiveDetector; import de.schlichtherle.truezip.file.TFile; import de.schlichtherle.truezip.file.TVFS; -import de.schlichtherle.truezip.key.CancelledOperation; +import de.schlichtherle.truezip.key.KeyPromptingCancelledException; +import de.schlichtherle.truezip.key.KeyPromptingInterruptedException; import static de.schlichtherle.truezip.fs.FsSyncOption.CLEAR_CACHE; import static de.schlichtherle.truezip.fs.FsSyncOption.FORCE_CLOSE_INPUT; import static de.schlichtherle.truezip.fs.FsSyncOption.FORCE_CLOSE_OUTPUT; @@ -87,7 +88,7 @@ public class SecureConsole extends VirtualMountPointConsole { public static String getSecureStorageName() { return String.format("storage.%s.%s", - String.valueOf(UserHandle.myUserId()), + String.valueOf(AndroidHelper.getMyUserId()), SecureStorageDriverProvider.SECURE_STORAGE_SCHEME); } @@ -419,7 +420,11 @@ public synchronized void mount(Context ctx) File root = mStorageRoot.getFile(); try { boolean newStorage = !root.exists(); - mStorageRoot.mount(); + if (newStorage) { + mStorageRoot.mkdirs(); + } else { + mStorageRoot.list(); + } if (newStorage) { // Force a synchronization mRequiresSync = true; @@ -439,8 +444,10 @@ public synchronized void mount(Context ctx) intent.putExtra(FileManagerSettings.EXTRA_STATUS, MountExecutable.READWRITE); getCtx().sendBroadcast(intent); - } catch (IOException ex) { - if (ex.getCause() != null && ex.getCause() instanceof CancelledOperation) { + } catch (RuntimeException ex) { + if (ex.getCause() != null && + (ex.getCause() instanceof KeyPromptingCancelledException + || ex.getCause() instanceof KeyPromptingInterruptedException)) { throw new CancelledOperationException(); } if (ex.getCause() != null && ex.getCause() instanceof RaesAuthenticationException) { diff --git a/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyManagerProvider.java b/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyManagerProvider.java index 810b94dd..1c5580d0 100644 --- a/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyManagerProvider.java +++ b/src/com/cyanogenmod/filemanager/console/secure/SecureStorageKeyManagerProvider.java @@ -94,7 +94,7 @@ private static final class Boot { MANAGERS = Collections.unmodifiableMap(fast); // We need that the provider ask always for a password - getKeyProvider().setAskAlwaysForWriteKey(true); + getKeyProvider().resetUnconditionally(); } } // class Boot diff --git a/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java b/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java index 04f5fe72..09cb91cf 100644 --- a/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java +++ b/src/com/cyanogenmod/filemanager/preferences/FileManagerSettings.java @@ -18,295 +18,328 @@ import com.cyanogenmod.filemanager.util.FileHelper; - /** * The enumeration of settings of FileManager application. */ public enum FileManagerSettings { - /** - * Whether is the first use of the application - * @hide - */ - SETTINGS_FIRST_USE("cm_filemanager_first_use", Boolean.TRUE), //$NON-NLS-1$ - - /** - * The access mode to use - * @hide - */ - SETTINGS_ACCESS_MODE("cm_filemanager_access_mode", AccessMode.SAFE), //$NON-NLS-1$ - - /** - * When secondary users will have a chrooted console - * @hide - */ - SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS("cm_filemanager_restrict_secondary_users_access", - Boolean.TRUE), //$NON-NLS-1$ - - /** - * The initial directory to be used. - * @hide - */ - SETTINGS_INITIAL_DIR("cm_filemanager_initial_dir", FileHelper.ROOT_DIRECTORY), //$NON-NLS-1$ - - /** - * The view mode to use (simple, details, or icons). - * @hide - */ - SETTINGS_LAYOUT_MODE("cm_filemanager_layout_mode", NavigationLayoutMode.DETAILS), //$NON-NLS-1$ - /** - * The sort mode to use (name or data, ascending or descending). - * @hide - */ - SETTINGS_SORT_MODE("cm_filemanager_sort_mode", NavigationSortMode.NAME_ASC), //$NON-NLS-1$ - - /** - * When to sort the directories before the files. - * @hide - */ - SETTINGS_SHOW_DIRS_FIRST("cm_filemanager_show_dirs_first", Boolean.TRUE), //$NON-NLS-1$ - /** - * When to show the hidden files. - * @hide - */ - SETTINGS_SHOW_HIDDEN("cm_filemanager_show_hidden", Boolean.TRUE), //$NON-NLS-1$ - /** - * When to show the system files. - * @hide - */ - SETTINGS_SHOW_SYSTEM("cm_filemanager_show_system", Boolean.TRUE), //$NON-NLS-1$ - /** - * When to show the symlinks files. - * @hide - */ - SETTINGS_SHOW_SYMLINKS("cm_filemanager_show_symlinks", Boolean.TRUE), //$NON-NLS-1$ - - /** - * When to use case sensitive comparison in sorting of files - * @hide - */ - SETTINGS_CASE_SENSITIVE_SORT("cm_filemanager_case_sensitive_sort", Boolean.FALSE), //$NON-NLS-1$ - /** - * Defines the filetime format mode to use - * @hide - */ - SETTINGS_FILETIME_FORMAT_MODE( - "cm_filemanager_filetime_format_mode", FileTimeFormatMode.LOCALE), //$NON-NLS-1$ - /** - * When display a warning in free disk widget - * @hide - */ - SETTINGS_DISK_USAGE_WARNING_LEVEL( - "cm_filemanager_disk_usage_warning_level", //$NON-NLS-1$ - new String("95")), //$NON-NLS-1$ - /** - * When to compute folder statistics in folder properties dialog - * @hide - */ - SETTINGS_COMPUTE_FOLDER_STATISTICS( - "cm_filemanager_compute_folder_statistics", Boolean.TRUE), //$NON-NLS-1$ - /** - * When to display thumbs of pictures, videos, ... - * @hide - */ - SETTINGS_DISPLAY_THUMBS( - "cm_filemanager_show_thumbs", Boolean.TRUE), //$NON-NLS-1$ - /** - * Whether use flinger to remove items - * @hide - */ - SETTINGS_USE_FLINGER("cm_filemanager_use_flinger", Boolean.FALSE), //$NON-NLS-1$ - - - /** - * When to highlight the terms of the search in the search results - * @hide - */ - SETTINGS_HIGHLIGHT_TERMS("cm_filemanager_highlight_terms", Boolean.TRUE), //$NON-NLS-1$ - /** - * When to show the relevance widget on searches - * @hide - */ - SETTINGS_SHOW_RELEVANCE_WIDGET( - "cm_filemanager_show_relevance_widget", //$NON-NLS-1$ - Boolean.TRUE), - /** - * How to sort the search results - * @hide - */ - SETTINGS_SORT_SEARCH_RESULTS_MODE( - "cm_filemanager_sort_search_results_mode", //$NON-NLS-1$ - SearchSortResultMode.RELEVANCE), - /** - * When to save the search terms - * @hide - */ - SETTINGS_SAVE_SEARCH_TERMS("cm_filemanager_save_search_terms", Boolean.TRUE), //$NON-NLS-1$ - - /** - * When to delayed filesystem synchronization in secure storages - * @hide - */ - SETTINGS_SECURE_STORAGE_DELAYED_SYNC("cm_filemanager_secure_storage_delayed_sync", - Boolean.TRUE), //$NON-NLS-1$ - - /** - * When to show debug traces - * @hide - */ - SETTINGS_SHOW_TRACES("cm_filemanager_show_debug_traces", Boolean.FALSE), //$NON-NLS-1$ - - /** - * When to editor should display suggestions - * @hide - */ - SETTINGS_EDITOR_NO_SUGGESTIONS( - "cm_filemanager_editor_no_suggestions", Boolean.FALSE), //$NON-NLS-1$ - - /** - * When to editor should use word wrap - * @hide - */ - SETTINGS_EDITOR_WORD_WRAP("cm_filemanager_editor_word_wrap", Boolean.TRUE), //$NON-NLS-1$ - - /** - * When to editor should open a binary file in a hex viewer - * @hide - */ - SETTINGS_EDITOR_HEXDUMP("cm_filemanager_editor_hexdump", Boolean.TRUE), //$NON-NLS-1$ - - /** - * When to editor should use the syntax highlight - * @hide - */ - SETTINGS_EDITOR_SYNTAX_HIGHLIGHT( - "cm_filemanager_editor_syntax_highlight", Boolean.TRUE), //$NON-NLS-1$ - - /** - * When to editor should use the default color scheme of the theme for syntax highlight - * @hide - */ - SETTINGS_EDITOR_SH_COLOR_SCHEME( - "cm_filemanager_editor_sh_color_scheme", ""), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The current theme to use in the app - * @hide - */ - SETTINGS_THEME("cm_filemanager_theme", //$NON-NLS-1$ - "com.cyanogenmod.filemanager:light"), - - /** - * The current theme to use in the app - * @hide - */ - USER_PREF_LAST_DRAWER_TAB("last_drawer_tab", //$NON-NLS-1$ + /** + * Whether is the first use of the application + * + * @hide + */ + SETTINGS_FIRST_USE("cm_filemanager_first_use", Boolean.TRUE), //$NON-NLS-1$ + + /** + * The access mode to use + * + * @hide + */ + SETTINGS_ACCESS_MODE("cm_filemanager_access_mode", AccessMode.SAFE), //$NON-NLS-1$ + + /** + * When secondary users will have a chrooted console + * + * @hide + */ + SETTINGS_RESTRICT_SECONDARY_USERS_ACCESS("cm_filemanager_restrict_secondary_users_access", + Boolean.TRUE), // $NON-NLS-1$ + + /** + * The initial directory to be used. + * + * @hide + */ + SETTINGS_INITIAL_DIR("cm_filemanager_initial_dir", FileHelper.ROOT_DIRECTORY), //$NON-NLS-1$ + + /** + * The view mode to use (simple, details, or icons). + * + * @hide + */ + SETTINGS_LAYOUT_MODE("cm_filemanager_layout_mode", NavigationLayoutMode.DETAILS), //$NON-NLS-1$ + /** + * The sort mode to use (name or data, ascending or descending). + * + * @hide + */ + SETTINGS_SORT_MODE("cm_filemanager_sort_mode", NavigationSortMode.NAME_ASC), //$NON-NLS-1$ + + /** + * When to sort the directories before the files. + * + * @hide + */ + SETTINGS_SHOW_DIRS_FIRST("cm_filemanager_show_dirs_first", Boolean.TRUE), //$NON-NLS-1$ + /** + * When to show the hidden files. + * + * @hide + */ + SETTINGS_SHOW_HIDDEN("cm_filemanager_show_hidden", Boolean.TRUE), //$NON-NLS-1$ + /** + * When to show the system files. + * + * @hide + */ + SETTINGS_SHOW_SYSTEM("cm_filemanager_show_system", Boolean.TRUE), //$NON-NLS-1$ + /** + * When to show the symlinks files. + * + * @hide + */ + SETTINGS_SHOW_SYMLINKS("cm_filemanager_show_symlinks", Boolean.TRUE), //$NON-NLS-1$ + + /** + * When to use case sensitive comparison in sorting of files + * + * @hide + */ + SETTINGS_CASE_SENSITIVE_SORT("cm_filemanager_case_sensitive_sort", Boolean.FALSE), //$NON-NLS-1$ + /** + * Defines the filetime format mode to use + * + * @hide + */ + SETTINGS_FILETIME_FORMAT_MODE( + "cm_filemanager_filetime_format_mode", FileTimeFormatMode.LOCALE), //$NON-NLS-1$ + /** + * When display a warning in free disk widget + * + * @hide + */ + SETTINGS_DISK_USAGE_WARNING_LEVEL( + "cm_filemanager_disk_usage_warning_level", //$NON-NLS-1$ + new String("95")), //$NON-NLS-1$ + /** + * When to compute folder statistics in folder properties dialog + * + * @hide + */ + SETTINGS_COMPUTE_FOLDER_STATISTICS( + "cm_filemanager_compute_folder_statistics", Boolean.TRUE), //$NON-NLS-1$ + /** + * When to display thumbs of pictures, videos, ... + * + * @hide + */ + SETTINGS_DISPLAY_THUMBS( + "cm_filemanager_show_thumbs", Boolean.TRUE), //$NON-NLS-1$ + /** + * Whether use flinger to remove items + * + * @hide + */ + SETTINGS_USE_FLINGER("cm_filemanager_use_flinger", Boolean.FALSE), //$NON-NLS-1$ + + /** + * When to highlight the terms of the search in the search results + * + * @hide + */ + SETTINGS_HIGHLIGHT_TERMS("cm_filemanager_highlight_terms", Boolean.TRUE), //$NON-NLS-1$ + /** + * When to show the relevance widget on searches + * + * @hide + */ + SETTINGS_SHOW_RELEVANCE_WIDGET( + "cm_filemanager_show_relevance_widget", //$NON-NLS-1$ + Boolean.TRUE), + /** + * How to sort the search results + * + * @hide + */ + SETTINGS_SORT_SEARCH_RESULTS_MODE( + "cm_filemanager_sort_search_results_mode", //$NON-NLS-1$ + SearchSortResultMode.RELEVANCE), + /** + * When to save the search terms + * + * @hide + */ + SETTINGS_SAVE_SEARCH_TERMS("cm_filemanager_save_search_terms", Boolean.TRUE), //$NON-NLS-1$ + + /** + * When to delayed filesystem synchronization in secure storages + * + * @hide + */ + SETTINGS_SECURE_STORAGE_DELAYED_SYNC("cm_filemanager_secure_storage_delayed_sync", + Boolean.TRUE), // $NON-NLS-1$ + + /** + * When to show debug traces + * + * @hide + */ + SETTINGS_SHOW_TRACES("cm_filemanager_show_debug_traces", Boolean.FALSE), //$NON-NLS-1$ + + /** + * When to editor should display suggestions + * + * @hide + */ + SETTINGS_EDITOR_NO_SUGGESTIONS( + "cm_filemanager_editor_no_suggestions", Boolean.FALSE), //$NON-NLS-1$ + + /** + * When to editor should use word wrap + * + * @hide + */ + SETTINGS_EDITOR_WORD_WRAP("cm_filemanager_editor_word_wrap", Boolean.TRUE), //$NON-NLS-1$ + + /** + * When to editor should open a binary file in a hex viewer + * + * @hide + */ + SETTINGS_EDITOR_HEXDUMP("cm_filemanager_editor_hexdump", Boolean.TRUE), //$NON-NLS-1$ + + /** + * When to editor should use the syntax highlight + * + * @hide + */ + SETTINGS_EDITOR_SYNTAX_HIGHLIGHT( + "cm_filemanager_editor_syntax_highlight", Boolean.TRUE), //$NON-NLS-1$ + + /** + * When to editor should use the default color scheme of the theme for syntax + * highlight + * + * @hide + */ + SETTINGS_EDITOR_SH_COLOR_SCHEME( + "cm_filemanager_editor_sh_color_scheme", ""), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The current theme to use in the app + * + * @hide + */ + SETTINGS_THEME("cm_filemanager_theme", //$NON-NLS-1$ + com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ":light"), + + /** + * The current theme to use in the app + * + * @hide + */ + USER_PREF_LAST_DRAWER_TAB("last_drawer_tab", //$NON-NLS-1$ Integer.valueOf(0)); + /** + * A broadcast intent that is sent when a setting was changed + */ + /** + * A broadcast intent that is sent when a setting was changed + */ + public final static String INTENT_SETTING_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".INTENT_SETTING_CHANGED"; //$NON-NLS-1$ + + /** + * A broadcast intent that is sent when a theme was changed + */ + public final static String INTENT_THEME_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".INTENT_THEME_CHANGED"; //$NON-NLS-1$ + + /** + * A broadcast intent that is sent when a setting was changed + */ + public final static String INTENT_MOUNT_STATUS_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".INTENT_MOUNT_STATUS_CHANGED"; //$NON-NLS-1$ + + /** + * A broadcast intent that is sent when a file was changed + */ + public final static String INTENT_FILE_CHANGED = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".INTENT_FILE_CHANGED"; //$NON-NLS-1$ + + /** + * Intent action to set the home directory + */ + public final static String INTENT_SET_HOME = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".ACTION_SET_HOME"; //$NON-NLS-1$ + + /** + * The extra key with the preference key that was changed + */ + public final static String EXTRA_SETTING_CHANGED_KEY = "preference"; //$NON-NLS-1$ + + /** + * The extra key with the file key that was changed + */ + public final static String EXTRA_FILE_CHANGED_KEY = "file"; //$NON-NLS-1$ + + /** + * The extra key with the file key that was changed + */ + public final static String EXTRA_THEME_PACKAGE = "package"; //$NON-NLS-1$ + + /** + * The extra key with the identifier of theme that was changed + */ + public final static String EXTRA_THEME_ID = "id"; //$NON-NLS-1$ + + /** + * The extra key with the identifier a mountpoint event + */ + public final static String EXTRA_MOUNTPOINT = "mount_point"; //$NON-NLS-1$ + + /** + * The extra key with the notify the status of an object + */ + public final static String EXTRA_STATUS = "status"; //$NON-NLS-1$ + + private final String mId; + private final Object mDefaultValue; + + /** + * Constructor of FileManagerSettings. + * + * @param id The unique identifier of the setting + * @param defaultValue The default value of the setting + */ + private FileManagerSettings(String id, Object defaultValue) { + this.mId = id; + this.mDefaultValue = defaultValue; + } + /** + * Method that returns the unique identifier of the setting. + * + * @return the mId + */ + public String getId() { + return this.mId; + } + + /** + * Method that returns the default value of the setting. + * + * @return Object The default value of the setting + */ + public Object getDefaultValue() { + return this.mDefaultValue; + } - /** - * A broadcast intent that is sent when a setting was changed - */ - public final static String INTENT_SETTING_CHANGED = - "com.cyanogenmod.filemanager.INTENT_SETTING_CHANGED"; //$NON-NLS-1$ - - /** - * A broadcast intent that is sent when a theme was changed - */ - public final static String INTENT_THEME_CHANGED = - "com.cyanogenmod.filemanager.INTENT_THEME_CHANGED"; //$NON-NLS-1$ - - /** - * A broadcast intent that is sent when a setting was changed - */ - public final static String INTENT_MOUNT_STATUS_CHANGED = - "com.cyanogenmod.filemanager.INTENT_MOUNT_STATUS_CHANGED"; //$NON-NLS-1$ - - /** - * A broadcast intent that is sent when a file was changed - */ - public final static String INTENT_FILE_CHANGED = - "com.cyanogenmod.filemanager.INTENT_FILE_CHANGED"; //$NON-NLS-1$ - - /** - * The extra key with the preference key that was changed - */ - public final static String EXTRA_SETTING_CHANGED_KEY = "preference"; //$NON-NLS-1$ - - /** - * The extra key with the file key that was changed - */ - public final static String EXTRA_FILE_CHANGED_KEY = "file"; //$NON-NLS-1$ - - /** - * The extra key with the file key that was changed - */ - public final static String EXTRA_THEME_PACKAGE = "package"; //$NON-NLS-1$ - - /** - * The extra key with the identifier of theme that was changed - */ - public final static String EXTRA_THEME_ID = "id"; //$NON-NLS-1$ - - /** - * The extra key with the identifier a mountpoint event - */ - public final static String EXTRA_MOUNTPOINT = "mount_point"; //$NON-NLS-1$ - - /** - * The extra key with the notify the status of an object - */ - public final static String EXTRA_STATUS = "status"; //$NON-NLS-1$ - - - - - private final String mId; - private final Object mDefaultValue; - - /** - * Constructor of FileManagerSettings. - * - * @param id The unique identifier of the setting - * @param defaultValue The default value of the setting - */ - private FileManagerSettings(String id, Object defaultValue) { - this.mId = id; - this.mDefaultValue = defaultValue; - } - - /** - * Method that returns the unique identifier of the setting. - * @return the mId - */ - public String getId() { - return this.mId; - } - - /** - * Method that returns the default value of the setting. - * - * @return Object The default value of the setting - */ - public Object getDefaultValue() { - return this.mDefaultValue; - } - - /** - * Method that returns an instance of {@link FileManagerSettings} from its. - * unique identifier - * - * @param id The unique identifier - * @return FileManagerSettings The navigation sort mode - */ - public static FileManagerSettings fromId(String id) { - FileManagerSettings[] values = values(); - int cc = values.length; - for (int i = 0; i < cc; i++) { - if (values[i].mId == id) { - return values[i]; - } + /** + * Method that returns an instance of {@link FileManagerSettings} from its. + * unique identifier + * + * @param id The unique identifier + * @return FileManagerSettings The navigation sort mode + */ + public static FileManagerSettings fromId(String id) { + FileManagerSettings[] values = values(); + int cc = values.length; + for (int i = 0; i < cc; i++) { + if (values[i].mId == id) { + return values[i]; + } + } + return null; } - return null; - } } diff --git a/src/com/cyanogenmod/filemanager/preferences/Preferences.java b/src/com/cyanogenmod/filemanager/preferences/Preferences.java index b07ec394..f82bf9d6 100644 --- a/src/com/cyanogenmod/filemanager/preferences/Preferences.java +++ b/src/com/cyanogenmod/filemanager/preferences/Preferences.java @@ -145,8 +145,8 @@ public static SharedPreferences getSharedPreferences() { private static File getWorldReadablePropertiesFile(Context context) { String dataDir = context.getApplicationInfo().dataDir; if (AndroidHelper.isSecondaryUser(context)) { - dataDir = dataDir.replace(String.valueOf(UserHandle.myUserId()), - String.valueOf(UserHandle.USER_OWNER)); + dataDir = dataDir.replace(String.valueOf(AndroidHelper.getMyUserId()), + String.valueOf(0)); } return new File(dataDir, SHARED_PROPERTIES_FILENAME); } diff --git a/src/com/cyanogenmod/filemanager/providers/BookmarksContentProvider.java b/src/com/cyanogenmod/filemanager/providers/BookmarksContentProvider.java index 2846951e..b76ee399 100644 --- a/src/com/cyanogenmod/filemanager/providers/BookmarksContentProvider.java +++ b/src/com/cyanogenmod/filemanager/providers/BookmarksContentProvider.java @@ -35,7 +35,7 @@ /** * A content provider for manage the user-defined bookmarks */ -public class BookmarksContentProvider extends ContentProvider { +public class BookmarksContentProvider extends ContentProvider { private static final boolean DEBUG = false; @@ -51,8 +51,8 @@ public class BookmarksContentProvider extends ContentProvider { /** * The authority string name. */ - public static final String AUTHORITY = - "com.cyanogenmod.filemanager.providers.bookmarks"; //$NON-NLS-1$ + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".providers.bookmarks"; //$NON-NLS-1$ private static final UriMatcher sURLMatcher = new UriMatcher(UriMatcher.NO_MATCH); @@ -122,7 +122,7 @@ public Cursor query(Uri url, String[] projectionIn, String selection, // Open the database SQLiteDatabase db = this.mOpenHelper.getReadableDatabase(); Cursor cursor = qb.query(db, projectionIn, selection, selectionArgs, - null, null, sort); + null, null, sort); if (cursor == null) { if (DEBUG) { Log.v(TAG, "Bookmarks.query: failed"); //$NON-NLS-1$ @@ -185,8 +185,8 @@ public int update(Uri url, ContentValues values, String where, String[] whereArg } if (DEBUG) { Log.v(TAG, - "*** notifyChange() rowId: " + //$NON-NLS-1$ - rowId + " url " + url); //$NON-NLS-1$ + "*** notifyChange() rowId: " + //$NON-NLS-1$ + rowId + " url " + url); //$NON-NLS-1$ } getContext().getContentResolver().notifyChange(url, null); return count; @@ -214,7 +214,7 @@ public Uri insert(Uri url, ContentValues initialValues) { tablename = "history"; uri = History.Columns.CONTENT_URI; } - long rowId = db.insert(tablename, null, initialValues); //$NON-NLS-1$ + long rowId = db.insert(tablename, null, initialValues); // $NON-NLS-1$ if (rowId < 0) { throw new SQLException("Failed to insert row"); //$NON-NLS-1$ } @@ -246,7 +246,7 @@ public int delete(Uri url, String where, String[] whereArgs) { whereQuery = "_id=" + segment; //$NON-NLS-1$ } else { whereQuery = "_id=" + segment + //$NON-NLS-1$ - " AND (" + whereQuery + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + " AND (" + whereQuery + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } count = db.delete("bookmarks", whereQuery, whereArgs); //$NON-NLS-1$ break; diff --git a/src/com/cyanogenmod/filemanager/providers/MimeTypeIndexProvider.java b/src/com/cyanogenmod/filemanager/providers/MimeTypeIndexProvider.java index fc3b9607..697a974e 100644 --- a/src/com/cyanogenmod/filemanager/providers/MimeTypeIndexProvider.java +++ b/src/com/cyanogenmod/filemanager/providers/MimeTypeIndexProvider.java @@ -33,6 +33,7 @@ /** * MimeTypeIndexProvider + * *
  *     Provider for handling access of mime type indexes
  * 
@@ -43,9 +44,9 @@ public class MimeTypeIndexProvider extends ContentProvider { // Constants private static final String TAG = MimeTypeIndexProvider.class.getSimpleName(); - private static final String AUTHORITY = "com.cyanogenmod.filemanager.providers.index"; + private static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ".providers.index"; private static final int ID_INDEX = 1; - private static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + + private static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/" + DatabaseHelper.INDEX_TABLE); private static final UriMatcher sUriMatcher = new UriMatcher(NO_MATCH); @@ -54,8 +55,7 @@ public class MimeTypeIndexProvider extends ContentProvider { public static final String COLUMN_SIZE = "size"; public static Uri getContentUri() { - return new Uri.Builder().scheme("content").authority(AUTHORITY).path - (DatabaseHelper.INDEX_TABLE).build(); + return new Uri.Builder().scheme("content").authority(AUTHORITY).path(DatabaseHelper.INDEX_TABLE).build(); } static { @@ -130,8 +130,7 @@ public int delete(Uri uri, String selection, String[] selectionArgs) { } @Override - public int update(Uri uri, ContentValues contentValues, String selection, String[] - selectionArgs) { + public int update(Uri uri, ContentValues contentValues, String selection, String[] selectionArgs) { throw new RuntimeException("MimeTypeIndexProvider::update(): Not implemented!"); } @@ -181,8 +180,7 @@ public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVers * * @throws IllegalArgumentException {@link java.lang.IllegalArgumentException} */ - public static Cursor getMountPointUsage(Context context, String fileRoot) throws - IllegalArgumentException { + public static Cursor getMountPointUsage(Context context, String fileRoot) throws IllegalArgumentException { if (context == null) { throw new IllegalArgumentException("'context' cannot be null!"); } @@ -206,15 +204,14 @@ public static Cursor getMountPointUsage(Context context, String fileRoot) throws * * @throws IllegalArgumentException {@link java.lang.IllegalArgumentException} */ - public static int clearMountPointUsages(Context context, String fileRoot) throws - IllegalArgumentException { + public static int clearMountPointUsages(Context context, String fileRoot) throws IllegalArgumentException { if (context == null) { throw new IllegalArgumentException("'context' cannot be null!"); } if (TextUtils.isEmpty(fileRoot)) { throw new IllegalArgumentException("'fileRoot' cannot be null or empty!"); } - String selection = COLUMN_FILE_ROOT + " = ?"; + String selection = COLUMN_FILE_ROOT + " = ?"; String[] selectionArgs = new String[] { fileRoot }; return context.getContentResolver().delete(MimeTypeIndexProvider.getContentUri(), selection, selectionArgs); } diff --git a/src/com/cyanogenmod/filemanager/providers/RecentSearchesContentProvider.java b/src/com/cyanogenmod/filemanager/providers/RecentSearchesContentProvider.java index 6a3e7d08..e826facd 100644 --- a/src/com/cyanogenmod/filemanager/providers/RecentSearchesContentProvider.java +++ b/src/com/cyanogenmod/filemanager/providers/RecentSearchesContentProvider.java @@ -26,8 +26,8 @@ public class RecentSearchesContentProvider extends SearchRecentSuggestionsProvid /** * The authority string name. */ - public static final String AUTHORITY = - "com.cyanogenmod.filemanager.providers.recentsearches"; //$NON-NLS-1$ + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".providers.recentsearches"; //$NON-NLS-1$ /** * The provider mode. diff --git a/src/com/cyanogenmod/filemanager/providers/SecureResourceProvider.java b/src/com/cyanogenmod/filemanager/providers/SecureResourceProvider.java index b06fc738..2f5eb13a 100644 --- a/src/com/cyanogenmod/filemanager/providers/SecureResourceProvider.java +++ b/src/com/cyanogenmod/filemanager/providers/SecureResourceProvider.java @@ -54,8 +54,8 @@ public final class SecureResourceProvider extends ContentProvider { private static final String TAG = "SecureResourceProvider"; - public static final String AUTHORITY = - "com.cyanogenmod.filemanager.providers.resources"; + public static final String AUTHORITY = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".providers.resources"; private static final String CONTENT_AUTHORITY = "content://" + AUTHORITY; @@ -64,7 +64,7 @@ public final class SecureResourceProvider extends ContentProvider { private static final String COLUMS_SIZE = OpenableColumns.SIZE; private static final String[] COLUMN_PROJECTION = { - COLUMS_ID, COLUMS_NAME, COLUMS_SIZE + COLUMS_ID, COLUMS_NAME, COLUMS_SIZE }; public static class AuthorizationResource { @@ -114,8 +114,9 @@ public void onAsyncExitCode(int exitCode) { @Override public void onPartialResult(Object result) { try { - if (result == null) return; - byte[] partial = (byte[])result; + if (result == null) + return; + byte[] partial = (byte[]) result; mOut.write(partial); mOut.flush(); } catch (Exception ex) { @@ -190,8 +191,8 @@ public boolean handleMessage(Message msg) { private static final String EXTRA_AUTH_ID = "auth_id"; private static final Handler CLEAR_AUTH_HANDLER = new Handler(CLEAR_AUTH_CALLBACK); - private static Map AUTHORIZATIONS = - (Map) Collections.synchronizedMap( + private static Map AUTHORIZATIONS = (Map) Collections + .synchronizedMap( new HashMap()); private final ExecutorService mExecutorService = Executors.newFixedThreadPool(1); @@ -214,7 +215,7 @@ public static Uri createAuthorizationUri(RegularFile file) { AUTHORIZATIONS.put(uuid, resource); break; } - } while(true); + } while (true); // Post a message to clear authorization after an interval of time Message msg = Message.obtain(CLEAR_AUTH_HANDLER, MSG_CLEAR_AUTHORIZATIONS); @@ -226,8 +227,10 @@ public static Uri createAuthorizationUri(RegularFile file) { } /** - * Method that register the {@link FileSystemObject} that allow external apps to access - * private files. An authorization MUST be explicit done by this app. Third party apps + * Method that register the {@link FileSystemObject} that allow external apps to + * access + * private files. An authorization MUST be explicit done by this app. Third + * party apps * can register * * @param uri The authorized uri @@ -272,7 +275,6 @@ public static AuthorizationResource revertAuthorization(Uri uri) { return AUTHORIZATIONS.remove(uuid); } - @Override public boolean onCreate() { return true; @@ -395,10 +397,11 @@ public void run() { /** * Method that returns an authorization for the passed Uri. * - * @param uri The uri to check + * @param uri The uri to check * @param revoke Whether revoke the grant - * @return AuthorizationResource The authorization resource or null if not there is not - * authorization + * @return AuthorizationResource The authorization resource or null if not there + * is not + * authorization */ private static AuthorizationResource getAuthorizacionResourceForUri(Uri uri) { UUID uuid = UUID.fromString(uri.getLastPathSegment()); diff --git a/src/com/cyanogenmod/filemanager/providers/secure/SecureCacheCleanupService.java b/src/com/cyanogenmod/filemanager/providers/secure/SecureCacheCleanupService.java index 6accb438..1b6326da 100644 --- a/src/com/cyanogenmod/filemanager/providers/secure/SecureCacheCleanupService.java +++ b/src/com/cyanogenmod/filemanager/providers/secure/SecureCacheCleanupService.java @@ -30,6 +30,7 @@ /** * SecureCacheCleanupService + * *
  *    Service that cleans up cache
  * 
@@ -39,11 +40,12 @@ public class SecureCacheCleanupService extends IntentService { // Constants - private static final String ACTION_START = "com.cyanogenmod.filemanager.ACTION_START_CLEANUP"; + private static final String ACTION_START = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + + ".ACTION_START_CLEANUP"; private static final String NAME = "cleanup-service"; /** - * Creates an IntentService. Invoked by your subclass's constructor. + * Creates an IntentService. Invoked by your subclass's constructor. */ public SecureCacheCleanupService() { super(NAME); @@ -110,7 +112,7 @@ public static void scheduleCleanup(Context context) throws IllegalArgumentExcept AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, SecureCacheCleanupService.class); intent.setAction(ACTION_START); - PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0); + PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_IMMUTABLE); alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, 1000, AlarmManager.INTERVAL_HOUR, pendingIntent); } @@ -129,7 +131,7 @@ public static void cancelAlarm(Context context) throws IllegalArgumentException AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(context, SecureCacheCleanupService.class); intent.setAction(ACTION_START); - PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0); + PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_IMMUTABLE); alarmManager.cancel(pendingIntent); } } diff --git a/src/com/cyanogenmod/filemanager/service/MimeTypeIndexService.java b/src/com/cyanogenmod/filemanager/service/MimeTypeIndexService.java index ad7192e5..c679a293 100644 --- a/src/com/cyanogenmod/filemanager/service/MimeTypeIndexService.java +++ b/src/com/cyanogenmod/filemanager/service/MimeTypeIndexService.java @@ -33,6 +33,7 @@ /** * MimeTypeIndexService + * *
  *    Service intended to index space used by mime type
  * 
@@ -43,7 +44,7 @@ public class MimeTypeIndexService extends IntentService { // Constants private static final String TAG = MimeTypeIndexService.class.getSimpleName(); - public static final String ACTION_START_INDEX = "com.cyanogenmod.filemanager" + + public static final String ACTION_START_INDEX = com.cyanogenmod.filemanager.BuildConfig.APPLICATION_ID + ".ACTION_START_INDEX"; public static final String EXTRA_FILE_ROOT = "extra_file_root"; @@ -86,8 +87,7 @@ private void performIndexAction(String fileRoot) { Log.i(TAG, "Starting mime type usage indexing on '" + fileRoot + "'"); fileRoot = fileRoot.trim(); File rootFile = new File(fileRoot); - Map spaceCalculationMap = - new HashMap(); + Map spaceCalculationMap = new HashMap(); calculateUsageByType(rootFile, spaceCalculationMap); ContentValues[] valuesList = new ContentValues[spaceCalculationMap.keySet().size()]; int i = 0; @@ -157,8 +157,7 @@ private void calculateUsageByType(File root, Map groupUs * * @throws IllegalArgumentException {@link java.lang.IllegalArgumentException} */ - public static void indexFileRoot(Context context, String fileRoot) throws - IllegalArgumentException { + public static void indexFileRoot(Context context, String fileRoot) throws IllegalArgumentException { if (context == null) { throw new IllegalArgumentException("'context' cannot be null"); } diff --git a/src/com/cyanogenmod/filemanager/ui/IconHolder.java b/src/com/cyanogenmod/filemanager/ui/IconHolder.java index 2a8e0993..dd180057 100644 --- a/src/com/cyanogenmod/filemanager/ui/IconHolder.java +++ b/src/com/cyanogenmod/filemanager/ui/IconHolder.java @@ -26,6 +26,7 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.media.ThumbnailUtils; +import android.provider.MediaStore; import android.net.Uri; import android.os.Handler; import android.os.HandlerThread; @@ -155,7 +156,7 @@ private Drawable getAppDrawable(FileSystemObject fso) { private Drawable getImageDrawable(String file) { Bitmap thumb = ThumbnailUtils.createImageThumbnail( MediaHelper.normalizeMediaPath(file), - ThumbnailUtils.TARGET_SIZE_MICRO_THUMBNAIL); + MediaStore.Images.Thumbnails.MICRO_KIND); if (thumb == null) { return null; } @@ -171,7 +172,7 @@ private Drawable getImageDrawable(String file) { private Drawable getVideoDrawable(String file) { Bitmap thumb = ThumbnailUtils.createVideoThumbnail( MediaHelper.normalizeMediaPath(file), - ThumbnailUtils.TARGET_SIZE_MICRO_THUMBNAIL); + MediaStore.Video.Thumbnails.MICRO_KIND); if (thumb == null) { return null; } @@ -190,7 +191,7 @@ private Drawable getAlbumDrawable(long albumId) { return null; } Bitmap thumb = ThumbnailUtils.createImageThumbnail(path, - ThumbnailUtils.TARGET_SIZE_MICRO_THUMBNAIL); + MediaStore.Images.Thumbnails.MICRO_KIND); if (thumb == null) { return null; } @@ -341,8 +342,11 @@ public void handleMessage(Message msg) { switch (msg.what) { case MSG_LOAD: Loadable l = (Loadable) msg.obj; - if (l.load()) { - mHandler.obtainMessage(MSG_LOADED, l).sendToTarget(); + try { + if (l.load()) { + mHandler.obtainMessage(MSG_LOADED, l).sendToTarget(); + } + } catch (RuntimeException ignored) { } break; } diff --git a/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java index 791d6dbe..f0d024bf 100644 --- a/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java +++ b/src/com/cyanogenmod/filemanager/ui/policy/PrintActionPolicy.java @@ -281,7 +281,6 @@ public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttribute .setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT) .setPageCount(calculatePageCount(rowsPerPage)) .build(); - info.setDataSize(size); boolean changed = !newAttributes.equals(oldAttributes); callback.onLayoutFinished(info, changed); } diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java b/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java index 17504dae..16816840 100755 --- a/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java +++ b/src/com/cyanogenmod/filemanager/ui/widgets/NavigationView.java @@ -1437,7 +1437,7 @@ public void createChRooted() { StorageVolume[] volumes = StorageHelper.getStorageVolumes(getContext(), false); if (volumes != null && volumes.length > 0) { - changeCurrentDir(volumes[0].getPath(), false, true, false, null, null); + changeCurrentDir(StorageHelper.getStorageVolumePath(volumes[0]), false, true, false, null, null); } } @@ -1468,7 +1468,7 @@ private String checkChRootedNavigation(String newDir) { if (!StorageHelper.isPathInStorageVolume(newDir)) { StorageVolume[] volumes = StorageHelper.getStorageVolumes(getContext(), false); if (volumes != null && volumes.length > 0) { - return volumes[0].getPath(); + return StorageHelper.getStorageVolumePath(volumes[0]); } } return newDir; diff --git a/src/com/cyanogenmod/filemanager/ui/widgets/ScrimInsetsFrameLayout.java b/src/com/cyanogenmod/filemanager/ui/widgets/ScrimInsetsFrameLayout.java index 56741558..a0d12621 100644 --- a/src/com/cyanogenmod/filemanager/ui/widgets/ScrimInsetsFrameLayout.java +++ b/src/com/cyanogenmod/filemanager/ui/widgets/ScrimInsetsFrameLayout.java @@ -21,7 +21,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.support.v4.view.ViewCompat; +import androidx.core.view.ViewCompat; import android.util.AttributeSet; import android.widget.FrameLayout; import com.cyanogenmod.filemanager.R; diff --git a/src/com/cyanogenmod/filemanager/util/AmbiguousExtensionHelper.java b/src/com/cyanogenmod/filemanager/util/AmbiguousExtensionHelper.java index 3b09367b..129c870f 100644 --- a/src/com/cyanogenmod/filemanager/util/AmbiguousExtensionHelper.java +++ b/src/com/cyanogenmod/filemanager/util/AmbiguousExtensionHelper.java @@ -75,7 +75,10 @@ public String getMimeType(String absolutePath, String extension) { } catch (RuntimeException e) { Log.e(TAG, "Unable to open 3GP file to determine mimetype"); } finally { - retriever.release(); + try { + retriever.release(); + } catch (Exception e) { + } } // Default to video 3gp if the file is unreadable as this was the default before // ambiguous resolution support was added. diff --git a/src/com/cyanogenmod/filemanager/util/AndroidHelper.java b/src/com/cyanogenmod/filemanager/util/AndroidHelper.java index 891e6e3a..92ffaace 100644 --- a/src/com/cyanogenmod/filemanager/util/AndroidHelper.java +++ b/src/com/cyanogenmod/filemanager/util/AndroidHelper.java @@ -27,13 +27,15 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.os.UserHandle; +import android.os.Process; import android.os.UserManager; import android.util.DisplayMetrics; +import com.cyanogenmod.filemanager.util.HexDump; import android.view.ViewConfiguration; -import com.android.internal.util.HexDump; import java.io.ByteArrayInputStream; +import java.lang.reflect.Method; import java.security.GeneralSecurityException; import java.security.MessageDigest; import java.security.cert.CertificateFactory; @@ -150,8 +152,20 @@ public static boolean hasSupportForMultipleUsers(Context context) { return UserManager.supportsMultipleUsers(); } + public static int getMyUserId() { + try { + Method myUserId = UserHandle.class.getMethod("myUserId"); + Object value = myUserId.invoke(null); + if (value instanceof Integer) { + return ((Integer) value).intValue(); + } + } catch (Exception ignored) { + } + return Process.myUid() / 100000; + } + public static boolean isUserOwner() { - return UserHandle.myUserId() == UserHandle.USER_OWNER; + return getMyUserId() == 0; } public static boolean isSecondaryUser(Context context) { diff --git a/src/com/cyanogenmod/filemanager/util/CommandHelper.java b/src/com/cyanogenmod/filemanager/util/CommandHelper.java index abb45ce8..00ce6ab3 100644 --- a/src/com/cyanogenmod/filemanager/util/CommandHelper.java +++ b/src/com/cyanogenmod/filemanager/util/CommandHelper.java @@ -16,8 +16,8 @@ package com.cyanogenmod.filemanager.util; -import android.annotation.NonNull; -import android.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.content.Context; import android.content.Intent; import android.media.MediaScannerConnection; diff --git a/src/com/cyanogenmod/filemanager/util/HexDump.java b/src/com/cyanogenmod/filemanager/util/HexDump.java new file mode 100644 index 00000000..e8e6e989 --- /dev/null +++ b/src/com/cyanogenmod/filemanager/util/HexDump.java @@ -0,0 +1,24 @@ +package com.cyanogenmod.filemanager.util; + +/** Simple replacement for android internal HexDump utility. */ +public class HexDump { + /** Convert entire byte array to hex string. */ + public static String toHexString(byte[] bytes) { + return toHexString(bytes, 0, bytes.length); + } + + /** Convert a range of a byte array to hex string. */ + public static String toHexString(byte[] bytes, int offset, int length) { + StringBuilder sb = new StringBuilder(); + for (int i = offset; i < offset + length; i++) { + sb.append(String.format("%02x", bytes[i])); + } + return sb.toString(); + } + + /** Convert an integer offset to an 8‑character hex string (like internal HexDump). */ + public static String toHexString(int value) { + return String.format("%08x", value); + } +} + diff --git a/src/com/cyanogenmod/filemanager/util/MediaHelper.java b/src/com/cyanogenmod/filemanager/util/MediaHelper.java index f00db57f..7239f21b 100644 --- a/src/com/cyanogenmod/filemanager/util/MediaHelper.java +++ b/src/com/cyanogenmod/filemanager/util/MediaHelper.java @@ -20,7 +20,7 @@ import android.content.Context; import android.database.Cursor; import android.net.Uri; -import android.os.UserHandle; +import android.os.Environment; import android.provider.BaseColumns; import android.provider.MediaStore; import android.provider.MediaStore.MediaColumns; @@ -59,24 +59,66 @@ public final class MediaHelper { */ public static Map getAllAlbums(ContentResolver cr) { Map albums = new HashMap(); - final String[] projection = - { - "distinct " + MediaStore.Audio.Media.ALBUM_ID, - "substr(" + MediaStore.Audio.Media.DATA + ", 0, length(" + - MediaStore.Audio.Media.DATA + ") - length(" + - MediaStore.Audio.Media.DISPLAY_NAME + "))" - }; final String where = MediaStore.Audio.Media.IS_MUSIC + " = ?"; - Cursor c = cr.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, - projection, where, new String[]{"1"}, null); - if (c != null) { + Cursor c = null; + try { try { + final String[] projection = { + MediaStore.Audio.Media.ALBUM_ID, + MediaColumns.RELATIVE_PATH + }; + c = cr.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, + projection, where, new String[]{"1"}, null); + if (c != null) { + while (c.moveToNext()) { + long albumId = c.getLong(0); + String relativePath = c.getString(1); + if (!TextUtils.isEmpty(relativePath)) { + String absPath = new File(Environment.getExternalStorageDirectory(), + relativePath).getAbsolutePath(); + albums.put(normalizeMediaPath(absPath), albumId); + } + } + } + return albums; + } catch (RuntimeException ignored) { + if (c != null) { + c.close(); + c = null; + } + albums.clear(); + } + + final String[] projection = { + MediaStore.Audio.Media.ALBUM_ID, + MediaStore.Audio.Media.DATA, + MediaStore.Audio.Media.DISPLAY_NAME + }; + c = cr.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, + projection, where, new String[]{"1"}, null); + if (c != null) { while (c.moveToNext()) { long albumId = c.getLong(0); - String albumPath = c.getString(1); - albums.put(albumPath, albumId); + String data = c.getString(1); + String displayName = c.getString(2); + if (TextUtils.isEmpty(data)) { + continue; + } + String albumPath; + if (!TextUtils.isEmpty(displayName) && data.endsWith(displayName)) { + albumPath = data.substring(0, data.length() - displayName.length()); + } else { + File parent = new File(data).getParentFile(); + albumPath = parent != null ? parent.getAbsolutePath() : null; + } + if (!TextUtils.isEmpty(albumPath)) { + albums.put(normalizeMediaPath(albumPath), albumId); + } } - } finally { + } + } catch (RuntimeException ignored) { + } finally { + if (c != null) { c.close(); } } @@ -267,7 +309,7 @@ public static String normalizeMediaPath(String path) { } // We need to convert EXTERNAL_STORAGE -> EMULATED_STORAGE_TARGET / userId if (path.startsWith(EXTERNAL_STORAGE)) { - final String userId = String.valueOf(UserHandle.myUserId()); + final String userId = String.valueOf(AndroidHelper.getMyUserId()); final String target = new File(EMULATED_STORAGE_TARGET, userId).getAbsolutePath(); path = path.replace(EXTERNAL_STORAGE, target); } diff --git a/src/com/cyanogenmod/filemanager/util/StorageHelper.java b/src/com/cyanogenmod/filemanager/util/StorageHelper.java index ed07fd5e..87afac06 100644 --- a/src/com/cyanogenmod/filemanager/util/StorageHelper.java +++ b/src/com/cyanogenmod/filemanager/util/StorageHelper.java @@ -35,6 +35,24 @@ public final class StorageHelper { private static StorageVolume[] sStorageVolumes; + public static String getStorageVolumePath(StorageVolume volume) { + if (volume == null) { + return null; + } + try { + Method method = volume.getClass().getMethod("getPath"); //$NON-NLS-1$ + return (String) method.invoke(volume); + } catch (Exception ignored) { + } + try { + Method method = volume.getClass().getMethod("getDirectory"); //$NON-NLS-1$ + File dir = (File) method.invoke(volume); + return dir != null ? dir.getAbsolutePath() : null; + } catch (Exception ignored) { + } + return null; + } + /** * Method that returns the storage volumes defined in the system. This method uses * reflection to retrieve the method because CM10 has a {@link Context} @@ -117,7 +135,7 @@ public static String getStorageVolumeDescription(Context ctx, StorageVolume volu } catch (Throwable _throw) { // Returns the volume storage path - return volume.getPath(); + return getStorageVolumePath(volume); } } @@ -135,7 +153,8 @@ public static boolean isPathInStorageVolume(String path) { int cc = volumes.length; for (int i = 0; i < cc; i++) { StorageVolume vol = volumes[i]; - if (fso.startsWith(vol.getPath())) { + String vPath = getStorageVolumePath(vol); + if (vPath != null && fso.startsWith(vPath)) { return true; } } @@ -156,7 +175,11 @@ public static boolean isStorageVolume(String path) { for (int i = 0; i < cc; i++) { StorageVolume vol = volumes[i]; String p = new File(path).getAbsolutePath(); - String v = new File(vol.getPath()).getAbsolutePath(); + String vPath = getStorageVolumePath(vol); + if (vPath == null) { + continue; + } + String v = new File(vPath).getAbsolutePath(); if (p.compareTo(v) == 0) { return true; } @@ -178,7 +201,11 @@ public static String getChrootedPath(String path) { for (int i = 0; i < cc; i++) { StorageVolume vol = volumes[i]; File p = new File(path); - File v = new File(vol.getPath()); + String vPath = getStorageVolumePath(vol); + if (vPath == null) { + continue; + } + File v = new File(vPath); if (p.getAbsolutePath().startsWith(v.getAbsolutePath())) { return v.getName() + path.substring(v.getAbsolutePath().length()); } diff --git a/src/com/cyanogenmod/filemanager/util/StringHelper.java b/src/com/cyanogenmod/filemanager/util/StringHelper.java index 89d7d2f0..e0aa53f9 100644 --- a/src/com/cyanogenmod/filemanager/util/StringHelper.java +++ b/src/com/cyanogenmod/filemanager/util/StringHelper.java @@ -18,7 +18,7 @@ import android.text.TextUtils; -import com.android.internal.util.HexDump; +import com.cyanogenmod.filemanager.util.HexDump; import java.io.ByteArrayInputStream; import java.util.Arrays; diff --git a/src/com/cyanogenmod/filemanager/util/XmlUtils.java b/src/com/cyanogenmod/filemanager/util/XmlUtils.java new file mode 100644 index 00000000..fd4e9e2e --- /dev/null +++ b/src/com/cyanogenmod/filemanager/util/XmlUtils.java @@ -0,0 +1,35 @@ +package com.cyanogenmod.filemanager.util; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + +import java.io.IOException; + +public final class XmlUtils { + + private XmlUtils() { + } + + public static void beginDocument(XmlPullParser parser, String firstElementName) + throws XmlPullParserException, IOException { + int type; + while ((type = parser.next()) != XmlPullParser.START_TAG + && type != XmlPullParser.END_DOCUMENT) { + } + if (type != XmlPullParser.START_TAG) { + throw new XmlPullParserException("No start tag found"); + } + if (!firstElementName.equals(parser.getName())) { + throw new XmlPullParserException( + "Unexpected start tag: found " + parser.getName() + ", expected " + firstElementName); + } + } + + public static void nextElement(XmlPullParser parser) + throws XmlPullParserException, IOException { + int type; + while ((type = parser.next()) != XmlPullParser.START_TAG + && type != XmlPullParser.END_DOCUMENT) { + } + } +}