@@ -9,6 +9,8 @@ import androidx.lifecycle.MutableLiveData
99import coil.Coil
1010import coil.ImageLoader
1111import com.topjohnwu.superuser.CallbackList
12+ import com.topjohnwu.superuser.Shell
13+ import com.topjohnwu.superuser.internal.MainShell
1214import me.bmax.apatch.util.*
1315import me.zhanghai.android.appiconloader.coil.AppIconFetcher
1416import me.zhanghai.android.appiconloader.coil.AppIconKeyer
@@ -86,7 +88,9 @@ class APApplication : Application() {
8688 val cmds = arrayOf(
8789 " rm -f $APD_PATH " ,
8890 " rm -f $KPATCH_PATH " ,
89- " rm -rf $APATCH_FOLDER " ,
91+ " rm -rf $APATCH_BIN_FOLDER " ,
92+ " rm -rf $APATCH_LOG_FOLDER " ,
93+ " rm -rf $APATCH_VERSION_PATH " ,
9094 )
9195
9296 val shell = getRootShell()
@@ -139,12 +143,15 @@ class APApplication : Application() {
139143 " echo ${Version .getManagerVersion().second} > $APATCH_VERSION_PATH " ,
140144 " restorecon -R $APATCH_FOLDER " ,
141145
142- " $KPATCH_PATH $superKey android_user init " ,
146+ " ${nativeDir} /libmagiskpolicy.so --magisk --live " ,
143147 )
144148
145149 val shell = getRootShell()
146150 shell.newJob().add(* cmds).to(logCallback, logCallback).exec()
147151
152+ // clear shell cache
153+ APatchCli .refresh()
154+
148155 Log .d(TAG , " APatch installed..." )
149156 _apStateLiveData .postValue(State .ANDROIDPATCH_INSTALLED )
150157 }
@@ -155,6 +162,7 @@ class APApplication : Application() {
155162 Log .d(TAG , " mark reboot ${result.code} " )
156163 }
157164
165+
158166 var superKey: String = " "
159167 set(value) {
160168 field = value
0 commit comments