mirror of https://github.com/NekoX-Dev/NekoX.git
try fix library extract
This commit is contained in:
parent
c5497364f2
commit
a5c52e476b
|
@ -355,13 +355,16 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
|
|||
ConnectionsManager.getInstance(currentAccount).updateDcSettings();
|
||||
needFinishActivity(false);
|
||||
} else {
|
||||
if (error.code == 401) {
|
||||
ConnectionsManager.native_cleanUp(currentAccount,true);
|
||||
}
|
||||
if (error.text != null) {
|
||||
if (error.text.contains("ACCESS_TOKEN_INVALID")) {
|
||||
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("InvalidAccessToken", R.string.InvalidAccessToken));
|
||||
} else if (error.text.startsWith("FLOOD_WAIT")) {
|
||||
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("FloodWait", R.string.FloodWait));
|
||||
} else if (error.code != -1000) {
|
||||
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.text);
|
||||
needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), error.code + ": " + error.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -868,11 +871,6 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
|
|||
|
||||
} else if (target == 0) {
|
||||
|
||||
if (dcType == 3) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
DataCenter.applyOfficalDataCanter(currentAccount);
|
||||
|
||||
} else if (target == 1) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import cn.hutool.crypto.digest.DigestUtil
|
|||
import org.telegram.messenger.MessagesController
|
||||
import org.telegram.tgnet.ConnectionsManager
|
||||
import org.telegram.tgnet.SerializedData
|
||||
import org.telegram.tgnet.TLRPC
|
||||
import java.math.BigInteger
|
||||
import java.nio.ByteBuffer
|
||||
import java.security.interfaces.RSAPublicKey
|
||||
|
@ -45,6 +46,7 @@ object DataCenter {
|
|||
applyDataCanter(account, 5, "149.154.171.5", "2001:67c:4e8:f005:0000:0000:0000:000a")
|
||||
|
||||
ConnectionsManager.native_cleanUp(account, true)
|
||||
ConnectionsManager.native_setLayer(account, TLRPC.LAYER)
|
||||
|
||||
repeat(5) {
|
||||
|
||||
|
@ -65,6 +67,8 @@ object DataCenter {
|
|||
|
||||
}
|
||||
|
||||
ConnectionsManager.native_setLayer(account, TLRPC.LAYER)
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
|
|
@ -164,12 +164,37 @@ object FileUtil {
|
|||
|
||||
if (!execFile.isFile) {
|
||||
|
||||
saveNonAsset("lib/$abi/${execFile.name}", execFile);
|
||||
runCatching {
|
||||
|
||||
saveNonAsset("lib/${Build.CPU_ABI}/${execFile.name}", execFile)
|
||||
|
||||
FileLog.d("lib extracted with default abi: $execFile, ${Build.CPU_ABI}")
|
||||
|
||||
}.recover {
|
||||
|
||||
saveNonAsset("lib/${Build.CPU_ABI2}/${execFile.name}", execFile)
|
||||
|
||||
FileLog.d("lib extracted with abi2: $execFile, ${Build.CPU_ABI2}")
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
FileLog.d("lib already extracted: $name")
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
FileLog.d("lib found after load: $name")
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
FileLog.d("lib found in nativePath: $name")
|
||||
|
||||
}
|
||||
|
||||
if (!execFile.canExecute()) {
|
||||
|
@ -185,10 +210,22 @@ object FileUtil {
|
|||
@JvmStatic
|
||||
fun saveNonAsset(path: String, saveTo: File) {
|
||||
|
||||
ResourceUtil.getStream(path)?.use {
|
||||
|
||||
FileLog.d("found nonAsset in resources: $path")
|
||||
|
||||
IoUtil.copy(it, saveTo)
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
ZipFile(ApplicationLoader.applicationContext.applicationInfo.sourceDir).use {
|
||||
|
||||
it.getInputStream(it.getEntry(path) ?: return@use).use { ins ->
|
||||
|
||||
FileLog.d("found nonAsset in main apk: $path")
|
||||
|
||||
IoUtil.copy(ins, saveTo)
|
||||
|
||||
return
|
||||
|
@ -205,6 +242,8 @@ object FileUtil {
|
|||
|
||||
it.getInputStream(it.getEntry(path) ?: return@use).use { ins ->
|
||||
|
||||
FileLog.d("found nonAsset in split apk: $path, $split")
|
||||
|
||||
IoUtil.copy(ins, saveTo)
|
||||
|
||||
return
|
||||
|
@ -217,14 +256,6 @@ object FileUtil {
|
|||
|
||||
}
|
||||
|
||||
ResourceUtil.getStream(path)?.use {
|
||||
|
||||
IoUtil.copy(it, saveTo)
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
error("res not found: $path")
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#Mon May 04 18:56:10 CST 2020
|
||||
#Fri May 08 14:23:18 CST 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
|
||||
|
|
Loading…
Reference in New Issue