Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
c3788fe
Initial commit for 5.0 image
shakalaca Apr 8, 2015
81112ec
Update Z00A 2.13.40.13 link
shakalaca Apr 10, 2015
0071646
Remove unused codes
shakalaca Apr 10, 2015
2270e27
Auto creating link_and_set_perm file
shakalaca Apr 10, 2015
29f4d89
Update to newest version
shakalaca Apr 10, 2015
1c991ca
Add ZenFone2 Z008
shakalaca Apr 10, 2015
bda7a42
Add applypatch binary
shakalaca Apr 21, 2015
6c045af
Support OTA package
shakalaca Apr 21, 2015
7d6fff8
put back install-recovery.sh
shakalaca Apr 21, 2015
aaafb0d
Fix OTA failure
shakalaca Apr 28, 2015
74b22df
Update Z00A to 2.14.40.19
shakalaca Apr 28, 2015
33d8d4c
Update Z008 to 2.14.40.17
shakalaca Apr 28, 2015
a262d80
Fix typo
shakalaca Apr 28, 2015
2402bfb
Check existence of ota/system before entering
shakalaca May 9, 2015
0a9605f
Fix error for one delete line only
shakalaca May 9, 2015
083f6d4
Update SuperSU to 2.46
shakalaca May 11, 2015
c93cf5f
Update to 2.15.40.13
shakalaca May 11, 2015
55e4dd2
add script to rebuild root/ from SuperSU.zip
gwenhael-le-moine May 12, 2015
df2558d
Merge pull request #2 from cycojesus/5.0
shakalaca May 12, 2015
2d93813
fix applypatch building
gwenhael-le-moine May 17, 2015
03ff995
Skip building mtdutils for OS X
shakalaca May 17, 2015
1cf5fd5
Merge pull request #4 from shakalaca/pr/3
shakalaca May 17, 2015
16dc4c7
Support rename function
shakalaca May 20, 2015
ed65a55
Update recovery also
shakalaca May 20, 2015
fa78451
ignore src & work directory
shakalaca May 20, 2015
b03d72e
Update to 2.17.40.x OTA update
shakalaca May 20, 2015
b91ecd9
Update to 2.17.40.x
shakalaca May 27, 2015
44c50f8
Ability to exclude apps :)
shakalaca May 27, 2015
83edf81
Fix no keyboard issue
shakalaca May 28, 2015
38fc693
FlipCover2 only works when installed in system
shakalaca May 28, 2015
6a9a9db
Comments for Camera related function & PCLink
shakalaca May 28, 2015
60f3e42
Remove asus setupwizard
shakalaca May 28, 2015
1994daa
Move non-script files to assets
shakalaca Jun 2, 2015
356c696
Patch to enable write permission for external sd
shakalaca Jun 2, 2015
fbcbb97
Add overlay for adding custom files
shakalaca Jun 2, 2015
16f66a0
Fix error executing link_and_set_perm file
shakalaca Jun 2, 2015
5ab2281
Update for T00F & T00G 5.0 upgrade
shakalaca Jun 2, 2015
740295c
Update excluded app list
shakalaca Jun 2, 2015
4ab285c
Correct permission of supersu related files
shakalaca Jun 2, 2015
778509d
Remove use of sudo
shakalaca Jun 2, 2015
f5c2e80
Remove ME572C
shakalaca Jun 3, 2015
41a2c32
Remove chown & chmod operation
shakalaca Jun 5, 2015
b494a07
Avoid file not found message
shakalaca Jun 5, 2015
4795b60
Update exclude_app_list
shakalaca Jun 5, 2015
1fef620
Update for 2.18.40.x OTA
shakalaca Jun 5, 2015
ab22eb4
Remove unused files
shakalaca Jun 5, 2015
727b58e
Patch for cygwin
shakalaca Jun 5, 2015
103b0c1
Fix error building system.img under windows
shakalaca Jun 5, 2015
36ab9bd
Add back gallery for camera
shakalaca Jun 10, 2015
655df96
Add back FlipCover
shakalaca Jun 10, 2015
cf4ca1e
update to 2.18.40.x
shakalaca Jun 19, 2015
3961016
Add ota for z00a 2.19.40.18
shakalaca Jun 19, 2015
6025b31
Refine overlay function
shakalaca Jun 19, 2015
0ce70a9
Add root survival function
shakalaca Jun 19, 2015
c5e752f
Add back AudioWizard
shakalaca Jun 20, 2015
31646eb
Update 2.19.40.x stock URL
shakalaca Jun 22, 2015
446ebf6
Add SLIM_DOWN section
shakalaca Jun 22, 2015
61e1cb5
Add Xposed v65
shakalaca Jul 2, 2015
9169427
Update OTA_URL
shakalaca Jul 2, 2015
8625bc6
Refine root process
shakalaca Jul 2, 2015
2c78092
Fix error using audio jack
shakalaca Jul 2, 2015
e727c13
Update stock ROM URL and minor OTA
shakalaca Jul 2, 2015
b93c9d1
Update vold
shakalaca Jul 4, 2015
f31bc1c
Update z00a 2.19.40.22 url
shakalaca Jul 4, 2015
4fa868e
Build necessary images
shakalaca Jul 5, 2015
337e5c4
Move images to folder
shakalaca Jul 5, 2015
8706213
Refine scripts ..
shakalaca Jul 5, 2015
20aa463
Refine message and remove vars
shakalaca Jul 5, 2015
825cd72
Refine root script
shakalaca Jul 7, 2015
956b9a5
Fix error updating recovery partition
shakalaca Jul 7, 2015
a44a1e6
Remove 4.4 part
shakalaca Jul 7, 2015
2ee4b52
Update Z008 to 2.19.40.23
shakalaca Jul 7, 2015
0a48c2e
Support OSIP (in ZenFone 4/5/6)
shakalaca Jul 8, 2015
50b32af
Fix error re-install supersu
shakalaca Jul 8, 2015
7625ed9
Add TW ROM links
shakalaca Jul 8, 2015
0a25a58
Fix error generating recovery.img
shakalaca Jul 8, 2015
e1268c7
Fix error executing install-recovery.sh
shakalaca Jul 8, 2015
ef0ca9e
Fix xposed permission
shakalaca Jul 8, 2015
ad2ea7c
Build ext2simg also
shakalaca Jul 9, 2015
498e69f
2.20.* update
shakalaca Aug 8, 2015
d31681d
change from sh to bash
shakalaca Aug 13, 2015
f4451cc
Fix error building in linux
shakalaca Aug 13, 2015
79941ec
For 2.20.40.x OTA
shakalaca Aug 14, 2015
d725273
Add full image of 2.20.40.59
shakalaca Aug 14, 2015
f6ffe96
Update Z008 to 2.20.40.41
shakalaca Aug 19, 2015
947fbb3
Update exclude apps list
shakalaca Aug 22, 2015
55e9ad0
Update Z00A 2.20.40.63 & Z008 2.20.40.43
shakalaca Aug 28, 2015
f0863a7
Update Xposed to v71
shakalaca Aug 29, 2015
d56495c
Z00A 2.20.40.63 & Z008 2.240.40.43 full ROM
shakalaca Sep 8, 2015
7aa4711
Update xposed to v73
shakalaca Sep 8, 2015
dca1cd7
Add OTA to Z00A 2.20.40.90 & Z008 2.20.40.88
shakalaca Sep 8, 2015
629bc1d
Stock ROM for 2.20.40.90 & 2.20.40.88
shakalaca Sep 22, 2015
6cd1ebc
OTA to 2.20.40.97
shakalaca Sep 22, 2015
98a5d71
OTA to 2.20.40.92
shakalaca Sep 30, 2015
d53863a
Update full ROM
shakalaca Sep 30, 2015
ef8cc97
Add missing scripts
shakalaca Oct 14, 2015
d29be03
Update Z00A 2.20.40.139 & Z008 2.20.40.130 OTA
shakalaca Nov 12, 2015
e4216bc
Update Xposed to v75
shakalaca Nov 12, 2015
26ba409
Clean up launcher workspace
shakalaca Nov 13, 2015
f9ce976
Update patched v75 xposed
shakalaca Nov 13, 2015
e984d27
Update Xposed to v78
shakalaca Nov 16, 2015
784f602
Update ZenFone 5/6 3.24.40.78 ROM
shakalaca Nov 28, 2015
84ef3d4
Remove Asphalt
shakalaca Dec 23, 2015
e59b67a
Update Z00A & Z008
shakalaca Dec 24, 2015
e034ee7
Update file_contexts
shakalaca Dec 31, 2015
8b59160
Update Z00A 2.20.40.160
shakalaca Dec 31, 2015
ed07a12
Z00A 2.20.40.165 & Z008 2.20.40.138
shakalaca Jan 28, 2016
8e9b99a
Update Xposed to v79
shakalaca Jan 29, 2016
8b4813c
Add Z00A 2.20.40.165
shakalaca Jan 29, 2016
bdac739
Update T00F & T00G 3.24.40.87
shakalaca Jan 29, 2016
bbb3d91
Update Xposed v80
shakalaca Feb 13, 2016
fe1ca13
Update SuperSU to 2.65
shakalaca Feb 22, 2016
8eaf40a
Update Z00A 2.20.40168
shakalaca Feb 22, 2016
5f6c516
Exclude CMKeyV3
shakalaca Feb 23, 2016
d41da90
Update Z00A 2.20.40.174
shakalaca Mar 15, 2016
0365eb8
Change md5 command to md5sum
shakalaca Mar 15, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/src/
/work/
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ Create system.img for ZenFone
- Build `make_ext4fs` binary for packing `system.img`
- `make_ext4fs` will be in `work` directory

