[GUIDE] How to Build TencentOS for any Device [GUIDE]

Search This thread

Qiangong2

Senior Member
Oct 31, 2014
1,450
376
Samsung Galaxy S20
Sadly there is only one kernel for my device and its the stock one :( and i already deleted the s app from the system folder. im just going to try to use cm11 from a similar device as a base.

MAKE SURE THE DEVICE YOU WILL BE USING AS A BASE CAN FLASH SUCCESSFULLY ON YOUR DEVICE OTHERWISE IT WILL BRICK YOUR DEVICE.

You have a samsung phone, the kernel source is available online. Build a kernel using that source, then try.

Sent from my Q5 using XDA Free mobile app
 

turnert

Senior Member
May 24, 2015
386
109
Las Vegas
MAKE SURE THE DEVICE YOU WILL BE USING AS A BASE CAN FLASH SUCCESSFULLY ON YOUR DEVICE OTHERWISE IT WILL BRICK YOUR DEVICE.

You have a samsung phone, the kernel source is available online. Build a kernel using that source, then try.

Sent from my Q5 using XDA Free mobile app
Can you use a custom kernel on an at&t locked boot loader?

Sent from my SAMSUNG-SM-G730A using XDA-Developers mobile app
 

turnert

Senior Member
May 24, 2015
386
109
Las Vegas
I discovered why my wifi is not working for my port. It is because I am flashing the rom in my second rom slot.(in my safestrap recovery) Unfortunitly when I install a rom to any rom slot except the stock slot wifi does not work.

Sent from my SAMSUNG-SM-G730A using XDA-Developers mobile app
 

Pavansk

Senior Member
Jun 17, 2015
116
21
TencentOS adds a few conf files of its own (not for bluetooth) which may interfere somehow. Bluetooth works fine on my build.

Sent from my Q5 using XDA Free mobile app
We have a build which was made before to this which has been posted now in that Bluetooth was working but when we changed kernel to boot the ROM and used cm 11 this is happening

Sent from my Moto E using XDA-Developers mobile app
 

Qiangong2

Senior Member
Oct 31, 2014
1,450
376
Samsung Galaxy S20
I discovered why my wifi is not working for my port. It is because I am flashing the rom in my second rom slot.(in my safestrap recovery) Unfortunitly when I install a rom to any rom slot except the stock slot wifi does not work.

Sent from my SAMSUNG-SM-G730A using XDA-Developers mobile app

That would be a problem with safestrap then. Using MultiROM it works with Carbon ROM installed as well.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    00000.jpg

    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:

    Code:
    sudo apt-get install openjdk-7-jdk

    Now we need the official Java 6.
    For Ubuntu and derivatives, type:

    Code:
    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:

    Code:
    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:
    Code:
    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:
    Code:
    source build/envsetup.sh
    This will initiate the build process.

    Step 4:
    Next, you build the directory for your device. Type:
    Code:
    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:
    Code:
    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:
    Code:
    make prepare

    Step 11:
    Now, you can patch your ota.zip. type:
    Code:
    make patch
    If there are any failed patches, you have to patch those smali files manually.

    Step 12:
    After patching has been done, type:
    Code:
    make repack
    It repacks the jars and frameworks required that TencentOS has edited.

    Step 13:
    You made it :) this is the final step. Type:
    Code:
    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://forum.xda-developers.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
    2
    i've quit trying. to much of a hassle.
    thx for a clean guide but i think it's above my hat for now.

    Np. It may be that TPS just doesn't work on 6.0.1

    Sent from my Q5 using XDA Free mobile app
    2
    Thanks .....where u ll upload the video

    Sent from my Moto E using XDA-Developers mobile app

    Here it is:

    https://vimeo.com/172327871

    Sorry the quality isn't too good, but it's a video :)
    1
    Can we port this rom for any device with above mentioned steps

    Sent from my XT1022 using XDA-Developers mobile app

    Yes. It even works on Spreadtrum devices

    Sent from my Q5 using XDA Free mobile app
    1
    Hey @Qiangong2 I remember I had asked you to Port guide of flyme os did u do that please tell

    Sent from my Moto E using XDA-Developers mobile app

    I've been working on the smali tutorial first, then i'll work on the Flyme tutorial.

    Sent from my Q5 using XDA Free mobile app
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone