Edited by RendyAK at 2017-08-06 07:40
Introduction:
Many people encounter difficulties when fixing rejects, and Im here to help!
Without many useless talks here, let's start!
Why?:
Flyme Patchrom README says:
Automatic patching may cause code merge conflicts. Conflicts will be marked in the form of the following, developers need to manually resolve these conflicts in the vendor's file.
How do I fix rejects?:
Fixing rejects is pretty simple, just like how you fix rejects in git.
The scheme of rejects is:
- <<<<<<< VENDOR
- original code block
- =======
- Flyme code block
- >>>>>>> BOSP
Copy the CodeFor example, this is the reject
- <<<<<<< VENDOR #Conflict 1
- new-instance v79, Lcom/android/server/LockSettingsService;
- ======= #@.method private startOtherServices@
- new-instance v77, Lcom/android/server/FlymeExtLockSettingsService;
- >>>>>>> BOSP #Conflict 1
Copy the CodeSo how do we fix it?
Pretty easy, what you need to do is replace
- Lcom/android/server/LockSettingsService;
Copy the Codein this line:
- new-instance v79, Lcom/android/server/LockSettingsService;
Copy the Codeto
- Lcom/android/server/FlymeExtLockSettingsService;
Copy the Codeso, when we have replace it, it should looks like this
- new-instance v79, Lcom/android/server/FlymeExtLockSettingsService;
Copy the Codeand then we can go work to other rejects!
Tip!
Never replace registers (vxx) and label (:xxx_try_xxx_xxx) while fixing rejects!
Hey! I have multiple lines rejects, how do I fix it?
Now this is pretty hard, this mostly happens on services.jar.out rejects, especially SystemServer.smali, now read carefully how to fix it!
For example:
this is out reject
- <<<<<<< VENDOR #Conflict 3
- .local v84, "mmsService":Lcom/android/server/MmsServiceBroker;
- :try_start_3d
- invoke-static/range {v67 .. v67}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- ======= #@.method private startOtherServices@
- .local v82, "mmsService":Lcom/android/server/MmsServiceBroker;
- move-object/from16 v0, p0
- move-object/from16 v3, v111
- move-object/from16 v4, v108
- invoke-static {v0, v3, v4}, Lcom/android/server/SystemServer$FlymeInjector;->addFlymeServices(Lcom/android/server/SystemServer;Lcom/android/server/wm/WindowManagerService;Lcom/android/server/wallpaper/WallpaperManagerService;)V
- :try_start_3b
- invoke-static/range {v65 .. v65}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
- >>>>>>> BOSP #Conflict 3
Copy the CodePretty hard, isn't it?
now what we do is, replace
- .local v84, "mmsService":Lcom/android/server/MmsServiceBroker;
Copy the Codewith
- .local v82, "mmsService":Lcom/android/server/MmsServiceBroker;
- move-object/from16 v0, p0
- move-object/from16 v3, v111
- move-object/from16 v4, v108
Copy the Codebut keep the registers and label!
now, replace the v82 into v84, to match with vendor register.
and :try_start_3b with :try_start_3d to match with vendor label.
And now, this is the tricky part, we need to correct the v111, and v108 register
now open up the BOSP's file, in this case, BOSP's SystemServer.smali.
and now, search for the method its stated in the reject part, in "
======= #@.method private startOtherServices@" and ".method private startOtherServices" is the method in this case.
now, search for what is v111 and v108 is for.
I've found where is v111 and v108 is defined.
- .local v111, "wm":Lcom/android/server/wm/WindowManagerService; (for v111)
- .local v108, "wallpaper":Lcom/android/server/wallpaper/WallpaperManagerService; (v108)
Copy the CodeSo, what now?
We should find what is
- "wm":Lcom/android/server/wm/WindowManagerService;
Copy the Code
register and- "wallpaper":Lcom/android/server/wallpaper/WallpaperManagerService;
Copy the Code
register in vendor
In this case, I've found it is
- .local v110, "wallpaper":Lcom/android/server/wallpaper/WallpaperManagerService;
- .local v113, "wm":Lcom/android/server/wm/WindowManagerService;
Copy the CodeSo, we need to replace v111 with v113, and v108 with v110.
So our result is
- .local v84, "mmsService":Lcom/android/server/MmsServiceBroker;
- move-object/from16 v0, p0
- move-object/from16 v3, v108
- move-object/from16 v4, v110
Copy the CodeAnd now we can put
- invoke-static {v0, v3, v4}, Lcom/android/server/SystemServer$FlymeInjector;->addFlymeServices(Lcom/android/server/SystemServer;Lcom/android/server/wm/WindowManagerService;Lcom/android/server/wallpaper/WallpaperManagerService;)V
- :try_start_3b
- invoke-static/range {v65 .. v65}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
Copy the Codewith :try_start_3b changed to :try_start_3d to match with vendor.
So our final result is
- .local v84, "mmsService":Lcom/android/server/MmsServiceBroker;
- move-object/from16 v0, p0
- move-object/from16 v3, v108
- move-object/from16 v4, v110
- invoke-static {v0, v3, v4}, Lcom/android/server/SystemServer$FlymeInjector;->addFlymeServices(Lcom/android/server/SystemServer;Lcom/android/server/wm/WindowManagerService;Lcom/android/server/wallpaper/WallpaperManagerService;)V
- :try_start_3d
- invoke-static/range {v65 .. v65}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
Copy the Code
That's not really that hard, isn't it? Now you can go create the Flyme package with
and enjoy your builded FlymeOS!
4