[Asus Zenfone 4] bamzzz:
Hi all, this time I want to provide a "OMNI Screenrecord Guide", this guide for recording screen with start/stop screenrecord using widget..

Hopefully it works for all ..

This guide is based on the Asus Zenfone 4S (T00Q) Lollipop firmware.

Feature:

Show/hide pointer while recording

Enable/disable thumbs preview after recording finish

Custom bitrate options

Custom time limit options

Saved path options

Requirement:

Understanding about APK compile/decompile

APKTool

Notepad++ (PC)

Step:

Part AsusSystemUI:

1. Decompile AsusSystemUI.apk

2. Put smali and res from guide to your systemui.. Overwrite if already exists..

3. Open AndroidManifest.xml

Find:

<uses-permission android:name="android.permission.SET_WALLPAPER"/>

Then add this just below:

<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />

Find:

<activity android:excludeFromRecents="true" android:name="com.android.keyguard.KeyguardIntruderView" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>

Add this just below:

<service android:name=".omni.screenrecord.TakeScreenrecordService" android:process=":screenrecord" android:exported="false" />
<receiver android:name="com.bamzzz.ScreenRecordWidget" android:label="@string/screenrecord_title">
<intent-filter >
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
<action android:name="android.appwidget.action.APPWIDGET_ENABLED"/>
<action android:name="android.appwidget.action.APPWIDGET_DISABLED"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/screen_record_widget_info" />
</receiver>
<receiver android:name="com.bamzzz.ScreenRecordWidgetReceiver" android:label="@string/screenrecord_title" >
<intent-filter>
<action android:name="com.bamzzz.intent.action.JONES_OF_RECORD" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/screen_record_widget_info" />
</receiver>

4. Open res/values/ids.xml and add this:

<item type="id" name="screen_record_image">false</item>
<item type="id" name="screen_record_label">false</item>

5. Open res/values/strings.xml and add this:

<string name="screenrecord_title">Screenrecord</string>
<string name="screenrecord_notif_ticker">Screen is being recorded</string>
<string name="screenrecord_notif_title">Recording screen</string>
<string name="screenrecord_notif_stop">Stop</string>
<string name="screenrecord_notif_share">Share</string>
<string name="screenrecord_notif_pointer_on">Show pointer</string>
<string name="screenrecord_notif_pointer_off">Hide pointer</string>
<string name="notification_recording_finished_title">Screen recording saved</string>
<string name="notification_recording_finished_text">Touch to view %s</string>
<string name="notification_recording_error_title">Screen recorder error</string>
<string name="notification_recording_error_text">%s</string>

6. Recompile SystemUI, then push and reboot phone.

7. Done.

Part Settings:

Optional..!!! You can using ZenControl.apk (Lollipop only) or/and include preference into Settings.apk

Add Preference using ZenControl.apk :

1. Decompile ZenControl.apk

2. Open res/xml/frameworks_general_prefs.xml and add this:

<PreferenceScreen android:title="@string/scr_options_title">
<PreferenceCategory android:title="@string/scr_options_title" />
<SwitchPreference
android:defaultValue="true"
android:key="scr_pointer"
android:summaryOff="@string/scr_disable"
android:summaryOn="@string/scr_enable"
android:title="@string/scr_pointer_title" />
<SwitchPreference
android:defaultValue="true"
android:key="scr_thumbs_preview"
android:summaryOff="@string/scr_disable"
android:summaryOn="@string/scr_enable"
android:title="@string/scr_thumbs_preview_title" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="4"
android:key="scr_bitrate"
android:entries="@array/scr_bitrate_entries"
android:entryValues="@array/scr_bitrate_values"
android:title="@string/scr_bitrate_title" />
<com.wubydax.romcontrol.prefs.MyEditTextPreference
android:title="@string/scr_bitrate_custom_title"
android:summary="@string/scr_bitrate_custom_summary"
android:key="scr_bitrate_custom"
android:dialogTitle="@string/scr_bitrate_custom_dialog"
android:inputType="number"
android:defaultValue="4000" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:key="scr_timelimit"
android:entries="@array/scr_timelimit_entries"
android:entryValues="@array/scr_timelimit_values"
android:title="@string/scr_timelimit_title" />
<com.wubydax.romcontrol.prefs.MyEditTextPreference
android:title="@string/scr_timelimit_custom_title"
android:summary="@string/scr_timelimit_custom_summary"
android:key="scr_timelimit_custom"
android:dialogTitle="@string/scr_timelimit_custom_dialog"
android:inputType="number"
android:defaultValue="180" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="0"
android:key="scr_storage_path"
android:entries="@array/scr_storage_path_entries"
android:entryValues="@array/scr_storage_path_values"
android:title="@string/scr_storage_path_title" />
</PreferenceScreen>

3. Open res/values/strings.xml and add this:

<string name="scr_options_title">Screenrecord Options</string>
<string name="scr_pointer_title">Always show pointer</string>
<string name="scr_thumbs_preview_title">Show thumb preview</string>
<string name="scr_bitrate_title">Bitrate</string>
<string name="scr_bitrate_custom_title">Custom bitrate</string>
<string name="scr_bitrate_custom_summary">%s Kbps</string>
<string name="scr_bitrate_custom_dialog">Enter value in Kbps, accepted value 100–10000 = 100Kbps-10Mbps</string>
<string name="scr_timelimit_title">Record time limit</string>
<string name="scr_timelimit_custom_title">Custom time limit</string>
<string name="scr_timelimit_custom_summary">%s second(s)</string>
<string name="scr_timelimit_custom_dialog">Enter value in second (max 180)</string>
<string name="scr_storage_path_title">Saved to</string>
<string name="scr_enable">Enable</string>
<string name="scr_disable">Disable</string>

