3 | * Copyright (C) 2016 The Android Open Source Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package ie.macinnes.tvheadend.player.reader;
19 |
20 | import android.content.Context;
21 | import android.support.annotation.NonNull;
22 |
23 | import com.google.android.exoplayer2.C;
24 | import com.google.android.exoplayer2.Format;
25 | import com.google.android.exoplayer2.extractor.ExtractorOutput;
26 | import com.google.android.exoplayer2.extractor.TrackOutput;
27 | import com.google.android.exoplayer2.util.MimeTypes;
28 | import com.google.android.exoplayer2.util.ParsableByteArray;
29 | import com.google.android.exoplayer2.util.Util;
30 |
31 | import java.nio.charset.Charset;
32 | import java.util.Arrays;
33 | import java.util.Locale;
34 |
35 | import ie.macinnes.htsp.HtspMessage;
36 | import ie.macinnes.tvheadend.Application;
37 |
38 | class TextsubStreamReader implements StreamReader {
39 | private static final String TAG = TextsubStreamReader.class.getName();
40 |
41 | /**
42 | * A template for the prefix that must be added to each subrip sample. The 12 byte end timecode
43 | * starting at {@link #SUBRIP_PREFIX_END_TIMECODE_OFFSET} is set to a dummy value, and must be
44 | * replaced with the duration of the subtitle.
45 | *
46 | * Equivalent to the UTF-8 string: "1\n00:00:00,000 --> 00:00:00,000\n".
47 | */
48 | private static final byte[] SUBRIP_PREFIX = new byte[] {49, 10, 48, 48, 58, 48, 48, 58, 48, 48,
49 | 44, 48, 48, 48, 32, 45, 45, 62, 32, 48, 48, 58, 48, 48, 58, 48, 48, 44, 48, 48, 48, 10};
50 | /**
51 | * A special end timecode indicating that a subtitle should be displayed until the next subtitle,
52 | * or until the end of the media in the case of the last subtitle.
53 | *
54 | * Equivalent to the UTF-8 string: " ".
55 | */
56 | private static final byte[] SUBRIP_TIMECODE_EMPTY =
57 | new byte[] {32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32};
58 | /**
59 | * The byte offset of the end timecode in {@link #SUBRIP_PREFIX}.
60 | */
61 | private static final int SUBRIP_PREFIX_END_TIMECODE_OFFSET = 19;
62 | /**
63 | * The length in bytes of a timecode in a subrip prefix.
64 | */
65 | private static final int SUBRIP_TIMECODE_LENGTH = 12;
66 |
67 | // UTF-8 is the default on Android
68 | private static final Charset UTF_8 = Charset.defaultCharset();
69 |
70 | private final Context mContext;
71 | private TrackOutput mTrackOutput;
72 |
73 | TextsubStreamReader(Context context) {
74 | mContext = context;
75 | }
76 |
77 | @Override
78 | public final void createTracks(@NonNull HtspMessage stream, @NonNull ExtractorOutput output) {
79 | final int streamIndex = stream.getInteger("index");
80 | mTrackOutput = output.track(streamIndex, C.TRACK_TYPE_TEXT);
81 | mTrackOutput.format(buildFormat(streamIndex, stream));
82 | }
83 |
84 | @Override
85 | public void consume(@NonNull final HtspMessage message) {
86 |
87 | final long pts = message.getLong("pts");
88 | final long duration = message.getInteger("duration");
89 | final byte[] payload = Util.getUtf8Bytes(
90 | new String(message.getByteArray("payload"), UTF_8).trim());
91 |
92 | final int lengthWithPrefix = SUBRIP_PREFIX.length + payload.length;
93 | final byte[] subsipSample = Arrays.copyOf(SUBRIP_PREFIX, lengthWithPrefix);
94 |
95 | System.arraycopy(payload, 0, subsipSample, SUBRIP_PREFIX.length, payload.length);
96 |
97 | setSubripSampleEndTimecode(subsipSample, duration);
98 |
99 | mTrackOutput.sampleData(new ParsableByteArray(subsipSample), lengthWithPrefix);
100 | mTrackOutput.sampleMetadata(pts, C.BUFFER_FLAG_KEY_FRAME, lengthWithPrefix, 0, null);
101 | }
102 |
103 | @Override
104 | public void release() {
105 | // Watch for memory leaks
106 | Application.getRefWatcher(mContext).watch(this);
107 | }
108 |
109 | @NonNull
110 | private Format buildFormat(int streamIndex, @NonNull HtspMessage stream) {
111 | return Format.createTextSampleFormat(
112 | Integer.toString(streamIndex),
113 | MimeTypes.APPLICATION_SUBRIP,
114 | C.SELECTION_FLAG_AUTOSELECT,
115 | stream.getString("language", "und"),
116 | null
117 | );
118 | }
119 |
120 | private static void setSubripSampleEndTimecode(byte[] subripSample, long timeUs) {
121 | byte[] timeCodeData;
122 | if (timeUs == C.TIME_UNSET || timeUs == 0) {
123 | timeCodeData = SUBRIP_TIMECODE_EMPTY;
124 | } else {
125 | int hours = (int) (timeUs / 3600000000L);
126 | timeUs -= (hours * 3600000000L);
127 | int minutes = (int) (timeUs / 60000000);
128 | timeUs -= (minutes * 60000000);
129 | int seconds = (int) (timeUs / 1000000);
130 | timeUs -= (seconds * 1000000);
131 | int milliseconds = (int) (timeUs / 1000);
132 | timeCodeData = Util.getUtf8Bytes(String.format(Locale.US, "%02d:%02d:%02d,%03d", hours,
133 | minutes, seconds, milliseconds));
134 | }
135 |
136 | System.arraycopy(timeCodeData, 0, subripSample, SUBRIP_PREFIX_END_TIMECODE_OFFSET,
137 | SUBRIP_TIMECODE_LENGTH);
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/app/src/main/java/ie/macinnes/tvheadend/player/reader/VorbisStreamReader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017 Kiall Mac Innes
3 | * Copyright (C) 2016 The Android Open Source Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package ie.macinnes.tvheadend.player.reader;
19 |
20 | import android.content.Context;
21 | import android.support.annotation.NonNull;
22 | import android.util.Log;
23 |
24 | import com.google.android.exoplayer2.C;
25 | import com.google.android.exoplayer2.Format;
26 | import com.google.android.exoplayer2.ParserException;
27 | import com.google.android.exoplayer2.util.MimeTypes;
28 |
29 | import java.util.ArrayList;
30 | import java.util.List;
31 |
32 | import ie.macinnes.htsp.HtspMessage;
33 | import ie.macinnes.tvheadend.TvhMappings;
34 |
35 | class VorbisStreamReader extends PlainStreamReader {
36 | private static final String TAG = VorbisStreamReader.class.getName();
37 |
38 | VorbisStreamReader(Context context) {
39 | super(context, C.TRACK_TYPE_AUDIO);
40 | }
41 |
42 | @NonNull
43 | @Override
44 | protected Format buildFormat(int streamIndex, @NonNull HtspMessage stream) {
45 | List initializationData = null;
46 |
47 | if (stream.containsKey("meta")) {
48 | try {
49 | initializationData = parseVorbisCodecPrivate(stream.getByteArray("meta"));
50 | } catch (ParserException e) {
51 | Log.e(TAG, "Failed to parse Vorbis meta, discarding");
52 | }
53 | }
54 |
55 | int rate = Format.NO_VALUE;
56 | if (stream.containsKey("rate")) {
57 | rate = TvhMappings.sriToRate(stream.getInteger("rate"));
58 | }
59 |
60 | return Format.createAudioSampleFormat(
61 | Integer.toString(streamIndex),
62 | MimeTypes.AUDIO_VORBIS,
63 | null,
64 | Format.NO_VALUE,
65 | Format.NO_VALUE,
66 | stream.getInteger("channels", Format.NO_VALUE),
67 | rate,
68 | C.ENCODING_PCM_16BIT,
69 | initializationData,
70 | null,
71 | C.SELECTION_FLAG_AUTOSELECT,
72 | stream.getString("language", "und")
73 | );
74 | }
75 |
76 | @Override
77 | protected int getTrackType() {
78 | return C.TRACK_TYPE_AUDIO;
79 | }
80 |
81 | /**
82 | * Builds initialization data for a {@link Format} from Vorbis codec private data.
83 | *
84 | * @return The initialization data for the {@link Format}.
85 | * @throws ParserException If the initialization data could not be built.
86 | */
87 | private static List parseVorbisCodecPrivate(byte[] codecPrivate)
88 | throws ParserException {
89 | try {
90 | if (codecPrivate[0] != 0x02) {
91 | throw new ParserException("Error parsing vorbis codec private");
92 | }
93 | int offset = 1;
94 | int vorbisInfoLength = 0;
95 | while (codecPrivate[offset] == (byte) 0xFF) {
96 | vorbisInfoLength += 0xFF;
97 | offset++;
98 | }
99 | vorbisInfoLength += codecPrivate[offset++];
100 |
101 | int vorbisSkipLength = 0;
102 | while (codecPrivate[offset] == (byte) 0xFF) {
103 | vorbisSkipLength += 0xFF;
104 | offset++;
105 | }
106 | vorbisSkipLength += codecPrivate[offset++];
107 |
108 | if (codecPrivate[offset] != 0x01) {
109 | throw new ParserException("Error parsing vorbis codec private");
110 | }
111 | byte[] vorbisInfo = new byte[vorbisInfoLength];
112 | System.arraycopy(codecPrivate, offset, vorbisInfo, 0, vorbisInfoLength);
113 | offset += vorbisInfoLength;
114 | if (codecPrivate[offset] != 0x03) {
115 | throw new ParserException("Error parsing vorbis codec private");
116 | }
117 | offset += vorbisSkipLength;
118 | if (codecPrivate[offset] != 0x05) {
119 | throw new ParserException("Error parsing vorbis codec private");
120 | }
121 | byte[] vorbisBooks = new byte[codecPrivate.length - offset];
122 | System.arraycopy(codecPrivate, offset, vorbisBooks, 0, codecPrivate.length - offset);
123 | List initializationData = new ArrayList<>(2);
124 | initializationData.add(vorbisInfo);
125 | initializationData.add(vorbisBooks);
126 | return initializationData;
127 | } catch (ArrayIndexOutOfBoundsException e) {
128 | throw new ParserException("Error parsing vorbis codec private");
129 | }
130 | }
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/app/src/main/java/ie/macinnes/tvheadend/settings/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016 Kiall Mac Innes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 | * not use this file except in compliance with the License. You may obtain
6 | * a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package ie.macinnes.tvheadend.settings;
18 |
19 | import android.app.Activity;
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.os.Bundle;
23 | import android.widget.Toast;
24 |
25 | import ie.macinnes.tvheadend.R;
26 |
27 | public class SettingsActivity extends Activity {
28 | public static Intent getPreferencesIntent(Context context) {
29 | return new Intent(context, SettingsActivity.class);
30 | }
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 |
36 | setContentView(R.layout.fragment_settings);
37 | }
38 |
39 | @Override
40 | protected void onStop() {
41 | super.onStop();
42 |
43 | Toast.makeText(this, R.string.settings_require_restart, Toast.LENGTH_LONG).show();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/ie/macinnes/tvheadend/settings/SettingsFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016 Kiall Mac Innes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 | * not use this file except in compliance with the License. You may obtain
6 | * a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package ie.macinnes.tvheadend.settings;
18 |
19 |
20 | import android.content.Context;
21 | import android.os.Bundle;
22 | import android.support.v14.preference.PreferenceFragment;
23 | import android.support.v17.preference.LeanbackPreferenceFragment;
24 | import android.support.v17.preference.LeanbackSettingsFragment;
25 | import android.support.v7.preference.DialogPreference;
26 | import android.support.v7.preference.Preference;
27 | import android.support.v7.preference.PreferenceScreen;
28 | import android.util.Log;
29 |
30 | import ie.macinnes.tvheadend.Constants;
31 | import ie.macinnes.tvheadend.R;
32 |
33 | public class SettingsFragment extends LeanbackSettingsFragment implements DialogPreference.TargetFragment {
34 | private static final String TAG = SettingsFragment.class.getName();
35 |
36 | private PreferenceFragment mPreferenceFragment;
37 |
38 | @Override
39 | public void onPreferenceStartInitialScreen() {
40 | mPreferenceFragment = buildPreferenceFragment(null);
41 | startPreferenceFragment(mPreferenceFragment);
42 | }
43 |
44 | @Override
45 | public boolean onPreferenceStartFragment(PreferenceFragment preferenceFragment, Preference preference) {
46 | return false;
47 | }
48 |
49 | @Override
50 | public boolean onPreferenceStartScreen(PreferenceFragment preferenceFragment, PreferenceScreen preferenceScreen) {
51 | PreferenceFragment fragment = buildPreferenceFragment(preferenceScreen.getKey());
52 |
53 | startPreferenceFragment(fragment);
54 |
55 | return true;
56 | }
57 |
58 | private PreferenceFragment buildPreferenceFragment(String root) {
59 | PreferenceFragment fragment = new LocalLeanbackPreferenceFragment();
60 |
61 | Bundle args = new Bundle();
62 | args.putString(PreferenceFragment.ARG_PREFERENCE_ROOT, root);
63 | fragment.setArguments(args);
64 |
65 | return fragment;
66 | }
67 |
68 | @Override
69 | public Preference findPreference(CharSequence charSequence) {
70 | return mPreferenceFragment.findPreference(charSequence);
71 | }
72 |
73 | public static class LocalLeanbackPreferenceFragment extends LeanbackPreferenceFragment {
74 |
75 | @Override
76 | public void onCreatePreferences(Bundle bundle, String s) {
77 | getPreferenceManager().setSharedPreferencesName(Constants.PREFERENCE_TVHEADEND);
78 | getPreferenceManager().setSharedPreferencesMode(Context.MODE_PRIVATE);
79 |
80 | String root = getArguments().getString(PreferenceFragment.ARG_PREFERENCE_ROOT, null);
81 |
82 | if (root == null) {
83 | addPreferencesFromResource(R.xml.preferences);
84 | } else {
85 | setPreferencesFromResource(R.xml.preferences, root);
86 | }
87 | }
88 |
89 | @Override
90 | public boolean onPreferenceTreeClick(Preference preference) {
91 | Log.d(TAG, "Test: onPreferenceTreeClick");
92 |
93 | return super.onPreferenceTreeClick(preference);
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/app/src/main/java/ie/macinnes/tvheadend/sync/EpgSyncService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016 Kiall Mac Innes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 | * not use this file except in compliance with the License. You may obtain
6 | * a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package ie.macinnes.tvheadend.sync;
18 |
19 | import android.accounts.Account;
20 | import android.accounts.AccountManager;
21 | import android.app.Service;
22 | import android.content.Intent;
23 | import android.content.SharedPreferences;
24 | import android.os.Handler;
25 | import android.os.HandlerThread;
26 | import android.os.IBinder;
27 | import android.util.Log;
28 |
29 | import ie.macinnes.htsp.HtspConnection;
30 | import ie.macinnes.htsp.SimpleHtspConnection;
31 | import ie.macinnes.tvheadend.BuildConfig;
32 | import ie.macinnes.tvheadend.Constants;
33 | import ie.macinnes.tvheadend.MiscUtils;
34 | import ie.macinnes.tvheadend.R;
35 | import ie.macinnes.tvheadend.account.AccountUtils;
36 |
37 | public class EpgSyncService extends Service {
38 | private static final String TAG = EpgSyncService.class.getName();
39 |
40 | private HandlerThread mHandlerThread;
41 | private Handler mHandler;
42 |
43 | private SharedPreferences mSharedPreferences;
44 |
45 | private AccountManager mAccountManager;
46 | private Account mAccount;
47 |
48 | private SimpleHtspConnection mConnection;
49 | private EpgSyncTask mEpgSyncTask;
50 | private DvrDeleteTask mDvrDeleteTask;
51 |
52 | public EpgSyncService() {
53 | }
54 |
55 | @Override
56 | public IBinder onBind(Intent intent) {
57 | throw new UnsupportedOperationException("Binding not allowed");
58 | }
59 |
60 | @Override
61 | public void onCreate() {
62 | Log.i(TAG, "Starting EPG Sync Service");
63 |
64 | mSharedPreferences = getSharedPreferences(Constants.PREFERENCE_TVHEADEND, MODE_PRIVATE);
65 |
66 | if (!MiscUtils.isSetupComplete(this)) {
67 | Log.i(TAG, "Setup not completed, shutting down EPG Sync Service");
68 | stopSelf();
69 | return;
70 | }
71 |
72 | final boolean enableEpgSync = mSharedPreferences.getBoolean(
73 | Constants.KEY_EPG_SYNC_ENABLED,
74 | getResources().getBoolean(R.bool.pref_default_epg_sync_enabled)
75 | );
76 |
77 | if (!enableEpgSync) {
78 | Log.i(TAG, "EPG Sync disabled, shutting down EPG Sync Service");
79 | stopSelf();
80 | return;
81 | }
82 |
83 | mHandlerThread = new HandlerThread("EpgSyncService Handler Thread");
84 | mHandlerThread.start();
85 | mHandler = new Handler(mHandlerThread.getLooper());
86 |
87 | mAccountManager = AccountManager.get(this);
88 | mAccount = AccountUtils.getActiveAccount(this);
89 |
90 | openConnection();
91 | }
92 |
93 | @Override
94 | public int onStartCommand(Intent intent, int flags, int startId) {
95 | if (mAccount == null) {
96 | return START_NOT_STICKY;
97 | }
98 | return START_STICKY;
99 | }
100 |
101 | @Override
102 | public void onDestroy() {
103 | Log.i(TAG, "Stopping EPG Sync Service");
104 |
105 | closeConnection();
106 |
107 | if (mHandlerThread != null) {
108 | mHandlerThread.quit();
109 | mHandlerThread.interrupt();
110 | mHandlerThread = null;
111 | }
112 | }
113 |
114 | private void openConnection() {
115 | if (!MiscUtils.isNetworkAvailable(this)) {
116 | Log.i(TAG, "No network available, shutting down EPG Sync Service");
117 | stopSelf();
118 | return;
119 | }
120 |
121 | if (mAccount == null) {
122 | Log.i(TAG, "No account configured, aborting startup of EPG Sync Service");
123 | stopSelf();
124 | return;
125 | }
126 |
127 | initHtspConnection();
128 | }
129 |
130 | private void initHtspConnection() {
131 | final String hostname = mAccountManager.getUserData(mAccount, Constants.KEY_HOSTNAME);
132 | final int port = Integer.parseInt(mAccountManager.getUserData(mAccount, Constants.KEY_HTSP_PORT));
133 | final String username = mAccount.name;
134 | final String password = mAccountManager.getPassword(mAccount);
135 |
136 | HtspConnection.ConnectionDetails connectionDetails = new HtspConnection.ConnectionDetails(
137 | hostname, port, username, password, "android-tvheadend (EPG)",
138 | BuildConfig.VERSION_NAME);
139 |
140 | mConnection = new SimpleHtspConnection(connectionDetails);
141 |
142 | mEpgSyncTask = new EpgSyncTask(this, mConnection);
143 | mConnection.addMessageListener(mEpgSyncTask);
144 | mConnection.addAuthenticationListener(mEpgSyncTask);
145 |
146 | mDvrDeleteTask = new DvrDeleteTask(this, mConnection);
147 | mConnection.addMessageListener(mDvrDeleteTask);
148 |
149 | mConnection.start();
150 | }
151 |
152 | private void closeConnection() {
153 | if (mDvrDeleteTask != null) {
154 | mConnection.removeMessageListener(mDvrDeleteTask);
155 | mDvrDeleteTask.stop();
156 | mDvrDeleteTask = null;
157 | }
158 |
159 | if (mEpgSyncTask != null) {
160 | mConnection.removeMessageListener(mEpgSyncTask);
161 | mConnection.removeAuthenticationListener(mEpgSyncTask);
162 | // mEpgSyncTask.stop();
163 | mEpgSyncTask = null;
164 | }
165 |
166 | if (mConnection != null) {
167 | Log.d(TAG, "Closing HTSP connection");
168 | mConnection.stop();
169 | }
170 |
171 | cleanupConnection();
172 | }
173 |
174 | private void cleanupConnection() {
175 | mConnection = null;
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/app/src/main/java/ie/macinnes/tvheadend/tvinput/HtspRecordingSession.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2017 Kiall Mac Innes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package ie.macinnes.tvheadend.tvinput;
18 |
19 | import android.content.Context;
20 | import android.content.SharedPreferences;
21 | import android.media.tv.TvInputManager;
22 | import android.media.tv.TvInputService;
23 | import android.net.Uri;
24 | import android.os.Build;
25 | import android.os.Handler;
26 | import android.support.annotation.Nullable;
27 | import android.support.annotation.RequiresApi;
28 | import android.util.Log;
29 |
30 | import java.util.concurrent.atomic.AtomicInteger;
31 |
32 | import ie.macinnes.htsp.HtspMessage;
33 | import ie.macinnes.htsp.HtspNotConnectedException;
34 | import ie.macinnes.htsp.SimpleHtspConnection;
35 | import ie.macinnes.tvheadend.Constants;
36 | import ie.macinnes.tvheadend.TvContractUtils;
37 |
38 |
39 | @RequiresApi(api = Build.VERSION_CODES.N)
40 | class HtspRecordingSession extends TvInputService.RecordingSession {
41 | private static final String TAG = HtspRecordingSession.class.getName();
42 | private static final int INVALID_DVR_ENTRY_ID = -1;
43 | private static final AtomicInteger sSessionCounter = new AtomicInteger();
44 |
45 | private final Context mContext;
46 | private final SimpleHtspConnection mConnection;
47 | private final int mSessionNumber;
48 | private final Handler mHandler;
49 | private final SharedPreferences mSharedPreferences;
50 |
51 | private Uri mChannelUri;
52 | private Uri mProgramUri;
53 | private int mDvrEntryId = INVALID_DVR_ENTRY_ID;
54 |
55 | public HtspRecordingSession(Context context, SimpleHtspConnection connection) {
56 | super(context);
57 |
58 | mContext = context;
59 | mConnection = connection;
60 | mSessionNumber = sSessionCounter.getAndIncrement();
61 | mHandler = new Handler();
62 |
63 | mSharedPreferences = mContext.getSharedPreferences(
64 | Constants.PREFERENCE_TVHEADEND, Context.MODE_PRIVATE);
65 |
66 | Log.d(TAG, "HtspRecordingSession created (" + mSessionNumber + ")");
67 | }
68 |
69 | @Override
70 | public void onTune(Uri channelUri) {
71 | Log.d(TAG, "RecordingSession onTune (" + mSessionNumber + ")");
72 |
73 | mChannelUri = channelUri;
74 |
75 | // I'm not sure we really need to do anything here?
76 | notifyTuned(channelUri);
77 | }
78 |
79 | @Override
80 | public void onStartRecording(@Nullable Uri programUri) {
81 | Log.d(TAG, "RecordingSession onStartRecording (" + mSessionNumber + ")");
82 |
83 | mProgramUri = programUri;
84 |
85 | if (mProgramUri == null || mChannelUri == null) {
86 | Log.e(TAG, "Failed to start recording, programUri or channelUri is null");
87 | return;
88 | }
89 |
90 | Integer eventId = TvContractUtils.getTvhEventIdFromProgramUri(mContext, mProgramUri);
91 | Integer channelId = TvContractUtils.getTvhChannelIdFromChannelUri(mContext, mChannelUri);
92 |
93 | if (eventId == null || channelId == null) {
94 | Log.e(TAG, "Failed to start recording, eventId or channelId is null");
95 | return;
96 | }
97 |
98 | HtspMessage addDvrEntry = new HtspMessage();
99 | addDvrEntry.put("method", "addDvrEntry");
100 | addDvrEntry.put("eventId", eventId);
101 | addDvrEntry.put("channelId", channelId);
102 |
103 | HtspMessage addDvrEntryResponse;
104 |
105 | try {
106 | addDvrEntryResponse = mConnection.sendMessage(addDvrEntry, 5000);
107 | } catch (HtspNotConnectedException e) {
108 | Log.e(TAG, "Failed to start recording, HTSP not connected", e);
109 | notifyError(TvInputManager.RECORDING_ERROR_UNKNOWN);
110 | return;
111 | }
112 |
113 | boolean success = addDvrEntryResponse.getBoolean("success");
114 |
115 | if (success) {
116 | mDvrEntryId = addDvrEntryResponse.getInteger("id");
117 | Log.i(TAG, "DVR Entry created with ID: " + mDvrEntryId);
118 | } else {
119 | String error = addDvrEntryResponse.getString("error", "Unknown error");
120 | Log.e(TAG, "Failed to create DVR Entry: " + error);
121 | notifyError(TvInputManager.RECORDING_ERROR_UNKNOWN);
122 | }
123 | }
124 |
125 | @Override
126 | public void onStopRecording() {
127 | Log.d(TAG, "RecordingSession onStopRecording (" + mSessionNumber + ")");
128 |
129 | if (mDvrEntryId == INVALID_DVR_ENTRY_ID) {
130 | Log.e(TAG, "Failed to stop recording, no known DvrEntryId");
131 | return;
132 | }
133 |
134 | HtspMessage cancelDvrEntry = new HtspMessage();
135 | cancelDvrEntry.put("method", "cancelDvrEntry");
136 | cancelDvrEntry.put("id", mDvrEntryId);
137 |
138 | try {
139 | mConnection.sendMessage(cancelDvrEntry);
140 | } catch (HtspNotConnectedException e) {
141 | Log.e(TAG, "Failed to stop recording, HTSP not connected", e);
142 | }
143 |
144 | notifyRecordingStopped(null);
145 | }
146 |
147 | @Override
148 | public void onRelease() {
149 | Log.d(TAG, "RecordingSession onRelease (" + mSessionNumber + ")");
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/app/src/main/java/ie/macinnes/tvheadend/tvinput/TvInputService.java:
--------------------------------------------------------------------------------
1 | /* Copyright 2016 Kiall Mac Innes
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may
4 | not use this file except in compliance with the License. You may obtain
5 | a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | License for the specific language governing permissions and limitations
13 | under the License.
14 | */
15 | package ie.macinnes.tvheadend.tvinput;
16 |
17 | import android.accounts.Account;
18 | import android.accounts.AccountManager;
19 | import android.content.ComponentName;
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.content.SharedPreferences;
23 | import android.media.tv.TvInputInfo;
24 | import android.media.tv.TvInputManager;
25 | import android.os.Build;
26 | import android.support.annotation.Nullable;
27 | import android.support.annotation.RequiresApi;
28 | import android.util.Log;
29 |
30 | import ie.macinnes.htsp.HtspConnection;
31 | import ie.macinnes.htsp.SimpleHtspConnection;
32 | import ie.macinnes.tvheadend.BuildConfig;
33 | import ie.macinnes.tvheadend.Constants;
34 | import ie.macinnes.tvheadend.MiscUtils;
35 | import ie.macinnes.tvheadend.R;
36 | import ie.macinnes.tvheadend.account.AccountUtils;
37 | import ie.macinnes.tvheadend.sync.EpgSyncService;
38 |
39 |
40 | public class TvInputService extends android.media.tv.TvInputService {
41 | private static final String TAG = TvInputService.class.getName();
42 |
43 | private SimpleHtspConnection mConnection;
44 |
45 | private AccountManager mAccountManager;
46 | private Account mAccount;
47 |
48 | private SharedPreferences mSharedPreferences;
49 |
50 | @Override
51 | public void onCreate() {
52 | super.onCreate();
53 |
54 | mSharedPreferences = getSharedPreferences(
55 | Constants.PREFERENCE_TVHEADEND, Context.MODE_PRIVATE);
56 |
57 | mAccountManager = AccountManager.get(this);
58 | mAccount = AccountUtils.getActiveAccount(this);
59 |
60 | openConnection();
61 | maybeEnableDvr();
62 |
63 | // Start the EPG Sync Service
64 | getApplicationContext().startService(new Intent(getApplicationContext(), EpgSyncService.class));
65 | }
66 |
67 | @Override
68 | public void onDestroy() {
69 | super.onDestroy();
70 |
71 | closeConnection();
72 | }
73 |
74 | @Nullable
75 | @Override
76 | public Session onCreateSession(String inputId) {
77 | Log.d(TAG, "Creating new TvInputService HtspSession for input ID: " + inputId + ".");
78 |
79 | return new HtspSession(this, mConnection);
80 | }
81 |
82 | @RequiresApi(api = Build.VERSION_CODES.N)
83 | @Nullable
84 | @Override
85 | public RecordingSession onCreateRecordingSession(String inputId) {
86 | Log.d(TAG, "Creating new TvInputService HtspRecordingSession for input ID: " + inputId + ".");
87 |
88 | return new HtspRecordingSession(this, mConnection);
89 | }
90 |
91 | private void maybeEnableDvr() {
92 | boolean dvrEnabled = mSharedPreferences.getBoolean(
93 | Constants.KEY_DVR_ENABLED,
94 | getResources().getBoolean(R.bool.pref_default_dvr_enabled));
95 |
96 | if (dvrEnabled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
97 | Log.i(TAG, "Enabling DVR Support");
98 | int tuners;
99 | try {
100 | tuners = Integer.parseInt(mSharedPreferences.getString(
101 | Constants.KEY_TUNER_COUNT,
102 | getResources().getString(R.string.pref_default_tuner_count)));
103 | }
104 | catch (NumberFormatException e) {
105 | tuners = 10;
106 | }
107 |
108 | TvInputManager tim = (TvInputManager) getSystemService(Context.TV_INPUT_SERVICE);
109 | ComponentName componentName = new ComponentName(this, TvInputService.class);
110 | TvInputInfo tvInputInfo = new TvInputInfo.Builder(this, componentName)
111 | .setCanRecord(true)
112 | .setTunerCount(tuners)
113 | .build();
114 | tim.updateTvInputInfo(tvInputInfo);
115 | }
116 | }
117 |
118 | private void openConnection() {
119 | if (!MiscUtils.isNetworkAvailable(this)) {
120 | Log.i(TAG, "No network available, shutting down TV Input Service");
121 | return;
122 | }
123 |
124 | if (mAccount == null) {
125 | Log.i(TAG, "No account configured, aborting startup of TV Input Service");
126 | return;
127 | }
128 |
129 | initHtspConnection();
130 | }
131 |
132 | private void initHtspConnection() {
133 | final String hostname = mAccountManager.getUserData(mAccount, Constants.KEY_HOSTNAME);
134 | final int port = Integer.parseInt(mAccountManager.getUserData(mAccount, Constants.KEY_HTSP_PORT));
135 | final String username = mAccount.name;
136 | final String password = mAccountManager.getPassword(mAccount);
137 |
138 | HtspConnection.ConnectionDetails connectionDetails = new HtspConnection.ConnectionDetails(
139 | hostname, port, username, password, "android-tvheadend (TV)",
140 | BuildConfig.VERSION_NAME);
141 |
142 | mConnection = new SimpleHtspConnection(connectionDetails);
143 | mConnection.start();
144 | }
145 |
146 | private void closeConnection() {
147 | if (mConnection != null) {
148 | Log.d(TAG, "Closing HTSP connection");
149 | mConnection.stop();
150 | }
151 |
152 | cleanupConnection();
153 | }
154 |
155 | private void cleanupConnection() {
156 | mConnection = null;
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/app/src/main/play/contactEmail:
--------------------------------------------------------------------------------
1 | tvheadend@macinnes.ie
--------------------------------------------------------------------------------
/app/src/main/play/contactPhone:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/contactPhone
--------------------------------------------------------------------------------
/app/src/main/play/contactWebsite:
--------------------------------------------------------------------------------
1 | https://github.com/kiall/android-tvheadend
--------------------------------------------------------------------------------
/app/src/main/play/defaultLanguage:
--------------------------------------------------------------------------------
1 | en-GB
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/featureGraphic/feature-graphic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/featureGraphic/feature-graphic.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/fulldescription:
--------------------------------------------------------------------------------
1 | Live Channels addon for Tvheadend. Pulls in DVB-T/S/C content from your Tvheadend server, including EPG, and makes it available within the Live Channels app on Nexus Player etc, or the Streaming Channels app on Sony Android TVs.
2 |
3 | The app is open source, contributors are welcome :)
4 |
5 | Important: A Tvheadend server is required, this app provides no content directly, relying entirely on your Tvheadend server for content.
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/icon/play-store-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/icon/play-store-icon.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/phoneScreenshots/01-guide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/phoneScreenshots/01-guide.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/phoneScreenshots/02-playback-overlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/phoneScreenshots/02-playback-overlay.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/phoneScreenshots/03-guide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/phoneScreenshots/03-guide.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/phoneScreenshots/04-playback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/phoneScreenshots/04-playback.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/phoneScreenshots/05-genres.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/phoneScreenshots/05-genres.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/shortdescription:
--------------------------------------------------------------------------------
1 | Live Channels addon for Tvheadend
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/title:
--------------------------------------------------------------------------------
1 | Tvheadend Live Channel
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/tvBanner/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/tvBanner/banner.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/tvScreenshots/01-guide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/tvScreenshots/01-guide.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/tvScreenshots/02-playback-overlay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/tvScreenshots/02-playback-overlay.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/tvScreenshots/03-guide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/tvScreenshots/03-guide.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/tvScreenshots/04-playback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/tvScreenshots/04-playback.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/tvScreenshots/05-genres.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/tvScreenshots/05-genres.png
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/listing/video:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/play/en-GB/listing/video
--------------------------------------------------------------------------------
/app/src/main/play/en-GB/whatsnew:
--------------------------------------------------------------------------------
1 | * Add basic DVR support
2 | * Display the channel icon & name when no video track is available (e.g. for radio stations)
3 | * Upgrade to ExoPlayer 2.5.1
4 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/default_event_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/drawable-hdpi/default_event_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/drawable-mdpi/banner.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_settings.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
22 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/player_overlay_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
34 |
35 |
38 |
39 |
46 |
56 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/setup_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
22 |
23 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_tv_service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/mipmap-hdpi/ic_tv_service.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_tv_service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/mipmap-mdpi/ic_tv_service.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_tv_service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/mipmap-xhdpi/ic_tv_service.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_tv_service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/mipmap-xxhdpi/ic_tv_service.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_tv_service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/app/src/main/res/mipmap-xxxhdpi/ic_tv_service.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #C03800
4 | #C03800
5 |
6 | #311b92
7 | #311b92
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/constants.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 13sp
21 |
22 |
23 | 500
24 | false
25 | false
26 | true
27 | true
28 | true
29 | 86400
30 | true
31 | false
32 | true
33 | false
34 | false
35 | false
36 | htsp
37 | 10
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | - 1 hour
21 | - 6 hours
22 | - 12 hours
23 | - 1 day
24 | - 3 days
25 | - 7 days
26 | - 8 days
27 |
28 |
29 |
30 | - 3600
31 | - 21600
32 | - 43200
33 | - 86400
34 | - 259200
35 | - 604800
36 | - 691200
37 |
38 |
39 |
40 | - No Buffer
41 | - 0.5 Seconds
42 | - 1 Second
43 | - 1.5 Seconds
44 | - 2 Seconds
45 | - 2.5 Seconds
46 | - 3 Seconds
47 | - 4 Seconds
48 | - 5 Seconds
49 |
50 |
51 |
52 | - 0
53 | - 500
54 | - 1000
55 | - 1500
56 | - 2000
57 | - 2500
58 | - 3000
59 | - 4000
60 | - 5000
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 | TVHeadend
18 |
19 | TVHeadend Authenticator
20 | TVHeadend
21 |
22 | Enable ACRA?
23 | ACRA enabled
24 | ACRA disabled
25 |
26 | Send system logs?
27 | Sending system logs is enabled
28 | Sending system logs is disabled
29 |
30 | Contact email address (optional)
31 | Sometimes, the developers may need to contact you for more info
32 |
33 | Successfully Added Account
34 | Failed to add account: %s
35 | Tvheadend Account
36 | Enter your Tvheadend username and password
37 | Password
38 | Invalid Password
39 | Username
40 | Invalid Username
41 |
42 | HTSP Port Number
43 | Invalid HTSP Port
44 | Hostname/IP
45 | Invalid Hostname
46 | Tvheadend Server
47 | Enter your Tvheadend server hostname or IP address
48 | Account Selection
49 | Please choose an existing, or create a new Tvheadend account to use
50 | You\'re all set!
51 | Add New Account
52 | Finish
53 | Select An Account
54 | Start Tvheadend Live Channel Setup
55 | Begin
56 | Complete
57 | More EPG data, channel logs, etc are downloading in the background
58 | Failed to add account
59 | Setup Complete
60 | Confirm
61 | Confirm This Selection
62 | Next
63 | Failed to validate HTSP Credentials
64 | Failed to connect to HTSP server
65 | Welcome to the Tvhheadend Live Channel, we\'ll guide you through the setup process now, once done you will be ready to watch TV
66 | Introduction
67 | Only one Tvheadend account is currently supported
68 | Processing
69 | Checking your HTSP account
70 | Advanced Settings
71 | Settings
72 | Just a few seconds please :)
73 | Syncing Channels and Program data
74 |
75 | IMPORTANT: Most settings require a device restart to take effect
76 | Channel Logo
77 |
78 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
22 |
23 |
27 |
28 |
31 |
32 |
36 |
37 |
40 |
41 |
50 |
51 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/authenticatorservice.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 |
23 |
31 |
32 |
37 |
38 |
43 |
44 |
48 |
49 |
53 |
54 |
55 |
56 |
60 |
68 |
73 |
78 |
79 |
80 |
81 |
85 |
86 |
90 |
91 |
96 |
97 |
102 |
103 |
104 |
109 |
110 |
117 |
118 |
119 |
124 |
129 |
132 |
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/tvinputservice.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
19 |
--------------------------------------------------------------------------------
/artwork/banner.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/artwork/banner.ai
--------------------------------------------------------------------------------
/artwork/logo-plain.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/artwork/logo-plain.ai
--------------------------------------------------------------------------------
/artwork/play-store-icon.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/artwork/play-store-icon.ai
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | apply from: 'properties.gradle'
3 |
4 | buildscript {
5 | repositories {
6 | jcenter()
7 | google()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.1.0'
11 | classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
12 | classpath 'org.ajoberstar:gradle-git:1.7.2'
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | maven {
22 | url "http://dl.bintray.com/kiall/exoplayer"
23 | }
24 | maven {
25 | url "http://dl.bintray.com/kiall/htsp"
26 | }
27 | maven {
28 | url "https://maven.google.com"
29 | }
30 | jcenter()
31 | google()
32 | }
33 |
34 | project.ext {
35 | compileSdkVersion = 26
36 | targetSdkVersion = 26
37 | minSdkVersion = 22
38 | buildToolsVersion = "27.0.3"
39 | }
40 | }
41 |
42 | task clean(type: Delete) {
43 | delete rootProject.buildDir
44 | }
45 |
--------------------------------------------------------------------------------
/debug-keystore.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/debug-keystore.jks
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 | org.gradle.jvmargs=-Xmx2048M
15 |
16 | # When configured, Gradle will run in incubating parallel mode.
17 | # This option should only be used with decoupled projects. More details, visit
18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
19 | # org.gradle.parallel=true
20 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kiall/android-tvheadend/f46e894a58211a5aceb018c9a2cd24a54ef9f52b/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Apr 02 17:37:34 IST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/play.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.github.triplet.play'
2 |
3 | if (tvhHasProperty("playServiceAccountFile")) {
4 | android {
5 | playAccountConfigs {
6 | defaultplayAccountConfig {
7 | jsonFile = file(tvhProperty("playServiceAccountFile"))
8 | }
9 | }
10 |
11 | defaultConfig {
12 | playAccountConfig = playAccountConfigs.defaultplayAccountConfig
13 | }
14 | }
15 |
16 | play {
17 | if (tvhHasProperty('playStoreTrack')) {
18 | track = tvhProperty('playStoreTrack')
19 | } else {
20 | track = 'alpha'
21 | }
22 |
23 | untrackOld = false
24 | errorOnSizeLimit = true
25 | uploadImages = true
26 | }
27 | }
--------------------------------------------------------------------------------
/properties.gradle:
--------------------------------------------------------------------------------
1 | def tvhProperties = new Properties()
2 |
3 | if (rootProject.file("local-tvheadend.properties").exists()) {
4 | tvhProperties.load(new FileInputStream(rootProject.file("local-tvheadend.properties")))
5 | }
6 |
7 | static def completeName(name) {
8 | return "ie.macinnes.tvheadend." + name
9 | }
10 |
11 | ext.tvhHasProperty = { name ->
12 | if (tvhProperties.containsKey(completeName(name))) {
13 | return true;
14 | } else if (rootProject.hasProperty(completeName(name))) {
15 | return true;
16 | } else {
17 | return rootProject.hasProperty(name)
18 | }
19 |
20 | }
21 |
22 | ext.tvhProperty = { name ->
23 | if (tvhProperties.containsKey(completeName(name))) {
24 | return tvhProperties[completeName(name)];
25 | } else if (rootProject.hasProperty(completeName(name))) {
26 | return rootProject.property(completeName(name));
27 | } else {
28 | return rootProject.property(name)
29 | }
30 | }
31 |
32 | ext.tvhPropertyFallback = { name, fallback ->
33 | if (tvhHasProperty(name)) {
34 | return tvhProperty(name)
35 | } else {
36 | return fallback
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/signing.gradle:
--------------------------------------------------------------------------------
1 | android {
2 | signingConfigs {
3 | if (tvhHasProperty("keystoreFile")) {
4 | release {
5 | // TODO: Also support relative paths to the storeFile?
6 | storeFile file(tvhProperty("keystoreFile"))
7 | storePassword tvhProperty("keystorePassword")
8 | keyAlias tvhProperty("keyAlias")
9 | keyPassword tvhProperty("keyPassword")
10 | }
11 | }
12 |
13 | debug {
14 | storeFile rootProject.file("debug-keystore.jks")
15 | storePassword "password"
16 | keyAlias "debug key"
17 | keyPassword "password"
18 | }
19 | }
20 |
21 | buildTypes {
22 | if (tvhHasProperty("keystoreFile")) {
23 | release {
24 | signingConfig signingConfigs.release
25 | }
26 | }
27 |
28 | debug {
29 | signingConfig signingConfigs.debug
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/tools/generate-changelog:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | git describe --exact-match HEAD &> /dev/null
4 | if [ "$?" == "0" ]; then
5 | THIS_TAG=$(git describe --tags --abbrev=0)
6 | LAST_TAG=$(git describe --tags --abbrev=0 ${THIS_TAG}^)
7 |
8 | git log --no-merges $LAST_TAG...$THIS_TAG --oneline | grep -v 'Merge pull request' | cut -d' ' -f2- | sed -e 's/^/* /'
9 |
10 | else
11 | LAST_TAG=$(git describe --tags --abbrev=0)
12 |
13 | git log --no-merges $LAST_TAG...HEAD --oneline | grep -v 'Merge pull request' | cut -d' ' -f2- | sed -e 's/^/* /'
14 | fi
15 |
--------------------------------------------------------------------------------
/version.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'org.ajoberstar.grgit'
2 |
3 | // Max accepted version code by Google Play = 2100000000
4 |
5 | import groovy.json.JsonSlurper
6 |
7 | def versionFile = rootProject.file("version.json")
8 | def versionJSON = getJSON(versionFile)
9 | def buildNumber = tvhHasProperty("buildNumber") ? Integer.parseInt(tvhProperty("buildNumber")) : 0
10 | def version = "${versionJSON.major}.${versionJSON.minor}.${versionJSON.patch}"
11 | def versionName = "v${version} (Build: ${buildNumber})"
12 | def versionCode = String.format("%02d", versionJSON.major) + \
13 | String.format("%02d", versionJSON.minor) + \
14 | String.format("%02d", versionJSON.patch) + \
15 | String.format("%04d", buildNumber)
16 | def gitVersion = "${grgit.describe()}".drop(1)
17 |
18 | // Expose as a properties to the project
19 | ext.versionName = versionName
20 | ext.versionCode = Integer.parseInt(versionCode)
21 |
22 | // Methods
23 | static def Object getJSON(File file) {
24 | return new JsonSlurper().parseText(file.text)
25 | }
26 |
27 | static def String mostRecentVersion(List versions ) {
28 | versions.sort( false ) { a, b ->
29 | [a,b]*.tokenize('.')*.collect { it as int }.with { u, v ->
30 | [u,v].transpose().findResult{ x,y-> x<=>y ?: null } ?: u.size() <=> v.size()
31 | }
32 | }[-1]
33 | }
34 |
35 | static def String cleanGitVersion(String version) {
36 | if (version.contains("-")) {
37 | return version.substring(0, version.indexOf("-"))
38 | } else {
39 | return version
40 | }
41 | }
42 |
43 | // Tasks
44 | task showVersionInfo {
45 | doLast {
46 | logger.lifecycle('Version: ' + version)
47 | logger.lifecycle('Version Name: ' + versionName)
48 | logger.lifecycle('Version Code: ' + versionCode)
49 | logger.lifecycle('Build Number: ' + buildNumber)
50 | logger.lifecycle('Git Tag Version: ' + gitVersion)
51 | }
52 | }
53 |
54 | task validateVersionInfo {
55 | doLast {
56 | // We need to validate the version.json is "newer"
57 | // than the most recent tag
58 | def mrv = mostRecentVersion([
59 | version, cleanGitVersion(gitVersion),
60 | ])
61 |
62 | if (mrv != version) {
63 | logger.error('Version: ' + version)
64 | logger.error('Git Tag Version: ' + gitVersion)
65 | throw new GradleException("version.json is out of date")
66 | }
67 |
68 | // We need to check the version number components or build number
69 | // don't cause us to "wrap" the versionCode, or exceed it's max
70 | // value
71 | if (versionJSON.major > 20) {
72 | throw new GradleException("The major version number may not exceed 20")
73 | }
74 | if (versionJSON.minor > 99) {
75 | throw new GradleException("The minor version number may not exceed 99")
76 | }
77 | if (versionJSON.patch > 99) {
78 | throw new GradleException("The patch version number may not exceed 99")
79 | }
80 | if (buildNumber > 9999) {
81 | throw new GradleException("Build Number causes versionCode to wrap, must be less than 5 digits")
82 | }
83 | }
84 | }
85 |
86 | tasks.assemble.dependsOn("showVersionInfo")
87 | tasks.assemble.dependsOn("validateVersionInfo")
88 |
--------------------------------------------------------------------------------
/version.json:
--------------------------------------------------------------------------------
1 | {
2 | "limits": "The play store has a limit on the max version code which maps to: 20.99.99",
3 | "major": 0,
4 | "minor": 4,
5 | "patch": 2
6 | }
7 |
--------------------------------------------------------------------------------