往期教程:
apk反编译修改教程系列-----修改apk应用名称 任意修改名称 签名【一】
apk反编译修改教程系列-----任意修改apk版本号 版本名 防止自动更新【二】
apk反编译修改教程系列-----修改apk中的图片 任意更换apk桌面图片【三】
apk反编译修改教程系列---简单去除apk联网权限 其他权限 无法自动更新等【四】
apk反编译修改教程系列---简单去除apk开屏广告【五】
apk反编译修改教程系列---修改apk设置菜单选项名称 修改默认设置 增加减少选项【六】
apk反编译修改教程系列---简单给app添加启动弹窗 添加对话框 跳转指定网页等【七】
安卓玩机-----给app加注册码 app加弹窗 云注入弹窗
apk反编译修改教程系列---如何简单的汉化apk 手机端与电脑端同步演示【八】
apk反编译修改教程系列---修改apk包名等信息 让一个应用拥有无限分身 手机电脑同步演示【九】
apk反编译修改教程系列---修改apk的默认颜色 布局颜色 手机电脑同步演示【十】
很多软件他不具备横竖屏幕自动切换功能。尤其在很多平板安装软件中比较常见。当然有类似的工具可以强制操作,今天主要解析下如何简单的反编译修改apk让其固定屏幕显示。
操作步骤;
演示apk;小米计算器
工具:MT或者电脑端反编译工具
电脑端反编译工具
小米计算器正常打开是这样的。默认竖屏
常规操作--找到小米计算器apk。统一步骤、反编译apk后打开AndroidManifest.xml文件在其中查找portrait字符。查找到后替换为landscape.意思是默认竖屏修改为横屏。步骤很简单
电脑端:
修改后回编译。然后签名安装
手机端:
打开apk选择查看----选择AndroidManifest.xml文件---选择反编译。搜索portrait---全部替换为landscape。然后回编译签名安装即可
效果:
原代码
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" package="com.miui.calculator" platformBuildVersionCode="30000056" platformBuildVersionName="12.0.26"><permission android:name="com.miui.calculator.permission.SHOW_FLOAT_WINDOW" android:protectionLevel="privileged|signature"/><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/><uses-permission android:name="android.permission.GET_TASKS"/><uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/><uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW"/><uses-permission android:name="android.permission.FOREGROUND_SERVICE"/><uses-permission android:name="com.xiaomi.market.sdk.UPDATE"/><uses-permission android:name="com.miui.securitycenter.permission.SYSTEM_PERMISSION_DECLARE"/><uses-permission android:name="android.permission.VIBRATE"/><application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:icon="@drawable/app_icon" android:label="@string/app_name" android:name="com.miui.calculator.CalculatorApplication" android:supportsRtl="true"><meta-data android:name="android.max_aspect" android:value="2.2"/><meta-data android:name="app_description_title" android:resource="@string/uninstall_warning_title"/><meta-data android:name="app_description_content" android:resource="@string/uninstall_warning_content"/><meta-data android:name="mi_stat_channel" android:value="miui"/><meta-data android:name="required_permissions" android:value="@string/required_permissions"/><meta-data android:name="use_miui_font" android:value="true"/><activity android:exported="true" android:label="@string/app_name" android:launchMode="singleTop" android:name="com.miui.calculator.cal.CalculatorActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Simple.ActionBar.NoTitle" android:windowSoftInputMode="stateAlwaysHidden"><intent-filter><action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.DEFAULT"/><category android:name="android.intent.category.LAUNCHER"/><category android:name="android.intent.category.APP_CALCULATOR"/><category android:name="miui.intent.category.SYSAPP_TOOL"/></intent-filter><meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts"/><intent-filter><category android:name="android.intent.category.DEFAULT"/><data android:host="com.miui.calculator" android:path="/home" android:scheme="calculator"/></intent-filter><intent-filter><action android:name="mi.quicksearch.intent.action.RETRIEVE"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><meta-data android:name="mi.quicksearch.hints" android:resource="@xml/mi_quicksearch_hints"/><intent-filter><action android:name="android.intent.action.SEARCH"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><intent-filter><action android:name="com.miui.calculator.action.SCIENTIFIC_MODE"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><intent-filter><action android:name="com.miui.calculator.action.CONVERT"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><meta-data android:name="functionindex" android:resource="@xml/functionindex"/></activity><activity android:exported="true" android:label="@string/app_name" android:name="com.miui.calculator.cal.CalculatorTabActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Translucent.ActionBar.NoTitle" android:windowSoftInputMode="stateAlwaysHidden"/><activity android:exported="true" android:label="@string/app_name" android:name="com.miui.calculator.cal.DefaultCalculatorActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Translucent" android:windowSoftInputMode="stateAlwaysHidden"/><activity android:exported="true" android:label="@string/app_name" android:name="com.miui.calculator.cal.AllInOneCalculatorActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Simple" android:windowSoftInputMode="stateAlwaysHidden"/><activity android:label="@string/tax_city_picker" android:name="com.miui.calculator.tax.CityPickerActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.ActionBar"/><activity android:label="@string/tax_individual_income_tax_result" android:name="com.miui.calculator.tax.ResultOfTaxActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.ActionBar"/><activity android:label="@string/tax_individual_income_tax_result" android:name="com.miui.calculator.tax.ResultOfMortgageActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.ActionBar"/><activity android:exported="true" android:label="@string/wf_word_figure" android:name="com.miui.calculator.wordfigure.WordFigureActivity" android:screenOrientation="portriat"/><activity android:exported="true" android:label="@string/convertion_unit" android:name="com.miui.calculator.convert.ConvertActivity" android:screenOrientation="portriat"/><activity android:exported="true" android:label="@string/convert_currency" android:name="com.miui.calculator.convert.CurrencyActivity" android:screenOrientation="portriat"/><activity android:exported="true" android:label="@string/item_title_relationship" android:name="com.miui.calculator.relationship.RelationshipActivity" android:screenOrientation="portriat"/><activity android:exported="true" android:name="com.miui.calculator.cal.CalSettingsActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Settings"/><activity android:exported="true" android:label="@string/extra_deduction_title" android:name="com.miui.calculator.tax.ExtraDeductionPickActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Simple"/><activity android:excludeFromRecents="true" android:exported="false" android:label="" android:name="com.miui.calculator.tax.LicenseActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.LicenseActivity"/><activity android:exported="true" android:label="@string/convertion_unit_radix" android:name="com.miui.calculator.convert.RadixActivity" android:screenOrientation="portriat"/><activity android:label="@string/item_title_bmi" android:name="com.miui.calculator.convert.BmiActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Bmi" android:windowSoftInputMode="adjustResize"/><activity android:label="@string/item_title_result" android:name="com.miui.calculator.convert.BmiResultActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Simple"/><activity android:exported="false" android:label="@string/tax_insurance_and_fund" android:name="com.miui.calculator.cal.FiveInsuranceActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Simple"/><activity android:label="@string/histories" android:name="com.miui.calculator.cal.HistoryActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.Translucent"/><activity android:label="@string/histories" android:name="com.miui.calculator.cal.HistoryFromSettingActivity" android:screenOrientation="portriat" android:theme="@style/Calculator.Theme.Light.HistoryFromSettingActivity"/><service android:configChanges="keyboardHidden|layoutDirection|locale|orientation|screenLayout|screenSize" android:name="com.miui.calculator.floatwindow.FloatWindowService" android:permission="com.miui.calculator.permission.SHOW_FLOAT_WINDOW"><intent-filter><action android:name="miui.intent.calculator.FLOAT_WINDOW_SERVICE"/></intent-filter></service><receiver android:name="com.xiaomi.market.sdk.DownloadCompleteReceiver"><intent-filter><action android:name="android.intent.action.DOWNLOAD_COMPLETE"/></intent-filter></receiver><provider android:authorities="your_package_name.selfupdate.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider"><meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"/></provider><receiver android:exported="true" android:name="com.miui.voiceassist.mvs.client.MvsClientReceiver" android:permission="com.miui.voiceassist.MVS_BROADCAST"><intent-filter><action android:name="com.miui.voiceassist.mvs.client.ACTION_RESGISTER_MVS"/></intent-filter></receiver><meta-data android:name="com.miui.maml.sdk" android:value="true"/><meta-data android:name="springback" android:value="1.0"/><meta-data android:name="recyclerview" android:value="1.0"/><meta-data android:name="nest" android:value="1.0"/><meta-data android:name="dynamicoverscroller" android:value="1.0"/><meta-data android:name="recyclerview_animator" android:value="1.0"/><meta-data android:name="folme" android:value="1.0"/><meta-data android:name="core" android:value="1.0"/><meta-data android:name="viewpager" android:value="1.0"/><meta-data android:name="spring" android:value="1.0"/><meta-data android:name="animation" android:value="1.0"/></application>
</manifest>
修改后的代码
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" package="com.miui.calculator" platformBuildVersionCode="30000056" platformBuildVersionName="12.0.26"><permission android:name="com.miui.calculator.permission.SHOW_FLOAT_WINDOW" android:protectionLevel="privileged|signature"/><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/><uses-permission android:name="android.permission.GET_TASKS"/><uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/><uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW"/><uses-permission android:name="android.permission.FOREGROUND_SERVICE"/><uses-permission android:name="com.xiaomi.market.sdk.UPDATE"/><uses-permission android:name="com.miui.securitycenter.permission.SYSTEM_PERMISSION_DECLARE"/><uses-permission android:name="android.permission.VIBRATE"/><application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:icon="@drawable/app_icon" android:label="@string/app_name" android:name="com.miui.calculator.CalculatorApplication" android:supportsRtl="true"><meta-data android:name="android.max_aspect" android:value="2.2"/><meta-data android:name="app_description_title" android:resource="@string/uninstall_warning_title"/><meta-data android:name="app_description_content" android:resource="@string/uninstall_warning_content"/><meta-data android:name="mi_stat_channel" android:value="miui"/><meta-data android:name="required_permissions" android:value="@string/required_permissions"/><meta-data android:name="use_miui_font" android:value="true"/><activity android:exported="true" android:label="@string/app_name" android:launchMode="singleTop" android:name="com.miui.calculator.cal.CalculatorActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Simple.ActionBar.NoTitle" android:windowSoftInputMode="stateAlwaysHidden"><intent-filter><action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.DEFAULT"/><category android:name="android.intent.category.LAUNCHER"/><category android:name="android.intent.category.APP_CALCULATOR"/><category android:name="miui.intent.category.SYSAPP_TOOL"/></intent-filter><meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts"/><intent-filter><category android:name="android.intent.category.DEFAULT"/><data android:host="com.miui.calculator" android:path="/home" android:scheme="calculator"/></intent-filter><intent-filter><action android:name="mi.quicksearch.intent.action.RETRIEVE"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><meta-data android:name="mi.quicksearch.hints" android:resource="@xml/mi_quicksearch_hints"/><intent-filter><action android:name="android.intent.action.SEARCH"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><intent-filter><action android:name="com.miui.calculator.action.SCIENTIFIC_MODE"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><intent-filter><action android:name="com.miui.calculator.action.CONVERT"/><category android:name="android.intent.category.DEFAULT"/></intent-filter><meta-data android:name="functionindex" android:resource="@xml/functionindex"/></activity><activity android:exported="true" android:label="@string/app_name" android:name="com.miui.calculator.cal.CalculatorTabActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Translucent.ActionBar.NoTitle" android:windowSoftInputMode="stateAlwaysHidden"/><activity android:exported="true" android:label="@string/app_name" android:name="com.miui.calculator.cal.DefaultCalculatorActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Translucent" android:windowSoftInputMode="stateAlwaysHidden"/><activity android:exported="true" android:label="@string/app_name" android:name="com.miui.calculator.cal.AllInOneCalculatorActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Simple" android:windowSoftInputMode="stateAlwaysHidden"/><activity android:label="@string/tax_city_picker" android:name="com.miui.calculator.tax.CityPickerActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.ActionBar"/><activity android:label="@string/tax_individual_income_tax_result" android:name="com.miui.calculator.tax.ResultOfTaxActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.ActionBar"/><activity android:label="@string/tax_individual_income_tax_result" android:name="com.miui.calculator.tax.ResultOfMortgageActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.ActionBar"/><activity android:exported="true" android:label="@string/wf_word_figure" android:name="com.miui.calculator.wordfigure.WordFigureActivity" android:screenOrientation="landscape"/><activity android:exported="true" android:label="@string/convertion_unit" android:name="com.miui.calculator.convert.ConvertActivity" android:screenOrientation="landscape"/><activity android:exported="true" android:label="@string/convert_currency" android:name="com.miui.calculator.convert.CurrencyActivity" android:screenOrientation="landscape"/><activity android:exported="true" android:label="@string/item_title_relationship" android:name="com.miui.calculator.relationship.RelationshipActivity" android:screenOrientation="landscape"/><activity android:exported="true" android:name="com.miui.calculator.cal.CalSettingsActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Settings"/><activity android:exported="true" android:label="@string/extra_deduction_title" android:name="com.miui.calculator.tax.ExtraDeductionPickActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Simple"/><activity android:excludeFromRecents="true" android:exported="false" android:label="" android:name="com.miui.calculator.tax.LicenseActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.LicenseActivity"/><activity android:exported="true" android:label="@string/convertion_unit_radix" android:name="com.miui.calculator.convert.RadixActivity" android:screenOrientation="landscape"/><activity android:label="@string/item_title_bmi" android:name="com.miui.calculator.convert.BmiActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Bmi" android:windowSoftInputMode="adjustResize"/><activity android:label="@string/item_title_result" android:name="com.miui.calculator.convert.BmiResultActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Simple"/><activity android:exported="false" android:label="@string/tax_insurance_and_fund" android:name="com.miui.calculator.cal.FiveInsuranceActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Simple"/><activity android:label="@string/histories" android:name="com.miui.calculator.cal.HistoryActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.Translucent"/><activity android:label="@string/histories" android:name="com.miui.calculator.cal.HistoryFromSettingActivity" android:screenOrientation="landscape" android:theme="@style/Calculator.Theme.Light.HistoryFromSettingActivity"/><service android:configChanges="keyboardHidden|layoutDirection|locale|orientation|screenLayout|screenSize" android:name="com.miui.calculator.floatwindow.FloatWindowService" android:permission="com.miui.calculator.permission.SHOW_FLOAT_WINDOW"><intent-filter><action android:name="miui.intent.calculator.FLOAT_WINDOW_SERVICE"/></intent-filter></service><receiver android:name="com.xiaomi.market.sdk.DownloadCompleteReceiver"><intent-filter><action android:name="android.intent.action.DOWNLOAD_COMPLETE"/></intent-filter></receiver><provider android:authorities="your_package_name.selfupdate.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider"><meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"/></provider><receiver android:exported="true" android:name="com.miui.voiceassist.mvs.client.MvsClientReceiver" android:permission="com.miui.voiceassist.MVS_BROADCAST"><intent-filter><action android:name="com.miui.voiceassist.mvs.client.ACTION_RESGISTER_MVS"/></intent-filter></receiver><meta-data android:name="com.miui.maml.sdk" android:value="true"/><meta-data android:name="springback" android:value="1.0"/><meta-data android:name="recyclerview" android:value="1.0"/><meta-data android:name="nest" android:value="1.0"/><meta-data android:name="dynamicoverscroller" android:value="1.0"/><meta-data android:name="recyclerview_animator" android:value="1.0"/><meta-data android:name="folme" android:value="1.0"/><meta-data android:name="core" android:value="1.0"/><meta-data android:name="viewpager" android:value="1.0"/><meta-data android:name="spring" android:value="1.0"/><meta-data android:name="animation" android:value="1.0"/></application>
</manifest>
反编译工具的不同反编译后的文件也有差异。这个初学者要明白。同一个软件。很多工具反编译后会找不到修改的选项。但使用另外的工具反编译后有可以。主要是反编译工具的编译机制有所不同.类似的反编译效果其实有很多第三方工具可以强制修改。但教程的目的是让学习的友友了解反编译的具体操作和基本常识。
下期预告:---apk反编译简单去广告演示步骤一
**系列教程只是让初学者了解反编译的一些初步常识,尽量每一步都图文说明。详细的由浅入深解析apk的各种反编译操作。有兴趣的友友可以关注