4. Open res/values/arrays.xml and add this:

<string-array name="scr_bitrate_entries">
<item>500Kbps</item>
<item>1Mbps</item>
<item>2Mbps</item>
<item>3Mbps</item>
<item>4Mbps (Default)</item>
<item>5Mbps</item>
<item>6Mbps</item>
<item>@string/scr_bitrate_custom_title</item>
</string-array>
<string-array name="scr_bitrate_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
<string-array name="scr_timelimit_entries">
<item>1 minute</item>
<item>2 minutes</item>
<item>3 minutes (Default)</item>
<item>@string/scr_timelimit_custom_title</item>
</string-array>
<string-array name="scr_timelimit_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="scr_storage_path_entries">
<item>Internal</item>
<item>MicroSD</item>
</string-array>
<string-array name="scr_storage_path_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>

5. Recompile ZenControl and install. Done.

Add Preference include settings:

1. Apply my guide: http://xdaforums.com/zenfone-4/themes-apps/guide-easy-preference-control-t3317849

2. Open res/xml/zen_prefs.xml and add this:

<PreferenceScreen android:title="@string/scr_options_title">
<SwitchPreference
android:defaultValue="true"
android:key="scr_pointer"
android:summaryOff="@string/scr_disable"
android:summaryOn="@string/scr_enable"
android:title="@string/scr_pointer_title" />
<SwitchPreference
android:defaultValue="true"
android:key="scr_thumbs_preview"
android:summaryOff="@string/scr_disable"
android:summaryOn="@string/scr_enable"
android:title="@string/scr_thumbs_preview_title" />
<com.android.settings.bamzzz.prefs.MyListPreference
android:defaultValue="4"
android:key="scr_bitrate"
android:entries="@array/scr_bitrate_entries"
android:entryValues="@array/scr_bitrate_values"
android:title="@string/scr_bitrate_title" />
<com.android.settings.bamzzz.prefs.MyEditTextPreference
android:title="@string/scr_bitrate_custom_title"
android:summary="@string/scr_bitrate_custom_summary"
android:key="scr_bitrate_custom"
android:dialogTitle="@string/scr_bitrate_custom_dialog"
android:inputType="number"
android:defaultValue="4000" />
<com.android.settings.bamzzz.prefs.MyListPreference
android:defaultValue="2"
android:key="scr_timelimit"
android:entries="@array/scr_timelimit_entries"
android:entryValues="@array/scr_timelimit_values"
android:title="@string/scr_timelimit_title" />
<com.android.settings.bamzzz.prefs.MyEditTextPreference
android:title="@string/scr_timelimit_custom_title"
android:summary="@string/scr_timelimit_custom_summary"
android:key="scr_timelimit_custom"
android:dialogTitle="@string/scr_timelimit_custom_dialog"
android:inputType="number"
android:defaultValue="180" />
<com.android.settings.bamzzz.prefs.MyListPreference
android:defaultValue="0"
android:key="scr_storage_path"
android:entries="@array/scr_storage_path_entries"
android:entryValues="@array/scr_storage_path_values"
android:title="@string/scr_storage_path_title" />
</PreferenceScreen>

3. Open res/values/strings.xml and add this:

<string name="scr_options_title">Screenrecord Options</string>
<string name="scr_pointer_title">Always show pointer</string>
<string name="scr_thumbs_preview_title">Show thumb preview</string>
<string name="scr_bitrate_title">Bitrate</string>
<string name="scr_bitrate_custom_title">Custom bitrate</string>
<string name="scr_bitrate_custom_summary">%s Kbps</string>
<string name="scr_bitrate_custom_dialog">Enter value in Kbps, accepted value 100–10000 = 100Kbps-10Mbps</string>
<string name="scr_timelimit_title">Record time limit</string>
<string name="scr_timelimit_custom_title">Custom time limit</string>
<string name="scr_timelimit_custom_summary">%s second(s)</string>
<string name="scr_timelimit_custom_dialog">Enter value in second (max 180)</string>
<string name="scr_storage_path_title">Saved to</string>
<string name="scr_enable">Enable</string>
<string name="scr_disable">Disable</string>

4. Open res/values/arrays.xml and add this:

<string-array name="scr_bitrate_entries">
<item>500Kbps</item>
<item>1Mbps</item>
<item>2Mbps</item>
<item>3Mbps</item>
<item>4Mbps (Default)</item>
<item>5Mbps</item>
<item>6Mbps</item>
<item>@string/scr_bitrate_custom_title</item>
</string-array>
<string-array name="scr_bitrate_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
<string-array name="scr_timelimit_entries">
<item>1 minute</item>
<item>2 minutes</item>
<item>3 minutes (Default)</item>
<item>@string/scr_timelimit_custom_title</item>
</string-array>
<string-array name="scr_timelimit_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="scr_storage_path_entries">
<item>Internal</item>
<item>MicroSD</item>
</string-array>
<string-array name="scr_storage_path_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>

5. Compile Settings. Done.

Attention: Don't rename or modify path of smali from this guide without my permissions !!!

Please hit thanks button if helped.. :D

Created by bamzzz@xda

fb.me/bamz4ever

http://xdaforums.com/member.php?u=4672359

ZenControl by Wuby986@xda & daxgirl@xda

http://xdaforums.com/android/apps-games/app-rom-control-app-devs-t3146567

OmniROM Project

/*

* Copyright (C) 2015 The OmniROM Project

*

* This program is free software: you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation, either version 3 of the License, or

* (at your option) any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

* GNU General Public License for more details.

*

* You should have received a copy of the GNU General Public License

* along with this program. If not, see <http://www.gnu.org/licenses/>.

*

*/