Current location - Quotes Website - Signature design - How to write your modified code into the system developed by AndroidTv?
How to write your modified code into the system developed by AndroidTv?
It depends on what your purpose is.

* If you need to replace the original launcher program, then first you need to meet the following two conditions:

You have adb shell root permissions for this TV device.

You hold the system signature of the TV equipment.

If the above two conditions are met, the following are the steps:

To compile your code, the application package name must be the same as the original name. After compiling, sign it with the system signature file.

Adb shell enters the /system partition (you must have root permission to enter), in.

The following two directories (earlier versions only had the first directory):

/system/application

/system/priv-app/

Locate the application you want to replace. Under adb shell, you can use the built-in command pm to easily find the location of apk according to the package name, and don't expand it. Please ask if necessary.

By default, the /system partition is read only. Before writing, you must use the adb remount command, or use the mount command under adb shell to remount the partition as a readable partition. If you need to know the specific format of the command, you can ask again.

Use adb push command to replace the original application with your own compiled application, or copy your own compiled apk to the device first, and then replace the original application with cp command under adb shell. Both methods require root privileges.

The system will monitor the changes of /system/app and /system/priv-app/ directory in real time, so the system will automatically identify the application immediately after you put it back to its original location. General application, can be used immediately after pushing. Special applications such as launcher may cause system anomalies, but it can definitely run after restarting (provided that there is no problem in modifying it yourself).

The system signature is needed because the system will compare the signature applied by the system with the signature of the system itself, otherwise it will not work.

* If your purpose is just to study the code and you don't need to replace the original launcher, it's easy. Steps:

Change the name of the initiator application package you modified, not the same as the name of the original system.

If you can connect adb to debug this TV device, compile it directly with eclipse and run it on this device. Adb can be connected wirelessly through wifi, and it is often used in TV development.

If you can't connect to adb for debugging, get your own apk signature, then use this signature to encapsulate the apk, and then copy it to this TV device for installation.

Signature is used here because the debugging signature cannot be installed as apk, and it must be a formal signature.

Above.