utermux

前言

这个文章适用于不想用魔改版但是又想改背景的同学。

原视频:

准备

你需要:

开始

首先,如果你在Play商店/Github渠道安装的Termux,那么恭喜你,会比从F-Droid版本安装的Termux多一个步骤!

1.添加drawable

首先,你需要打开MT文件管理器,然后打开Termux安装包的所在路径,点一下那个apk文件,点击“查看”按钮。

1.1 点击resources.arsc
1.2 选择Arsc编辑器
1.3 点击com.termux
1.4 然后点击drawable
1.5 再点一次drawable
1.6 然后点击右上角的三个点
1.7 添加
1.8 新建
1.9 随便命名一个
1.10 找到刚刚命名的来源
1.11 点一下
1.12 把res/xxxx修改成res/你图片的文件名
1.13 确定
1.14 保存并退出Arsc编辑器

2.添加图片

2.1 打开res文件夹
2.2 在MT文件管理器的左侧打开图片的所在路径
2.3 长按图片
2.4 添加(到APK)

3.添加ImageView控件

3.1 添加完成之后,编辑res文件夹中的-A1.xml
3.2 反编译
3.3 把原来的全部删掉把下面的加进去:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView
        android:background="@7f0700a1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <com.termux.app.terminal.TermuxActivityRootView
        android:orientation="vertical"
        android:id="@7f080045"
        android:background="@010800a9"
        android:fitsSystemWindows="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <RelativeLayout
            android:orientation="vertical"
            android:id="@7f080044"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginLeft="3dp"
            android:layout_marginTop="0dp"
            android:layout_marginRight="3dp"
            android:layout_marginBottom="0dp"
            android:layout_weight="1.0"
            android:layout_marginHorizontal="3dp"
            android:layout_marginVertical="0dp">
            <androidx.drawerlayout.widget.DrawerLayout
                android:id="@7f080098"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_above="@7f080190"
                android:layout_alignParentTop="true">
                <com.termux.view.TerminalView
                    android:scrollbarThumbVertical="@7f07009b"
                    android:id="@7f080191"
                    android:focusableInTouchMode="true"
                    android:scrollbars="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:autofillHints="password"
                    android:importantForAutofill="no" />
                <LinearLayout
                    android:layout_gravity="start"
                    android:orientation="vertical"
                    android:id="@7f0800d0"
                    android:background="@0106000b"
                    android:descendantFocusability="blocksDescendants"
                    android:layout_width="240dp"
                    android:layout_height="match_parent"
                    android:divider="@0106000d"
                    android:dividerHeight="0dp"
                    android:choiceMode="singleChoice">
                    <LinearLayout
                        android:orientation="horizontal"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">
                        <ImageButton
                            android:id="@7f08015c"
                            android:background="@null"
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:src="@7f070073"
                            android:contentDescription="@7f100029" />
                    </LinearLayout>
                    <ListView
                        android:layout_gravity="top"
                        android:id="@7f08018d"
                        android:longClickable="true"
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:choiceMode="singleChoice"
                        android:layout_weight="1.0" />
                    <LinearLayout
                        android:orientation="horizontal"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        style="?0101032e">
                        <Button
                            android:id="@7f0801b2"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@7f100034"
                            android:layout_weight="1.0"
                            style="?0101032f" />
                        <Button
                            android:id="@7f08011a"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:text="@7f100025"
                            android:layout_weight="1.0"
                            style="?0101032f" />
                    </LinearLayout>
                </LinearLayout>
            </androidx.drawerlayout.widget.DrawerLayout>
            <androidx.viewpager.widget.ViewPager
                android:id="@7f080190"
                android:visibility="gone"
                android:layout_width="match_parent"
                android:layout_height="37.500004dp"
                android:layout_alignParentBottom="true" />
        </RelativeLayout>
        <View
            android:id="@7f080043"
            android:background="@0106000d"
            android:layout_width="match_parent"
            android:layout_height="1dp" />
    </com.termux.app.terminal.TermuxActivityRootView>
</FrameLayout>

3.4 保存并退出

3.5 备份并卸载原来的Termux

3.6 然后安装修改好的APK文件

3.7 不知道怎么备份?看这里:https://wiki.termux.com/wiki/Backing_up_Termux

3.8 到这里,基本上就完成了。

4.GitHub/Play商店下载的Termux

4.1 需要修改AndroidManifest.xml中的android:shareUserId,改成别的,比如com.diy.termux

4.2 做完这一步之后,你就可以:
4.3 备份并卸载原来的Termux

4.4 然后安装修改好的APK文件

注意事项

  • 图片文件名跟drawable中的要相同!
  • 一定要F-Droid下载的Termux安装包!

成品

扫描二维码,在手机上阅读!
支付宝支付

支付宝支付

评论

icon_question.gificon_razz.gificon_sad.gificon_evil.gificon_exclaim.gificon_smile.gificon_redface.gificon_biggrin.gificon_surprised.gificon_eek.gificon_confused.gificon_cool.gificon_lol.gificon_mad.gificon_twisted.gificon_rolleyes.gificon_wink.gificon_idea.gificon_arrow.gificon_neutral.gificon_cry.gificon_mrgreen.gif

This is just a placeholder img.