Skip to content

Commit

Permalink
AE: Oreo rework
Browse files Browse the repository at this point in the history
- New activity/fragment structure

- Use AppCompat as little as possible

- Inherit DeviceDefault settings theme by default

- Theme setting

- Added back color picker preference

- Added back SeekBarPreferenceCham

- Add back stats, this time without GoogleAnalytics

- Add back changelog

- Introduce adaptive icon

- Add SystemSettingsStore

    To make any preference a SystemSettingsPreference, call
    myWhateverPreference.setPreferenceDataStore(new SystemSettingsStore(context.getContentResolver()));

- Added new SystemSettingsSwitchPreference that uses the new
  SystemSettingsStore

- Add Util.requireRoot() to remove preferences when no su found
  Util.requireRoot(myPreference) after initialization to hide the
  preference on devices without su

- Add back AICP log it

- AICP log it share zip workaround: temporarily disable death on file
  uri exposure

- Add back SELinux switch, make reading current state work rootless,
  also show toast when switching to enforcing on devices that are
  permissive by default and when su was denied

- Add back custom bootanimation
    - Add own AnimationDrawable subclass so we don't need frameworks
      modifications anymore
    - Create backup dir in case it doesn't already exist

- Add back system app remover
    Use mount options rw,remount instead of remount,rw to fix error
    "Device or resource busy"

- Add back launcher shortcuts, change color to amber & get it from color
  resources

- Add back restart systemui utils
    - Rewrite them to use classes directly, we're system app!

PS2:
- Update dashboard logo

PS3:
- Fix light theme -> dark theme switch keeping icons suited for light
  statusbar themes only

PS4:
- Fix SELinux preference in wrong sharedPreferences
- Fix double-tapping SELinux switch before denying SU leading to wrong
  checked status

PS5:
- Make it a privileged app again

Change-Id: Idd6e924ce2399dae9c02b8107c43e9e767bc8a0f
  • Loading branch information
SpiritCroc committed Sep 19, 2017
1 parent 83bb111 commit 75b568b
Show file tree
Hide file tree
Showing 341 changed files with 4,597 additions and 34,373 deletions.
77 changes: 35 additions & 42 deletions Android.mk
@@ -1,66 +1,59 @@
# Copyright (C) 2015 The Android Open Source Project
#
# Copyright (C) 2015 The Pure Nexus Project
# 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
#
# 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
# http://www.apache.org/licenses/LICENSE-2.0
#
# http://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.

# 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.
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

#Include res dir from libraries
appcompat_dir := ../../../$(SUPPORT_LIBRARY_ROOT)/v7/appcompat/res
cardview_dir := ../../../$(SUPPORT_LIBRARY_ROOT)/v7/cardview/res
recyclerview_dir := ../../../$(SUPPORT_LIBRARY_ROOT)/v7/recyclerview/res
design_dir := ../../../$(SUPPORT_LIBRARY_ROOT)/design/res
LOCAL_PROGUARD_ENABLED := disabled

res_dirs := res $(appcompat_dir) $(cardview_dir) $(recyclerview_dir) $(design_dir)
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += $(SUPPORT_LIBRARY_ROOT)/v7/appcompat/res
LOCAL_RESOURCE_DIR += $(SUPPORT_LIBRARY_ROOT)/v7/cardview/res
LOCAL_RESOURCE_DIR += $(SUPPORT_LIBRARY_ROOT)/v7/recyclerview/res
LOCAL_RESOURCE_DIR += $(SUPPORT_LIBRARY_ROOT)/design/res

##################################################
# Build APK
include $(CLEAR_VARS)
LOCAL_ASSET_DIR := $(LOCAL_PATH)/assets

LOCAL_PACKAGE_NAME := AicpExtras
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PROGUARD_ENABLED := disabled

LOCAL_STATIC_JAVA_LIBRARIES := \
android-support-v4 \
android-support-v7-appcompat \
android-support-v7-recyclerview \
android-support-v7-cardview \
android-support-v13 \
android-support-design \
libsuperuser \
play \
org.cyanogenmod.platform.internal \
particles

LOCAL_JAVA_LIBRARIES := org.cyanogenmod.hardware
LOCAL_STATIC_JAVA_LIBRARIES := particles
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-cardview
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview
LOCAL_STATIC_JAVA_LIBRARIES += android-support-design

# Apache http for stats
LOCAL_JAVA_LIBRARIES := org.apache.http.legacy

LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat:android.support.v7.cardview:android.support.v7.recyclerview:android.support.design

LOCAL_PACKAGE_NAME := AicpExtras

LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true

include $(BUILD_PACKAGE)

