[Android Software/Hacking General [Developers Only]] Qiangong2:
TencentOS is an aftermarket firmware designed by the Chinese company Tencent. Tencent also created the QQ and WeChat IM services.​

TencentOS, just like MiUi is not open source. However, Tencent has provided a version of PatchRom for you to use called TOSPlus. I have tested this on the Samsung Galaxy Star Pro. The guide for the TencentOS PatchRom is different than the MiUi and LewaOS and it is written in Chinese only. I will be writing a guide in English so that more people can port this great ROM to their devices.

Pre Steps:

You should Install 2 versions of Java. Version 7, and Version 6.

For Ubuntu and derivatives, type:

sudo apt-get install openjdk-7-jdk

Now we need the official Java 6.

For Ubuntu and derivatives, type:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer

Be sure to select add when it asks if you want to add the repository or not.

Then, make sure you have all of the required android packages:

sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip

Note: the above is only for 64-bit. Will update when 32-bit is tested.

------------------------------------------------------------------------------------------------------

Step 1:

Make sure you are on a version of Ubuntu 14.04 or greater (16.04 may or may not work).

Step 2:

Now you need to make a copy of the TencentOS PatchRom. Change to whatever directory you want and Type:

git clone https://github.com/TOSPlus/TPS

This will make a folder called TPS in whatever directory you were in before. The TPS folder will contain all of the code required to build TencentOS for your device.

Step 3:

Change the directory to TPS and type:

source build/envsetup.sh

This will initiate the build process.

Step 4:

Next, you build the directory for your device. Type:

make create brand=put-manufacturer-name device=device-model

Replace "put-manufacturer-name" with your manufacturer and replace "device-model" with your device model.

Step 5:

Next you need to copy a zip file of a ROM you want to use as your base into your device model folder. Name the zip file to ota.zip. Make sure the base ROM is android 4.3 or above.

Step 6:

Now, you configure the build. Type:

make config device=device-model

Replace device-model with your device's model.

Step 7:

Once you have that done, you need to edit a few files. Those files are misc_info.txt, remove_files.list, tos_system_files.ignore, and build.prop. You can find all of the files underneath the config folder within your device-model folder.

In misc_info.txt, you need to change blocksize, boot_size, recovery_size, system_size, userdata_size, and cache_size to match your device. You can find these in the BoardConfig.mk of your device.

In remove_files.list, you add the files that need to be removed so that TencentOS can function fully. This usually takes quite a bit of trial and error to get correct.

In tos_system_files.ignore, you designate which files should not get edited when you are patching the different services.

In the build.prop, you need to add the TencentOS properties.

example (for the gt-i9500):

ro.qrom.beaconkey=0M000V5PH01B6QQD

ro.qrom.product.device=ja3g

ro.qrom.product.device.brand=samsung

ro.qrom.build.brand=tos

ro.qrom.build.os=android4.4.2

ro.qrom.otapath=/data/media/0

qrom_disposeIcon_enable=1

qrom_permission_enable=1

# ro.qrom.build.version.snflag=ADRQRTOS

ro.qrom.build.version.snver=01

#need edit ro.qrom.build.version.day=151028

ro.qrom.build.version.name=ADRQRTOS01_M

ro.qrom.build.version.number=01151028

ro.qrom.build.version.type=M

#need edit ro.qrom.build.number=3

ro.qrom.build.lc=A1B2C3000D4E5F6

ro.qrom.build.lcid=99

#need edit ro.qrom.build.date=Wed OCT 28 21:01:25 CST 2015

ro.qrom.build.date.utc=1446014851

ro.qrom.build.type=mod

Everything that says need edit, you need to edit for your device specifically.

Step 8:

Copy file_contexts from the boot.img and put in the config folder.

Step 9:

Copy recovery.fstab from the recovery.img of your device to the config folder

Step 10:

Next, you need to extract all of the files from the ota.zip and put them in the correct place. To do that, type:

make prepare

Step 11:

Now, you can patch your ota.zip. type:

make patch

If there are any failed patches, you have to patch those smali files manually.

Step 12:

After patching has been done, type:

make repack

It repacks the jars and frameworks required that TencentOS has edited.

Step 13:

You made it :) this is the final step. Type:

make package

It will create a zip file of TencentOS for your device model.

Then you can flash it in a custom recovery and enjoy your new ROM :)

Here is a video of how to do it: http://xdaforums.com/showpost.php?p=67495578&postcount=75

===========================================================================================

Apps you should manually remove after building (not all may be in your ROM) :

SystemUI.apk

Trebuchet.apk

Dialer.apk

Mms.apk

Contacts.apk

Email.apk

DSPManager.apk

qotaupdater.apk (let's face it, our devices will never get an official update :P )

Apollo.apk

Launcher3.apk

SetupWizard.apk

VideoEditor.apk

Calculator.apk

Calendar.apk

CalendarProvider.apk

CMFileManager.apk

CMHome.apk

CMWallpapers.apk

DocumentsUI.apk

Gallery2.apk

DownloadProviderUI.apk

HoloSpiralWallpaper.apk

InCallUI.apk

LatinIME.apk (or qime.apk)

LiveWallpapers.apk

LiveWallpapersPicker.apk

LockClock.apk

MagicSmokeWallpapers.apk

PackageInstaller.apk

SoundRecorder.apk

Term.apk

VideoEditor.apk

CMAccount.apk

CMUpdater.apk

Contactsprovider.apk

VoiceDialer.apk

qtheme.apk

ThemeChooser.apk

ThemeProvider.apk