/ app / src / main / java / com / reandroid / app / AndroidManifest.java
AndroidManifest.java
  1  /*
  2   *  Copyright (C) 2022 github.com/REAndroid
  3   *
  4   *  Licensed under the Apache License, Version 2.0 (the "License");
  5   *  you may not use this file except in compliance with the License.
  6   *  You may obtain a copy of the License at
  7   *
  8   *      http://www.apache.org/licenses/LICENSE-2.0
  9   *
 10   * Unless required by applicable law or agreed to in writing, software
 11   * distributed under the License is distributed on an "AS IS" BASIS,
 12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13   * See the License for the specific language governing permissions and
 14   * limitations under the License.
 15   */
 16  package com.reandroid.app;
 17  
 18  import com.reandroid.utils.ObjectsUtil;
 19  
 20  @SuppressWarnings("unused")
 21  public interface AndroidManifest {
 22  
 23      String getPackageName();
 24      void setPackageName(String packageName);
 25  
 26      String getApplicationClassName();
 27      void setApplicationClassName(String className);
 28  
 29      String getMainActivityClassName();
 30      void setMainActivityClassName(String className);
 31  
 32      Integer getVersionCode();
 33      void setVersionCode(int version);
 34      String getVersionName();
 35      void setVersionName(String name);
 36      Integer getPlatformBuildVersionCode();
 37      void setPlatformBuildVersionCode(int version);
 38      Object getPlatformBuildVersionName();
 39      void setPlatformBuildVersionName(Object name);
 40  
 41      Integer getCompileSdkVersion();
 42      void setCompileSdkVersion(int version);
 43      String getCompileSdkVersionCodename();
 44      void setCompileSdkVersionCodename(String name);
 45  
 46      Integer getMinSdkVersion();
 47      void setMinSdkVersion(int version);
 48  
 49      Integer getTargetSdkVersion();
 50      void setTargetSdkVersion(int version);
 51  
 52      default AndroidApiLevel getPlatformBuild(){
 53          Integer api = getPlatformBuildVersionCode();
 54          if(api != null){
 55              return AndroidApiLevel.forApi(api);
 56          }
 57          return null;
 58      }
 59      default void setPlatformBuild(AndroidApiLevel apiLevel){
 60          setPlatformBuildVersionCode(apiLevel.getApi());
 61          setPlatformBuildVersionName(apiLevel.getVersion());
 62      }
 63      default AndroidApiLevel getCompileSdk(){
 64          Integer api = getCompileSdkVersion();
 65          if(api != null){
 66              return AndroidApiLevel.forApi(api);
 67          }
 68          return null;
 69      }
 70      default void setCompileSdk(AndroidApiLevel apiLevel){
 71          setCompileSdkVersion(apiLevel.getApi());
 72          setCompileSdkVersionCodename(apiLevel.getVersion());
 73      }
 74  
 75      int ID_authorities = ObjectsUtil.of(0x01010018);
 76      int ID_compileSdkVersionCodename = ObjectsUtil.of(0x01010573);
 77      int ID_compileSdkVersion = ObjectsUtil.of(0x01010572);
 78      int ID_configChanges = ObjectsUtil.of(0x0101001f);
 79      int ID_debuggable = ObjectsUtil.of(0x0101000f);
 80      int ID_exported = ObjectsUtil.of(0x01010010);
 81      int ID_extractNativeLibs = ObjectsUtil.of(0x010104ea);
 82      int ID_host = ObjectsUtil.of(0x01010028);
 83      int ID_icon = ObjectsUtil.of(0x01010002);
 84      int ID_id = ObjectsUtil.of(0x010100d0);
 85      int ID_isFeatureSplit = ObjectsUtil.of(0x0101055b);
 86      int ID_isSplitRequired = ObjectsUtil.of(0x01010591);
 87      int ID_label = ObjectsUtil.of(0x01010001);
 88      int ID_maxSdkVersion = ObjectsUtil.of(0x01010271);
 89      int ID_minSdkVersion = ObjectsUtil.of(0x0101020c);
 90      int ID_name = ObjectsUtil.of(0x01010003);
 91      int ID_requiredSplitTypes = ObjectsUtil.of(0x0101064e);
 92      int ID_resource = ObjectsUtil.of(0x01010025);
 93      int ID_roundIcon = ObjectsUtil.of(0x0101052c);
 94      int ID_screenOrientation = ObjectsUtil.of(0x0101001e);
 95      int ID_splitTypes = ObjectsUtil.of(0x0101064f);
 96      int ID_targetActivity = ObjectsUtil.of(0x01010202);
 97      int ID_targetSdkVersion = ObjectsUtil.of(0x01010270);
 98      int ID_theme = ObjectsUtil.of(0x01010000);
 99      int ID_value = ObjectsUtil.of(0x01010024);
100      int ID_versionCode = ObjectsUtil.of(0x0101021b);
101      int ID_versionName = ObjectsUtil.of(0x0101021c);
102  
103      String NAME_authorities = ObjectsUtil.of("authorities");
104      String NAME_compileSdkVersionCodename = ObjectsUtil.of("compileSdkVersionCodename");
105      String NAME_compileSdkVersion = ObjectsUtil.of("compileSdkVersion");
106      String NAME_configChanges = ObjectsUtil.of("configChanges");
107      String NAME_coreApp = ObjectsUtil.of("coreApp");
108      String NAME_debuggable = ObjectsUtil.of("debuggable");
109      String NAME_exported = ObjectsUtil.of("exported");
110      String NAME_extractNativeLibs = ObjectsUtil.of("extractNativeLibs");
111      String NAME_host = ObjectsUtil.of("host");
112      String NAME_icon = ObjectsUtil.of("icon");
113      String NAME_id = ObjectsUtil.of("id");
114      String NAME_installLocation = ObjectsUtil.of("installLocation");
115      String NAME_isFeatureSplit = ObjectsUtil.of("isFeatureSplit");
116      String NAME_isSplitRequired = ObjectsUtil.of("isSplitRequired");
117      String NAME_label = ObjectsUtil.of("label");
118      String NAME_maxSdkVersion = ObjectsUtil.of("maxSdkVersion");
119      String NAME_minSdkVersion = ObjectsUtil.of("minSdkVersion");
120      String NAME_name = ObjectsUtil.of("name");
121      String NAME_PACKAGE = ObjectsUtil.of("package");
122      String NAME_platformBuildVersionCode = ObjectsUtil.of("platformBuildVersionCode");
123      String NAME_platformBuildVersionName = ObjectsUtil.of("platformBuildVersionName");
124      String NAME_requiredSplitTypes = ObjectsUtil.of("requiredSplitTypes");
125      String NAME_resource = ObjectsUtil.of("resource");
126      String NAME_roundIcon = ObjectsUtil.of("roundIcon");
127      String NAME_screenOrientation = ObjectsUtil.of("screenOrientation");
128      String NAME_split = ObjectsUtil.of("split");
129      String NAME_splitTypes = ObjectsUtil.of("splitTypes");
130      String NAME_targetActivity = ObjectsUtil.of("targetActivity");
131      String NAME_targetSdkVersion = ObjectsUtil.of("targetSdkVersion");
132      String NAME_theme = ObjectsUtil.of("theme");
133      String NAME_value = ObjectsUtil.of("value");
134      String NAME_versionCode = ObjectsUtil.of("versionCode");
135      String NAME_versionName = ObjectsUtil.of("versionName");
136  
137      String TAG_action = ObjectsUtil.of("action");
138      String TAG_activity_alias = ObjectsUtil.of("activity-alias");
139      String TAG_activity = ObjectsUtil.of("activity");
140      String TAG_application = ObjectsUtil.of("application");
141      String TAG_category = ObjectsUtil.of("category");
142      String TAG_data = ObjectsUtil.of("data");
143      String TAG_intent_filter = ObjectsUtil.of("intent-filter");
144      String TAG_manifest = ObjectsUtil.of("manifest");
145      String TAG_meta_data = ObjectsUtil.of("meta-data");
146      String TAG_package = ObjectsUtil.of("package");
147      String TAG_permission = ObjectsUtil.of("permission");
148      String TAG_provider = ObjectsUtil.of("provider");
149      String TAG_receiver = ObjectsUtil.of("receiver");
150      String TAG_service = ObjectsUtil.of("service");
151      String TAG_uses_feature = ObjectsUtil.of("uses-feature");
152      String TAG_uses_library = ObjectsUtil.of("uses-library");
153      String TAG_uses_permission = ObjectsUtil.of("uses-permission");
154      String TAG_uses_sdk = ObjectsUtil.of("uses-sdk");
155  
156      String VALUE_android_intent_action_MAIN = ObjectsUtil.of("android.intent.action.MAIN");
157  
158      String FILE_NAME = ObjectsUtil.of("AndroidManifest.xml");
159      String FILE_NAME_BIN = ObjectsUtil.of("AndroidManifest.xml.bin");
160      String FILE_NAME_JSON = ObjectsUtil.of("AndroidManifest.xml.json");
161  
162      String EMPTY_MANIFEST_TAG = ObjectsUtil.of("x");
163  
164  }