include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libsuperuser:lib/libsuperuser.jar \
particles:lib/LeonidsLib-1.3.2.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := particles:lib/LeonidsLib-1.3.2.jar

include $(BUILD_MULTI_PREBUILT)

include $(call all-makefiles-under, $(LOCAL_PATH))
221 changes: 36 additions & 185 deletions AndroidManifest.xml
@@ -1,217 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lordclockan"
android:versionCode="25"
android:versionName="0.5.0"
package="com.aicp.extras"
android:versionCode="1"
android:versionName="1.0"
android:sharedUserId="android.uid.system">

<uses-sdk
android:minSdkVersion="25" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" android:protectionLevel="signatureOrSystem" />
<uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE" />
<uses-permission android:name="android.permission.GET_APP_OPS_STATS" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_APP_TOKENS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SET_ACTIVITY_WATCHER" />
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE" />
<uses-permission android:name="android.permission.SHUTDOWN" />
<uses-permission android:name="android.permission.UPDATE_APP_OPS_STATS" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="cyanogenmod.permission.READ_SETTINGS" />
<uses-permission android:name="cyanogenmod.permission.WRITE_SETTINGS" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_aicp"
android:roundIcon="@drawable/ic_aicp_round"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true" >
android:supportsRtl="true">

<activity
android:name=".SettingsActivity"
android:label="@string/app_name" />

<activity
android:name=".SubSettingsActivity"
android:label="@string/app_name" />

<activity
android:name=".aicpextras.MainActivity"
android:label="@string/app_name"
android:configChanges="screenSize|orientation"
android:theme="@style/AppTheme.NoActionBar" >
android:name=".LauncherActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>

<activity
android:name=".aicpextras.ChangeLogActivity"
android:theme="@style/PreferenceTheme"
android:label="@string/changelog_title">
</activity>
<activity
android:name=".aicpextras.SettingsActivity"
android:theme="@style/PreferenceTheme"
android:label="@string/settings_activity_title">
</activity>
<activity
android:name=".aicpextras.Traffic"
android:theme="@style/PreferenceTheme"
android:label="@string/traffic_category">
</activity>
<activity
android:name=".aicpextras.SystemappRemover"
android:label="@string/system_app_remover"
android:theme="@style/PreferenceTheme"
android:excludeFromRecents="true">
</activity>
<activity
android:name=".aicpextras.CarrierLabel"
android:theme="@style/PreferenceTheme"
android:label="@string/carrier_options">
</activity>
<activity
android:name=".aicpextras.BatteryBar"
android:theme="@style/PreferenceTheme"
android:label="@string/battery_bar_title">
</activity>
<activity
android:name=".aicpextras.GestureAnywhereSettings"
android:theme="@style/PreferenceTheme"
android:label="@string/gesture_anywhere_title">
</activity>
<activity
android:name=".aicpextras.GestureAnywhereCreateGestureActivity"
android:theme="@style/PreferenceTheme"
android:label="@string/gesture_anywhere_title">
</activity>
<activity
android:name=".aicpextras.GestureAnywhereBuilderActivity"
android:theme="@style/PreferenceTheme"
android:label="@string/gesture_anywhere_title">
</activity>
<activity
android:name=".aicpextras.StatusBarWeather"
android:theme="@style/PreferenceTheme"
android:label="@string/status_bar_temperature_title">
</activity>
<activity
android:name=".aicpextras.Weather"
android:theme="@style/PreferenceTheme"
android:label="@string/weahter_lockscreen_category">
</activity>
<activity
android:name=".aicpextras.AppCircleBar"
android:theme="@style/PreferenceTheme"
android:label="@string/category_app_circle_bar_title">
</activity>
<activity
android:name=".aicpextras.AppSidebar"
android:theme="@style/PreferenceTheme"
android:label="@string/app_sidebar_title">
</activity>
<activity
android:name=".aicpextras.SubActivity"
android:theme="@style/PreferenceTheme">
</activity>
<activity
android:name=".aicpextras.SlimRecentAppSidebarActivity"
android:theme="@style/PreferenceTheme"
android:label="@string/recent_app_sidebar_title">
</activity>
<activity
android:name=".aicpextras.PieControl"
android:theme="@style/PreferenceTheme"
android:label="@string/pa_pie_control_title">
</activity>
<activity
android:name=".aicpextras.PieColor"
android:theme="@style/PreferenceTheme"
android:label="@string/pa_pie_control_title">
</activity>
<activity
android:name=".aicpextras.PieTargets"
android:theme="@style/PreferenceTheme"
android:label="@string/pa_pie_control_title">
</activity>
<activity
android:name=".aicpextras.AnimationControls"
android:theme="@style/PreferenceTheme"
android:label="@string/aokp_animation_title">
</activity>
<activity
android:name=".aicpextras.KeyboardAnimationInterfaceSettings"
android:theme="@style/PreferenceTheme"
android:label="@string/ime_animation_title">
</activity>
<activity
android:name=".aicpextras.FloatingWindows"
android:theme="@style/PreferenceTheme"
android:label="@string/floating_windows">
</activity>
<activity
android:name=".aicpextras.BootDialog"
android:theme="@style/PreferenceTheme"
android:label="@string/boot_dialog_title">
</activity>
<activity
android:name=".aicpextras.Ticker"
android:theme="@style/PreferenceTheme"
android:label="@string/ticker_screen_title">
</activity>
<activity
android:name=".aicpextras.HAFRAppListActivity"
android:theme="@style/PreferenceTheme"
android:label="@string/hide_apps_from_recents_title">
</activity>
<activity
android:name=".aicpextras.SuspendActions"
android:theme="@style/PreferenceTheme"
android:label="@string/screen_state_toggles_title">
android:name=".changelog.ChangelogActivity"
android:label="@string/changelog_name">
<intent-filter>
<action android:name="com.aicp.extras.ViewChangelog" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".aicpextras.HiddenAnimActivity"
android:name=".HiddenAnimActivity"
android:label="@string/hidden_anim_activity_title"
android:theme="@style/PreferenceTheme"
android:excludeFromRecents="true">
</activity>

