Commit 7431b771 by pye52

迁移MainActivity的包名,保证能从旧应用升级到重构版应用(守护服务安装完毕后会通过MainActivity的包名来启动主应用)

parent 3c5f689c
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:name=".RootApp" android:name=".RootApp"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".MainActivity" <activity android:name=".activity.MainActivity"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:screenOrientation="landscape"> android:screenOrientation="landscape">
<intent-filter> <intent-filter>
......
package com.bgycc.smartcanteen; package com.bgycc.smartcanteen.activity;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
...@@ -21,6 +21,9 @@ import android.widget.ImageView; ...@@ -21,6 +21,9 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.bgycc.smartcanteen.BuildConfig;
import com.bgycc.smartcanteen.Injection;
import com.bgycc.smartcanteen.R;
import com.bgycc.smartcanteen.entity.PayData; import com.bgycc.smartcanteen.entity.PayData;
import com.bgycc.smartcanteen.executor.SCTaskExecutor; import com.bgycc.smartcanteen.executor.SCTaskExecutor;
import com.bgycc.smartcanteen.socket.SCWebSocketClient; import com.bgycc.smartcanteen.socket.SCWebSocketClient;
......
...@@ -5,8 +5,9 @@ import android.content.BroadcastReceiver; ...@@ -5,8 +5,9 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import com.bgycc.smartcanteen.MainActivity; import com.bgycc.smartcanteen.activity.MainActivity;
// 开机广播,保证设备启动后应用能被主动唤起
public class BootBroadcast extends BroadcastReceiver { public class BootBroadcast extends BroadcastReceiver {
@SuppressLint("UnsafeProtectedBroadcastReceiver") @SuppressLint("UnsafeProtectedBroadcastReceiver")
@Override @Override
......
...@@ -5,7 +5,7 @@ import android.content.Intent; ...@@ -5,7 +5,7 @@ import android.content.Intent;
import android.os.Build; import android.os.Build;
import com.bgycc.smartcanteen.BuildConfig; import com.bgycc.smartcanteen.BuildConfig;
import com.bgycc.smartcanteen.MainActivity; import com.bgycc.smartcanteen.activity.MainActivity;
import com.blankj.utilcode.util.AppUtils; import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.FileUtils; import com.blankj.utilcode.util.FileUtils;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
......
...@@ -22,7 +22,7 @@ public class DaemonService extends Service { ...@@ -22,7 +22,7 @@ public class DaemonService extends Service {
// 主应用package name // 主应用package name
private static final String MAIN_PACKAGE_NAME = "com.bgycc.smartcanteen"; private static final String MAIN_PACKAGE_NAME = "com.bgycc.smartcanteen";
// 主应用类名称 // 主应用类名称
private static final String MAIN_ACTIVITY_NAME = "com.bgycc.smartcanteen.MainActivity"; private static final String MAIN_ACTIVITY_NAME = "com.bgycc.smartcanteen.activity.MainActivity";
@Override @Override
public int onStartCommand(Intent intent, int flags, int startId) { public int onStartCommand(Intent intent, int flags, int startId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment