updated android-example to 1.5.0 latest
This commit is contained in:
BIN
android-example/app/app/release/app-app-release.apk
Normal file
BIN
android-example/app/app/release/app-app-release.apk
Normal file
Binary file not shown.
20
android-example/app/app/release/output-metadata.json
Normal file
20
android-example/app/app/release/output-metadata.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "net.irext.ircontrol",
|
||||||
|
"variantName": "appRelease",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 7,
|
||||||
|
"versionName": "1.5.0",
|
||||||
|
"outputFile": "app-app-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File"
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdk 36
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "net.irext.ircontrol"
|
applicationId "net.irext.ircontrol"
|
||||||
minSdkVersion 19
|
targetSdkVersion 36
|
||||||
targetSdkVersion 28
|
minSdkVersion 26
|
||||||
versionCode 6
|
versionCode 7
|
||||||
versionName '0.2.4'
|
versionName '1.5.0'
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
@@ -15,25 +15,35 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceSets.main {
|
buildTypes {
|
||||||
jniLibs.srcDirs = ['src/main/jniLibs']
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flavorDimensions = ['app']
|
||||||
|
|
||||||
productFlavors {
|
productFlavors {
|
||||||
|
app {
|
||||||
|
ndk {
|
||||||
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
namespace 'net.irext.ircontrol'
|
namespace 'net.irext.ircontrol'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation project(':decodesdk')
|
||||||
|
implementation project(':web-api')
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.aar'])
|
||||||
|
|
||||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||||
implementation 'com.android.support:design:28.0.0'
|
implementation 'com.android.support:design:28.0.0'
|
||||||
implementation 'com.android.support:support-v4:28.0.0'
|
implementation 'com.android.support:support-v4:28.0.0'
|
||||||
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
|
|
||||||
implementation project(':decodesdk')
|
implementation 'com.android.support:multidex:1.0.3'
|
||||||
implementation project(':web-api')
|
|
||||||
}
|
}
|
||||||
BIN
android-example/app/libs/activeandroid-3.1.0.jar
Normal file
BIN
android-example/app/libs/activeandroid-3.1.0.jar
Normal file
Binary file not shown.
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
>
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
@@ -15,12 +14,14 @@
|
|||||||
android:icon="@mipmap/ir_logo"
|
android:icon="@mipmap/ir_logo"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
|
android:requestLegacyExternalStorage="true"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
|
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="net.irext.ircontrol.ui.activity.MainActivity"
|
android:name="net.irext.ircontrol.ui.activity.MainActivity"
|
||||||
android:label="@string/title_activity_main"
|
android:label="@string/title_activity_main"
|
||||||
|
android:exported="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|||||||
@@ -71,4 +71,8 @@ public class IRApplication extends com.activeandroid.app.Application {
|
|||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getApplicationName() {
|
||||||
|
return IRApplication.class.getPackageName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,16 +11,20 @@ import android.support.annotation.NonNull;
|
|||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.v4.app.ActivityCompat;
|
import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
import net.irext.ircontrol.R;
|
import net.irext.ircontrol.R;
|
||||||
import net.irext.ircontrol.bean.RemoteControl;
|
import net.irext.ircontrol.bean.RemoteControl;
|
||||||
import net.irext.ircontrol.ui.fragment.MainFragment;
|
import net.irext.ircontrol.ui.fragment.MainFragment;
|
||||||
import net.irext.ircontrol.utils.MessageUtil;
|
import net.irext.ircontrol.utils.MessageUtil;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filename: MainActivity.java
|
* Filename: MainActivity.java
|
||||||
@@ -37,6 +41,11 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private static final String TAG = MainActivity.class.getSimpleName();
|
private static final String TAG = MainActivity.class.getSimpleName();
|
||||||
|
|
||||||
|
private boolean mReadPermissionGranted = false;
|
||||||
|
|
||||||
|
private boolean mWritePermissionGranted = false;
|
||||||
|
private static final int PERMISSIONS_REQUEST_STORAGE = 1001;
|
||||||
|
|
||||||
public static final int CMD_GOTO_CONTROL = 0;
|
public static final int CMD_GOTO_CONTROL = 0;
|
||||||
|
|
||||||
private RemoteControl mCurrentRemoteControl;
|
private RemoteControl mCurrentRemoteControl;
|
||||||
@@ -62,6 +71,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
initView();
|
initView();
|
||||||
|
checkAndRequestStoragePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -98,49 +108,64 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
gotoCreateNew();
|
gotoCreateNew();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
isReadStoragePermissionGranted();
|
|
||||||
isWriteStoragePermissionGranted();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void isReadStoragePermissionGranted() {
|
private void checkAndRequestStoragePermissions() {
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
boolean readGranted = ContextCompat.checkSelfPermission(this,
|
||||||
if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
|
Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
||||||
== PackageManager.PERMISSION_GRANTED) {
|
boolean writeGranted = ContextCompat.checkSelfPermission(this,
|
||||||
Log.v(TAG,"read permission is granted");
|
Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
||||||
|
|
||||||
|
List<String> permissionsToRequest = new ArrayList<>();
|
||||||
|
|
||||||
|
if (!readGranted) {
|
||||||
|
permissionsToRequest.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
|
Log.w(TAG, "read external storage permission not granted");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!writeGranted) {
|
||||||
|
permissionsToRequest.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
|
Log.w(TAG, "write external storage permission not granted");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!permissionsToRequest.isEmpty()) {
|
||||||
|
Log.d(TAG, "requesting permission: " + String.join(", ", permissionsToRequest));
|
||||||
|
ActivityCompat.requestPermissions(this,
|
||||||
|
permissionsToRequest.toArray(new String[0]),
|
||||||
|
PERMISSIONS_REQUEST_STORAGE);
|
||||||
} else {
|
} else {
|
||||||
|
Log.i(TAG, "storage permissions already granted.");
|
||||||
Log.v(TAG,"read permission is revoked");
|
mReadPermissionGranted = true;
|
||||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 3);
|
mWritePermissionGranted = true;
|
||||||
}
|
|
||||||
}
|
|
||||||
else { //permission is automatically granted on sdk<23 upon installation
|
|
||||||
Log.v(TAG,"read permission is granted");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void isWriteStoragePermissionGranted() {
|
@Override
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
== PackageManager.PERMISSION_GRANTED) {
|
if (requestCode == PERMISSIONS_REQUEST_STORAGE) {
|
||||||
Log.v(TAG,"write permission is granted");
|
Log.d(TAG, "storage permission requested successfully");
|
||||||
} else {
|
mReadPermissionGranted = true;
|
||||||
|
mWritePermissionGranted = true;
|
||||||
Log.v(TAG,"write permission is revoked");
|
|
||||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// permission is automatically granted on sdk<23 upon installation
|
|
||||||
Log.v(TAG,"write permission is granted");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gotoCreateNew() {
|
private void gotoCreateNew() {
|
||||||
|
if (!mReadPermissionGranted || !mWritePermissionGranted) {
|
||||||
|
Log.e(TAG, "storage read and write permission not granted");
|
||||||
|
Toast.makeText(this, this.getString(R.string.storage_permission_warning), Toast.LENGTH_SHORT).show();
|
||||||
|
checkAndRequestStoragePermissions();
|
||||||
|
}
|
||||||
Intent intent = new Intent(this, CreateActivity.class);
|
Intent intent = new Intent(this, CreateActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gotoControl() {
|
private void gotoControl() {
|
||||||
|
if (!mReadPermissionGranted || !mWritePermissionGranted) {
|
||||||
|
Log.e(TAG, "storage read and write permission not granted");
|
||||||
|
Toast.makeText(this, this.getString(R.string.storage_permission_warning), Toast.LENGTH_SHORT).show();
|
||||||
|
checkAndRequestStoragePermissions();
|
||||||
|
}
|
||||||
Intent intent = new Intent(this, ControlActivity.class);
|
Intent intent = new Intent(this, ControlActivity.class);
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putLong(ControlActivity.KEY_REMOTE_ID, mCurrentRemoteControl.getID());
|
bundle.putLong(ControlActivity.KEY_REMOTE_ID, mCurrentRemoteControl.getID());
|
||||||
@@ -167,10 +192,4 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
|
|
||||||
@NonNull int[] grantResults) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class ControlFragment extends Fragment implements View.OnClickListener {
|
|||||||
mCurrentRemoteControl = RemoteControl.getRemoteControl(mRemoteID);
|
mCurrentRemoteControl = RemoteControl.getRemoteControl(mRemoteID);
|
||||||
if (null != mCurrentRemoteControl) {
|
if (null != mCurrentRemoteControl) {
|
||||||
int category = mCurrentRemoteControl.getCategoryId();
|
int category = mCurrentRemoteControl.getCategoryId();
|
||||||
String binFileName = FileUtils.BIN_PATH + FileUtils.FILE_NAME_PREFIX +
|
String binFileName = FileUtils.binDir + FileUtils.FILE_NAME_PREFIX +
|
||||||
mCurrentRemoteControl.getRemoteMap() + FileUtils.FILE_NAME_EXT;
|
mCurrentRemoteControl.getRemoteMap() + FileUtils.FILE_NAME_EXT;
|
||||||
|
|
||||||
/* decode SDK - load binary file */
|
/* decode SDK - load binary file */
|
||||||
@@ -234,6 +234,14 @@ public class ControlFragment extends Fragment implements View.OnClickListener {
|
|||||||
} else if (id == R.id.iv_menu) {
|
} else if (id == R.id.iv_menu) {
|
||||||
decoded = irControl(KEY_MENU);
|
decoded = irControl(KEY_MENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// debug decoded value
|
||||||
|
String decodedValue = "";
|
||||||
|
for (int i = 0; i < decoded.length; i++) {
|
||||||
|
decodedValue += decoded[i];
|
||||||
|
decodedValue += ",";
|
||||||
|
}
|
||||||
|
Log.d(TAG, "decodedValue : " + decodedValue);
|
||||||
// send decoded integer array to IR emitter
|
// send decoded integer array to IR emitter
|
||||||
ConsumerIrManager irEmitter =
|
ConsumerIrManager irEmitter =
|
||||||
(ConsumerIrManager) mParent.getSystemService(Context.CONSUMER_IR_SERVICE);
|
(ConsumerIrManager) mParent.getSystemService(Context.CONSUMER_IR_SERVICE);
|
||||||
|
|||||||
@@ -145,10 +145,11 @@ public class IndexFragment extends BaseCreateFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean createDirectory() {
|
private boolean createDirectory() {
|
||||||
File file = new File(FileUtils.BIN_PATH);
|
File file = new File(FileUtils.binDir);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Log.d(TAG, "create directory : " + file.getAbsolutePath());
|
||||||
return file.mkdirs();
|
return file.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +158,7 @@ public class IndexFragment extends BaseCreateFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (createDirectory()) {
|
if (createDirectory()) {
|
||||||
File binFile = new File(FileUtils.BIN_PATH +
|
File binFile = new File(FileUtils.binDir +
|
||||||
FileUtils.FILE_NAME_PREFIX + mCurrentIndex.getRemoteMap() +
|
FileUtils.FILE_NAME_PREFIX + mCurrentIndex.getRemoteMap() +
|
||||||
FileUtils.FILE_NAME_EXT);
|
FileUtils.FILE_NAME_EXT);
|
||||||
boolean ret = FileUtils.write(binFile, mBinStream);
|
boolean ret = FileUtils.write(binFile, mBinStream);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package net.irext.ircontrol.utils;
|
|||||||
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import net.irext.ircontrol.IRApplication;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
@@ -20,9 +21,9 @@ public class FileUtils {
|
|||||||
|
|
||||||
private static final String TAG = FileUtils.class.getSimpleName();
|
private static final String TAG = FileUtils.class.getSimpleName();
|
||||||
|
|
||||||
public static final String BASE_PATH = Environment.getExternalStorageDirectory() + File.separator +
|
public static final String packageDataDir = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator +
|
||||||
"irext" + File.separator;
|
Environment.DIRECTORY_DOWNLOADS + File.separator + IRApplication.getApplicationName() + File.separator;
|
||||||
public static final String BIN_PATH = BASE_PATH + "bin" + File.separator;
|
public static final String binDir = packageDataDir + "bin" + File.separator;
|
||||||
|
|
||||||
public static final String FILE_NAME_PREFIX = "irext_";
|
public static final String FILE_NAME_PREFIX = "irext_";
|
||||||
public static final String FILE_NAME_EXT = ".ir";
|
public static final String FILE_NAME_EXT = ".ir";
|
||||||
@@ -64,36 +65,15 @@ public class FileUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File createBinaryFile(String fileName) {
|
|
||||||
if(createDirs(BASE_PATH) && createDirs(BIN_PATH)) {
|
|
||||||
String path = BIN_PATH + fileName;
|
|
||||||
File file = new File(path);
|
|
||||||
if (!file.exists()) {
|
|
||||||
try {
|
|
||||||
if (file.createNewFile()) {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.w(TAG, "binary file already exists ?");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "failed to create dirs");
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean createDirs(String path) {
|
private static boolean createDirs(String path) {
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
return file.exists() || file.mkdir();
|
return file.exists() || file.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File getLocalFile(String fileName) {
|
public static File getLocalFile(String fileName) {
|
||||||
File file = new File(BIN_PATH);
|
File file = new File(binDir);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
String path = BIN_PATH + fileName;
|
String path = binDir + fileName;
|
||||||
file = new File(path);
|
file = new File(path);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
return file;
|
return file;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package net.irext.iris.utils;
|
package net.irext.ircontrol.utils;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 951 B |
Binary file not shown.
|
Before Width: | Height: | Size: 661 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
<!-- Main UI -->
|
<!-- Main UI -->
|
||||||
<string name="create_new">点击 + 安装遥控</string>
|
<string name="create_new">点击 + 安装遥控</string>
|
||||||
|
<string name="storage_permission_warning">请先授权应用对存储进行读写</string>
|
||||||
|
|
||||||
<!-- Create New -->
|
<!-- Create New -->
|
||||||
<string name="default_category">电视机</string>
|
<string name="default_category">电视机</string>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
<!-- Main UI -->
|
<!-- Main UI -->
|
||||||
<string name="create_new">Tap + to create new remote control</string>
|
<string name="create_new">Tap + to create new remote control</string>
|
||||||
|
<string name="storage_permission_warning">Please grant storage read and write permission first</string>
|
||||||
|
|
||||||
<!-- Create New -->
|
<!-- Create New -->
|
||||||
<string name="default_category">TV</string>
|
<string name="default_category">TV</string>
|
||||||
|
|||||||
@@ -1,24 +1,29 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
maven {
|
||||||
|
url "https://maven.aliyun.com/nexus/content/repositories/releases"
|
||||||
|
}
|
||||||
google()
|
google()
|
||||||
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.2.0'
|
classpath 'com.android.tools.build:gradle:8.1.0'
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
|
||||||
// in the individual module build.gradle files
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
maven {
|
||||||
|
url "https://maven.aliyun.com/nexus/content/repositories/releases/"
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
url "https://maven.aliyun.com/nexus/content/repositories/snapshots"
|
||||||
|
}
|
||||||
|
|
||||||
google()
|
google()
|
||||||
|
jcenter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
|
||||||
delete rootProject.buildDir
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdk 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 19
|
minSdkVersion 26
|
||||||
targetSdkVersion 28
|
targetSdkVersion 36
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
@@ -17,6 +17,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
api 'com.android.support:appcompat-v7:28.0.0'
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<application android:allowBackup="true" android:label="@string/app_name"
|
<application android:allowBackup="true" android:label="@string/app_name"
|
||||||
android:supportsRtl="true">
|
android:supportsRtl="true">
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
# Project-wide Gradle settings.
|
# Project-wide Gradle settings.
|
||||||
|
|
||||||
# IDE (e.g. Android Studio) users:
|
# IDE (e.g. Android Studio) users:
|
||||||
# Gradle settings configured through the IDE *will override*
|
# Gradle settings configured through the IDE *will override*
|
||||||
# any settings specified in this file.
|
# any settings specified in this file.
|
||||||
|
|
||||||
# For more details on how to configure your build environment visit
|
# For more details on how to configure your build environment visit
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx1536m
|
org.gradle.jvmargs=-Xmx4096M \
|
||||||
|
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
|
||||||
|
--add-opens=java.base/java.lang=ALL-UNNAMED \
|
||||||
|
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
|
||||||
|
--add-opens=java.base/java.io=ALL-UNNAMED \
|
||||||
|
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
android.useDeprecatedNdk=true
|
||||||
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
|
android.nonTransitiveRClass=false
|
||||||
|
android.nonFinalResIds=false
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
|
#Thu Jan 04 08:41:31 CST 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ apply plugin: 'com.android.library'
|
|||||||
android {
|
android {
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
}
|
}
|
||||||
compileSdkVersion 33
|
compileSdk 36
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 19
|
minSdkVersion 26
|
||||||
targetSdkVersion 33
|
targetSdkVersion 36
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
@@ -20,7 +20,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api files('libs/gson-2.8.0.jar')
|
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
|
||||||
api files('libs/okhttp-3.7.0.jar')
|
implementation 'com.squareup.okio:okio:3.4.0'
|
||||||
api files('libs/okio-1.12.0.jar')
|
implementation 'com.google.code.gson:gson:2.13.2'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<application android:allowBackup="true" android:supportsRtl="true">
|
<application android:allowBackup="true" android:supportsRtl="true">
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class WebAPIs {
|
|||||||
// download bin from OSS
|
// download bin from OSS
|
||||||
private static final String IR_BIN_FILE_PREFIX = "irda_";
|
private static final String IR_BIN_FILE_PREFIX = "irda_";
|
||||||
private static final String IR_BIN_FILE_SUFFIX = ".bin";
|
private static final String IR_BIN_FILE_SUFFIX = ".bin";
|
||||||
private static final String IR_BIN_DOWNLOAD_PREFIX = "http://irext-debug.oss-cn-hangzhou.aliyuncs.com/";
|
private static final String IR_BIN_DOWNLOAD_PREFIX = "https://irext-release.oss-cn-hangzhou.aliyuncs.com/";
|
||||||
|
|
||||||
private static final String SERVICE_SIGN_IN = "/app/app_login";
|
private static final String SERVICE_SIGN_IN = "/app/app_login";
|
||||||
private static final String SERVICE_LIST_CATEGORIES = "/indexing/list_categories";
|
private static final String SERVICE_LIST_CATEGORIES = "/indexing/list_categories";
|
||||||
@@ -79,6 +79,7 @@ public class WebAPIs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private InputStream getFileByteStreamByURL(String url) throws IOException {
|
private InputStream getFileByteStreamByURL(String url) throws IOException {
|
||||||
|
Log.d(TAG, "download remote binary file, url = " + url);
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.get()
|
.get()
|
||||||
|
|||||||
Reference in New Issue
Block a user