<activity android:name=".aicpextras.ChangelogActivity"
android:label="@string/stats_title"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
android:excludeFromRecents="true" />

<receiver android:name="com.lordclockan.aicpextras.util.OnBoot">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>

<activity android:name=".romstats.AnonymousStats"
android:label="@string/stats_title" >
<activity
android:name=".SystemappRemover"
android:label="@string/system_app_remover_title">
<intent-filter>
<action android:name=".romstats.AnonymousStats" />
<action android:name="com.aicp.extras.ViewSystemAppRemover" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity android:name=".romstats.PreviewActivity" />

<receiver
android:name=".romstats.ReportingServiceManager"
android:enabled="true"
Expand All @@ -223,20 +76,18 @@
</intent-filter>
</receiver>

<service android:name="com.google.android.gms.analytics.AnalyticsService"
android:enabled="true"
android:exported="false"/>

<service
android:name=".romstats.ReportingService"
android:enabled="true"
android:exported="false"
android:label="ReportingService" >
</service>

<meta-data
android:name="io.fabric.ApiKey"
android:value="d89ae088b2672fcdcfddbe98ad7e338886bf8997" />
<receiver android:name="com.aicp.extras.utils.OnBoot">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>

</application>
</manifest>
Binary file removed lib/libsuperuser.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions proguard-project.txt

This file was deleted.

12 changes: 0 additions & 12 deletions res/anim/rotate.xml

This file was deleted.

Binary file removed res/drawable-hdpi/ic_about.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_aicp_round.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_blur_ui.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_bugreport.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_display_animation.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_halo.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_lockscreen.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_multishit.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_notif.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_opacity.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_recents.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_statusbar.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_various_shit.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_about.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_aicp_round.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_blur_ui.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_bugreport.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_display_animation.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_halo.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_lockscreen.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_multishit.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_notif.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_opacity.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_recents.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_statusbar.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_various_shit.png
Diff not rendered.
Binary file removed res/drawable-nodpi/aicp_wall.png
Diff not rendered.
Binary file added res/drawable-nodpi/star_alternative.png
Binary file removed res/drawable-xhdpi/ic_about.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_aicp_round.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_blur_ui.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_bugreport.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_display_animation.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_halo.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_lockscreen.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_multishit.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_notif.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_opacity.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_recents.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_statusbar.png
Diff not rendered.
Binary file removed res/drawable-xhdpi/ic_various_shit.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_about.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_aicp_round.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_blur_ui.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_bugreport.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_display_animation.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_halo.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_lockscreen.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_multishit.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_notif.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_opacity.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_recents.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_statusbar.png
Diff not rendered.
Binary file removed res/drawable-xxhdpi/ic_various_shit.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_about.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_aicp_round.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_blur_ui.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_bugreport.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_display_animation.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_halo.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_lockscreen.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_multishit.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_notif.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_opacity.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_recents.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_statusbar.png
Diff not rendered.
Binary file removed res/drawable-xxxhdpi/ic_various_shit.png
Diff not rendered.
Binary file removed res/drawable/activities_icon.png
Diff not rendered.
Binary file removed res/drawable/aicp_logo_bg.png
Diff not rendered.

0 comments on commit 75b568b

Please sign in to comment.