1. 程式人生 > 其它 >MX Player 一些修改方法記錄-2021.12.07

MX Player 一些修改方法記錄-2021.12.07

說明

作為一個有強迫症但是技術又很渣的菜狗,對於MX Player這樣的神軟總是躍躍欲試,學習了眾多大佬的修改成果後,記錄一些修改方法,僅限於修改佈局等功能,不涉及付費破解(主要是我不會)。

修改記錄

1,去指定字型

a. 刪除\res\font目錄下的所有ttf字型檔案;
b. 在\res\values目錄新建fonts.xml
fonts.xml內容為:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item type="font" name="muli_extrabold">false</item>
    <item type="font" name="muli_extrabolditalic">false</item>
    <item type="font" name="muli_italic">false</item>
    <item type="font" name="muli_light">false</item>
    <item type="font" name="muli_lightitalic">false</item>
    <item type="font" name="muli_regular">false</item>
    <item type="font" name="muli_semibold">false</item>
    <item type="font" name="muli_semibolditalic">false</item>  <!--將所有刪除的字型名字放在name=後面,有多少字型就改多少行-->
</resources>

注:此方法適用於使用APKDB等反編譯軟體,如果使用MT修改的話,在刪除字型後,開啟resources.arsc,font/font,將其中所有的:

<string name="ttf_muli_black">res/font/ttf_muli_black.ttf</string>

改為:

<bool name="ttf_muli_black">false</bool>

有多少字型就改多少行。

2,去啟動頁

a, 開啟AndroidManifest.xml檔案;
b,

<activity android:configChanges="keyboard|keyboardHidden|layoutDirection|locale|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode 
    android:exported="true" 
    android:launchMode="singleTop" 
    android:name="com.mxtech.videoplayer.pro.ActivityMediaList" 
    android:theme="@style/Default.White.Welcome" <!--刪除.White.Welcome-->
    android:windowSoftInputMode="stateAlwaysHidden">

3,精簡語言

略過
注意在\res\values\arrays.xml檔案裡刪除其他語言條目

4,去除檔案右側三點選單中的“MX 分享”和“在私密資料夾中鎖定”

a, 開啟\res\layout\fragment_more_bottom_sheet_dialog.xml檔案,
b,

<LinearLayout 
    android:gravity="center_vertical" 
    android:orientation="horizontal" 
    android:id="@id/transfer_share" 
    android:visibility="gone" <!--此處新增這一行-->
    android:paddingLeft="16.0dip" 
    android:paddingRight="16.0dip" 
    android:layout_width="fill_parent" 
    android:layout_height="56.0dip">
<LinearLayout 
    android:gravity="center_vertical" 
    android:orientation="horizontal" 
    android:id="@id/option_private_folder" 
    android:visibility="gone" <!--此處新增這一行-->
    android:paddingLeft="16.0dip" 
    android:paddingRight="16.0dip" 
    android:layout_width="fill_parent" 
    android:layout_height="56.0dip">

5,去除側邊欄中的“應用語言”、“檔案傳輸”、“私密資料夾”

a, 開啟\res\layout\layout_drawerlayout_content_global_user.xml檔案
b, 去除 應用語言

<androidx.appcompat.widget.AppCompatTextView 
    android:id="@id/tv_app_language" 
    android:visibility="gone" <!--此處新增這一行-->
    android:background="?selectableItemBackground" 
    android:paddingLeft="16.0dip" 
    android:focusable="true" 
    android:clickable="true" 
    android:layout_width="fill_parent" 
    android:layout_height="@dimen/dp_48" 
    android:layout_marginLeft="0.0dip" 
    android:layout_marginTop="@dimen/dp8" 
    android:text="@string/app_languages" 
    android:drawableLeft="@drawable/ic_app_language_navigation__light" 
    android:drawablePadding="22.0dip" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintTop_toTopOf="parent" 
    style="?globalNavigationTextAppearance" />

C, 去除 檔案傳輸、私密資料夾 方法同上,在android:id="@id/ll_file_transfer"android:id="@id/include_private_folder"後各新增一行android:visibility="gone"

6,去除首頁左上角三槓導航中幫助右側的箭頭

a, 開啟\res\layout\layout_drawerlayout_content_global_user.xml檔案
b,

<androidx.appcompat.widget.AppCompatImageView 
    android:src="@drawable/mxskin__ic_arrow_navigation__light" 
    app:layout_constraintBottom_toBottomOf="@id/tv_help" 
    android:visibility="gone" <!--此處新增這一行-->
    app:layout_constraintRight_toRightOf="parent" 
    app:layout_constraintTop_toTopOf="@id/tv_help" 
    app:mxSkin="src" style="?globalNavigationArrow" />

7,去除視訊播放頁右上角三點選單“更多”中的“幫助、更新內容、功能、常見疑問、檢查更新、錯誤報告、關於”

a, 開啟\res\layout\menu_sub_more.xml檔案
b, 方法同上,在android:id="@id/textView4"android:id="@id/tv_whats_new"android:id="@id/tv_features"android:id="@id/tv_faq"android:id="@id/tv_check_for_update"android:id="@id/tv_bug_report"android:id="@id/tv_about"後面新增android:visibility="gone"

8,去除首頁檔案選中後右上角三點選單中的“在私密資料夾中鎖定”和“MX分享”

a, 開啟\res\menu\list_action_mode.xml檔案
b, 將

<item 
    android:icon="@drawable/ic_private_file_menu_icon" 
    android:id="@id/option_private_folder" 
    android:title="@string/lock_in_private_folder" 
    android:alphabeticShortcut="f" 
    app:showAsAction="ifRoom" />

刪除:
c,

<item 
    android:icon="@drawable/ic_share_white_24dp" 
    android:id="@id/mx_share" 
    android:visibility="gone" <!--此處新增這一行-->
    android:title="@string/mxshare_file" 
    android:alphabeticShortcut="s" 
    app:showAsAction="ifRoom" />

9,去首次啟動的 [側邊欄更多功能引導提示]

a, 開啟\smali\com\mxtech\videoplayer\drawerlayout\view\NavigationDrawerGuideView.smali檔案
b,

    const-string v0, "key_navigation_drawer_tips_show"

    invoke-interface {p2, v0, p3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result p2
	
    const p2, 0x1  #此處新增這一行
	
    if-nez p2, :cond_3

備註

在刪除不需要的佈局的時候,可以採用上面常用的辦法,在對應ID後新增android:visibility="gone"(意思是不佔位置不顯示),也可以將

android:layout_width="XXXXX" 
android:layout_height="XXXXX"

中的XXXXX改為0dp或者0.0dip(也就是將長寬尺寸都改成0),甚至還可以將相關內容直接刪除,三種方法可以靈活使用,如果一種不行換一種方法便是。