1. Objectives

The author of Unidbg has been updating quite frequently recently. We have to keep up with him so as not to be left behind.

2. Analysis

Code comparison

Pull back the latest code first

git pull

Then compared with our previous code, it seems that there are a lot of changes. I merged 3-5 files manually and vomited blood…

git

As a certified senior programmer, I actually still merged codes manually, and my boss almost suspected that my senior certificate was issued in Zhongguancun.

Our goal now is to merge the latest updates from https://github.com/zhkl0228/unidbg .

first

h1yxMac:unidbg h1yx$ git remote -v  
origin        https://github.com/h1yx331/unidbg.git (fetch)
origin        https://github.com/h1yx331/unidbg.git (push)

Then add the remote repository to be synchronized

git remote add upstream https://github.com/zhkl0228/unidbg

Check the status again

h1yxMac:unidbg h1yx$ git remote -v
origin        https://github.com/h1yx331/unidbg.git (fetch)
origin        https://github.com/h1yx331/unidbg.git (push)
upstream        https://github.com/zhkl0228/unidbg (fetch)
upstream        https://github.com/zhkl0228/unidbg (push)

No problem, added successfully

Then start merging.

First fetch all remote branches and store them locally

h1yxMac:unidbg h1yx$ git fetch upstream
remote: Enumerating objects: 6513, done.
remote: Counting objects: 100% (1205/1205), done.
remote: Compressing objects: 100% (269/269), done.
remote: Total 6513 (delta 870), reused 1123 (delta 814), pack-reused 5308
Receiving objects: 100% (6513/6513), 30.48 MiB | 6.00 MiB/s, done.
Resolving deltas: 100% (2852/2852), completed with 206 local objects.
From https://github.com/zhkl0228/unidbg
 * [new branch]        master     -> upstream/master
 * [new tag]           v0.9.2     -> v0.9.2
 * [new tag]           v0.9.3     -> v0.9.3

Then the merger officially started

git merge upstream/master

A vi-like interface appears, requiring us to fill in the log.

Press the I key, then enter update and then esc → shift+: → wq to save and exit

h1yxMac:unidbg h1yx$ git merge upstream/master
Removing unidbg-dynarmic/src/test/java/com/github/unidbg/arm/backend/dynarmic/DynarmicTest.java
Removing unidbg-dynarmic/src/test/java/com/github/unidbg/arm/backend/DynarmicBackendTest.java
Removing unidbg-dynarmic/src/main/java/com/github/unidbg/arm/backend/dynarmic/DynarmicLoader.java
Removing unidbg-api/src/main/java/com/github/unidbg/arm/backend/dynarmic/EventMemHookNotifier.java
Auto-merging unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/DalvikVM.java
Auto-merging unidbg-android/src/main/java/com/github/unidbg/linux/android/dvm/AbstractJni.java
Merge made by the 'recursive' strategy.
 .gitignore                                                |    4 +-
 README.md                                                 |   14 +-
 backend/dynarmic/README.md                                |    3 +
 {unidbg-dynarmic => backend/dynarmic}/pom.xml             |    7 +-
 .../com/github/unidbg/arm/backend/DynarmicBackend.java    |  138 +--
 .../com/github/unidbg/arm/backend/DynarmicFactory.java    |   29 +
 .../com/github/unidbg/arm/backend/dynarmic/Dynarmic.java  |   21 +-
 .../unidbg/arm/backend/dynarmic/DynarmicBackend32.java    |    2 +-
 .../unidbg/arm/backend/dynarmic/DynarmicBackend64.java    |    2 +-
......

It seems like it’s going quite smoothly. Has it been merged?

Try running

I knew it wouldn’t go this smoothly.

The function to create the Emulator has changed

private static AndroidEmulator createARMEmulator() {
        return AndroidEmulatorBuilder
                .for32Bit()
                .build();
        // return new AndroidARMEmulator("test");
    }

Run again

st=1606701201628&sign=59039230dc2e1ea27a4f250d9ec81b8c&sv=111
destroy
run

This value looks familiar.

Finally, update to our GitHub fork directlygit push origin masterThat’s fine.