安卓修改ROM 修改固件中的一些基本常识 自己做rom注意事项

修改rom 制作rom 解包rom的一些问题解析

安卓系列机型如何内置app 如何选择so文件内置

修改设置里 添加选项 添加文字 修改图标 修改版本号等等 实例解析

最近有几个粉丝对修改rom有兴趣。今天主要给这些友友提供一些自己初学修改rom的一些建议和思路,可以供大家参考,只是个人见解.初步的常识可以参考以上两个博文了解相关。

修改rom的基本常识

如果你手里有官方的线刷包,而且你也有兴趣尝试这方面的操作。那么可以继续查看我下面的步骤。对做rom的工具和解包打包过程这边不做阐述,毕竟各种解打工具各有所长,具体以自己操作为主。当我们要修改rom的时候。对于初学者应该尝试先不要直接该系统分区,因为有的搞完不开机有多重因素

没有官方固件可以查看我往期博文了解怎么提取系统分区  怎么制作线刷包等

修改系统固件不开机 安卓13去除系统app签名验证的几种方法

miui编译第三方卡米 对应的修改步骤位置

建议修改步骤

1-----先不要直接下手系统分区。应该先搞boot内核分区,可以先修补boot 然后写入手机看能不能开机。如果是电脑端修补boot,还要分清楚当前机型的cpu架构来修补

01----不能开机就先尝试更换面具版本重新修补在写入测试。在这个基础上可以结合去avb验证的方法

02---如果更换面具版本修补和结合去avb验证写入还是不进系统。那么对于小品牌机型首先判断机型有没有bl锁。

03----正常来说,只要解锁了bl分区的机型。对应安卓版本只修补boot写入或者结合去avb校验正常就可以进入系统了。如果这样还不进。那么你在搞系统分区也是白费功夫。

04---当然以上这种情况也有例外。例如vivo机型虽然解锁了bl分区。但写入常规修补boot和去验证会不开机,原因需要专用的修改面具版本来修补内核

对于初学者来说,循序渐进一步步来.因为不同于资深大佬。他们可以抓log来查看系统进程就可以明白具体问题。

修补boot写入可以进系统后的操作

按以上步骤修改内核可以进系统,那么接下来我们可以对系统分区下手了

1-----直接对系统分区解包打包。不做任何修改。然后写入手机查看能不能进系统。首先我们要明白一个道理。只要对系统解包打包不做任何的修改。他已经不属于官方包了,这点很重要。很多友友说我没有修改什么怎么重新打包后写入手机不开机呢。还以为是打包工具的问题,其实就是以上的道理。他已经不属于官方包。

2-----只解包打包不进系统就可以尝试按我以前的有关博文去除各种校验问题来尝试。例如dm校验  去卡米等各种验证.

以上只是针对初学友修改固件的一些建议.

故障解决思路

当你可以按以上步骤修改开机的情况下会遇到各种关于的改rom的bug

例如修改了build.prop文件导致的不开机 卡log 精简app等问题。这种就要找系统开机校验的原因对症操作。

进阶路程

当你具备修改rom基本操作可以正常开机的情况下,你可以进行反编译系统框架 美化自己机型的进阶操作了。例如用反编译工具反编译framework-res.apk,在获得的反编译目录内framework-res\res\layout\unlock_dna_typeb.xml文件就是锁屏输出的界面,用文本编辑器打开这个文件,原码说明参看下列代码备注:

.android.internal.policy.impl.ZteLockScreenView

android:background="@drawable/unlock_bg" android:layout_width="fill_parent"

android:layout_height="fill_parent"

//ulock_bg是背景,改相应图片

xmlns:android="schemas.android./apk/res/android">

<

TextView android:textSize="19.0sp" android:textStyle="bold"

android:textColor="#ff000000" android:gravity="right" android:id="@id/carrier"

android:layout_width="480.0px" android:layout_height="wrap_content"

android:layout_marginTop="16.0px" android:layout_marginRight="15.0px" /> //

#ff000000是营运商颜色,默认#ff000000是黑色完全不透明

android:layout_width="fill_parent" android:layout_height="wrap_content"

android:layout_marginLeft="0.0px" android:layout_marginTop="103.0px">

<

LinearLayout android: orientation="horizontal" android:id="@id/timeDisplay"

android:layout_width="243.0px" android:layout_height="75.0px"

android:layout_marginLeft="12.0px" android:layout_marginTop="0.0px">

<

ImageView android:id="@id/hour_1" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:src="@drawable/time_8"

/>

< ImageView android:id="@id/hour_0"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:src="@drawable/time_8" />

< ImageView

