├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── values │ │ │ ├── ids.xml │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings_settings.xml │ │ │ ├── styles.xml │ │ │ ├── strings.xml │ │ │ └── strings_about.xml │ │ ├── xml │ │ │ ├── provider_paths.xml │ │ │ └── settings.xml │ │ ├── drawable │ │ │ ├── circle.xml │ │ │ ├── ic_title_24dp.xml │ │ │ ├── ic_layers_24dp.xml │ │ │ ├── ic_audiotrack_24dp.xml │ │ │ ├── ic_mode_edit_24dp.xml │ │ │ ├── ic_more_vert_24dp.xml │ │ │ ├── ic_build_24dp.xml │ │ │ ├── ic_build_white_24dp.xml │ │ │ ├── ic_delete_forever_24dp.xml │ │ │ ├── ic_unarchive_24dp.xml │ │ │ └── ic_attach_file_24dp.xml │ │ ├── menu │ │ │ ├── menu_patcher.xml │ │ │ └── menu_main.xml │ │ └── layout │ │ │ ├── fragment_assets_list.xml │ │ │ ├── view_empty_assets.xml │ │ │ ├── view_template_item.xml │ │ │ ├── view_color_picker.xml │ │ │ ├── activity_settings.xml │ │ │ ├── activity_patcher.xml │ │ │ ├── fragment_theme_patcher.xml │ │ │ ├── item_assets_adapter.xml │ │ │ ├── fragment_assets_picker.xml │ │ │ └── activity_main.xml │ │ ├── java │ │ └── com │ │ │ └── pddstudio │ │ │ └── otgsubs │ │ │ ├── events │ │ │ ├── RefreshItemListEvent.java │ │ │ ├── PatchThemeDialogEvent.java │ │ │ ├── ImportAssetsFromApkEvent.java │ │ │ ├── FileChooserDialogEvent.java │ │ │ ├── AssetTypeAddedEvent.java │ │ │ ├── ExistingAssetsItemEvent.java │ │ │ ├── ColorChooserDialogEvent.java │ │ │ └── PatchThemePreparationEvent.java │ │ │ ├── models │ │ │ ├── ColorChooserType.java │ │ │ ├── AssetsModificationType.java │ │ │ ├── FileChooserType.java │ │ │ └── AssetsAdapterItem.java │ │ │ ├── utils │ │ │ ├── FormattingUtils.java │ │ │ ├── Preferences.java │ │ │ ├── DialogUtils.java │ │ │ ├── DeviceUtils.java │ │ │ ├── ThemeUtils.java │ │ │ └── DrawerUtils.java │ │ │ ├── OTGSubsApplication.java │ │ │ ├── beans │ │ │ ├── EventBusBean.java │ │ │ ├── NavigationBean.java │ │ │ ├── ManifestProcessorBean.java │ │ │ └── PackageInfoBean.java │ │ │ ├── dialogs │ │ │ ├── InfoDialog.java │ │ │ └── InputDialog.java │ │ │ ├── views │ │ │ ├── EmptyAssetsView.java │ │ │ ├── TemplateItemView.java │ │ │ └── ColorPickerView.java │ │ │ ├── adapters │ │ │ └── AssetsPageAdapter.java │ │ │ ├── receivers │ │ │ └── PackageManagerReceiver.java │ │ │ ├── services │ │ │ ├── ImportApkService.java │ │ │ ├── PackageService.java │ │ │ └── PatchTemplateService.java │ │ │ ├── fragments │ │ │ ├── AssetsPickerFragment.java │ │ │ ├── AssetsListFragment.java │ │ │ └── ThemePatcherFragment.java │ │ │ ├── SettingsActivity.java │ │ │ └── PatcherActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── substratum-packager ├── .gitignore ├── libs │ ├── zipio-lib-1.8.jar │ ├── zipsigner-lib-1.17.jar │ ├── kellinwood-logging-lib-1.1.jar │ ├── zipsigner-lib-optional-1.16.jar │ ├── kellinwood-logging-log4j-1.0.jar │ └── kellinwood-logging-android-1.4.jar ├── src │ └── main │ │ ├── assets │ │ ├── source.zip │ │ └── substratum.zip │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── pddstudio │ │ │ └── substratum │ │ │ └── packager │ │ │ ├── PackageCallback.java │ │ │ ├── models │ │ │ ├── AssetsType.java │ │ │ ├── AssetFileInfo.java │ │ │ └── ApkInfo.java │ │ │ ├── utils │ │ │ ├── AssetUtils.java │ │ │ ├── ZipUtils.java │ │ │ └── ApkHelper.java │ │ │ ├── ApkExtractor.java │ │ │ └── SubstratumPackager.java │ │ └── res │ │ └── values │ │ └── strings.xml ├── proguard-rules.pro └── build.gradle ├── .hgignore ├── substratum-template-patcher ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ └── java │ │ └── com │ │ └── pddstudio │ │ └── substratum │ │ └── template │ │ └── patcher │ │ ├── internal │ │ ├── Patcher.java │ │ ├── LinePatcher.java │ │ └── model │ │ │ ├── JsonConfigModel.java │ │ │ └── Template.java │ │ ├── ThemeConfiguration.java │ │ ├── PatchingException.java │ │ ├── TemplateConfiguration.java │ │ ├── XmlPatcher.java │ │ └── TemplatePatcher.java ├── proguard-rules.pro └── build.gradle ├── gfx ├── otgsubs.png ├── en-play-badge.png └── otgsubs_banner.jpg ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── .gitignore ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /substratum-packager/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | 2 | .idea/instapk.xml 3 | instapk.log* -------------------------------------------------------------------------------- /substratum-template-patcher/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /gfx/otgsubs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/gfx/otgsubs.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':substratum-packager', ':substratum-template-patcher' 2 | -------------------------------------------------------------------------------- /gfx/en-play-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/gfx/en-play-badge.png -------------------------------------------------------------------------------- /gfx/otgsubs_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/gfx/otgsubs_banner.jpg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /substratum-packager/libs/zipio-lib-1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/libs/zipio-lib-1.8.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /substratum-packager/src/main/assets/source.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/src/main/assets/source.zip -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /substratum-packager/libs/zipsigner-lib-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/libs/zipsigner-lib-1.17.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /substratum-packager/src/main/assets/substratum.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/src/main/assets/substratum.zip -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | substratum-template-patcher 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /substratum-packager/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /substratum-packager/libs/kellinwood-logging-lib-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/libs/kellinwood-logging-lib-1.1.jar -------------------------------------------------------------------------------- /substratum-packager/libs/zipsigner-lib-optional-1.16.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/libs/zipsigner-lib-optional-1.16.jar -------------------------------------------------------------------------------- /substratum-packager/libs/kellinwood-logging-log4j-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/libs/kellinwood-logging-log4j-1.0.jar -------------------------------------------------------------------------------- /substratum-packager/libs/kellinwood-logging-android-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDDStudio/OTGSubs/develop/substratum-packager/libs/kellinwood-logging-android-1.4.jar -------------------------------------------------------------------------------- /app/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/RefreshItemListEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | /** 4 | * Created by pddstudio on 24/04/2017. 5 | */ 6 | 7 | public class RefreshItemListEvent {} 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/models/ColorChooserType.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.models; 2 | 3 | /** 4 | * Created by pddstudio on 26/04/2017. 5 | */ 6 | 7 | public enum ColorChooserType { 8 | PRIMARY_COLOR, 9 | PRIMARY_DARK_COLOR, 10 | IGNORE 11 | } 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Apr 20 14:42:44 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/models/AssetsModificationType.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.models; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by pddstudio on 25/04/2017. 7 | */ 8 | 9 | public enum AssetsModificationType implements Serializable { 10 | RENAME, 11 | DELETE 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/models/FileChooserType.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.models; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by pddstudio on 24/04/2017. 7 | */ 8 | 9 | public enum FileChooserType implements Serializable { 10 | DIRECTORY, 11 | ZIP_FILE, 12 | IGNORE 13 | } 14 | -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/java/com/pddstudio/substratum/template/patcher/internal/Patcher.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.template.patcher.internal; 2 | 3 | /** 4 | * Created by pddstudio on 25/04/2017. 5 | */ 6 | 7 | public interface Patcher { 8 | F patch(F target, K key, V value); 9 | } 10 | -------------------------------------------------------------------------------- /substratum-packager/src/main/java/com/pddstudio/substratum/packager/PackageCallback.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.packager; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * Created by pddstudio on 21/04/2017. 7 | */ 8 | 9 | public interface PackageCallback { 10 | void onPackagingFailed(int errorCode); 11 | void onPackagingSucceeded(File signedApk); 12 | } 13 | -------------------------------------------------------------------------------- /substratum-packager/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | substratum-packager 3 | Fonts 4 | Overlays 5 | Audio 6 | Boot Animations 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_title_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/java/com/pddstudio/substratum/template/patcher/ThemeConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.template.patcher; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by pddstudio on 04/05/2017. 7 | */ 8 | 9 | public interface ThemeConfiguration { 10 | String getThemeName(); 11 | String getThemeAuthor(); 12 | List getThemeTemplates(); 13 | } 14 | -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/java/com/pddstudio/substratum/template/patcher/PatchingException.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.template.patcher; 2 | 3 | /** 4 | * Created by pddstudio on 25/04/2017. 5 | */ 6 | 7 | public class PatchingException extends Exception { 8 | 9 | public PatchingException(Exception e) { 10 | super(e); 11 | } 12 | 13 | public PatchingException(String message) { 14 | super(message); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/PatchThemeDialogEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | /** 4 | * Created by pddstudio on 04/05/2017. 5 | */ 6 | 7 | public class PatchThemeDialogEvent { 8 | 9 | private final boolean showDialog; 10 | 11 | public PatchThemeDialogEvent(boolean showDialog) { 12 | this.showDialog = showDialog; 13 | } 14 | 15 | public boolean isShowDialogEvent() { 16 | return showDialog; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_layers_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_audiotrack_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/utils/FormattingUtils.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.utils; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | 5 | /** 6 | * Created by pddstudio on 08/05/2017. 7 | */ 8 | 9 | public class FormattingUtils { 10 | 11 | private FormattingUtils() { 12 | //disable instance creation 13 | } 14 | 15 | public static String formatUserThemeName(String userThemeName) { 16 | return StringUtils.replace(userThemeName, " ", "_"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_mode_edit_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_more_vert_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_build_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_build_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/java/com/pddstudio/substratum/template/patcher/internal/LinePatcher.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.template.patcher.internal; 2 | 3 | /** 4 | * Created by pddstudio on 25/04/2017. 5 | */ 6 | 7 | public abstract class LinePatcher implements Patcher { 8 | 9 | @Override 10 | public String patch(String target, String key, String value) { 11 | return patchLine(target, key, value); 12 | } 13 | 14 | public abstract String patchLine(String line, String targetKey, String replacementValue); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete_forever_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_patcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_unarchive_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/OTGSubsApplication.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs; 2 | 3 | import android.app.Application; 4 | 5 | import com.google.firebase.analytics.FirebaseAnalytics; 6 | 7 | import org.androidannotations.annotations.EApplication; 8 | 9 | /** 10 | * Created by pddstudio on 25/04/2017. 11 | */ 12 | 13 | @EApplication 14 | public class OTGSubsApplication extends Application { 15 | 16 | @Override 17 | public void onCreate() { 18 | super.onCreate(); 19 | if(BuildConfig.DEBUG) { 20 | FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_attach_file_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /substratum-template-patcher/src/main/java/com/pddstudio/substratum/template/patcher/TemplateConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.template.patcher; 2 | 3 | import java.util.HashMap; 4 | 5 | /** 6 | * Created by pddstudio on 25/04/2017. 7 | */ 8 | 9 | public interface TemplateConfiguration { 10 | HashMap getThemeMappings(); 11 | void updateThemeMappings(HashMap updatedMap); 12 | void setTemplateName(String templateName); 13 | String getTemplateName(); 14 | String getTemplateFileName(); 15 | String getTemplateId(); 16 | String getTemplateTitle(); 17 | String getTemplateType(); 18 | String getTemplateDescription(); 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/ImportAssetsFromApkEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | import com.pddstudio.substratum.packager.models.AssetFileInfo; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * Created by pddstudio on 24/04/2017. 10 | */ 11 | 12 | public class ImportAssetsFromApkEvent { 13 | 14 | private final List assets; 15 | 16 | public ImportAssetsFromApkEvent() { 17 | assets = new ArrayList<>(); 18 | } 19 | 20 | public ImportAssetsFromApkEvent withList(List files) { 21 | this.assets.addAll(files); 22 | return this; 23 | } 24 | 25 | public List getAssets() { 26 | return assets; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /substratum-packager/src/main/java/com/pddstudio/substratum/packager/models/AssetsType.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.packager.models; 2 | 3 | import com.pddstudio.substratum.packager.R; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by pddstudio on 24/04/2017. 9 | */ 10 | 11 | public enum AssetsType implements Serializable { 12 | FONTS(R.string.fragment_title_fonts), 13 | OVERLAYS(R.string.fragment_title_overlays), 14 | AUDIO(R.string.fragment_title_audio), 15 | BOOT_ANIMATIONS(R.string.fragment_title_boot_animations); 16 | 17 | private final int titleName; 18 | 19 | AssetsType(int title) { 20 | this.titleName = title; 21 | } 22 | 23 | public int getTitleRes() { 24 | return titleName; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/beans/EventBusBean.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.beans; 2 | 3 | import org.androidannotations.annotations.AfterInject; 4 | import org.androidannotations.annotations.EBean; 5 | import org.greenrobot.eventbus.EventBus; 6 | 7 | /** 8 | * Created by pddstudio on 21/04/2017. 9 | */ 10 | 11 | @EBean(scope = EBean.Scope.Singleton) 12 | public class EventBusBean { 13 | 14 | private EventBus bus; 15 | 16 | @AfterInject 17 | protected void prepareBean() { 18 | if(bus == null) { 19 | bus = EventBus.getDefault(); 20 | } 21 | } 22 | 23 | public EventBus getEventBus() { 24 | return bus; 25 | } 26 | 27 | public void post(Object o) { 28 | getEventBus().post(o); 29 | } 30 | 31 | public void register(Object o) { 32 | getEventBus().register(o); 33 | } 34 | 35 | public void unregister(Object o) { 36 | getEventBus().unregister(o); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/dialogs/InfoDialog.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.dialogs; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.StringRes; 5 | 6 | import com.afollestad.materialdialogs.MaterialDialog; 7 | 8 | import org.androidannotations.annotations.EBean; 9 | import org.androidannotations.annotations.RootContext; 10 | 11 | /** 12 | * Created by pddstudio on 08/05/2017. 13 | */ 14 | 15 | @EBean 16 | public class InfoDialog { 17 | 18 | @RootContext 19 | Context context; 20 | 21 | private MaterialDialog infoDialog; 22 | 23 | public void show(@StringRes int title, @StringRes int content) { 24 | infoDialog = new MaterialDialog.Builder(context).title(title).content(content).positiveText(android.R.string.ok).show(); 25 | } 26 | 27 | public void dismiss() { 28 | if(infoDialog != null && infoDialog.isShowing()) { 29 | infoDialog.dismiss(); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 12 | 13 | 17 | 18 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_assets_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 18 | 19 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #3F51B5 5 | #303F9F 6 | #FF4081 7 | 8 | #F44336 9 | #D32F2F 10 | #607D8B 11 | 12 | #4CAF50 13 | #388E3C 14 | #795548 15 | 16 | #FF9800 17 | #F57C00 18 | #9E9E9E 19 | 20 | #66000000 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/FileChooserDialogEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | import com.pddstudio.otgsubs.models.FileChooserType; 4 | 5 | /** 6 | * Created by pddstudio on 21/04/2017. 7 | */ 8 | 9 | public class FileChooserDialogEvent { 10 | 11 | private String resultLocation; 12 | private boolean openRequest; 13 | private FileChooserType fileChooserType; 14 | 15 | public FileChooserDialogEvent(boolean openRequest, FileChooserType fileChooserType) { 16 | this.openRequest = openRequest; 17 | this.fileChooserType = fileChooserType; 18 | } 19 | 20 | public void setResult(String resultLocation) { 21 | this.resultLocation = resultLocation; 22 | } 23 | 24 | public String getResultLocation() { 25 | return resultLocation; 26 | } 27 | 28 | public boolean isOpenRequest() { 29 | return openRequest; 30 | } 31 | 32 | public FileChooserType getFileChooserType() { 33 | return fileChooserType; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/AssetTypeAddedEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | import com.pddstudio.substratum.packager.models.AssetFileInfo; 4 | import com.pddstudio.substratum.packager.models.AssetsType; 5 | 6 | /** 7 | * Created by pddstudio on 24/04/2017. 8 | */ 9 | 10 | public class AssetTypeAddedEvent { 11 | 12 | private final AssetsType assetsType; 13 | private final AssetFileInfo assetFileInfo; 14 | private boolean fragmentIgnore = true; 15 | 16 | public AssetTypeAddedEvent(AssetsType assetsType, AssetFileInfo assetFileInfo) { 17 | this.assetsType = assetsType; 18 | this.assetFileInfo = assetFileInfo; 19 | } 20 | 21 | public AssetsType getAssetsType() { 22 | return assetsType; 23 | } 24 | 25 | public AssetFileInfo getAssetFileInfo() { 26 | return assetFileInfo; 27 | } 28 | 29 | public boolean isIgnore() { 30 | return fragmentIgnore; 31 | } 32 | 33 | public void setFragmentIgnore(boolean fragmentIgnore) { 34 | this.fragmentIgnore = fragmentIgnore; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/pddstudio/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 14sp 6 | 18sp 7 | 2dp 8 | 20sp 9 | 16sp 10 | 16dp 11 | 12dp 12 | 13 | 14 | 0dp 15 | 16 | 16dp 17 | 56dp 18 | 19 | 0x02000000 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/ExistingAssetsItemEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | import com.pddstudio.otgsubs.models.AssetsModificationType; 4 | import com.pddstudio.substratum.packager.models.AssetFileInfo; 5 | 6 | /** 7 | * Created by pddstudio on 25/04/2017. 8 | */ 9 | 10 | public class ExistingAssetsItemEvent { 11 | 12 | private AssetFileInfo assetFileInfo; 13 | private AssetsModificationType modificationType; 14 | private String newName; 15 | 16 | public ExistingAssetsItemEvent(AssetFileInfo assetFileInfo, AssetsModificationType modificationType) { 17 | this.assetFileInfo = assetFileInfo; 18 | this.modificationType = modificationType; 19 | } 20 | 21 | public void setNewName(String newName) { 22 | this.newName = newName; 23 | } 24 | 25 | public AssetFileInfo getAssetFileInfo() { 26 | return assetFileInfo; 27 | } 28 | 29 | public AssetsModificationType getModificationType() { 30 | return modificationType; 31 | } 32 | 33 | public String getNewName() { 34 | return newName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /substratum-packager/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/pddstudio/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /substratum-template-patcher/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/pddstudio/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Base .gitignore taken from "https://raw.githubusercontent.com/github/gitignore/master/Android.gitignore" 2 | # Built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # Files for the ART/Dalvik VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | out/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | local.properties 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # Android Studio Navigation editor temp files 31 | .navigation/ 32 | 33 | # Android Studio captures folder 34 | captures/ 35 | 36 | # Intellij 37 | *.iml 38 | .idea/workspace.xml 39 | .idea/tasks.xml 40 | .idea/libraries 41 | .idea/misc.xml 42 | .idea/ 43 | 44 | # Keystore files 45 | *.jks 46 | 47 | # Google Firebase Configuration 48 | app/google-services.json 49 | 50 | # External native build folder generated in Android Studio 2.2 and later 51 | .externalNativeBuild 52 | .idea/vcs.xml 53 | .idea/misc.xml 54 | 55 | .idea/instapk.xml 56 | instapk.log* 57 | .playstore/* -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/utils/Preferences.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.utils; 2 | 3 | import com.pddstudio.otgsubs.R; 4 | 5 | import org.androidannotations.annotations.sharedpreferences.DefaultBoolean; 6 | import org.androidannotations.annotations.sharedpreferences.DefaultInt; 7 | import org.androidannotations.annotations.sharedpreferences.SharedPref; 8 | 9 | /** 10 | * Created by pddstudio on 28/07/16. 11 | */ 12 | @SharedPref(SharedPref.Scope.UNIQUE) 13 | public interface Preferences { 14 | 15 | @DefaultBoolean(value = false, keyRes = R.string.pref_item_tint_nav_bar_key) 16 | boolean tintNavigationBar(); 17 | 18 | @DefaultBoolean(value = true, keyRes = R.string.pref_item_crash_reports_key) 19 | boolean crashReportEnabled(); 20 | 21 | @DefaultBoolean(value = true, keyRes = R.string.pref_item_install_build_apk_key) 22 | boolean openPackageInstaller(); 23 | 24 | @DefaultInt(value = 0, keyRes = R.string.pref_item_app_theme_key) 25 | int themeId(); 26 | 27 | @DefaultBoolean(value = false, keyRes = R.string.pref_item_app_theme_changed_runtime_key) 28 | boolean themeChanged(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /substratum-packager/src/main/java/com/pddstudio/substratum/packager/utils/AssetUtils.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.substratum.packager.utils; 2 | 3 | import android.content.res.AssetManager; 4 | 5 | import java.io.File; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.OutputStream; 10 | 11 | /** 12 | * Created by pddstudio on 20/04/2017. 13 | */ 14 | 15 | public class AssetUtils { 16 | 17 | public static boolean copyFromAssetsToCache(File cacheDir, AssetManager assetManager, String assetFileName) throws IOException { 18 | InputStream inputStream = assetManager.open(assetFileName); 19 | File outputFile = new File(cacheDir, assetFileName); 20 | OutputStream outputStream = new FileOutputStream(outputFile); 21 | copyFile(inputStream, outputStream); 22 | return outputFile.exists(); 23 | } 24 | 25 | private static void copyFile(InputStream in, OutputStream out) throws IOException { 26 | byte[] buffer = new byte[1024]; 27 | int read; 28 | while((read = in.read(buffer)) != -1){ 29 | out.write(buffer, 0, read); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_empty_assets.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 20 | 21 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_template_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 17 | 18 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/pddstudio/otgsubs/events/ColorChooserDialogEvent.java: -------------------------------------------------------------------------------- 1 | package com.pddstudio.otgsubs.events; 2 | 3 | /** 4 | * Created by pddstudio on 26/04/2017. 5 | */ 6 | 7 | public class ColorChooserDialogEvent { 8 | 9 | private String resultColor; 10 | private boolean openRequest; 11 | private String templateId; 12 | private String templateKey; 13 | 14 | public ColorChooserDialogEvent(boolean openRequest, String templateId) { 15 | this.openRequest = openRequest; 16 | this.templateId = templateId; 17 | } 18 | 19 | public ColorChooserDialogEvent withTemplateKey(String templateKey) { 20 | this.templateKey = templateKey; 21 | return this; 22 | 23 | } 24 | 25 | public void setOpenRequest(boolean openRequest) { 26 | this.openRequest = openRequest; 27 | } 28 | 29 | public void setResult(String resultLocation) { 30 | this.resultColor = resultLocation; 31 | } 32 | 33 | public String getResultColor() { 34 | return resultColor; 35 | } 36 | 37 | public boolean isOpenRequest() { 38 | return openRequest; 39 | } 40 | 41 | public String getTemplateId() { 42 | return templateId; 43 | } 44 | 45 | public String getTemplateKey() { 46 | return templateKey; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_color_picker.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 17 | 18 | 23 | 24 |