2. run `scripts/build.sh`
2. run `scripts/build_applypatch.sh`
- Fetch required source tree from AOSP to `src` directory
- Build `applypatch` binary for applying delta OTA updates
- `applypatch` will be in `work` directory

3. run `scripts/build.sh`
- Fetch ROM file of ZenFone 5 (1.17.40.16, WW version) to `work` directory
- Extract ROM file and get system directory
- Inject root package
Expand Down
161 changes: 161 additions & 0 deletions assets/applypatch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
diff --git a/recovery/applypatch/applypatch.c b/recovery/applypatch/applypatch.c
index 2c86e09..58d1596 100644
--- a/recovery/applypatch/applypatch.c
+++ b/recovery/applypatch/applypatch.c
@@ -20,7 +20,14 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+
+#ifdef __APPLE__
+#include <sys/param.h>
+#include <sys/mount.h>
+#else
#include <sys/statfs.h>
+#endif
+
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
@@ -31,7 +38,10 @@
#include "mtdutils/mtdutils.h"
#include "edify/expr.h"

+#if !defined(__APPLE__) && !defined(__CYGWIN__)
static int LoadPartitionContents(const char* filename, FileContents* file);
+#endif
+
static ssize_t FileSink(const unsigned char* data, ssize_t len, void* token);
static int GenerateTarget(FileContents* source_file,
const Value* source_patch_value,
@@ -56,7 +66,11 @@ int LoadFileContents(const char* filename, FileContents* file) {
// load the contents of a partition.
if (strncmp(filename, "MTD:", 4) == 0 ||
strncmp(filename, "EMMC:", 5) == 0) {
+#if defined(__APPLE__) || defined(__CYGWIN__)
+ return -1;
+#else
return LoadPartitionContents(filename, file);
+#endif
}

if (stat(filename, &file->st) != 0) {
@@ -104,6 +118,7 @@ static int compare_size_indices(const void* a, const void* b) {
}
}

+#if !defined(__APPLE__) && !defined(__CYGWIN__)
// Load the contents of an MTD or EMMC partition into the provided
// FileContents. filename should be a string of the form
// "MTD:<partition_name>:<size_1>:<sha1_1>:<size_2>:<sha1_2>:..." (or
@@ -304,7 +319,7 @@ static int LoadPartitionContents(const char* filename, FileContents* file) {

return 0;
}
-
+#endif

// Save the contents of the given FileContents object under the given
// filename. Return 0 on success.
@@ -345,6 +360,7 @@ int SaveFileContents(const char* filename, const FileContents* file) {
return 0;
}

+#if !defined(__APPLE__) && !defined(__CYGWIN__)
// Write a memory buffer to 'target' partition, a string of the form
// "MTD:<partition>[:...]" or "EMMC:<partition_device>:". Return 0 on
// success.
@@ -524,6 +540,7 @@ int WriteToPartition(unsigned char* data, size_t len,
free(copy);
return 0;
}
+#endif


// Take a string 'str' of 40 hex digits and parse it into the 20
@@ -1009,11 +1026,15 @@ static int GenerateTarget(FileContents* source_file,
}

if (output < 0) {
+#if defined(__APPLE__) || defined(__CYGWIN__)
+ return 1;
+#else
// Copy the temp file to the partition.
if (WriteToPartition(msi.buffer, msi.pos, target_filename) != 0) {
printf("write of patched data to %s failed\n", target_filename);
return 1;
}
+#endif
free(msi.buffer);
} else {
// Give the .patch file the same owner, group, and mode of the
diff --git a/recovery/applypatch/applypatch.h b/recovery/applypatch/applypatch.h
index edec848..6cfa498 100644
--- a/recovery/applypatch/applypatch.h
+++ b/recovery/applypatch/applypatch.h
@@ -38,7 +38,7 @@ typedef struct _FileContents {
// it to free up space. If the expected source file doesn't exist, or
// is corrupted, we look to see if this file contains the bits we want
// and use it as the source instead.
-#define CACHE_TEMP_SOURCE "/cache/saved.file"
+#define CACHE_TEMP_SOURCE "saved.file"

typedef ssize_t (*SinkFn)(const unsigned char*, ssize_t, void*);

diff --git a/recovery/applypatch/bspatch.c b/recovery/applypatch/bspatch.c
index b34ec2a..b9fb174 100644
--- a/recovery/applypatch/bspatch.c
+++ b/recovery/applypatch/bspatch.c
@@ -28,6 +28,10 @@

#include <bzlib.h>

+#ifdef __APPLE__
+#include <sys/types.h>
+#endif
+
#include "mincrypt/sha.h"
#include "applypatch.h"

@@ -63,7 +67,7 @@ void ShowBSDiffLicense() {
);
}

-static off_t offtin(u_char *buf)
+static off_t offtin(unsigned char *buf)
{
off_t y;

diff --git a/recovery/applypatch/freecache.c b/recovery/applypatch/freecache.c
index 9827fda..d308a57 100644
--- a/recovery/applypatch/freecache.c
+++ b/recovery/applypatch/freecache.c
@@ -4,7 +4,14 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+
+#ifdef __APPLE__
+#include <sys/param.h>
+#include <sys/mount.h>
+#else
#include <sys/statfs.h>
+#endif
+
#include <unistd.h>
#include <dirent.h>
#include <ctype.h>

diff --git a/recovery/applypatch/imgpatch.c b/recovery/applypatch/imgpatch.c
index 33c4487..38cbbd8 100644
--- a/recovery/applypatch/imgpatch.c
+++ b/recovery/applypatch/imgpatch.c
@@ -36,7 +36,7 @@
* file, and update the SHA context with the output data as well.
* Return 0 on success.
*/
-int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size __unused,
+int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size,
const Value* patch,
SinkFn sink, void* token, SHA_CTX* ctx,
const Value* bonus_data) {
Loading