android:id="@id/parting_point" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:layout_marginLeft="2.0px"

android:src="@drawable/parting_point" />

< ImageView

android:id="@id/minute_1" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:layout_marginLeft="2.0px"

android:src="@drawable/time_8" />

< ImageView android:id="@id/minute_0"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:src="@drawable/time_8" />

<

/LinearLayout> //以上是时间显示,时间数字通过调用图片time_0至9,中间冒号调用图片parting_point

<

ImageView android:id="@id/am_pm" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:layout_marginLeft="259.0px"

android:layout_marginTop="39.0px" android:src="@drawable/am" />

//这段调用图片am_zh和pm_zh来显示上午和下午,换图片即可

< /RelativeLayout>

< TextView

android:id="@id/division" android:background="#ff605f5f"

android:layout_width="318.0px" android:layout_height="2.0px"

android:layout_marginLeft="0.0px" android:layout_marginTop="180.0px" />

//定义横线位置与颜色

android:textColor="#ff605f5f" android:id="@id/date"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="24.0px" android:layout_marginTop="193.0px"

android:text="@string/default_date" /> //定义日期位置与颜色

android:textAppearance="?textAppearanceMedium" android:textColor="#ff605f5f"

android:id="@id/status1" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:layout_marginLeft="24.0px"

android:layout_marginTop="4.0dip" android:drawablePadding="4.0dip"

android:layout_below="@id/date" /> //定义星期位置与颜色

android:id="@id/arrow_left" android:visibility="invisible"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="36.0px" android:layout_marginTop="424.0px"

android:src="@drawable/arrow_left" /> //定义向左下指示图片及其位置

android:id="@id/arrow_right" android:visibility="invisible"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="142.0px" android:layout_marginTop="319.0px"

android:src="@drawable/arrow_right" />

//定义向右上指示图片及其位置

android:id="@id/unlock_handler" android:clickable="true"

android:layout_width="480.0px" android:layout_height="480.0px"

android:layout_alignParentRight="true" android:layout_alignParentBottom="true"

/>

< .android.internal.policy.impl.UnlockAniView

android:id="@id/unlock_animation" android:visibility="gone"

android:layout_width="480.0px" android:layout_height="480.0px"

android:layout_alignParentRight="true" android:layout_alignParentBottom="true"

/>

< ImageView android:id="@id/unlock_icon"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="20.0px" android:layout_marginTop="654.0px"

android:src="@drawable/unlock_icon" /> //定义向开锁图标及其位置

android:id="@id/selected_icon" android:visibility="invisible"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="-10.0px" android:layout_marginTop="620.0px"

android:src="@drawable/selected_icon" />

< ImageView

android:id="@id/silence_icon" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:layout_marginLeft="381.0px"

android:layout_marginTop="298.0px" android:src="@drawable/silence_in" />

//定义移动到声音图标后显示的图片及其位置

android:visibility="invisible" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:layout_marginLeft="349.0px"

android:layout_marginTop="272.0px" android:src="@drawable/selected_silence_icon"

/> //定义移动到开锁图标后显示的图片及其位置

android:id="@id/emergencyCallButton" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:src="@null"

android:layout_alignParentRight="true" android:layout_alignParentBottom="true"

/>

< ImageView android:id="@id/emergency_icon"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="409.0px" android:layout_marginTop="688.0px"

android:src="@drawable/emergence_icon" /> //定义声音图标及其位置

<

/.android.internal.policy.impl.ZteLockScreenView>

android:id="@id/emergencyCallButton" android:layout_width="wrap_content"

android:layout_height="wrap_content" android:src="@null"

android:layout_alignParentRight="true" android:layout_alignParentBottom="true"

/>

< ImageView android:id="@id/emergency_icon"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:layout_marginLeft="409.0px" android:layout_marginTop="688.0px"

android:src="@drawable/emergence_icon" /> //定义声音图标及其位置

<

/.android.internal.policy.impl.ZteLockScreenView>

修改完回编译替换系统

修改主题美化

<activity
    android:theme="@style/splashTheme"
    android:name=".MainActivity"
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
-----------------------------------
还有例如替换开机动画  开机声音。默认开机壁纸  修改版本信息等等

目前各种反编译工具很多。在这些操作过程中你会逐步了解系统框架 反编译签名 4K对齐等等的操作。这些你搞明白后,你已经属于完rom中的大佬级别.

其实兴趣是最好的老师,当我们修改的rom可以开机的时刻,那种心情是一般人无法体会和理解的。就相当于你修好了你喜欢的一件物品。不在与其价值如何。

猜你喜欢

转载自blog.csdn.net/u011283906/article/details/133296368
ROM