[GUIDE] OMNI Screen Record with widget

July 08, 2017
Hi all, kali ini saya ingin memberikan "GUIDE OMNI Screenrecord", panduan untuk merekam layar dengan start / stop screenrecord menggunakan widget ..

Semoga berhasil untuk semua rom..

Panduan ini didasarkan pada firmware Lollipop Asus Zenfone 4S (T00Q).

Scrennshot:
omni-scr

omni-scr

omni-scr


Feature:
Show/hide pointer while recording
Enable/disable thumbs preview after recording finish
Custom bitrate options
Custom time limit options
Saved path options

Requirement:
- Mengerti compile/decompile APK
- APKTool
- Notepad++ (PC)


Bahan:
ZenControl.apk
Guide.zip


Step:
Part AsusSystemUI:
1. Decompile AsusSystemUI.apk
2. Letakkan smali dan res yg dari guide ke tempat masing".. Timpah aja bila yg sudah ada..
3. Buka AndroidManifest.xml
   Cari:
    <uses-permission android:name="android.permission.SET_WALLPAPER"/>
   
   Tambahkan dibawahnya:
    <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
   
   Cari:
        <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>

   Tambahkan dibawahnya:
        <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. Buka res/values/ids.xml
   Tambahkan:
    <item type="id" name="screen_record_image">false</item>
    <item type="id" name="screen_record_label">false</item>

5. Buka res/values/strings.xml
   Tambahkan:
    <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 UI nya, jgn lupa di Sign dan zipalign. Push & Reboot.

7. Selesai.


Part Settings:

Optional!!! Pilih salah satu, menggunakan ZenControl.apk (Lollipop only) atau dimasukin ke Settings.apk

Add Preference using ZenControl.apk :

1. Decompile ZenControl.apk

2. Buka dan tambahkan script dibawah ini di /res/xml/frameworks_general_prefs.xml

    <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. Buka dan tambahkan script dibawah ini di res/values/strings.xml

    <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. Buka dan tambahkan script dibawah ini di res/values/arrays.xml

    <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..

6. Install ZenControl seperti apk normal


Add Preference include settings:

1. Terapkan guide ane sebelumnya: http://forum.xda-developers.com/zenfone-4/themes-apps/guide-easy-preference-control-t3317849

2. Buka dan tambahkan script dibawah ini di /res/xml/zen_prefs.xml

    <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. Buka dan tambahkan script dibawah ini di res/values/strings.xml

    <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. Buka dan tambahkan script dibawah ini di res/values/arrays.xml

    <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. Selesai.


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

NB: Dilarang mengubah nama smali atau path smali yang ada didalam guide ini tanpa izin ane !!!
Attention: Don't rename or modify path of smali from this guide without my permissions !!!

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

Created by bamzzz@xda
fb.me/bamz4ever

ZenControl by Wuby986@xda & daxgirl@xda

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/>.
 *
 */

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

Artikel Terkait

Previous
Next Post »

Silahkan tinggalkan komentar EmoticonEmoticon